pocketbase/ui/dist/assets/index.a658f3b6.js

364 lines
804 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

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

const I1=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const l of r.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function t(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerpolicy&&(r.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?r.credentials="include":o.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(o){if(o.ep)return;o.ep=!0;const r=t(o);fetch(o.href,r)}};I1();function le(){}const Vr=n=>n;function ut(n,e){for(const t in e)n[t]=e[t];return n}function Ib(n){return n()}function bc(){return Object.create(null)}function rt(n){n.forEach(Ib)}function Yn(n){return typeof n=="function"}function Ee(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let rl;function Qn(n,e){return rl||(rl=document.createElement("a")),rl.href=e,n===rl.href}function R1(n){return Object.keys(n).length===0}function Rb(n,...e){if(n==null)return le;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function pn(n,e,t){n.$$.on_destroy.push(Rb(e,t))}function $n(n,e,t,i){if(n){const o=Nb(n,e,t,i);return n[0](o)}}function Nb(n,e,t,i){return n[1]&&i?ut(t.ctx.slice(),n[1](i(e))):t.ctx}function An(n,e,t,i){if(n[2]&&i){const o=n[2](i(t));if(e.dirty===void 0)return o;if(typeof o=="object"){const r=[],l=Math.max(e.dirty.length,o.length);for(let s=0;s<l;s+=1)r[s]=e.dirty[s]|o[s];return r}return e.dirty|o}return e.dirty}function Dn(n,e,t,i,o,r){if(o){const l=Nb(e,t,i,r);n.p(l,o)}}function On(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 ui(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Wt(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 gc(n){return n==null?"":n}function jb(n,e,t){return n.set(t),e}function Xe(n){return n&&Yn(n.destroy)?n.destroy:le}const zb=typeof window!="undefined";let vs=zb?()=>window.performance.now():()=>Date.now(),gf=zb?n=>requestAnimationFrame(n):le;const Lo=new Set;function Hb(n){Lo.forEach(e=>{e.c(n)||(Lo.delete(e),e.f())}),Lo.size!==0&&gf(Hb)}function ys(n){let e;return Lo.size===0&&gf(Hb),{promise:new Promise(t=>{Lo.add(e={c:n,f:t})}),abort(){Lo.delete(e)}}}function m(n,e){n.appendChild(e)}function qb(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function N1(n){const e=g("style");return j1(qb(n),e),e.sheet}function j1(n,e){m(n.head||n,e)}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function qn(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function g(n){return document.createElement(n)}function j(n){return document.createTextNode(n)}function $(){return j(" ")}function lt(){return j("")}function X(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Gt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Vn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function Vb(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 ci(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 At(n){return n===""?null:+n}function z1(n){return Array.from(n.childNodes)}function ge(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Me(n,e){n.value=e==null?"":e}function _c(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function ne(n,e,t){n.classList[t?"add":"remove"](e)}function Bb(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(n,t,i,e),o}const Kl=new Map;let Jl=0;function H1(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function q1(n,e){const t={stylesheet:N1(e),rules:{}};return Kl.set(n,t),t}function Er(n,e,t,i,o,r,l,s=0){const a=16.666/i;let f=`{
`;for(let _=0;_<=1;_+=a){const y=e+(t-e)*r(_);f+=_*100+`%{${l(y,1-y)}}
`}const c=f+`100% {${l(t,1-t)}}
}`,u=`__svelte_${H1(c)}_${s}`,d=qb(n),{stylesheet:h,rules:b}=Kl.get(d)||q1(d,n);b[u]||(b[u]=!0,h.insertRule(`@keyframes ${u} ${c}`,h.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${u} ${i}ms linear ${o}ms 1 both`,Jl+=1,u}function Pr(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?r=>r.indexOf(e)<0:r=>r.indexOf("__svelte")===-1),o=t.length-i.length;o&&(n.style.animation=i.join(", "),Jl-=o,Jl||V1())}function V1(){gf(()=>{Jl||(Kl.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),Kl.clear())})}function B1(n,e,t,i){if(!e)return le;const o=n.getBoundingClientRect();if(e.left===o.left&&e.right===o.right&&e.top===o.top&&e.bottom===o.bottom)return le;const{delay:r=0,duration:l=300,easing:s=Vr,start:a=vs()+r,end:f=a+l,tick:c=le,css:u}=t(n,{from:e,to:o},i);let d=!0,h=!1,b;function v(){u&&(b=Er(n,0,1,l,r,s,u)),r||(h=!0)}function _(){u&&Pr(n,b),d=!1}return ys(y=>{if(!h&&y>=a&&(h=!0),h&&y>=f&&(c(1,0),_()),!d)return!1;if(h){const S=y-a,C=0+1*s(S/l);c(C,1-C)}return!0}),v(),c(0,1),_}function U1(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,o=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,Ub(n,o)}}function Ub(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),o=i.transform==="none"?"":i.transform;n.style.transform=`${o} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let Fr;function wr(n){Fr=n}function ks(){if(!Fr)throw new Error("Function called outside component initialization");return Fr}function di(n){ks().$$.on_mount.push(n)}function W1(n){ks().$$.after_update.push(n)}function Y1(n){ks().$$.on_destroy.push(n)}function yn(){const n=ks();return(e,t,{cancelable:i=!1}={})=>{const o=n.$$.callbacks[e];if(o){const r=Bb(e,t,{cancelable:i});return o.slice().forEach(l=>{l.call(n,r)}),!r.defaultPrevented}return!0}}function ft(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const br=[],he=[],Rl=[],Da=[],Wb=Promise.resolve();let Oa=!1;function Yb(){Oa||(Oa=!0,Wb.then(Gb))}function Bi(){return Yb(),Wb}function Dt(n){Rl.push(n)}function Re(n){Da.push(n)}const Is=new Set;let ll=0;function Gb(){const n=Fr;do{for(;ll<br.length;){const e=br[ll];ll++,wr(e),G1(e.$$)}for(wr(null),br.length=0,ll=0;he.length;)he.pop()();for(let e=0;e<Rl.length;e+=1){const t=Rl[e];Is.has(t)||(Is.add(t),t())}Rl.length=0}while(br.length);for(;Da.length;)Da.pop()();Oa=!1,Is.clear(),wr(n)}function G1(n){if(n.fragment!==null){n.update(),rt(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Dt)}}let tr;function _f(){return tr||(tr=Promise.resolve(),tr.then(()=>{tr=null})),tr}function fo(n,e,t){n.dispatchEvent(Bb(`${e?"intro":"outro"}${t}`))}const Nl=new Set;let si;function Ae(){si={r:0,c:[],p:si}}function De(){si.r||rt(si.c),si=si.p}function T(n,e){n&&n.i&&(Nl.delete(n),n.i(e))}function F(n,e,t,i){if(n&&n.o){if(Nl.has(n))return;Nl.add(n),si.c.push(()=>{Nl.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}}const vf={duration:0};function yf(n,e,t){let i=e(n,t),o=!1,r,l,s=0;function a(){r&&Pr(n,r)}function f(){const{delay:u=0,duration:d=300,easing:h=Vr,tick:b=le,css:v}=i||vf;v&&(r=Er(n,0,1,d,u,h,v,s++)),b(0,1);const _=vs()+u,y=_+d;l&&l.abort(),o=!0,Dt(()=>fo(n,!0,"start")),l=ys(S=>{if(o){if(S>=y)return b(1,0),fo(n,!0,"end"),a(),o=!1;if(S>=_){const C=h((S-_)/d);b(C,1-C)}}return o})}let c=!1;return{start(){c||(c=!0,Pr(n),Yn(i)?(i=i(),_f().then(f)):f())},invalidate(){c=!1},end(){o&&(a(),o=!1)}}}function Kb(n,e,t){let i=e(n,t),o=!0,r;const l=si;l.r+=1;function s(){const{delay:a=0,duration:f=300,easing:c=Vr,tick:u=le,css:d}=i||vf;d&&(r=Er(n,1,0,f,a,c,d));const h=vs()+a,b=h+f;Dt(()=>fo(n,!1,"start")),ys(v=>{if(o){if(v>=b)return u(0,1),fo(n,!1,"end"),--l.r||rt(l.c),!1;if(v>=h){const _=c((v-h)/f);u(1-_,_)}}return o})}return Yn(i)?_f().then(()=>{i=i(),s()}):s(),{end(a){a&&i.tick&&i.tick(1,0),o&&(r&&Pr(n,r),o=!1)}}}function ct(n,e,t,i){let o=e(n,t),r=i?0:1,l=null,s=null,a=null;function f(){a&&Pr(n,a)}function c(d,h){const b=d.b-r;return h*=Math.abs(b),{a:r,b:d.b,d:b,duration:h,start:d.start,end:d.start+h,group:d.group}}function u(d){const{delay:h=0,duration:b=300,easing:v=Vr,tick:_=le,css:y}=o||vf,S={start:vs()+h,b:d};d||(S.group=si,si.r+=1),l||s?s=S:(y&&(f(),a=Er(n,r,d,b,h,v,y)),d&&_(0,1),l=c(S,b),Dt(()=>fo(n,d,"start")),ys(C=>{if(s&&C>s.start&&(l=c(s,b),s=null,fo(n,l.b,"start"),y&&(f(),a=Er(n,r,l.b,l.duration,0,v,o.css))),l){if(C>=l.end)_(r=l.b,1-r),fo(n,l.b,"end"),s||(l.b?f():--l.group.r||rt(l.group.c)),l=null;else if(C>=l.start){const x=C-l.start;r=l.a+l.d*v(x/l.duration),_(r,1-r)}}return!!(l||s)}))}return{run(d){Yn(o)?_f().then(()=>{o=o(),u(d)}):u(d)},end(){f(),l=s=null}}}function an(n,e){n.d(1),e.delete(n.key)}function Pt(n,e){F(n,1,1,()=>{e.delete(n.key)})}function K1(n,e){n.f(),Pt(n,e)}function st(n,e,t,i,o,r,l,s,a,f,c,u){let d=n.length,h=r.length,b=d;const v={};for(;b--;)v[n[b].key]=b;const _=[],y=new Map,S=new Map;for(b=h;b--;){const A=u(o,r,b),O=t(A);let D=l.get(O);D?i&&D.p(A,e):(D=f(O,A),D.c()),y.set(O,_[b]=D),O in v&&S.set(O,Math.abs(b-v[O]))}const C=new Set,x=new Set;function M(A){T(A,1),A.m(s,c),l.set(A.key,A),c=A.first,h--}for(;d&&h;){const A=_[h-1],O=n[d-1],D=A.key,E=O.key;A===O?(c=A.first,d--,h--):y.has(E)?!l.has(D)||C.has(D)?M(A):x.has(E)?d--:S.get(D)>S.get(E)?(x.add(D),M(A)):(C.add(E),d--):(a(O,l),d--)}for(;d--;){const A=n[d];y.has(A.key)||a(A,l)}for(;h;)M(_[h-1]);return _}function bn(n,e){const t={},i={},o={$$scope:1};let r=n.length;for(;r--;){const l=n[r],s=e[r];if(s){for(const a in l)a in s||(i[a]=1);for(const a in s)o[a]||(t[a]=s[a],o[a]=1);n[r]=s}else for(const a in l)o[a]=1}for(const l in i)l in t||(t[l]=void 0);return t}function pi(n){return typeof n=="object"&&n!==null?n:{}}function Fe(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function V(n){n&&n.c()}function H(n,e,t,i){const{fragment:o,on_mount:r,on_destroy:l,after_update:s}=n.$$;o&&o.m(e,t),i||Dt(()=>{const a=r.map(Ib).filter(Yn);l?l.push(...a):rt(a),n.$$.on_mount=[]}),s.forEach(Dt)}function q(n,e){const t=n.$$;t.fragment!==null&&(rt(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function J1(n,e){n.$$.dirty[0]===-1&&(br.push(n),Yb(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function Le(n,e,t,i,o,r,l,s=[-1]){const a=Fr;wr(n);const f=n.$$={fragment:null,ctx:null,props:r,update:le,not_equal:o,bound:bc(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:bc(),dirty:s,skip_bound:!1,root:e.target||a.$$.root};l&&l(f.root);let c=!1;if(f.ctx=t?t(n,e.props||{},(u,d,...h)=>{const b=h.length?h[0]:d;return f.ctx&&o(f.ctx[u],f.ctx[u]=b)&&(!f.skip_bound&&f.bound[u]&&f.bound[u](b),c&&J1(n,u)),d}):[],f.update(),c=!0,rt(f.before_update),f.fragment=i?i(f.ctx):!1,e.target){if(e.hydrate){const u=z1(e.target);f.fragment&&f.fragment.l(u),u.forEach(k)}else f.fragment&&f.fragment.c();e.intro&&T(n.$$.fragment),H(n,e.target,e.anchor,e.customElement),Gb()}wr(a)}class Ie{$destroy(){q(this,1),this.$destroy=le}$on(e,t){const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const o=i.indexOf(t);o!==-1&&i.splice(o,1)}}$set(e){this.$$set&&!R1(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function Zt(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 xo=[];function Jb(n,e){return{subscribe:Mi(n,e).subscribe}}function Mi(n,e=le){let t;const i=new Set;function o(s){if(Ee(n,s)&&(n=s,t)){const a=!xo.length;for(const f of i)f[1](),xo.push(f,n);if(a){for(let f=0;f<xo.length;f+=2)xo[f][0](xo[f+1]);xo.length=0}}}function r(s){o(s(n))}function l(s,a=le){const f=[s,a];return i.add(f),i.size===1&&(t=e(o)||le),s(n),()=>{i.delete(f),i.size===0&&(t(),t=null)}}return{set:o,update:r,subscribe:l}}function Zb(n,e,t){const i=!Array.isArray(n),o=i?[n]:n,r=e.length<2;return Jb(t,l=>{let s=!1;const a=[];let f=0,c=le;const u=()=>{if(f)return;c();const h=e(i?a[0]:a,l);r?l(h):c=Yn(h)?h:le},d=o.map((h,b)=>Rb(h,v=>{a[b]=v,f&=~(1<<b),s&&u()},()=>{f|=1<<b}));return s=!0,u(),function(){rt(d),c()}})}function Xb(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,o,r,l=[],s="",a=n.split("/");for(a[0]||a.shift();o=a.shift();)t=o[0],t==="*"?(l.push("wild"),s+="/(.*)"):t===":"?(i=o.indexOf("?",1),r=o.indexOf(".",1),l.push(o.substring(1,~i?i:~r?r:o.length)),s+=!!~i&&!~r?"(?:/([^/]+?))?":"/([^/]+?)",~r&&(s+=(~i?"?":"")+"\\"+o.substring(r))):s+="/"+o;return{keys:l,pattern:new RegExp("^"+s+(e?"(?=$|/)":"/?$"),"i")}}function Z1(n){let e,t,i;const o=[n[2]];var r=n[0];function l(s){let a={};for(let f=0;f<o.length;f+=1)a=ut(a,o[f]);return{props:a}}return r&&(e=new r(l()),e.$on("routeEvent",n[7])),{c(){e&&V(e.$$.fragment),t=lt()},m(s,a){e&&H(e,s,a),w(s,t,a),i=!0},p(s,a){const f=a&4?bn(o,[pi(s[2])]):{};if(r!==(r=s[0])){if(e){Ae();const c=e;F(c.$$.fragment,1,0,()=>{q(c,1)}),De()}r?(e=new r(l()),e.$on("routeEvent",s[7]),V(e.$$.fragment),T(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else r&&e.$set(f)},i(s){i||(e&&T(e.$$.fragment,s),i=!0)},o(s){e&&F(e.$$.fragment,s),i=!1},d(s){s&&k(t),e&&q(e,s)}}}function X1(n){let e,t,i;const o=[{params:n[1]},n[2]];var r=n[0];function l(s){let a={};for(let f=0;f<o.length;f+=1)a=ut(a,o[f]);return{props:a}}return r&&(e=new r(l()),e.$on("routeEvent",n[6])),{c(){e&&V(e.$$.fragment),t=lt()},m(s,a){e&&H(e,s,a),w(s,t,a),i=!0},p(s,a){const f=a&6?bn(o,[a&2&&{params:s[1]},a&4&&pi(s[2])]):{};if(r!==(r=s[0])){if(e){Ae();const c=e;F(c.$$.fragment,1,0,()=>{q(c,1)}),De()}r?(e=new r(l()),e.$on("routeEvent",s[6]),V(e.$$.fragment),T(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else r&&e.$set(f)},i(s){i||(e&&T(e.$$.fragment,s),i=!0)},o(s){e&&F(e.$$.fragment,s),i=!1},d(s){s&&k(t),e&&q(e,s)}}}function Q1(n){let e,t,i,o;const r=[X1,Z1],l=[];function s(a,f){return a[1]?0:1}return e=s(n),t=l[e]=r[e](n),{c(){t.c(),i=lt()},m(a,f){l[e].m(a,f),w(a,i,f),o=!0},p(a,[f]){let c=e;e=s(a),e===c?l[e].p(a,f):(Ae(),F(l[c],1,1,()=>{l[c]=null}),De(),t=l[e],t?t.p(a,f):(t=l[e]=r[e](a),t.c()),T(t,1),t.m(i.parentNode,i))},i(a){o||(T(t),o=!0)},o(a){F(t),o=!1},d(a){l[e].d(a),a&&k(i)}}}function vc(){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 ws=Jb(null,function(e){e(vc());const t=()=>{e(vc())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});Zb(ws,n=>n.location);Zb(ws,n=>n.querystring);const yc=Mi(void 0);async function Ss(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await Bi();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 xn(n,e){if(e=wc(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with <a> tags');return kc(n,e),{update(t){t=wc(t),kc(n,t)}}}function kc(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||e_(i.currentTarget.getAttribute("href"))})}function wc(n){return n&&typeof n=="string"?{href:n}:n||{}}function e_(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0,void 0),window.location.hash=n}function t_(n,e,t){let{routes:i={}}=e,{prefix:o=""}=e,{restoreScrollState:r=!1}=e;class l{constructor(M,A){if(!A||typeof A!="function"&&(typeof A!="object"||A._sveltesparouter!==!0))throw Error("Invalid component object");if(!M||typeof M=="string"&&(M.length<1||M.charAt(0)!="/"&&M.charAt(0)!="*")||typeof M=="object"&&!(M instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:O,keys:D}=Xb(M);this.path=M,typeof A=="object"&&A._sveltesparouter===!0?(this.component=A.component,this.conditions=A.conditions||[],this.userData=A.userData,this.props=A.props||{}):(this.component=()=>Promise.resolve(A),this.conditions=[],this.props={}),this._pattern=O,this._keys=D}match(M){if(o){if(typeof o=="string")if(M.startsWith(o))M=M.substr(o.length)||"/";else return null;else if(o instanceof RegExp){const E=M.match(o);if(E&&E[0])M=M.substr(E[0].length)||"/";else return null}}const A=this._pattern.exec(M);if(A===null)return null;if(this._keys===!1)return A;const O={};let D=0;for(;D<this._keys.length;){try{O[this._keys[D]]=decodeURIComponent(A[D+1]||"")||null}catch{O[this._keys[D]]=null}D++}return O}async checkConditions(M){for(let A=0;A<this.conditions.length;A++)if(!await this.conditions[A](M))return!1;return!0}}const s=[];i instanceof Map?i.forEach((x,M)=>{s.push(new l(M,x))}):Object.keys(i).forEach(x=>{s.push(new l(x,i[x]))});let a=null,f=null,c={};const u=yn();async function d(x,M){await Bi(),u(x,M)}let h=null,b=null;r&&(b=x=>{x.state&&x.state.__svelte_spa_router_scrollY?h=x.state:h=null},window.addEventListener("popstate",b),W1(()=>{h?window.scrollTo(h.__svelte_spa_router_scrollX,h.__svelte_spa_router_scrollY):window.scrollTo(0,0)}));let v=null,_=null;const y=ws.subscribe(async x=>{v=x;let M=0;for(;M<s.length;){const A=s[M].match(x.location);if(!A){M++;continue}const O={route:s[M].path,location:x.location,querystring:x.querystring,userData:s[M].userData,params:A&&typeof A=="object"&&Object.keys(A).length?A:null};if(!await s[M].checkConditions(O)){t(0,a=null),_=null,d("conditionsFailed",O);return}d("routeLoading",Object.assign({},O));const D=s[M].component;if(_!=D){D.loading?(t(0,a=D.loading),_=D,t(1,f=D.loadingParams),t(2,c={}),d("routeLoaded",Object.assign({},O,{component:a,name:a.name,params:f}))):(t(0,a=null),_=null);const E=await D();if(x!=v)return;t(0,a=E&&E.default||E),_=D}A&&typeof A=="object"&&Object.keys(A).length?t(1,f=A):t(1,f=null),t(2,c=s[M].props),d("routeLoaded",Object.assign({},O,{component:a,name:a.name,params:f})).then(()=>{yc.set(f)});return}t(0,a=null),_=null,yc.set(void 0)});Y1(()=>{y(),b&&window.removeEventListener("popstate",b)});function S(x){ft.call(this,n,x)}function C(x){ft.call(this,n,x)}return n.$$set=x=>{"routes"in x&&t(3,i=x.routes),"prefix"in x&&t(4,o=x.prefix),"restoreScrollState"in x&&t(5,r=x.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=r?"manual":"auto")},[a,f,c,i,o,r,S,C]}class n_ extends Ie{constructor(e){super(),Le(this,e,t_,Q1,Ee,{routes:3,prefix:4,restoreScrollState:5})}}const jl=[];let Qb;function eg(n){const e=n.pattern.test(Qb);Sc(n,n.className,e),Sc(n,n.inactiveClassName,!e)}function Sc(n,e,t){(e||"").split(" ").forEach(i=>{!i||(n.node.classList.remove(i),t&&n.node.classList.add(i))})}ws.subscribe(n=>{Qb=n.location+(n.querystring?"?"+n.querystring:""),jl.map(eg)});function li(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"?Xb(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return jl.push(i),eg(i),{destroy(){jl.splice(jl.indexOf(i),1)}}}const i_="modulepreload",Cc={},o_="/_/",_i=function(e,t){return!t||t.length===0?e():Promise.all(t.map(i=>{if(i=`${o_}${i}`,i in Cc)return;Cc[i]=!0;const o=i.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${r}`))return;const l=document.createElement("link");if(l.rel=o?"stylesheet":i_,o||(l.as="script",l.crossOrigin=""),l.href=i,document.head.appendChild(l),o)return new Promise((s,a)=>{l.addEventListener("load",s),l.addEventListener("error",()=>a(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>e())};function r_(n){if(n.__esModule)return n;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(n).forEach(function(t){var i=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:function(){return n[t]}})}),e}var Ta={exports:{}},tg=function(n,e){return function(){for(var t=new Array(arguments.length),i=0;i<t.length;i++)t[i]=arguments[i];return n.apply(e,t)}},l_=tg,so=Object.prototype.toString;function Ea(n){return so.call(n)==="[object Array]"}function Rs(n){return n===void 0}function xc(n){return n!==null&&typeof n=="object"}function sl(n){if(so.call(n)!=="[object Object]")return!1;var e=Object.getPrototypeOf(n);return e===null||e===Object.prototype}function Mc(n){return so.call(n)==="[object Function]"}function Ns(n,e){if(n!=null)if(typeof n!="object"&&(n=[n]),Ea(n))for(var t=0,i=n.length;t<i;t++)e.call(null,n[t],t,n);else for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.call(null,n[o],o,n)}var Pn={isArray:Ea,isArrayBuffer:function(n){return so.call(n)==="[object ArrayBuffer]"},isBuffer:function(n){return n!==null&&!Rs(n)&&n.constructor!==null&&!Rs(n.constructor)&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)},isFormData:function(n){return typeof FormData!="undefined"&&n instanceof FormData},isArrayBufferView:function(n){return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?ArrayBuffer.isView(n):n&&n.buffer&&n.buffer instanceof ArrayBuffer},isString:function(n){return typeof n=="string"},isNumber:function(n){return typeof n=="number"},isObject:xc,isPlainObject:sl,isUndefined:Rs,isDate:function(n){return so.call(n)==="[object Date]"},isFile:function(n){return so.call(n)==="[object File]"},isBlob:function(n){return so.call(n)==="[object Blob]"},isFunction:Mc,isStream:function(n){return xc(n)&&Mc(n.pipe)},isURLSearchParams:function(n){return typeof URLSearchParams!="undefined"&&n instanceof URLSearchParams},isStandardBrowserEnv:function(){return(typeof navigator=="undefined"||navigator.product!=="ReactNative"&&navigator.product!=="NativeScript"&&navigator.product!=="NS")&&typeof window!="undefined"&&typeof document!="undefined"},forEach:Ns,merge:function n(){var e={};function t(r,l){sl(e[l])&&sl(r)?e[l]=n(e[l],r):sl(r)?e[l]=n({},r):Ea(r)?e[l]=r.slice():e[l]=r}for(var i=0,o=arguments.length;i<o;i++)Ns(arguments[i],t);return e},extend:function(n,e,t){return Ns(e,function(i,o){n[o]=t&&typeof i=="function"?l_(i,t):i}),n},trim:function(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")},stripBOM:function(n){return n.charCodeAt(0)===65279&&(n=n.slice(1)),n}},Mo=Pn;function $c(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var ng=function(n,e,t){if(!e)return n;var i;if(t)i=t(e);else if(Mo.isURLSearchParams(e))i=e.toString();else{var o=[];Mo.forEach(e,function(l,s){l!=null&&(Mo.isArray(l)?s+="[]":l=[l],Mo.forEach(l,function(a){Mo.isDate(a)?a=a.toISOString():Mo.isObject(a)&&(a=JSON.stringify(a)),o.push($c(s)+"="+$c(a))}))}),i=o.join("&")}if(i){var r=n.indexOf("#");r!==-1&&(n=n.slice(0,r)),n+=(n.indexOf("?")===-1?"?":"&")+i}return n},s_=Pn;function zl(){this.handlers=[]}zl.prototype.use=function(n,e,t){return this.handlers.push({fulfilled:n,rejected:e,synchronous:!!t&&t.synchronous,runWhen:t?t.runWhen:null}),this.handlers.length-1},zl.prototype.eject=function(n){this.handlers[n]&&(this.handlers[n]=null)},zl.prototype.forEach=function(n){s_.forEach(this.handlers,function(e){e!==null&&n(e)})};var a_=zl,f_=Pn,ig=function(n,e,t,i,o){return n.config=e,t&&(n.code=t),n.request=i,n.response=o,n.isAxiosError=!0,n.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},n},c_=ig,og=function(n,e,t,i,o){var r=new Error(n);return c_(r,e,t,i,o)},u_=og,al=Pn,d_=al.isStandardBrowserEnv()?{write:function(n,e,t,i,o,r){var l=[];l.push(n+"="+encodeURIComponent(e)),al.isNumber(t)&&l.push("expires="+new Date(t).toGMTString()),al.isString(i)&&l.push("path="+i),al.isString(o)&&l.push("domain="+o),r===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(n){var e=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},p_=function(n){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(n)},h_=function(n,e){return e?n.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):n},js=Pn,m_=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],Ac=Pn,b_=Ac.isStandardBrowserEnv()?function(){var n,e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");function i(o){var r=o;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return n=i(window.location.href),function(o){var r=Ac.isString(o)?i(o):o;return r.protocol===n.protocol&&r.host===n.host}}():function(){return!0},fl=Pn,g_=function(n,e,t){var i=t.config.validateStatus;t.status&&i&&!i(t.status)?e(u_("Request failed with status code "+t.status,t.config,null,t.request,t)):n(t)},__=d_,v_=ng,y_=function(n,e){return n&&!p_(e)?h_(n,e):e},k_=function(n){var e,t,i,o={};return n&&js.forEach(n.split(`
`),function(r){if(i=r.indexOf(":"),e=js.trim(r.substr(0,i)).toLowerCase(),t=js.trim(r.substr(i+1)),e){if(o[e]&&m_.indexOf(e)>=0)return;o[e]=e==="set-cookie"?(o[e]?o[e]:[]).concat([t]):o[e]?o[e]+", "+t:t}}),o},w_=b_,zs=og,S_=function(n){return new Promise(function(e,t){var i=n.data,o=n.headers,r=n.responseType;fl.isFormData(i)&&delete o["Content-Type"];var l=new XMLHttpRequest;if(n.auth){var s=n.auth.username||"",a=n.auth.password?unescape(encodeURIComponent(n.auth.password)):"";o.Authorization="Basic "+btoa(s+":"+a)}var f=y_(n.baseURL,n.url);function c(){if(l){var d="getAllResponseHeaders"in l?k_(l.getAllResponseHeaders()):null,h={data:r&&r!=="text"&&r!=="json"?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:d,config:n,request:l};g_(e,t,h),l=null}}if(l.open(n.method.toUpperCase(),v_(f,n.params,n.paramsSerializer),!0),l.timeout=n.timeout,"onloadend"in l?l.onloadend=c:l.onreadystatechange=function(){l&&l.readyState===4&&(l.status!==0||l.responseURL&&l.responseURL.indexOf("file:")===0)&&setTimeout(c)},l.onabort=function(){l&&(t(zs("Request aborted",n,"ECONNABORTED",l)),l=null)},l.onerror=function(){t(zs("Network Error",n,null,l)),l=null},l.ontimeout=function(){var d="timeout of "+n.timeout+"ms exceeded";n.timeoutErrorMessage&&(d=n.timeoutErrorMessage),t(zs(d,n,n.transitional&&n.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",l)),l=null},fl.isStandardBrowserEnv()){var u=(n.withCredentials||w_(f))&&n.xsrfCookieName?__.read(n.xsrfCookieName):void 0;u&&(o[n.xsrfHeaderName]=u)}"setRequestHeader"in l&&fl.forEach(o,function(d,h){i===void 0&&h.toLowerCase()==="content-type"?delete o[h]:l.setRequestHeader(h,d)}),fl.isUndefined(n.withCredentials)||(l.withCredentials=!!n.withCredentials),r&&r!=="json"&&(l.responseType=n.responseType),typeof n.onDownloadProgress=="function"&&l.addEventListener("progress",n.onDownloadProgress),typeof n.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",n.onUploadProgress),n.cancelToken&&n.cancelToken.promise.then(function(d){l&&(l.abort(),t(d),l=null)}),i||(i=null),l.send(i)})},Qt=Pn,Dc=function(n,e){f_.forEach(n,function(t,i){i!==e&&i.toUpperCase()===e.toUpperCase()&&(n[e]=t,delete n[i])})},C_=ig,x_={"Content-Type":"application/x-www-form-urlencoded"};function Oc(n,e){!Qt.isUndefined(n)&&Qt.isUndefined(n["Content-Type"])&&(n["Content-Type"]=e)}var Tc,Hl={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:((typeof XMLHttpRequest!="undefined"||typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]")&&(Tc=S_),Tc),transformRequest:[function(n,e){return Dc(e,"Accept"),Dc(e,"Content-Type"),Qt.isFormData(n)||Qt.isArrayBuffer(n)||Qt.isBuffer(n)||Qt.isStream(n)||Qt.isFile(n)||Qt.isBlob(n)?n:Qt.isArrayBufferView(n)?n.buffer:Qt.isURLSearchParams(n)?(Oc(e,"application/x-www-form-urlencoded;charset=utf-8"),n.toString()):Qt.isObject(n)||e&&e["Content-Type"]==="application/json"?(Oc(e,"application/json"),function(t,i,o){if(Qt.isString(t))try{return(i||JSON.parse)(t),Qt.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(o||JSON.stringify)(t)}(n)):n}],transformResponse:[function(n){var e=this.transitional,t=e&&e.silentJSONParsing,i=e&&e.forcedJSONParsing,o=!t&&this.responseType==="json";if(o||i&&Qt.isString(n)&&n.length)try{return JSON.parse(n)}catch(r){if(o)throw r.name==="SyntaxError"?C_(r,this,"E_JSON_PARSE"):r}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(n){return n>=200&&n<300}};Hl.headers={common:{Accept:"application/json, text/plain, */*"}},Qt.forEach(["delete","get","head"],function(n){Hl.headers[n]={}}),Qt.forEach(["post","put","patch"],function(n){Hl.headers[n]=Qt.merge(x_)});var kf=Hl,M_=Pn,$_=kf,rg=function(n){return!(!n||!n.__CANCEL__)},Ec=Pn,Hs=function(n,e,t){var i=this||$_;return M_.forEach(t,function(o){n=o.call(i,n,e)}),n},A_=rg,D_=kf;function qs(n){n.cancelToken&&n.cancelToken.throwIfRequested()}var on=Pn,lg=function(n,e){e=e||{};var t={},i=["url","method","data"],o=["headers","auth","proxy","params"],r=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],l=["validateStatus"];function s(u,d){return on.isPlainObject(u)&&on.isPlainObject(d)?on.merge(u,d):on.isPlainObject(d)?on.merge({},d):on.isArray(d)?d.slice():d}function a(u){on.isUndefined(e[u])?on.isUndefined(n[u])||(t[u]=s(void 0,n[u])):t[u]=s(n[u],e[u])}on.forEach(i,function(u){on.isUndefined(e[u])||(t[u]=s(void 0,e[u]))}),on.forEach(o,a),on.forEach(r,function(u){on.isUndefined(e[u])?on.isUndefined(n[u])||(t[u]=s(void 0,n[u])):t[u]=s(void 0,e[u])}),on.forEach(l,function(u){u in e?t[u]=s(n[u],e[u]):u in n&&(t[u]=s(void 0,n[u]))});var f=i.concat(o).concat(r).concat(l),c=Object.keys(n).concat(Object.keys(e)).filter(function(u){return f.indexOf(u)===-1});return on.forEach(c,a),t},sg={name:"axios",version:"0.21.4",description:"Promise based HTTP client for the browser and node.js",main:"index.js",scripts:{test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},repository:{type:"git",url:"https://github.com/axios/axios.git"},keywords:["xhr","http","ajax","promise","node"],author:"Matt Zabriskie",license:"MIT",bugs:{url:"https://github.com/axios/axios/issues"},homepage:"https://axios-http.com",devDependencies:{coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},browser:{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},jsdelivr:"dist/axios.min.js",unpkg:"dist/axios.min.js",typings:"./index.d.ts",dependencies:{"follow-redirects":"^1.14.0"},bundlesize:[{path:"./dist/axios.min.js",threshold:"5kB"}]},wf={};["object","boolean","number","function","string","symbol"].forEach(function(n,e){wf[n]=function(t){return typeof t===n||"a"+(e<1?"n ":" ")+n}});var Pc={},O_=sg.version.split(".");function ag(n,e){for(var t=e?e.split("."):O_,i=n.split("."),o=0;o<3;o++){if(t[o]>i[o])return!0;if(t[o]<i[o])return!1}return!1}wf.transitional=function(n,e,t){var i=e&&ag(e);function o(r,l){return"[Axios v"+sg.version+"] Transitional option '"+r+"'"+l+(t?". "+t:"")}return function(r,l,s){if(n===!1)throw new Error(o(l," has been removed in "+e));return i&&!Pc[l]&&(Pc[l]=!0,console.warn(o(l," has been deprecated since v"+e+" and will be removed in the near future"))),!n||n(r,l,s)}};var T_={isOlderVersion:ag,assertOptions:function(n,e,t){if(typeof n!="object")throw new TypeError("options must be an object");for(var i=Object.keys(n),o=i.length;o-- >0;){var r=i[o],l=e[r];if(l){var s=n[r],a=s===void 0||l(s,r,n);if(a!==!0)throw new TypeError("option "+r+" must be "+a)}else if(t!==!0)throw Error("Unknown option "+r)}},validators:wf},Fc=Pn,E_=ng,Lc=a_,Ic=function(n){return qs(n),n.headers=n.headers||{},n.data=Hs.call(n,n.data,n.headers,n.transformRequest),n.headers=Ec.merge(n.headers.common||{},n.headers[n.method]||{},n.headers),Ec.forEach(["delete","get","head","post","put","patch","common"],function(e){delete n.headers[e]}),(n.adapter||D_.adapter)(n).then(function(e){return qs(n),e.data=Hs.call(n,e.data,e.headers,n.transformResponse),e},function(e){return A_(e)||(qs(n),e&&e.response&&(e.response.data=Hs.call(n,e.response.data,e.response.headers,n.transformResponse))),Promise.reject(e)})},cl=lg,fg=T_,$o=fg.validators;function gr(n){this.defaults=n,this.interceptors={request:new Lc,response:new Lc}}gr.prototype.request=function(n){typeof n=="string"?(n=arguments[1]||{}).url=arguments[0]:n=n||{},(n=cl(this.defaults,n)).method?n.method=n.method.toLowerCase():this.defaults.method?n.method=this.defaults.method.toLowerCase():n.method="get";var e=n.transitional;e!==void 0&&fg.assertOptions(e,{silentJSONParsing:$o.transitional($o.boolean,"1.0.0"),forcedJSONParsing:$o.transitional($o.boolean,"1.0.0"),clarifyTimeoutError:$o.transitional($o.boolean,"1.0.0")},!1);var t=[],i=!0;this.interceptors.request.forEach(function(c){typeof c.runWhen=="function"&&c.runWhen(n)===!1||(i=i&&c.synchronous,t.unshift(c.fulfilled,c.rejected))});var o,r=[];if(this.interceptors.response.forEach(function(c){r.push(c.fulfilled,c.rejected)}),!i){var l=[Ic,void 0];for(Array.prototype.unshift.apply(l,t),l=l.concat(r),o=Promise.resolve(n);l.length;)o=o.then(l.shift(),l.shift());return o}for(var s=n;t.length;){var a=t.shift(),f=t.shift();try{s=a(s)}catch(c){f(c);break}}try{o=Ic(s)}catch(c){return Promise.reject(c)}for(;r.length;)o=o.then(r.shift(),r.shift());return o},gr.prototype.getUri=function(n){return n=cl(this.defaults,n),E_(n.url,n.params,n.paramsSerializer).replace(/^\?/,"")},Fc.forEach(["delete","get","head","options"],function(n){gr.prototype[n]=function(e,t){return this.request(cl(t||{},{method:n,url:e,data:(t||{}).data}))}}),Fc.forEach(["post","put","patch"],function(n){gr.prototype[n]=function(e,t,i){return this.request(cl(i||{},{method:n,url:e,data:t}))}});var P_=gr;function Pa(n){this.message=n}Pa.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Pa.prototype.__CANCEL__=!0;var cg=Pa,F_=cg;function ql(n){if(typeof n!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(i){e=i});var t=this;n(function(i){t.reason||(t.reason=new F_(i),e(t.reason))})}ql.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},ql.source=function(){var n;return{token:new ql(function(e){n=e}),cancel:n}};var L_=ql,Rc=Pn,I_=tg,Vl=P_,R_=lg;function ug(n){var e=new Vl(n),t=I_(Vl.prototype.request,e);return Rc.extend(t,Vl.prototype,e),Rc.extend(t,e),t}var Gn=ug(kf);Gn.Axios=Vl,Gn.create=function(n){return ug(R_(Gn.defaults,n))},Gn.Cancel=cg,Gn.CancelToken=L_,Gn.isCancel=rg,Gn.all=function(n){return Promise.all(n)},Gn.spread=function(n){return function(e){return n.apply(null,e)}},Gn.isAxiosError=function(n){return typeof n=="object"&&n.isAxiosError===!0},Ta.exports=Gn,Ta.exports.default=Gn;var Vs=Ta.exports,Nc=typeof Symbol!="undefined"&&Symbol,N_=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},e=Symbol("test"),t=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(t)!=="[object Symbol]")return!1;for(e in n[e]=42,n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var i=Object.getOwnPropertySymbols(n);if(i.length!==1||i[0]!==e||!Object.prototype.propertyIsEnumerable.call(n,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(n,e);if(o.value!==42||o.enumerable!==!0)return!1}return!0},j_="Function.prototype.bind called on incompatible ",Bs=Array.prototype.slice,z_=Object.prototype.toString,H_=function(n){var e=this;if(typeof e!="function"||z_.call(e)!=="[object Function]")throw new TypeError(j_+e);for(var t,i=Bs.call(arguments,1),o=function(){if(this instanceof t){var f=e.apply(this,i.concat(Bs.call(arguments)));return Object(f)===f?f:this}return e.apply(n,i.concat(Bs.call(arguments)))},r=Math.max(0,e.length-i.length),l=[],s=0;s<r;s++)l.push("$"+s);if(t=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(o),e.prototype){var a=function(){};a.prototype=e.prototype,t.prototype=new a,a.prototype=null}return t},Sf=Function.prototype.bind||H_,q_=Sf.call(Function.call,Object.prototype.hasOwnProperty),qo=SyntaxError,dg=Function,Io=TypeError,Us=function(n){try{return dg('"use strict"; return ('+n+").constructor;")()}catch{}},co=Object.getOwnPropertyDescriptor;if(co)try{co({},"")}catch{co=null}var Ws=function(){throw new Io},V_=co?function(){try{return Ws}catch{try{return co(arguments,"callee").get}catch{return Ws}}}():Ws,Ao=typeof Nc=="function"&&typeof Symbol=="function"&&typeof Nc("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&N_(),Ti=Object.getPrototypeOf||function(n){return n.__proto__},Po={},B_=typeof Uint8Array=="undefined"?void 0:Ti(Uint8Array),Ro={"%AggregateError%":typeof AggregateError=="undefined"?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":Ao?Ti([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":Po,"%AsyncGenerator%":Po,"%AsyncGeneratorFunction%":Po,"%AsyncIteratorPrototype%":Po,"%Atomics%":typeof Atomics=="undefined"?void 0:Atomics,"%BigInt%":typeof BigInt=="undefined"?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?void 0:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?void 0:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?void 0:FinalizationRegistry,"%Function%":dg,"%GeneratorFunction%":Po,"%Int8Array%":typeof Int8Array=="undefined"?void 0:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?void 0:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ao?Ti(Ti([][Symbol.iterator]())):void 0,"%JSON%":typeof JSON=="object"?JSON:void 0,"%Map%":typeof Map=="undefined"?void 0:Map,"%MapIteratorPrototype%":typeof Map!="undefined"&&Ao?Ti(new Map()[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?void 0:Promise,"%Proxy%":typeof Proxy=="undefined"?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?void 0:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?void 0:Set,"%SetIteratorPrototype%":typeof Set!="undefined"&&Ao?Ti(new Set()[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ao?Ti(""[Symbol.iterator]()):void 0,"%Symbol%":Ao?Symbol:void 0,"%SyntaxError%":qo,"%ThrowTypeError%":V_,"%TypedArray%":B_,"%TypeError%":Io,"%Uint8Array%":typeof Uint8Array=="undefined"?void 0:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?void 0:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?void 0:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?void 0:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?void 0:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?void 0:WeakSet},U_=function n(e){var t;if(e==="%AsyncFunction%")t=Us("async function () {}");else if(e==="%GeneratorFunction%")t=Us("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=Us("async function* () {}");else if(e==="%AsyncGenerator%"){var i=n("%AsyncGeneratorFunction%");i&&(t=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var o=n("%AsyncGenerator%");o&&(t=Ti(o.prototype))}return Ro[e]=t,t},jc={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Br=Sf,Zl=q_,W_=Br.call(Function.call,Array.prototype.concat),Y_=Br.call(Function.apply,Array.prototype.splice),zc=Br.call(Function.call,String.prototype.replace),Xl=Br.call(Function.call,String.prototype.slice),G_=Br.call(Function.call,RegExp.prototype.exec),K_=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,J_=/\\(\\)?/g,Z_=function(n){var e=Xl(n,0,1),t=Xl(n,-1);if(e==="%"&&t!=="%")throw new qo("invalid intrinsic syntax, expected closing `%`");if(t==="%"&&e!=="%")throw new qo("invalid intrinsic syntax, expected opening `%`");var i=[];return zc(n,K_,function(o,r,l,s){i[i.length]=l?zc(s,J_,"$1"):r||o}),i},X_=function(n,e){var t,i=n;if(Zl(jc,i)&&(i="%"+(t=jc[i])[0]+"%"),Zl(Ro,i)){var o=Ro[i];if(o===Po&&(o=U_(i)),o===void 0&&!e)throw new Io("intrinsic "+n+" exists, but is not available. Please file an issue!");return{alias:t,name:i,value:o}}throw new qo("intrinsic "+n+" does not exist!")},Cf=function(n,e){if(typeof n!="string"||n.length===0)throw new Io("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Io('"allowMissing" argument must be a boolean');if(G_(/^%?[^%]*%?$/g,n)===null)throw new qo("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var t=Z_(n),i=t.length>0?t[0]:"",o=X_("%"+i+"%",e),r=o.name,l=o.value,s=!1,a=o.alias;a&&(i=a[0],Y_(t,W_([0,1],a)));for(var f=1,c=!0;f<t.length;f+=1){var u=t[f],d=Xl(u,0,1),h=Xl(u,-1);if((d==='"'||d==="'"||d==="`"||h==='"'||h==="'"||h==="`")&&d!==h)throw new qo("property names with quotes must have matching quotes");if(u!=="constructor"&&c||(s=!0),Zl(Ro,r="%"+(i+="."+u)+"%"))l=Ro[r];else if(l!=null){if(!(u in l)){if(!e)throw new Io("base intrinsic for "+n+" exists, but the property is not available.");return}if(co&&f+1>=t.length){var b=co(l,u);l=(c=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:l[u]}else c=Zl(l,u),l=l[u];c&&!s&&(Ro[r]=l)}}return l},pg={exports:{}};(function(n){var e=Sf,t=Cf,i=t("%Function.prototype.apply%"),o=t("%Function.prototype.call%"),r=t("%Reflect.apply%",!0)||e.call(o,i),l=t("%Object.getOwnPropertyDescriptor%",!0),s=t("%Object.defineProperty%",!0),a=t("%Math.max%");if(s)try{s({},"a",{value:1})}catch{s=null}n.exports=function(c){var u=r(e,o,arguments);if(l&&s){var d=l(u,"length");d.configurable&&s(u,"length",{value:1+a(0,c.length-(arguments.length-1))})}return u};var f=function(){return r(e,i,arguments)};s?s(n.exports,"apply",{value:f}):n.exports.apply=f})(pg);var hg=Cf,mg=pg.exports,Q_=mg(hg("String.prototype.indexOf")),ev=r_(Object.freeze({__proto__:null,default:{}})),xf=typeof Map=="function"&&Map.prototype,Ys=Object.getOwnPropertyDescriptor&&xf?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ul=xf&&Ys&&typeof Ys.get=="function"?Ys.get:null,tv=xf&&Map.prototype.forEach,Mf=typeof Set=="function"&&Set.prototype,Gs=Object.getOwnPropertyDescriptor&&Mf?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,dl=Mf&&Gs&&typeof Gs.get=="function"?Gs.get:null,nv=Mf&&Set.prototype.forEach,nr=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap.prototype.has:null,ir=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet.prototype.has:null,Hc=typeof WeakRef=="function"&&WeakRef.prototype?WeakRef.prototype.deref:null,iv=Boolean.prototype.valueOf,ov=Object.prototype.toString,rv=Function.prototype.toString,lv=String.prototype.match,$f=String.prototype.slice,Ri=String.prototype.replace,sv=String.prototype.toUpperCase,qc=String.prototype.toLowerCase,bg=RegExp.prototype.test,Vc=Array.prototype.concat,ri=Array.prototype.join,av=Array.prototype.slice,Bc=Math.floor,Ks=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Js=Object.getOwnPropertySymbols,Fa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Vo=typeof Symbol=="function"&&typeof Symbol.iterator=="object",rn=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Vo||"symbol")?Symbol.toStringTag:null,gg=Object.prototype.propertyIsEnumerable,Uc=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function Wc(n,e){if(n===1/0||n===-1/0||n!=n||n&&n>-1e3&&n<1e3||bg.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var i=n<0?-Bc(-n):Bc(n);if(i!==n){var o=String(i),r=$f.call(e,o.length+1);return Ri.call(o,t,"$&_")+"."+Ri.call(Ri.call(r,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ri.call(e,t,"$&_")}var La=ev,Yc=La.custom,Gc=vg(Yc)?Yc:null;function _g(n,e,t){var i=(t.quoteStyle||e)==="double"?'"':"'";return i+n+i}function fv(n){return Ri.call(String(n),/"/g,"&quot;")}function Ia(n){return!(Pi(n)!=="[object Array]"||rn&&typeof n=="object"&&rn in n)}function Kc(n){return!(Pi(n)!=="[object RegExp]"||rn&&typeof n=="object"&&rn in n)}function vg(n){if(Vo)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!Fa)return!1;try{return Fa.call(n),!0}catch{}return!1}var cv=Object.prototype.hasOwnProperty||function(n){return n in this};function Ei(n,e){return cv.call(n,e)}function Pi(n){return ov.call(n)}function Jc(n,e){if(n.indexOf)return n.indexOf(e);for(var t=0,i=n.length;t<i;t++)if(n[t]===e)return t;return-1}function yg(n,e){if(n.length>e.maxStringLength){var t=n.length-e.maxStringLength,i="... "+t+" more character"+(t>1?"s":"");return yg($f.call(n,0,e.maxStringLength),e)+i}return _g(Ri.call(Ri.call(n,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,uv),"single",e)}function uv(n){var e=n.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+sv.call(e.toString(16))}function or(n){return"Object("+n+")"}function Zs(n){return n+" { ? }"}function Zc(n,e,t,i){return n+" ("+e+") {"+(i?Ra(t,i):ri.call(t,", "))+"}"}function Ra(n,e){if(n.length===0)return"";var t=`
`+e.prev+e.base;return t+ri.call(n,","+t)+`
`+e.prev}function pl(n,e){var t=Ia(n),i=[];if(t){i.length=n.length;for(var o=0;o<n.length;o++)i[o]=Ei(n,o)?e(n[o],n):""}var r,l=typeof Js=="function"?Js(n):[];if(Vo){r={};for(var s=0;s<l.length;s++)r["$"+l[s]]=l[s]}for(var a in n)Ei(n,a)&&(t&&String(Number(a))===a&&a<n.length||Vo&&r["$"+a]instanceof Symbol||(bg.call(/[^\w$]/,a)?i.push(e(a,n)+": "+e(n[a],n)):i.push(a+": "+e(n[a],n))));if(typeof Js=="function")for(var f=0;f<l.length;f++)gg.call(n,l[f])&&i.push("["+e(l[f])+"]: "+e(n[l[f]],n));return i}var kg,Af=Cf,Ko=function(n,e){var t=hg(n,!!e);return typeof t=="function"&&Q_(n,".prototype.")>-1?mg(t):t},dv=function n(e,t,i,o){var r=t||{};if(Ei(r,"quoteStyle")&&r.quoteStyle!=="single"&&r.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ei(r,"maxStringLength")&&(typeof r.maxStringLength=="number"?r.maxStringLength<0&&r.maxStringLength!==1/0:r.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=!Ei(r,"customInspect")||r.customInspect;if(typeof l!="boolean"&&l!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ei(r,"indent")&&r.indent!==null&&r.indent!==" "&&!(parseInt(r.indent,10)===r.indent&&r.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ei(r,"numericSeparator")&&typeof r.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=r.numericSeparator;if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return yg(e,r);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var a=String(e);return s?Wc(e,a):a}if(typeof e=="bigint"){var f=String(e)+"n";return s?Wc(e,f):f}var c=r.depth===void 0?5:r.depth;if(i===void 0&&(i=0),i>=c&&c>0&&typeof e=="object")return Ia(e)?"[Array]":"[Object]";var u=function(R,G){var U;if(R.indent===" ")U=" ";else{if(!(typeof R.indent=="number"&&R.indent>0))return null;U=ri.call(Array(R.indent+1)," ")}return{base:U,prev:ri.call(Array(G+1),U)}}(r,i);if(o===void 0)o=[];else if(Jc(o,e)>=0)return"[Circular]";function d(R,G,U){if(G&&(o=av.call(o)).push(G),U){var z={depth:r.depth};return Ei(r,"quoteStyle")&&(z.quoteStyle=r.quoteStyle),n(R,z,i+1,o)}return n(R,r,i+1,o)}if(typeof e=="function"&&!Kc(e)){var h=function(R){if(R.name)return R.name;var G=lv.call(rv.call(R),/^function\s*([\w$]+)/);return G?G[1]:null}(e),b=pl(e,d);return"[Function"+(h?": "+h:" (anonymous)")+"]"+(b.length>0?" { "+ri.call(b,", ")+" }":"")}if(vg(e)){var v=Vo?Ri.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Fa.call(e);return typeof e!="object"||Vo?v:or(v)}if(function(R){return!R||typeof R!="object"?!1:typeof HTMLElement!="undefined"&&R instanceof HTMLElement?!0:typeof R.nodeName=="string"&&typeof R.getAttribute=="function"}(e)){for(var _="<"+qc.call(String(e.nodeName)),y=e.attributes||[],S=0;S<y.length;S++)_+=" "+y[S].name+"="+_g(fv(y[S].value),"double",r);return _+=">",e.childNodes&&e.childNodes.length&&(_+="..."),_+="</"+qc.call(String(e.nodeName))+">"}if(Ia(e)){if(e.length===0)return"[]";var C=pl(e,d);return u&&!function(R){for(var G=0;G<R.length;G++)if(Jc(R[G],`
`)>=0)return!1;return!0}(C)?"["+Ra(C,u)+"]":"[ "+ri.call(C,", ")+" ]"}if(function(R){return!(Pi(R)!=="[object Error]"||rn&&typeof R=="object"&&rn in R)}(e)){var x=pl(e,d);return"cause"in Error.prototype||!("cause"in e)||gg.call(e,"cause")?x.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+ri.call(x,", ")+" }":"{ ["+String(e)+"] "+ri.call(Vc.call("[cause]: "+d(e.cause),x),", ")+" }"}if(typeof e=="object"&&l){if(Gc&&typeof e[Gc]=="function"&&La)return La(e,{depth:c-i});if(l!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(function(R){if(!ul||!R||typeof R!="object")return!1;try{ul.call(R);try{dl.call(R)}catch{return!0}return R instanceof Map}catch{}return!1}(e)){var M=[];return tv.call(e,function(R,G){M.push(d(G,e,!0)+" => "+d(R,e))}),Zc("Map",ul.call(e),M,u)}if(function(R){if(!dl||!R||typeof R!="object")return!1;try{dl.call(R);try{ul.call(R)}catch{return!0}return R instanceof Set}catch{}return!1}(e)){var A=[];return nv.call(e,function(R){A.push(d(R,e))}),Zc("Set",dl.call(e),A,u)}if(function(R){if(!nr||!R||typeof R!="object")return!1;try{nr.call(R,nr);try{ir.call(R,ir)}catch{return!0}return R instanceof WeakMap}catch{}return!1}(e))return Zs("WeakMap");if(function(R){if(!ir||!R||typeof R!="object")return!1;try{ir.call(R,ir);try{nr.call(R,nr)}catch{return!0}return R instanceof WeakSet}catch{}return!1}(e))return Zs("WeakSet");if(function(R){if(!Hc||!R||typeof R!="object")return!1;try{return Hc.call(R),!0}catch{}return!1}(e))return Zs("WeakRef");if(function(R){return!(Pi(R)!=="[object Number]"||rn&&typeof R=="object"&&rn in R)}(e))return or(d(Number(e)));if(function(R){if(!R||typeof R!="object"||!Ks)return!1;try{return Ks.call(R),!0}catch{}return!1}(e))return or(d(Ks.call(e)));if(function(R){return!(Pi(R)!=="[object Boolean]"||rn&&typeof R=="object"&&rn in R)}(e))return or(iv.call(e));if(function(R){return!(Pi(R)!=="[object String]"||rn&&typeof R=="object"&&rn in R)}(e))return or(d(String(e)));if(!function(R){return!(Pi(R)!=="[object Date]"||rn&&typeof R=="object"&&rn in R)}(e)&&!Kc(e)){var O=pl(e,d),D=Uc?Uc(e)===Object.prototype:e instanceof Object||e.constructor===Object,E=e instanceof Object?"":"null prototype",P=!D&&rn&&Object(e)===e&&rn in e?$f.call(Pi(e),8,-1):E?"Object":"",I=(D||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"")+(P||E?"["+ri.call(Vc.call([],P||[],E||[]),": ")+"] ":"");return O.length===0?I+"{}":u?I+"{"+Ra(O,u)+"}":I+"{ "+ri.call(O,", ")+" }"}return String(e)},pv=Af("%TypeError%"),hl=Af("%WeakMap%",!0),ml=Af("%Map%",!0),hv=Ko("WeakMap.prototype.get",!0),mv=Ko("WeakMap.prototype.set",!0),bv=Ko("WeakMap.prototype.has",!0),gv=Ko("Map.prototype.get",!0),_v=Ko("Map.prototype.set",!0),vv=Ko("Map.prototype.has",!0),Xs=function(n,e){for(var t,i=n;(t=i.next)!==null;i=t)if(t.key===e)return i.next=t.next,t.next=n.next,n.next=t,t},yv=String.prototype.replace,kv=/%20/g,Xc="RFC3986",Df={default:Xc,formatters:{RFC1738:function(n){return yv.call(n,kv,"+")},RFC3986:function(n){return String(n)}},RFC1738:"RFC1738",RFC3986:Xc},wv=Df,Qs=Object.prototype.hasOwnProperty,Ji=Array.isArray,ii=function(){for(var n=[],e=0;e<256;++e)n.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return n}(),Qc=function(n,e){for(var t=e&&e.plainObjects?Object.create(null):{},i=0;i<n.length;++i)n[i]!==void 0&&(t[i]=n[i]);return t},wg={arrayToObject:Qc,assign:function(n,e){return Object.keys(e).reduce(function(t,i){return t[i]=e[i],t},n)},combine:function(n,e){return[].concat(n,e)},compact:function(n){for(var e=[{obj:{o:n},prop:"o"}],t=[],i=0;i<e.length;++i)for(var o=e[i],r=o.obj[o.prop],l=Object.keys(r),s=0;s<l.length;++s){var a=l[s],f=r[a];typeof f=="object"&&f!==null&&t.indexOf(f)===-1&&(e.push({obj:r,prop:a}),t.push(f))}return function(c){for(;c.length>1;){var u=c.pop(),d=u.obj[u.prop];if(Ji(d)){for(var h=[],b=0;b<d.length;++b)d[b]!==void 0&&h.push(d[b]);u.obj[u.prop]=h}}}(e),n},decode:function(n,e,t){var i=n.replace(/\+/g," ");if(t==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},encode:function(n,e,t,i,o){if(n.length===0)return n;var r=n;if(typeof n=="symbol"?r=Symbol.prototype.toString.call(n):typeof n!="string"&&(r=String(n)),t==="iso-8859-1")return escape(r).replace(/%u[0-9a-f]{4}/gi,function(f){return"%26%23"+parseInt(f.slice(2),16)+"%3B"});for(var l="",s=0;s<r.length;++s){var a=r.charCodeAt(s);a===45||a===46||a===95||a===126||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||o===wv.RFC1738&&(a===40||a===41)?l+=r.charAt(s):a<128?l+=ii[a]:a<2048?l+=ii[192|a>>6]+ii[128|63&a]:a<55296||a>=57344?l+=ii[224|a>>12]+ii[128|a>>6&63]+ii[128|63&a]:(s+=1,a=65536+((1023&a)<<10|1023&r.charCodeAt(s)),l+=ii[240|a>>18]+ii[128|a>>12&63]+ii[128|a>>6&63]+ii[128|63&a])}return l},isBuffer:function(n){return!(!n||typeof n!="object")&&!!(n.constructor&&n.constructor.isBuffer&&n.constructor.isBuffer(n))},isRegExp:function(n){return Object.prototype.toString.call(n)==="[object RegExp]"},maybeMap:function(n,e){if(Ji(n)){for(var t=[],i=0;i<n.length;i+=1)t.push(e(n[i]));return t}return e(n)},merge:function n(e,t,i){if(!t)return e;if(typeof t!="object"){if(Ji(e))e.push(t);else{if(!e||typeof e!="object")return[e,t];(i&&(i.plainObjects||i.allowPrototypes)||!Qs.call(Object.prototype,t))&&(e[t]=!0)}return e}if(!e||typeof e!="object")return[e].concat(t);var o=e;return Ji(e)&&!Ji(t)&&(o=Qc(e,i)),Ji(e)&&Ji(t)?(t.forEach(function(r,l){if(Qs.call(e,l)){var s=e[l];s&&typeof s=="object"&&r&&typeof r=="object"?e[l]=n(s,r,i):e.push(r)}else e[l]=r}),e):Object.keys(t).reduce(function(r,l){var s=t[l];return Qs.call(r,l)?r[l]=n(r[l],s,i):r[l]=s,r},o)}},Sg=function(){var n,e,t,i={assert:function(o){if(!i.has(o))throw new pv("Side channel does not contain "+dv(o))},get:function(o){if(hl&&o&&(typeof o=="object"||typeof o=="function")){if(n)return hv(n,o)}else if(ml){if(e)return gv(e,o)}else if(t)return function(r,l){var s=Xs(r,l);return s&&s.value}(t,o)},has:function(o){if(hl&&o&&(typeof o=="object"||typeof o=="function")){if(n)return bv(n,o)}else if(ml){if(e)return vv(e,o)}else if(t)return function(r,l){return!!Xs(r,l)}(t,o);return!1},set:function(o,r){hl&&o&&(typeof o=="object"||typeof o=="function")?(n||(n=new hl),mv(n,o,r)):ml?(e||(e=new ml),_v(e,o,r)):(t||(t={key:{},next:null}),function(l,s,a){var f=Xs(l,s);f?f.value=a:l.next={key:s,next:l.next,value:a}}(t,o,r))}};return i},Na=wg,Sr=Df,Sv=Object.prototype.hasOwnProperty,eu={brackets:function(n){return n+"[]"},comma:"comma",indices:function(n,e){return n+"["+e+"]"},repeat:function(n){return n}},vi=Array.isArray,Cv=String.prototype.split,xv=Array.prototype.push,Cg=function(n,e){xv.apply(n,vi(e)?e:[e])},Mv=Date.prototype.toISOString,tu=Sr.default,Xt={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Na.encode,encodeValuesOnly:!1,format:tu,formatter:Sr.formatters[tu],indices:!1,serializeDate:function(n){return Mv.call(n)},skipNulls:!1,strictNullHandling:!1},ea={},$v=function n(e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_){for(var y,S=e,C=_,x=0,M=!1;(C=C.get(ea))!==void 0&&!M;){var A=C.get(e);if(x+=1,A!==void 0){if(A===x)throw new RangeError("Cyclic object value");M=!0}C.get(ea)===void 0&&(x=0)}if(typeof a=="function"?S=a(t,S):S instanceof Date?S=u(S):i==="comma"&&vi(S)&&(S=Na.maybeMap(S,function(ce){return ce instanceof Date?u(ce):ce})),S===null){if(r)return s&&!b?s(t,Xt.encoder,v,"key",d):t;S=""}if(typeof(y=S)=="string"||typeof y=="number"||typeof y=="boolean"||typeof y=="symbol"||typeof y=="bigint"||Na.isBuffer(S)){if(s){var O=b?t:s(t,Xt.encoder,v,"key",d);if(i==="comma"&&b){for(var D=Cv.call(String(S),","),E="",P=0;P<D.length;++P)E+=(P===0?"":",")+h(s(D[P],Xt.encoder,v,"value",d));return[h(O)+(o&&vi(S)&&D.length===1?"[]":"")+"="+E]}return[h(O)+"="+h(s(S,Xt.encoder,v,"value",d))]}return[h(t)+"="+h(String(S))]}var I,R=[];if(S===void 0)return R;if(i==="comma"&&vi(S))I=[{value:S.length>0?S.join(",")||null:void 0}];else if(vi(a))I=a;else{var G=Object.keys(S);I=f?G.sort(f):G}for(var U=o&&vi(S)&&S.length===1?t+"[]":t,z=0;z<I.length;++z){var K=I[z],Y=typeof K=="object"&&K.value!==void 0?K.value:S[K];if(!l||Y!==null){var W=vi(S)?typeof i=="function"?i(U,K):U:U+(c?"."+K:"["+K+"]");_.set(e,x);var te=Sg();te.set(ea,_),Cg(R,n(Y,W,i,o,r,l,s,a,f,c,u,d,h,b,v,te))}}return R},Fo=wg,ja=Object.prototype.hasOwnProperty,Av=Array.isArray,Jt={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Fo.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Dv=function(n){return n.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},xg=function(n,e){return n&&typeof n=="string"&&e.comma&&n.indexOf(",")>-1?n.split(","):n},Ov=function(n,e,t,i){if(n){var o=t.allowDots?n.replace(/\.([^.[]+)/g,"[$1]"):n,r=/(\[[^[\]]*])/g,l=t.depth>0&&/(\[[^[\]]*])/.exec(o),s=l?o.slice(0,l.index):o,a=[];if(s){if(!t.plainObjects&&ja.call(Object.prototype,s)&&!t.allowPrototypes)return;a.push(s)}for(var f=0;t.depth>0&&(l=r.exec(o))!==null&&f<t.depth;){if(f+=1,!t.plainObjects&&ja.call(Object.prototype,l[1].slice(1,-1))&&!t.allowPrototypes)return;a.push(l[1])}return l&&a.push("["+o.slice(l.index)+"]"),function(c,u,d,h){for(var b=h?u:xg(u,d),v=c.length-1;v>=0;--v){var _,y=c[v];if(y==="[]"&&d.parseArrays)_=[].concat(b);else{_=d.plainObjects?Object.create(null):{};var S=y.charAt(0)==="["&&y.charAt(y.length-1)==="]"?y.slice(1,-1):y,C=parseInt(S,10);d.parseArrays||S!==""?!isNaN(C)&&y!==S&&String(C)===S&&C>=0&&d.parseArrays&&C<=d.arrayLimit?(_=[])[C]=b:S!=="__proto__"&&(_[S]=b):_={0:b}}b=_}return b}(a,e,t,i)}},Tv=function(n,e){var t,i=n,o=function(b){if(!b)return Xt;if(b.encoder!==null&&b.encoder!==void 0&&typeof b.encoder!="function")throw new TypeError("Encoder has to be a function.");var v=b.charset||Xt.charset;if(b.charset!==void 0&&b.charset!=="utf-8"&&b.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var _=Sr.default;if(b.format!==void 0){if(!Sv.call(Sr.formatters,b.format))throw new TypeError("Unknown format option provided.");_=b.format}var y=Sr.formatters[_],S=Xt.filter;return(typeof b.filter=="function"||vi(b.filter))&&(S=b.filter),{addQueryPrefix:typeof b.addQueryPrefix=="boolean"?b.addQueryPrefix:Xt.addQueryPrefix,allowDots:b.allowDots===void 0?Xt.allowDots:!!b.allowDots,charset:v,charsetSentinel:typeof b.charsetSentinel=="boolean"?b.charsetSentinel:Xt.charsetSentinel,delimiter:b.delimiter===void 0?Xt.delimiter:b.delimiter,encode:typeof b.encode=="boolean"?b.encode:Xt.encode,encoder:typeof b.encoder=="function"?b.encoder:Xt.encoder,encodeValuesOnly:typeof b.encodeValuesOnly=="boolean"?b.encodeValuesOnly:Xt.encodeValuesOnly,filter:S,format:_,formatter:y,serializeDate:typeof b.serializeDate=="function"?b.serializeDate:Xt.serializeDate,skipNulls:typeof b.skipNulls=="boolean"?b.skipNulls:Xt.skipNulls,sort:typeof b.sort=="function"?b.sort:null,strictNullHandling:typeof b.strictNullHandling=="boolean"?b.strictNullHandling:Xt.strictNullHandling}}(e);typeof o.filter=="function"?i=(0,o.filter)("",i):vi(o.filter)&&(t=o.filter);var r,l=[];if(typeof i!="object"||i===null)return"";r=e&&e.arrayFormat in eu?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var s=eu[r];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var a=s==="comma"&&e&&e.commaRoundTrip;t||(t=Object.keys(i)),o.sort&&t.sort(o.sort);for(var f=Sg(),c=0;c<t.length;++c){var u=t[c];o.skipNulls&&i[u]===null||Cg(l,$v(i[u],u,s,a,o.strictNullHandling,o.skipNulls,o.encode?o.encoder:null,o.filter,o.sort,o.allowDots,o.serializeDate,o.format,o.formatter,o.encodeValuesOnly,o.charset,f))}var d=l.join(o.delimiter),h=o.addQueryPrefix===!0?"?":"";return o.charsetSentinel&&(o.charset==="iso-8859-1"?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),d.length>0?h+d:""},Ev={formats:Df,parse:function(n,e){var t=function(f){if(!f)return Jt;if(f.decoder!==null&&f.decoder!==void 0&&typeof f.decoder!="function")throw new TypeError("Decoder has to be a function.");if(f.charset!==void 0&&f.charset!=="utf-8"&&f.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var c=f.charset===void 0?Jt.charset:f.charset;return{allowDots:f.allowDots===void 0?Jt.allowDots:!!f.allowDots,allowPrototypes:typeof f.allowPrototypes=="boolean"?f.allowPrototypes:Jt.allowPrototypes,allowSparse:typeof f.allowSparse=="boolean"?f.allowSparse:Jt.allowSparse,arrayLimit:typeof f.arrayLimit=="number"?f.arrayLimit:Jt.arrayLimit,charset:c,charsetSentinel:typeof f.charsetSentinel=="boolean"?f.charsetSentinel:Jt.charsetSentinel,comma:typeof f.comma=="boolean"?f.comma:Jt.comma,decoder:typeof f.decoder=="function"?f.decoder:Jt.decoder,delimiter:typeof f.delimiter=="string"||Fo.isRegExp(f.delimiter)?f.delimiter:Jt.delimiter,depth:typeof f.depth=="number"||f.depth===!1?+f.depth:Jt.depth,ignoreQueryPrefix:f.ignoreQueryPrefix===!0,interpretNumericEntities:typeof f.interpretNumericEntities=="boolean"?f.interpretNumericEntities:Jt.interpretNumericEntities,parameterLimit:typeof f.parameterLimit=="number"?f.parameterLimit:Jt.parameterLimit,parseArrays:f.parseArrays!==!1,plainObjects:typeof f.plainObjects=="boolean"?f.plainObjects:Jt.plainObjects,strictNullHandling:typeof f.strictNullHandling=="boolean"?f.strictNullHandling:Jt.strictNullHandling}}(e);if(n===""||n==null)return t.plainObjects?Object.create(null):{};for(var i=typeof n=="string"?function(f,c){var u,d={},h=c.ignoreQueryPrefix?f.replace(/^\?/,""):f,b=c.parameterLimit===1/0?void 0:c.parameterLimit,v=h.split(c.delimiter,b),_=-1,y=c.charset;if(c.charsetSentinel)for(u=0;u<v.length;++u)v[u].indexOf("utf8=")===0&&(v[u]==="utf8=%E2%9C%93"?y="utf-8":v[u]==="utf8=%26%2310003%3B"&&(y="iso-8859-1"),_=u,u=v.length);for(u=0;u<v.length;++u)if(u!==_){var S,C,x=v[u],M=x.indexOf("]="),A=M===-1?x.indexOf("="):M+1;A===-1?(S=c.decoder(x,Jt.decoder,y,"key"),C=c.strictNullHandling?null:""):(S=c.decoder(x.slice(0,A),Jt.decoder,y,"key"),C=Fo.maybeMap(xg(x.slice(A+1),c),function(O){return c.decoder(O,Jt.decoder,y,"value")})),C&&c.interpretNumericEntities&&y==="iso-8859-1"&&(C=Dv(C)),x.indexOf("[]=")>-1&&(C=Av(C)?[C]:C),ja.call(d,S)?d[S]=Fo.combine(d[S],C):d[S]=C}return d}(n,t):n,o=t.plainObjects?Object.create(null):{},r=Object.keys(i),l=0;l<r.length;++l){var s=r[l],a=Ov(s,i[s],t,typeof n=="string");o=Fo.merge(o,a,t)}return t.allowSparse===!0?o:Fo.compact(o)},stringify:Tv};kg=typeof atob=="function"?atob:function(n){return Buffer.from(n,"base64").toString("binary")};var Pv=function(){function n(){}return n.getPayload=function(e){if(e)try{var t=decodeURIComponent(kg(e.split(".")[1]).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(t)||{}}catch{}return{}},n.isExpired=function(e,t){t===void 0&&(t=0);var i=n.getPayload(e);return!(Object.keys(i).length>0&&(!i.exp||i.exp-t>Date.now()/1e3))},n}(),za=function(n,e){return za=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])},za(n,e)};function mn(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}za(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Bl(n,e,t,i){return new(t||(t=Promise))(function(o,r){function l(f){try{a(i.next(f))}catch(c){r(c)}}function s(f){try{a(i.throw(f))}catch(c){r(c)}}function a(f){var c;f.done?o(f.value):(c=f.value,c instanceof t?c:new t(function(u){u(c)})).then(l,s)}a((i=i.apply(n,e||[])).next())})}function Ul(n,e){var t,i,o,r,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function s(a){return function(f){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;l;)try{if(t=1,i&&(o=2&c[0]?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,i=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(o=l.trys,!((o=o.length>0&&o[o.length-1])||c[0]!==6&&c[0]!==2)){l=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(c[0]===6&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=e.call(n,l)}catch(u){c=[6,u],i=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([a,f])}}}var Ur=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}(),Ql=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return mn(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t);for(var i=0,o=Object.entries(t);i<o.length;i++){var r=o[i],l=r[0],s=r[1];this[l]=s}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}(Ur),es=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return mn(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 Ql(t.profile):null},e}(Ur),Bo=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return mn(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}(Ur),Mg=function(){function n(e){e===void 0&&(e="pocketbase_auth"),this.fallback={},this.storageKey=e}return Object.defineProperty(n.prototype,"token",{get:function(){return(this._storageGet(this.storageKey)||{}).token||""},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"model",{get:function(){var e,t=this._storageGet(this.storageKey)||{};return t===null||typeof t!="object"||t.model===null||typeof t.model!="object"?{}:((e=t.model)===null||e===void 0?void 0:e.verified)!==void 0?new es(t.model):new Bo(t.model)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isValid",{get:function(){return!Pv.isExpired(this.token)},enumerable:!1,configurable:!0}),n.prototype.save=function(e,t){this._storageSet(this.storageKey,{token:e,model:t})},n.prototype.clear=function(){return this._storageRemove(this.storageKey)},n.prototype._storageGet=function(e){var t;if(typeof window!="undefined"&&(window==null?void 0:window.localStorage)){var i=((t=window==null?void 0:window.localStorage)===null||t===void 0?void 0:t.getItem(e))||"";try{return JSON.parse(i)}catch{return i}}return this.fallback[e]},n.prototype._storageSet=function(e,t){var i;if(typeof window!="undefined"&&(window==null?void 0:window.localStorage)){var o=t;typeof t!="string"&&(o=JSON.stringify(t)),(i=window==null?void 0:window.localStorage)===null||i===void 0||i.setItem(e,o)}else this.fallback[e]=t},n.prototype._storageRemove=function(e){var t;typeof window!="undefined"&&((t=window==null?void 0:window.localStorage)===null||t===void 0||t.removeItem(e)),delete this.fallback[e]},n}(),Cs=function(n){this.client=n},Fv=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return mn(e,n),e.prototype.getAll=function(t){return t===void 0&&(t={}),this.client.send({method:"get",url:"/api/settings",params:t}).then(function(i){return(i==null?void 0:i.data)||{}})},e.prototype.update=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send({method:"patch",url:"/api/settings",params:i,data:t}).then(function(o){return(o==null?void 0:o.data)||{}})},e}(Cs),$g=function(n,e,t,i){this.page=n>0?n:1,this.perPage=e>=0?e:0,this.totalItems=t>=0?t:0,this.items=i||[]},Ag=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return mn(e,n),e.prototype._getFullList=function(t,i,o){var r=this;i===void 0&&(i=100),o===void 0&&(o={});var l=[],s=function(a){return Bl(r,void 0,void 0,function(){return Ul(this,function(f){return[2,this._getList(t,a,i,o).then(function(c){var u=c,d=u.items,h=u.totalItems;return l=l.concat(d),d.length&&h>l.length?s(a+1):l})]})})};return s(1)},e.prototype._getList=function(t,i,o,r){var l=this;return i===void 0&&(i=1),o===void 0&&(o=30),r===void 0&&(r={}),r=Object.assign({page:i,perPage:o},r),this.client.send({method:"get",url:t,params:r}).then(function(s){var a,f,c,u,d,h=[];if(!((a=s==null?void 0:s.data)===null||a===void 0)&&a.items){s.data.items=((f=s==null?void 0:s.data)===null||f===void 0?void 0:f.items)||[];for(var b=0,v=s.data.items;b<v.length;b++){var _=v[b];h.push(l.decode(_))}}return new $g(((c=s==null?void 0:s.data)===null||c===void 0?void 0:c.page)||1,((u=s==null?void 0:s.data)===null||u===void 0?void 0:u.perPage)||0,((d=s==null?void 0:s.data)===null||d===void 0?void 0:d.totalItems)||0,h)})},e.prototype._getOne=function(t,i,o){var r=this;return o===void 0&&(o={}),this.client.send({method:"get",url:t+"/"+encodeURIComponent(i),params:o}).then(function(l){return r.decode(l==null?void 0:l.data)})},e.prototype._create=function(t,i,o){var r=this;return i===void 0&&(i={}),o===void 0&&(o={}),this.client.send({method:"post",url:t,params:o,data:i}).then(function(l){return r.decode(l==null?void 0:l.data)})},e.prototype._update=function(t,i,o,r){var l=this;return o===void 0&&(o={}),r===void 0&&(r={}),this.client.send({method:"patch",url:t+"/"+encodeURIComponent(i),params:r,data:o}).then(function(s){return l.decode(s==null?void 0:s.data)})},e.prototype._delete=function(t,i,o,r){return o===void 0&&(o={}),r===void 0&&(r={}),this.client.send({method:"delete",url:t+"/"+encodeURIComponent(i),params:r,data:o}).then(function(){return!0})},e}(Cs),Of=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return mn(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,o){return t===void 0&&(t=1),i===void 0&&(i=30),o===void 0&&(o={}),this._getList(this.baseCrudPath(),t,i,o)},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,o){return i===void 0&&(i={}),o===void 0&&(o={}),this._update(this.baseCrudPath(),t,i,o)},e.prototype.delete=function(t,i,o){return i===void 0&&(i={}),o===void 0&&(o={}),this._delete(this.baseCrudPath(),t,i,o)},e}(Ag),Lv=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return mn(e,n),e.prototype.decode=function(t){return new Bo(t)},e.prototype.baseCrudPath=function(){return"/api/admins"},e.prototype.authResponse=function(t){var i,o,r,l,s=this.decode(((i=t==null?void 0:t.data)===null||i===void 0?void 0:i.admin)||{});return((o=t==null?void 0:t.data)===null||o===void 0?void 0:o.token)&&((r=t==null?void 0:t.data)===null||r===void 0?void 0:r.admin)&&this.client.AuthStore.save(t.data.token,s),Object.assign({},t==null?void 0:t.data,{token:((l=t==null?void 0:t.data)===null||l===void 0?void 0:l.token)||"",admin:s})},e.prototype.authViaEmail=function(t,i,o,r){return o===void 0&&(o={}),r===void 0&&(r={}),o=Object.assign({email:t,password:i},o),this.client.send({method:"post",url:this.baseCrudPath()+"/auth-via-email",params:r,data: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({method:"post",url:this.baseCrudPath()+"/refresh",params:i,data:t}).then(this.authResponse.bind(this))},e.prototype.requestPasswordReset=function(t,i,o){return i===void 0&&(i={}),o===void 0&&(o={}),i=Object.assign({email:t},i),this.client.send({method:"post",url:this.baseCrudPath()+"/request-password-reset",params:o,data:i}).then(function(){return!0})},e.prototype.confirmPasswordReset=function(t,i,o,r,l){return r===void 0&&(r={}),l===void 0&&(l={}),r=Object.assign({token:t,password:i,passwordConfirm:o},r),this.client.send({method:"post",url:this.baseCrudPath()+"/confirm-password-reset",params:l,data:r}).then(this.authResponse.bind(this))},e}(Of),Iv=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return mn(e,n),e.prototype.decode=function(t){return new es(t)},e.prototype.baseCrudPath=function(){return"/api/users"},e.prototype.authResponse=function(t){var i,o,r,l,s=this.decode(((i=t==null?void 0:t.data)===null||i===void 0?void 0:i.user)||{});return((o=t==null?void 0:t.data)===null||o===void 0?void 0:o.token)&&((r=t==null?void 0:t.data)===null||r===void 0?void 0:r.user)&&this.client.AuthStore.save(t.data.token,s),Object.assign({},t==null?void 0:t.data,{token:((l=t==null?void 0:t.data)===null||l===void 0?void 0:l.token)||"",user:s})},e.prototype.listAuthMethods=function(t){return t===void 0&&(t={}),this.client.send({method:"get",url:this.baseCrudPath()+"/auth-methods",params:t}).then(function(i){var o,r,l;return Object.assign({},i==null?void 0:i.data,{emailPassword:!!(!((o=i==null?void 0:i.data)===null||o===void 0)&&o.emailPassword),authProviders:Array.isArray((r=i==null?void 0:i.data)===null||r===void 0?void 0:r.authProviders)?(l=i==null?void 0:i.data)===null||l===void 0?void 0:l.authProviders:[]})})},e.prototype.authViaEmail=function(t,i,o,r){return o===void 0&&(o={}),r===void 0&&(r={}),o=Object.assign({email:t,password:i},o),this.client.send({method:"post",url:this.baseCrudPath()+"/auth-via-email",params:r,data:o,headers:{Authorization:""}}).then(this.authResponse.bind(this))},e.prototype.authViaOAuth2=function(t,i,o,r,l,s){return l===void 0&&(l={}),s===void 0&&(s={}),l=Object.assign({provider:t,code:i,codeVerifier:o,redirectUrl:r},l),this.client.send({method:"post",url:this.baseCrudPath()+"/auth-via-oauth2",params:s,data:l,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({method:"post",url:this.baseCrudPath()+"/refresh",params:i,data:t}).then(this.authResponse.bind(this))},e.prototype.requestPasswordReset=function(t,i,o){return i===void 0&&(i={}),o===void 0&&(o={}),i=Object.assign({email:t},i),this.client.send({method:"post",url:this.baseCrudPath()+"/request-password-reset",params:o,data:i}).then(function(){return!0})},e.prototype.confirmPasswordReset=function(t,i,o,r,l){return r===void 0&&(r={}),l===void 0&&(l={}),r=Object.assign({token:t,password:i,passwordConfirm:o},r),this.client.send({method:"post",url:this.baseCrudPath()+"/confirm-password-reset",params:l,data:r}).then(this.authResponse.bind(this))},e.prototype.requestVerification=function(t,i,o){return i===void 0&&(i={}),o===void 0&&(o={}),i=Object.assign({email:t},i),this.client.send({method:"post",url:this.baseCrudPath()+"/request-verification",params:o,data:i}).then(function(){return!0})},e.prototype.confirmVerification=function(t,i,o){return i===void 0&&(i={}),o===void 0&&(o={}),i=Object.assign({token:t},i),this.client.send({method:"post",url:this.baseCrudPath()+"/confirm-verification",params:o,data:i}).then(this.authResponse.bind(this))},e.prototype.requestEmailChange=function(t,i,o){return i===void 0&&(i={}),o===void 0&&(o={}),i=Object.assign({newEmail:t},i),this.client.send({method:"post",url:this.baseCrudPath()+"/request-email-change",params:o,data:i}).then(function(){return!0})},e.prototype.confirmEmailChange=function(t,i,o,r){return o===void 0&&(o={}),r===void 0&&(r={}),o=Object.assign({token:t,password:i},o),this.client.send({method:"post",url:this.baseCrudPath()+"/confirm-email-change",params:r,data:o}).then(this.authResponse.bind(this))},e}(Of),kn=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}(),En=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return mn(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,o=t.schema;i<o.length;i++){var r=o[i];this.schema.push(new kn(r))}},e}(Ur),Rv=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return mn(e,n),e.prototype.decode=function(t){return new En(t)},e.prototype.baseCrudPath=function(){return"/api/collections"},e}(Of),Nv=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return mn(e,n),e.prototype.decode=function(t){return new Ql(t)},e.prototype.baseCrudPath=function(t){return"/api/collections/"+encodeURIComponent(t)+"/records"},e.prototype.getFileUrl=function(t,i,o){o===void 0&&(o={});var r=[];r.push(this.client.baseUrl.replace(/\/+$/gm,"")),r.push("api"),r.push("files"),r.push(t["@collectionId"]),r.push(t.id),r.push(i);var l=r.join("/");if(Object.keys(o).length){var s=new URLSearchParams(o);l+=(l.includes("?")?"&":"?")+s}return l},e}(function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return mn(e,n),e.prototype.getFullList=function(t,i,o){return i===void 0&&(i=100),o===void 0&&(o={}),this._getFullList(this.baseCrudPath(t),i,o)},e.prototype.getList=function(t,i,o,r){return i===void 0&&(i=1),o===void 0&&(o=30),r===void 0&&(r={}),this._getList(this.baseCrudPath(t),i,o,r)},e.prototype.getOne=function(t,i,o){return o===void 0&&(o={}),this._getOne(this.baseCrudPath(t),i,o)},e.prototype.create=function(t,i,o){return i===void 0&&(i={}),o===void 0&&(o={}),this._create(this.baseCrudPath(t),i,o)},e.prototype.update=function(t,i,o,r){return o===void 0&&(o={}),r===void 0&&(r={}),this._update(this.baseCrudPath(t),i,o,r)},e.prototype.delete=function(t,i,o,r){return o===void 0&&(o={}),r===void 0&&(r={}),this._delete(this.baseCrudPath(t),i,o,r)},e}(Ag)),Ha=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return mn(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),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.ip=typeof t.ip=="string"?t.ip:"",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}(Ur),jv=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return mn(e,n),e.prototype.getRequestsList=function(t,i,o){return t===void 0&&(t=1),i===void 0&&(i=30),o===void 0&&(o={}),o=Object.assign({page:t,perPage:i},o),this.client.send({method:"get",url:"/api/logs/requests",params:o}).then(function(r){var l,s,a,f,c,u=[];if(!((l=r==null?void 0:r.data)===null||l===void 0)&&l.items){r.data.items=((s=r==null?void 0:r.data)===null||s===void 0?void 0:s.items)||[];for(var d=0,h=r.data.items;d<h.length;d++){var b=h[d];u.push(new Ha(b))}}return new $g(((a=r==null?void 0:r.data)===null||a===void 0?void 0:a.page)||1,((f=r==null?void 0:r.data)===null||f===void 0?void 0:f.perPage)||0,((c=r==null?void 0:r.data)===null||c===void 0?void 0:c.totalItems)||0,u)})},e.prototype.getRequest=function(t,i){return i===void 0&&(i={}),this.client.send({method:"get",url:"/api/logs/requests/"+encodeURIComponent(t),params:i}).then(function(o){return new Ha(o==null?void 0:o.data)})},e.prototype.getRequestsStats=function(t){return t===void 0&&(t={}),this.client.send({method:"get",url:"/api/logs/requests/stats",params:t}).then(function(i){return i==null?void 0:i.data})},e}(Cs),zv=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.clientId="",t.eventSource=null,t.subscriptions={},t}return mn(e,n),e.prototype.subscribe=function(t,i){var o;return Bl(this,void 0,void 0,function(){return Ul(this,function(r){switch(r.label){case 0:if(!t)throw new Error("subscription must be set.");return this.subscriptions[t]&&((o=this.eventSource)===null||o===void 0||o.removeEventListener(t,this.subscriptions[t])),this.subscriptions[t]=function(l){var s,a=l;try{s=JSON.parse(a==null?void 0:a.data)}catch{}i(s||{})},this.eventSource?[3,1]:(this.connect(),[3,3]);case 1:return this.clientId?[4,this.submitSubscriptions()]:[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.unsubscribe=function(t){var i;return Bl(this,void 0,void 0,function(){return Ul(this,function(o){switch(o.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:o.sent(),o.label=2;case 2:return Object.keys(this.subscriptions).length||this.disconnect(),[2]}})})},e.prototype.submitSubscriptions=function(){return Bl(this,void 0,void 0,function(){return Ul(this,function(t){return this.addSubscriptionListeners(),[2,this.client.send({method:"post",url:"/api/realtime",data:{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.baseUrl+"/api/realtime"),this.eventSource.addEventListener("PB_CONNECT",function(i){return t.connectHandler(i)})},e.prototype.disconnect=function(){var t,i,o=this;this.removeSubscriptionListeners(),(t=this.eventSource)===null||t===void 0||t.removeEventListener("PB_CONNECT",function(r){return o.connectHandler(r)}),(i=this.eventSource)===null||i===void 0||i.close(),this.eventSource=null,this.clientId=""},e}(Cs),Tf=function(){function n(e,t,i,o){e===void 0&&(e="/"),t===void 0&&(t="en-US");var r=this;this.cancelSource={},this.defaultAuthStore=new Mg,this.http=Vs.create(Object.assign({paramsSerializer:function(l){var s={};for(var a in l)l[a]!==null&&(s[a]=l[a]);return Ev.stringify(s,{arrayFormat:"repeat",serializeDate:function(f){return f.toISOString()}})}},o||{})),this.http.interceptors.request.use(function(l){var s,a,f,c;if(!l.cancelToken&&((s=l==null?void 0:l.params)===null||s===void 0?void 0:s.$autoCancel)!==!1){var u=((a=l==null?void 0:l.params)===null||a===void 0?void 0:a.$cancelKey)||(l.method||"get")+l.url;r.cancelRequest(u),r.cancelSource[u]=Vs.CancelToken.source(),l.cancelToken=r.cancelSource[u].token}return(f=l==null?void 0:l.params)===null||f===void 0||delete f.$autoCancel,(c=l==null?void 0:l.params)===null||c===void 0||delete c.$cancelKey,l}),this.http.interceptors.response.use(function(l){return l},function(l){return Vs.isCancel(l)?Promise.reject(null):Promise.reject(l)}),this.baseUrl=e,this.language=t,this.AuthStore=i||this.defaultAuthStore,this.Settings=new Fv(this),this.Admins=new Lv(this),this.Users=new Iv(this),this.Collections=new Rv(this),this.Records=new Nv(this),this.Logs=new jv(this),this.Realtime=new zv(this)}return Object.defineProperty(n.prototype,"baseUrl",{get:function(){return this.http.defaults.baseURL||""},set:function(e){this.http.defaults.baseURL=e.replace(/\/+$/,"")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"language",{set:function(e){e?this.http.defaults.headers.common["Accept-Language"]=e:delete this.http.defaults.headers.common["Accept-Language"]},enumerable:!1,configurable:!0}),n.prototype.cancelRequest=function(e){return this.cancelSource[e]&&(this.cancelSource[e].cancel(),delete this.cancelSource[e]),this},n.prototype.cancelAllRequests=function(){for(var e in this.cancelSource)this.cancelSource[e].cancel();return this},n.prototype.send=function(e){var t,i,o,r=Object.assign({},e);if(((t=this.AuthStore)===null||t===void 0?void 0:t.token)&&((i=r==null?void 0:r.headers)===null||i===void 0?void 0:i.Authorization)===void 0){var l="Admin";((o=this.AuthStore.model)===null||o===void 0?void 0:o.verified)!==void 0&&(l="User"),r.headers=Object.assign({},r.headers,{Authorization:l+" "+this.AuthStore.token})}return this.http.request(r)},n}();class bo extends Error{}class Hv extends bo{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class qv extends bo{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Vv extends bo{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class _r extends bo{}class Dg extends bo{constructor(e){super(`Invalid unit ${e}`)}}class jn extends bo{}class Di extends bo{constructor(){super("Zone is an abstract class")}}const Be="numeric",ei="short",Tn="long",qa={year:Be,month:Be,day:Be},Og={year:Be,month:ei,day:Be},Bv={year:Be,month:ei,day:Be,weekday:ei},Tg={year:Be,month:Tn,day:Be},Eg={year:Be,month:Tn,day:Be,weekday:Tn},Pg={hour:Be,minute:Be},Fg={hour:Be,minute:Be,second:Be},Lg={hour:Be,minute:Be,second:Be,timeZoneName:ei},Ig={hour:Be,minute:Be,second:Be,timeZoneName:Tn},Rg={hour:Be,minute:Be,hourCycle:"h23"},Ng={hour:Be,minute:Be,second:Be,hourCycle:"h23"},jg={hour:Be,minute:Be,second:Be,hourCycle:"h23",timeZoneName:ei},zg={hour:Be,minute:Be,second:Be,hourCycle:"h23",timeZoneName:Tn},Hg={year:Be,month:Be,day:Be,hour:Be,minute:Be},qg={year:Be,month:Be,day:Be,hour:Be,minute:Be,second:Be},Vg={year:Be,month:ei,day:Be,hour:Be,minute:Be},Bg={year:Be,month:ei,day:Be,hour:Be,minute:Be,second:Be},Uv={year:Be,month:ei,day:Be,weekday:ei,hour:Be,minute:Be},Ug={year:Be,month:Tn,day:Be,hour:Be,minute:Be,timeZoneName:ei},Wg={year:Be,month:Tn,day:Be,hour:Be,minute:Be,second:Be,timeZoneName:ei},Yg={year:Be,month:Tn,day:Be,weekday:Tn,hour:Be,minute:Be,timeZoneName:Tn},Gg={year:Be,month:Tn,day:Be,weekday:Tn,hour:Be,minute:Be,second:Be,timeZoneName:Tn};function pt(n){return typeof n=="undefined"}function uo(n){return typeof n=="number"}function xs(n){return typeof n=="number"&&n%1===0}function Wv(n){return typeof n=="string"}function Yv(n){return Object.prototype.toString.call(n)==="[object Date]"}function Kg(){try{return typeof Intl!="undefined"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Gv(n){return Array.isArray(n)?n:[n]}function nu(n,e,t){if(n.length!==0)return n.reduce((i,o)=>{const r=[e(o),o];return i&&t(i[0],r[0])===i[0]?i:r},null)[1]}function Kv(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Uo(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ki(n,e,t){return xs(n)&&n>=e&&n<=t}function Jv(n,e){return n-e*Math.floor(n/e)}function Bt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Fi(n){if(!(pt(n)||n===null||n===""))return parseInt(n,10)}function Zi(n){if(!(pt(n)||n===null||n===""))return parseFloat(n)}function Ef(n){if(!(pt(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function Pf(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function Wr(n){return n%4===0&&(n%100!==0||n%400===0)}function Cr(n){return Wr(n)?366:365}function ts(n,e){const t=Jv(e-1,12)+1,i=n+(e-t)/12;return t===2?Wr(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Ff(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 ns(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 Va(n){return n>99?n:n>60?1900+n:2e3+n}function Jg(n,e,t,i=null){const o=new Date(n),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(r.timeZone=i);const l={timeZoneName:e,...r},s=new Intl.DateTimeFormat(t,l).formatToParts(o).find(a=>a.type.toLowerCase()==="timezonename");return s?s.value:null}function Ms(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,o=t<0||Object.is(t,-0)?-i:i;return t*60+o}function Zg(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new jn(`Invalid unit value ${n}`);return e}function is(n,e){const t={};for(const i in n)if(Uo(n,i)){const o=n[i];if(o==null)continue;t[e(i)]=Zg(o)}return t}function xr(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),o=n>=0?"+":"-";switch(e){case"short":return`${o}${Bt(t,2)}:${Bt(i,2)}`;case"narrow":return`${o}${t}${i>0?`:${i}`:""}`;case"techie":return`${o}${Bt(t,2)}${Bt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function $s(n){return Kv(n,["hour","minute","second","millisecond"])}const Xg=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,Zv=["January","February","March","April","May","June","July","August","September","October","November","December"],Qg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Xv=["J","F","M","A","M","J","J","A","S","O","N","D"];function e0(n){switch(n){case"narrow":return[...Xv];case"short":return[...Qg];case"long":return[...Zv];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 t0=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n0=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Qv=["M","T","W","T","F","S","S"];function i0(n){switch(n){case"narrow":return[...Qv];case"short":return[...n0];case"long":return[...t0];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const o0=["AM","PM"],ey=["Before Christ","Anno Domini"],ty=["BC","AD"],ny=["B","A"];function r0(n){switch(n){case"narrow":return[...ny];case"short":return[...ty];case"long":return[...ey];default:return null}}function iy(n){return o0[n.hour<12?0:1]}function oy(n,e){return i0(e)[n.weekday-1]}function ry(n,e){return e0(e)[n.month-1]}function ly(n,e){return r0(e)[n.year<0?0:1]}function sy(n,e,t="always",i=!1){const o={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."]},r=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&r){const u=n==="days";switch(e){case 1:return u?"tomorrow":`next ${o[n][0]}`;case-1:return u?"yesterday":`last ${o[n][0]}`;case 0:return u?"today":`this ${o[n][0]}`}}const l=Object.is(e,-0)||e<0,s=Math.abs(e),a=s===1,f=o[n],c=i?a?f[1]:f[2]||f[1]:a?o[n][0]:n;return l?`${s} ${c} ago`:`in ${s} ${c}`}function iu(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const ay={D:qa,DD:Og,DDD:Tg,DDDD:Eg,t:Pg,tt:Fg,ttt:Lg,tttt:Ig,T:Rg,TT:Ng,TTT:jg,TTTT:zg,f:Hg,ff:Vg,fff:Ug,ffff:Yg,F:qg,FF:Bg,FFF:Wg,FFFF:Gg};class vn{static create(e,t={}){return new vn(e,t)}static parseFormat(e){let t=null,i="",o=!1;const r=[];for(let l=0;l<e.length;l++){const s=e.charAt(l);s==="'"?(i.length>0&&r.push({literal:o,val:i}),t=null,i="",o=!o):o||s===t?i+=s:(i.length>0&&r.push({literal:!1,val:i}),i=s,t=s)}return i.length>0&&r.push({literal:o,val:i}),r}static macroTokenToFormatOpts(e){return ay[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 Bt(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",o=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",r=(h,b)=>this.loc.extract(e,h,b),l=h=>e.isOffsetFixed&&e.offset===0&&h.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,h.format):"",s=()=>i?iy(e):r({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(h,b)=>i?ry(e,h):r(b?{month:h}:{month:h,day:"numeric"},"month"),f=(h,b)=>i?oy(e,h):r(b?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),c=h=>{const b=vn.macroTokenToFormatOpts(h);return b?this.formatWithSystemDefault(e,b):h},u=h=>i?ly(e,h):r({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 l({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return l({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return l({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 s();case"d":return o?r({day:"numeric"},"day"):this.num(e.day);case"dd":return o?r({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return f("short",!0);case"cccc":return f("long",!0);case"ccccc":return f("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return f("short",!1);case"EEEE":return f("long",!1);case"EEEEE":return f("narrow",!1);case"L":return o?r({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return o?r({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 o?r({month:"numeric"},"month"):this.num(e.month);case"MM":return o?r({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 o?r({year:"numeric"},"year"):this.num(e.year);case"yy":return o?r({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return o?r({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return o?r({year:"numeric"},"year"):this.num(e.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("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 c(h)}};return iu(vn.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}},o=a=>f=>{const c=i(f);return c?this.num(a.get(c),f.length):f},r=vn.parseFormat(t),l=r.reduce((a,{literal:f,val:c})=>f?a:a.concat(c),[]),s=e.shiftTo(...l.map(i).filter(a=>a));return iu(r,o(s))}}class Zn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Yr{get type(){throw new Di}get name(){throw new Di}get ianaName(){return this.name}get isUniversal(){throw new Di}offsetName(e,t){throw new Di}formatOffset(e,t){throw new Di}offset(e){throw new Di}equals(e){throw new Di}get isValid(){throw new Di}}let ta=null;class Lf extends Yr{static get instance(){return ta===null&&(ta=new Lf),ta}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return Jg(e,t,i)}formatOffset(e,t){return xr(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let Wl={};function fy(n){return Wl[n]||(Wl[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"})),Wl[n]}const cy={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function uy(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,o,r,l,s,a,f,c]=i;return[l,o,r,s,a,f,c]}function dy(n,e){const t=n.formatToParts(e),i=[];for(let o=0;o<t.length;o++){const{type:r,value:l}=t[o],s=cy[r];r==="era"?i[s]=l:pt(s)||(i[s]=parseInt(l,10))}return i}let bl={};class Si extends Yr{static create(e){return bl[e]||(bl[e]=new Si(e)),bl[e]}static resetCache(){bl={},Wl={}}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=Si.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return Jg(e,t,i,this.name)}formatOffset(e,t){return xr(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const i=fy(this.name);let[o,r,l,s,a,f,c]=i.formatToParts?dy(i,t):uy(i,t);s==="BC"&&(o=-Math.abs(o)+1);const d=Ff({year:o,month:r,day:l,hour:a===24?0:a,minute:f,second:c,millisecond:0});let h=+t;const b=h%1e3;return h-=b>=0?b:1e3+b,(d-h)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let na=null;class dn extends Yr{static get utcInstance(){return na===null&&(na=new dn(0)),na}static instance(e){return e===0?dn.utcInstance:new dn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new dn(Ms(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${xr(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${xr(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return xr(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 py extends Yr{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(pt(n)||n===null)return e;if(n instanceof Yr)return n;if(Wv(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?dn.utcInstance:dn.parseSpecifier(t)||Si.create(n)}else return uo(n)?dn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new py(n)}let ou=()=>Date.now(),ru="system",lu=null,su=null,au=null,fu;class Yt{static get now(){return ou}static set now(e){ou=e}static set defaultZone(e){ru=e}static get defaultZone(){return Li(ru,Lf.instance)}static get defaultLocale(){return lu}static set defaultLocale(e){lu=e}static get defaultNumberingSystem(){return su}static set defaultNumberingSystem(e){su=e}static get defaultOutputCalendar(){return au}static set defaultOutputCalendar(e){au=e}static get throwOnInvalid(){return fu}static set throwOnInvalid(e){fu=e}static resetCaches(){Lt.resetCache(),Si.resetCache()}}let cu={};function hy(n,e={}){const t=JSON.stringify([n,e]);let i=cu[t];return i||(i=new Intl.ListFormat(n,e),cu[t]=i),i}let Ba={};function Ua(n,e={}){const t=JSON.stringify([n,e]);let i=Ba[t];return i||(i=new Intl.DateTimeFormat(n,e),Ba[t]=i),i}let Wa={};function my(n,e={}){const t=JSON.stringify([n,e]);let i=Wa[t];return i||(i=new Intl.NumberFormat(n,e),Wa[t]=i),i}let Ya={};function by(n,e={}){const{base:t,...i}=e,o=JSON.stringify([n,i]);let r=Ya[o];return r||(r=new Intl.RelativeTimeFormat(n,e),Ya[o]=r),r}let vr=null;function gy(){return vr||(vr=new Intl.DateTimeFormat().resolvedOptions().locale,vr)}function _y(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Ua(n).resolvedOptions()}catch{t=Ua(i).resolvedOptions()}const{numberingSystem:o,calendar:r}=t;return[i,o,r]}}function vy(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function yy(n){const e=[];for(let t=1;t<=12;t++){const i=Qe.utc(2016,t,1);e.push(n(i))}return e}function ky(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 gl(n,e,t,i,o){const r=n.listingMode(t);return r==="error"?null:r==="en"?i(e):o(e)}function wy(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 Sy{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:o,floor:r,...l}=i;if(!t||Object.keys(l).length>0){const s={useGrouping:!1,...i};i.padTo>0&&(s.minimumIntegerDigits=i.padTo),this.inf=my(e,s)}}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):Pf(e,3);return Bt(t,this.padTo)}}}class Cy{constructor(e,t,i){this.opts=i;let o;if(e.zone.isUniversal){const l=-1*(e.offset/60),s=l>=0?`Etc/GMT+${l}`:`Etc/GMT${l}`;e.offset!==0&&Si.create(s).valid?(o=s,this.dt=e):(o="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,o=e.zone.name);const r={...this.opts};o&&(r.timeZone=o),this.dtf=Ua(t,r)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class xy{constructor(e,t,i){this.opts={style:"long",...i},!t&&Kg()&&(this.rtf=by(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):sy(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Lt{static fromOpts(e){return Lt.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,o=!1){const r=e||Yt.defaultLocale,l=r||(o?"en-US":gy()),s=t||Yt.defaultNumberingSystem,a=i||Yt.defaultOutputCalendar;return new Lt(l,s,a,r)}static resetCache(){vr=null,Ba={},Wa={},Ya={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return Lt.create(e,t,i)}constructor(e,t,i,o){const[r,l,s]=_y(e);this.locale=r,this.numberingSystem=t||l||null,this.outputCalendar=i||s||null,this.intl=vy(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=o,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=wy(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:Lt.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 gl(this,e,i,e0,()=>{const o=t?{month:e,day:"numeric"}:{month:e},r=t?"format":"standalone";return this.monthsCache[r][e]||(this.monthsCache[r][e]=yy(l=>this.extract(l,o,"month"))),this.monthsCache[r][e]})}weekdays(e,t=!1,i=!0){return gl(this,e,i,i0,()=>{const o=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=ky(l=>this.extract(l,o,"weekday"))),this.weekdaysCache[r][e]})}meridiems(e=!0){return gl(this,void 0,e,()=>o0,()=>{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 gl(this,e,t,r0,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[Qe.utc(-40,1,1),Qe.utc(2017,1,1)].map(o=>this.extract(o,i,"era"))),this.eraCache[e]})}extract(e,t,i){const o=this.dtFormatter(e,t),r=o.formatToParts(),l=r.find(s=>s.type.toLowerCase()===i);return l?l.value:null}numberFormatter(e={}){return new Sy(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Cy(e,this.intl,t)}relFormatter(e={}){return new xy(this.intl,this.isEnglish(),e)}listFormatter(e={}){return hy(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 Jo(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Zo(...n){return e=>n.reduce(([t,i,o],r)=>{const[l,s,a]=r(e,o);return[{...t,...l},s||i,a]},[{},null,1]).slice(0,2)}function Xo(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const o=t.exec(n);if(o)return i(o)}return[null,null]}function l0(...n){return(e,t)=>{const i={};let o;for(o=0;o<n.length;o++)i[n[o]]=Fi(e[t+o]);return[i,null,t+o]}}const s0=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,My=`(?:${s0.source}?(?:\\[(${Xg.source})\\])?)?`,If=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,a0=RegExp(`${If.source}${My}`),Rf=RegExp(`(?:T${a0.source})?`),$y=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Ay=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Dy=/(\d{4})-?(\d{3})/,Oy=l0("weekYear","weekNumber","weekDay"),Ty=l0("year","ordinal"),Ey=/(\d{4})-(\d\d)-(\d\d)/,f0=RegExp(`${If.source} ?(?:${s0.source}|(${Xg.source}))?`),Py=RegExp(`(?: ${f0.source})?`);function No(n,e,t){const i=n[e];return pt(i)?t:Fi(i)}function Fy(n,e){return[{year:No(n,e),month:No(n,e+1,1),day:No(n,e+2,1)},null,e+3]}function Qo(n,e){return[{hours:No(n,e,0),minutes:No(n,e+1,0),seconds:No(n,e+2,0),milliseconds:Ef(n[e+3])},null,e+4]}function Gr(n,e){const t=!n[e]&&!n[e+1],i=Ms(n[e+1],n[e+2]),o=t?null:dn.instance(i);return[{},o,e+3]}function Kr(n,e){const t=n[e]?Si.create(n[e]):null;return[{},t,e+1]}const Ly=RegExp(`^T?${If.source}$`),Iy=/^-?P(?:(?:(-?\d{1,9}(?:\.\d{1,9})?)Y)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,9}(?:\.\d{1,9})?)W)?(?:(-?\d{1,9}(?:\.\d{1,9})?)D)?(?:T(?:(-?\d{1,9}(?:\.\d{1,9})?)H)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;function Ry(n){const[e,t,i,o,r,l,s,a,f]=n,c=e[0]==="-",u=a&&a[0]==="-",d=(h,b=!1)=>h!==void 0&&(b||h&&c)?-h:h;return[{years:d(Zi(t)),months:d(Zi(i)),weeks:d(Zi(o)),days:d(Zi(r)),hours:d(Zi(l)),minutes:d(Zi(s)),seconds:d(Zi(a),a==="-0"),milliseconds:d(Ef(f),u)}]}const Ny={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 Nf(n,e,t,i,o,r,l){const s={year:e.length===2?Va(Fi(e)):Fi(e),month:Qg.indexOf(t)+1,day:Fi(i),hour:Fi(o),minute:Fi(r)};return l&&(s.second=Fi(l)),n&&(s.weekday=n.length>3?t0.indexOf(n)+1:n0.indexOf(n)+1),s}const jy=/^(?:(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 zy(n){const[,e,t,i,o,r,l,s,a,f,c,u]=n,d=Nf(e,o,i,t,r,l,s);let h;return a?h=Ny[a]:f?h=0:h=Ms(c,u),[d,new dn(h)]}function Hy(n){return n.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const qy=/^(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$/,Vy=/^(Monday|Tuesday|Wedsday|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$/,By=/^(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 uu(n){const[,e,t,i,o,r,l,s]=n;return[Nf(e,o,i,t,r,l,s),dn.utcInstance]}function Uy(n){const[,e,t,i,o,r,l,s]=n;return[Nf(e,s,t,i,o,r,l),dn.utcInstance]}const Wy=Jo($y,Rf),Yy=Jo(Ay,Rf),Gy=Jo(Dy,Rf),Ky=Jo(a0),c0=Zo(Fy,Qo,Gr,Kr),Jy=Zo(Oy,Qo,Gr,Kr),Zy=Zo(Ty,Qo,Gr,Kr),Xy=Zo(Qo,Gr,Kr);function Qy(n){return Xo(n,[Wy,c0],[Yy,Jy],[Gy,Zy],[Ky,Xy])}function e2(n){return Xo(Hy(n),[jy,zy])}function t2(n){return Xo(n,[qy,uu],[Vy,uu],[By,Uy])}function n2(n){return Xo(n,[Iy,Ry])}const i2=Zo(Qo);function o2(n){return Xo(n,[Ly,i2])}const r2=Jo(Ey,Py),l2=Jo(f0),s2=Zo(Qo,Gr,Kr);function a2(n){return Xo(n,[r2,c0],[l2,s2])}const f2="Invalid Duration",u0={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}},c2={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},...u0},Ln=146097/400,Do=146097/4800,u2={years:{quarters:4,months:12,weeks:Ln/7,days:Ln,hours:Ln*24,minutes:Ln*24*60,seconds:Ln*24*60*60,milliseconds:Ln*24*60*60*1e3},quarters:{months:3,weeks:Ln/28,days:Ln/4,hours:Ln*24/4,minutes:Ln*24*60/4,seconds:Ln*24*60*60/4,milliseconds:Ln*24*60*60*1e3/4},months:{weeks:Do/7,days:Do,hours:Do*24,minutes:Do*24*60,seconds:Do*24*60*60,milliseconds:Do*24*60*60*1e3},...u0},io=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],d2=io.slice(0).reverse();function Xi(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 _t(i)}function p2(n){return n<0?Math.floor(n):Math.ceil(n)}function d0(n,e,t,i,o){const r=n[o][t],l=e[t]/r,s=Math.sign(l)===Math.sign(i[o]),a=!s&&i[o]!==0&&Math.abs(l)<=1?p2(l):Math.trunc(l);i[o]+=a,e[t]-=a*r}function h2(n,e){d2.reduce((t,i)=>pt(e[i])?t:(t&&d0(n,e,t,e,i),i),null)}class _t{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||Lt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?u2:c2,this.isLuxonDuration=!0}static fromMillis(e,t){return _t.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new jn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new _t({values:is(e,_t.normalizeUnit),loc:Lt.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(uo(e))return _t.fromMillis(e);if(_t.isDuration(e))return e;if(typeof e=="object")return _t.fromObject(e);throw new jn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=n2(e);return i?_t.fromObject(i,t):_t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=o2(e);return i?_t.fromObject(i,t):_t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new jn("need to specify a reason the Duration is invalid");const i=e instanceof Zn?e:new Zn(e,t);if(Yt.throwOnInvalid)throw new Vv(i);return new _t({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 Dg(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?vn.create(this.loc,i).formatDurationFromString(this,e):f2}toHuman(e={}){const t=io.map(i=>{const o=this.values[i];return pt(o)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(o)}).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+=Pf(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 o=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(o+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(o+=".SSS"));let r=i.toFormat(o);return e.includePrefix&&(r="T"+r),r}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=_t.fromDurationLike(e),i={};for(const o of io)(Uo(t.values,o)||Uo(this.values,o))&&(i[o]=t.get(o)+this.get(o));return Xi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=_t.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]=Zg(e(this.values[i],i));return Xi(this,{values:t},!0)}get(e){return this[_t.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...is(e,_t.normalizeUnit)};return Xi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i}={}){const o=this.loc.clone({locale:e,numberingSystem:t}),r={loc:o};return i&&(r.conversionAccuracy=i),Xi(this,r)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return h2(this.matrix,e),Xi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(l=>_t.normalizeUnit(l));const t={},i={},o=this.toObject();let r;for(const l of io)if(e.indexOf(l)>=0){r=l;let s=0;for(const f in i)s+=this.matrix[f][l]*i[f],i[f]=0;uo(o[l])&&(s+=o[l]);const a=Math.trunc(s);t[l]=a,i[l]=(s*1e3-a*1e3)/1e3;for(const f in o)io.indexOf(f)>io.indexOf(l)&&d0(this.matrix,o,f,t,l)}else uo(o[l])&&(i[l]=o[l]);for(const l in i)i[l]!==0&&(t[r]+=l===r?i[l]:i[l]/this.matrix[r][l]);return Xi(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 Xi(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,o){return i===void 0||i===0?o===void 0||o===0:i===o}for(const i of io)if(!t(this.values[i],e.values[i]))return!1;return!0}}const rr="Invalid Interval";function m2(n,e){return!n||!n.isValid?It.invalid("missing or invalid start"):!e||!e.isValid?It.invalid("missing or invalid end"):e<n?It.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 It{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 jn("need to specify a reason the Interval is invalid");const i=e instanceof Zn?e:new Zn(e,t);if(Yt.throwOnInvalid)throw new qv(i);return new It({invalid:i})}static fromDateTimes(e,t){const i=ar(e),o=ar(t),r=m2(i,o);return r==null?new It({start:i,end:o}):r}static after(e,t){const i=_t.fromDurationLike(t),o=ar(e);return It.fromDateTimes(o,o.plus(i))}static before(e,t){const i=_t.fromDurationLike(t),o=ar(e);return It.fromDateTimes(o.minus(i),o)}static fromISO(e,t){const[i,o]=(e||"").split("/",2);if(i&&o){let r,l;try{r=Qe.fromISO(i,t),l=r.isValid}catch{l=!1}let s,a;try{s=Qe.fromISO(o,t),a=s.isValid}catch{a=!1}if(l&&a)return It.fromDateTimes(r,s);if(l){const f=_t.fromISO(o,t);if(f.isValid)return It.after(r,f)}else if(a){const f=_t.fromISO(i,t);if(f.isValid)return It.before(s,f)}}return It.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?It.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(ar).filter(l=>this.contains(l)).sort(),i=[];let{s:o}=this,r=0;for(;o<this.e;){const l=t[r]||this.e,s=+l>+this.e?this.e:l;i.push(It.fromDateTimes(o,s)),o=s,r+=1}return i}splitBy(e){const t=_t.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,o=1,r;const l=[];for(;i<this.e;){const s=this.start.plus(t.mapUnits(a=>a*o));r=+s>+this.e?this.e:s,l.push(It.fromDateTimes(i,r)),i=r,o+=1}return l}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:It.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 It.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((o,r)=>o.s-r.s).reduce(([o,r],l)=>r?r.overlaps(l)||r.abutsStart(l)?[o,r.union(l)]:[o.concat([r]),l]:[o,l],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const o=[],r=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),l=Array.prototype.concat(...r),s=l.sort((a,f)=>a.time-f.time);for(const a of s)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&o.push(It.fromDateTimes(t,a.time)),t=null);return It.merge(o)}difference(...e){return It.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()})`:rr}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:rr}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:rr}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:rr}toFormat(e,{separator:t=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:rr}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):_t.invalid(this.invalidReason)}mapEndpoints(e){return It.fromDateTimes(e(this.s),e(this.e))}}class _l{static hasDST(e=Yt.defaultZone){const t=Qe.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Si.isValidZone(e)}static normalizeZone(e){return Li(e,Yt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:o=null,outputCalendar:r="gregory"}={}){return(o||Lt.create(t,i,r)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:o=null,outputCalendar:r="gregory"}={}){return(o||Lt.create(t,i,r)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:o=null}={}){return(o||Lt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:o=null}={}){return(o||Lt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Lt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Lt.create(t,null,"gregory").eras(e)}static features(){return{relative:Kg()}}}function du(n,e){const t=o=>o.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(_t.fromMillis(i).as("days"))}function b2(n,e,t){const i=[["years",(s,a)=>a.year-s.year],["quarters",(s,a)=>a.quarter-s.quarter],["months",(s,a)=>a.month-s.month+(a.year-s.year)*12],["weeks",(s,a)=>{const f=du(s,a);return(f-f%7)/7}],["days",du]],o={};let r,l;for(const[s,a]of i)if(t.indexOf(s)>=0){r=s;let f=a(n,e);l=n.plus({[s]:f}),l>e?(n=n.plus({[s]:f-1}),f-=1):n=l,o[s]=f}return[n,o,l,r]}function g2(n,e,t,i){let[o,r,l,s]=b2(n,e,t);const a=e-o,f=t.filter(u=>["hours","minutes","seconds","milliseconds"].indexOf(u)>=0);f.length===0&&(l<e&&(l=o.plus({[s]:1})),l!==o&&(r[s]=(r[s]||0)+a/(l-o)));const c=_t.fromObject(r,i);return f.length>0?_t.fromMillis(a,i).shiftTo(...f).plus(c):c}const jf={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"},pu={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]},_2=jf.hanidec.replace(/[\[|\]]/g,"").split("");function v2(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(jf.hanidec)!==-1)e+=_2.indexOf(n[t]);else for(const o in pu){const[r,l]=pu[o];i>=r&&i<=l&&(e+=i-r)}}return parseInt(e,10)}else return e}function Kn({numberingSystem:n},e=""){return new RegExp(`${jf[n||"latn"]}${e}`)}const y2="missing Intl.DateTimeFormat.formatToParts support";function kt(n,e=t=>t){return{regex:n,deser:([t])=>e(v2(t))}}const k2=String.fromCharCode(160),p0=`[ ${k2}]`,h0=new RegExp(p0,"g");function w2(n){return n.replace(/\./g,"\\.?").replace(h0,p0)}function hu(n){return n.replace(/\./g,"").replace(h0," ").toLowerCase()}function Jn(n,e){return n===null?null:{regex:RegExp(n.map(w2).join("|")),deser:([t])=>n.findIndex(i=>hu(t)===hu(i))+e}}function mu(n,e){return{regex:n,deser:([,t,i])=>Ms(t,i),groups:e}}function ia(n){return{regex:n,deser:([e])=>e}}function S2(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function C2(n,e){const t=Kn(e),i=Kn(e,"{2}"),o=Kn(e,"{3}"),r=Kn(e,"{4}"),l=Kn(e,"{6}"),s=Kn(e,"{1,2}"),a=Kn(e,"{1,3}"),f=Kn(e,"{1,6}"),c=Kn(e,"{1,9}"),u=Kn(e,"{2,4}"),d=Kn(e,"{4,6}"),h=_=>({regex:RegExp(S2(_.val)),deser:([y])=>y,literal:!0}),v=(_=>{if(n.literal)return h(_);switch(_.val){case"G":return Jn(e.eras("short",!1),0);case"GG":return Jn(e.eras("long",!1),0);case"y":return kt(f);case"yy":return kt(u,Va);case"yyyy":return kt(r);case"yyyyy":return kt(d);case"yyyyyy":return kt(l);case"M":return kt(s);case"MM":return kt(i);case"MMM":return Jn(e.months("short",!0,!1),1);case"MMMM":return Jn(e.months("long",!0,!1),1);case"L":return kt(s);case"LL":return kt(i);case"LLL":return Jn(e.months("short",!1,!1),1);case"LLLL":return Jn(e.months("long",!1,!1),1);case"d":return kt(s);case"dd":return kt(i);case"o":return kt(a);case"ooo":return kt(o);case"HH":return kt(i);case"H":return kt(s);case"hh":return kt(i);case"h":return kt(s);case"mm":return kt(i);case"m":return kt(s);case"q":return kt(s);case"qq":return kt(i);case"s":return kt(s);case"ss":return kt(i);case"S":return kt(a);case"SSS":return kt(o);case"u":return ia(c);case"uu":return ia(s);case"uuu":return kt(t);case"a":return Jn(e.meridiems(),0);case"kkkk":return kt(r);case"kk":return kt(u,Va);case"W":return kt(s);case"WW":return kt(i);case"E":case"c":return kt(t);case"EEE":return Jn(e.weekdays("short",!1,!1),1);case"EEEE":return Jn(e.weekdays("long",!1,!1),1);case"ccc":return Jn(e.weekdays("short",!0,!1),1);case"cccc":return Jn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return mu(new RegExp(`([+-]${s.source})(?::(${i.source}))?`),2);case"ZZZ":return mu(new RegExp(`([+-]${s.source})(${i.source})?`),2);case"z":return ia(/[a-z_+-/]{1,256}?/i);default:return h(_)}})(n)||{invalidReason:y2};return v.token=n,v}const x2={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 M2(n,e,t){const{type:i,value:o}=n;if(i==="literal")return{literal:!0,val:o};const r=t[i];let l=x2[i];if(typeof l=="object"&&(l=l[r]),l)return{literal:!1,val:l}}function $2(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function A2(n,e,t){const i=n.match(e);if(i){const o={};let r=1;for(const l in t)if(Uo(t,l)){const s=t[l],a=s.groups?s.groups+1:1;!s.literal&&s.token&&(o[s.token.val[0]]=s.deser(i.slice(r,r+a))),r+=a}return[i,o]}else return[i,{}]}function D2(n){const e=r=>{switch(r){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 pt(n.z)||(t=Si.create(n.z)),pt(n.Z)||(t||(t=new dn(n.Z)),i=n.Z),pt(n.q)||(n.M=(n.q-1)*3+1),pt(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),pt(n.u)||(n.S=Ef(n.u)),[Object.keys(n).reduce((r,l)=>{const s=e(l);return s&&(r[s]=n[l]),r},{}),t,i]}let oa=null;function O2(){return oa||(oa=Qe.fromMillis(1555555555555)),oa}function T2(n,e){if(n.literal)return n;const t=vn.macroTokenToFormatOpts(n.val);if(!t)return n;const r=vn.create(e,t).formatDateTimeParts(O2()).map(l=>M2(l,e,t));return r.includes(void 0)?n:r}function E2(n,e){return Array.prototype.concat(...n.map(t=>T2(t,e)))}function m0(n,e,t){const i=E2(vn.parseFormat(t),n),o=i.map(l=>C2(l,n)),r=o.find(l=>l.invalidReason);if(r)return{input:e,tokens:i,invalidReason:r.invalidReason};{const[l,s]=$2(o),a=RegExp(l,"i"),[f,c]=A2(e,a,s),[u,d,h]=c?D2(c):[null,null,void 0];if(Uo(c,"a")&&Uo(c,"H"))throw new _r("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:f,matches:c,result:u,zone:d,specificOffset:h}}}function P2(n,e,t){const{result:i,zone:o,specificOffset:r,invalidReason:l}=m0(n,e,t);return[i,o,r,l]}const b0=[0,31,59,90,120,151,181,212,243,273,304,334],g0=[0,31,60,91,121,152,182,213,244,274,305,335];function Hn(n,e){return new Zn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function _0(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const o=i.getUTCDay();return o===0?7:o}function v0(n,e,t){return t+(Wr(n)?g0:b0)[e-1]}function y0(n,e){const t=Wr(n)?g0:b0,i=t.findIndex(r=>r<e),o=e-t[i];return{month:i+1,day:o}}function Ga(n){const{year:e,month:t,day:i}=n,o=v0(e,t,i),r=_0(e,t,i);let l=Math.floor((o-r+10)/7),s;return l<1?(s=e-1,l=ns(s)):l>ns(e)?(s=e+1,l=1):s=e,{weekYear:s,weekNumber:l,weekday:r,...$s(n)}}function bu(n){const{weekYear:e,weekNumber:t,weekday:i}=n,o=_0(e,1,4),r=Cr(e);let l=t*7+i-o-3,s;l<1?(s=e-1,l+=Cr(s)):l>r?(s=e+1,l-=Cr(e)):s=e;const{month:a,day:f}=y0(s,l);return{year:s,month:a,day:f,...$s(n)}}function ra(n){const{year:e,month:t,day:i}=n,o=v0(e,t,i);return{year:e,ordinal:o,...$s(n)}}function gu(n){const{year:e,ordinal:t}=n,{month:i,day:o}=y0(e,t);return{year:e,month:i,day:o,...$s(n)}}function F2(n){const e=xs(n.weekYear),t=ki(n.weekNumber,1,ns(n.weekYear)),i=ki(n.weekday,1,7);return e?t?i?!1:Hn("weekday",n.weekday):Hn("week",n.week):Hn("weekYear",n.weekYear)}function L2(n){const e=xs(n.year),t=ki(n.ordinal,1,Cr(n.year));return e?t?!1:Hn("ordinal",n.ordinal):Hn("year",n.year)}function k0(n){const e=xs(n.year),t=ki(n.month,1,12),i=ki(n.day,1,ts(n.year,n.month));return e?t?i?!1:Hn("day",n.day):Hn("month",n.month):Hn("year",n.year)}function w0(n){const{hour:e,minute:t,second:i,millisecond:o}=n,r=ki(e,0,23)||e===24&&t===0&&i===0&&o===0,l=ki(t,0,59),s=ki(i,0,59),a=ki(o,0,999);return r?l?s?a?!1:Hn("millisecond",o):Hn("second",i):Hn("minute",t):Hn("hour",e)}const la="Invalid DateTime",_u=864e13;function vl(n){return new Zn("unsupported zone",`the zone "${n.name}" is not supported`)}function sa(n){return n.weekData===null&&(n.weekData=Ga(n.c)),n.weekData}function lr(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 S0(n,e,t){let i=n-e*60*1e3;const o=t.offset(i);if(e===o)return[i,e];i-=(o-e)*60*1e3;const r=t.offset(i);return o===r?[i,o]:[n-Math.min(o,r)*60*1e3,Math.max(o,r)]}function vu(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 Yl(n,e,t){return S0(Ff(n),e,t)}function yu(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),o=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,r={...n.c,year:i,month:o,day:Math.min(n.c.day,ts(i,o))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},l=_t.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"),s=Ff(r);let[a,f]=S0(s,t,n.zone);return l!==0&&(a+=l,f=n.zone.offset(a)),{ts:a,o:f}}function sr(n,e,t,i,o,r){const{setZone:l,zone:s}=t;if(n&&Object.keys(n).length!==0){const a=e||s,f=Qe.fromObject(n,{...t,zone:a,specificOffset:r});return l?f:f.setZone(s)}else return Qe.invalid(new Zn("unparsable",`the input "${o}" can't be parsed as ${i}`))}function yl(n,e,t=!0){return n.isValid?vn.create(Lt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function aa(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Bt(n.c.year,t?6:4),e?(i+="-",i+=Bt(n.c.month),i+="-",i+=Bt(n.c.day)):(i+=Bt(n.c.month),i+=Bt(n.c.day)),i}function ku(n,e,t,i,o,r){let l=Bt(n.c.hour);return e?(l+=":",l+=Bt(n.c.minute),(n.c.second!==0||!t)&&(l+=":")):l+=Bt(n.c.minute),(n.c.second!==0||!t)&&(l+=Bt(n.c.second),(n.c.millisecond!==0||!i)&&(l+=".",l+=Bt(n.c.millisecond,3))),o&&(n.isOffsetFixed&&n.offset===0&&!r?l+="Z":n.o<0?(l+="-",l+=Bt(Math.trunc(-n.o/60)),l+=":",l+=Bt(Math.trunc(-n.o%60))):(l+="+",l+=Bt(Math.trunc(n.o/60)),l+=":",l+=Bt(Math.trunc(n.o%60)))),r&&(l+="["+n.zone.ianaName+"]"),l}const C0={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},I2={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},R2={ordinal:1,hour:0,minute:0,second:0,millisecond:0},x0=["year","month","day","hour","minute","second","millisecond"],N2=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],j2=["year","ordinal","hour","minute","second","millisecond"];function wu(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 Dg(n);return e}function Su(n,e){const t=Li(e.zone,Yt.defaultZone),i=Lt.fromObject(e),o=Yt.now();let r,l;if(pt(n.year))r=o;else{for(const f of x0)pt(n[f])&&(n[f]=C0[f]);const s=k0(n)||w0(n);if(s)return Qe.invalid(s);const a=t.offset(o);[r,l]=Yl(n,a,t)}return new Qe({ts:r,zone:t,loc:i,o:l})}function Cu(n,e,t){const i=pt(t.round)?!0:t.round,o=(l,s)=>(l=Pf(l,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(l,s)),r=l=>t.calendary?e.hasSame(n,l)?0:e.startOf(l).diff(n.startOf(l),l).get(l):e.diff(n,l).get(l);if(t.unit)return o(r(t.unit),t.unit);for(const l of t.units){const s=r(l);if(Math.abs(s)>=1)return o(s,l)}return o(n>e?-0:0,t.units[t.units.length-1])}function xu(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||Yt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Zn("invalid input"):null)||(t.isValid?null:vl(t));this.ts=pt(e.ts)?Yt.now():e.ts;let o=null,r=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[o,r]=[e.old.c,e.old.o];else{const s=t.offset(this.ts);o=vu(this.ts,s),i=Number.isNaN(o.year)?new Zn("invalid input"):null,o=i?null:o,r=i?null:s}this._zone=t,this.loc=e.loc||Lt.create(),this.invalid=i,this.weekData=null,this.c=o,this.o=r,this.isLuxonDateTime=!0}static now(){return new Qe({})}static local(){const[e,t]=xu(arguments),[i,o,r,l,s,a,f]=t;return Su({year:i,month:o,day:r,hour:l,minute:s,second:a,millisecond:f},e)}static utc(){const[e,t]=xu(arguments),[i,o,r,l,s,a,f]=t;return e.zone=dn.utcInstance,Su({year:i,month:o,day:r,hour:l,minute:s,second:a,millisecond:f},e)}static fromJSDate(e,t={}){const i=Yv(e)?e.valueOf():NaN;if(Number.isNaN(i))return Qe.invalid("invalid input");const o=Li(t.zone,Yt.defaultZone);return o.isValid?new Qe({ts:i,zone:o,loc:Lt.fromObject(t)}):Qe.invalid(vl(o))}static fromMillis(e,t={}){if(uo(e))return e<-_u||e>_u?Qe.invalid("Timestamp out of range"):new Qe({ts:e,zone:Li(t.zone,Yt.defaultZone),loc:Lt.fromObject(t)});throw new jn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(uo(e))return new Qe({ts:e*1e3,zone:Li(t.zone,Yt.defaultZone),loc:Lt.fromObject(t)});throw new jn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Li(t.zone,Yt.defaultZone);if(!i.isValid)return Qe.invalid(vl(i));const o=Yt.now(),r=pt(t.specificOffset)?i.offset(o):t.specificOffset,l=is(e,wu),s=!pt(l.ordinal),a=!pt(l.year),f=!pt(l.month)||!pt(l.day),c=a||f,u=l.weekYear||l.weekNumber,d=Lt.fromObject(t);if((c||s)&&u)throw new _r("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(f&&s)throw new _r("Can't mix ordinal dates with month/day");const h=u||l.weekday&&!c;let b,v,_=vu(o,r);h?(b=N2,v=I2,_=Ga(_)):s?(b=j2,v=R2,_=ra(_)):(b=x0,v=C0);let y=!1;for(const D of b){const E=l[D];pt(E)?y?l[D]=v[D]:l[D]=_[D]:y=!0}const S=h?F2(l):s?L2(l):k0(l),C=S||w0(l);if(C)return Qe.invalid(C);const x=h?bu(l):s?gu(l):l,[M,A]=Yl(x,r,i),O=new Qe({ts:M,zone:i,o:A,loc:d});return l.weekday&&c&&e.weekday!==O.weekday?Qe.invalid("mismatched weekday",`you can't specify both a weekday of ${l.weekday} and a date of ${O.toISO()}`):O}static fromISO(e,t={}){const[i,o]=Qy(e);return sr(i,o,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,o]=e2(e);return sr(i,o,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,o]=t2(e);return sr(i,o,t,"HTTP",t)}static fromFormat(e,t,i={}){if(pt(e)||pt(t))throw new jn("fromFormat requires an input string and a format");const{locale:o=null,numberingSystem:r=null}=i,l=Lt.fromOpts({locale:o,numberingSystem:r,defaultToEN:!0}),[s,a,f,c]=P2(l,e,t);return c?Qe.invalid(c):sr(s,a,i,`format ${t}`,e,f)}static fromString(e,t,i={}){return Qe.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,o]=a2(e);return sr(i,o,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new jn("need to specify a reason the DateTime is invalid");const i=e instanceof Zn?e:new Zn(e,t);if(Yt.throwOnInvalid)throw new Hv(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?sa(this).weekYear:NaN}get weekNumber(){return this.isValid?sa(this).weekNumber:NaN}get weekday(){return this.isValid?sa(this).weekday:NaN}get ordinal(){return this.isValid?ra(this.c).ordinal:NaN}get monthShort(){return this.isValid?_l.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?_l.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?_l.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?_l.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 Wr(this.year)}get daysInMonth(){return ts(this.year,this.month)}get daysInYear(){return this.isValid?Cr(this.year):NaN}get weeksInWeekYear(){return this.isValid?ns(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:o}=vn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:o}}toUTC(e=0,t={}){return this.setZone(dn.instance(e),t)}toLocal(){return this.setZone(Yt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Li(e,Yt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let o=this.ts;if(t||i){const r=e.offset(this.ts),l=this.toObject();[o]=Yl(l,r,e)}return lr(this,{ts:o,zone:e})}else return Qe.invalid(vl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const o=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return lr(this,{loc:o})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=is(e,wu),i=!pt(t.weekYear)||!pt(t.weekNumber)||!pt(t.weekday),o=!pt(t.ordinal),r=!pt(t.year),l=!pt(t.month)||!pt(t.day),s=r||l,a=t.weekYear||t.weekNumber;if((s||o)&&a)throw new _r("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new _r("Can't mix ordinal dates with month/day");let f;i?f=bu({...Ga(this.c),...t}):pt(t.ordinal)?(f={...this.toObject(),...t},pt(t.day)&&(f.day=Math.min(ts(f.year,f.month),f.day))):f=gu({...ra(this.c),...t});const[c,u]=Yl(f,this.o,this.zone);return lr(this,{ts:c,o:u})}plus(e){if(!this.isValid)return this;const t=_t.fromDurationLike(e);return lr(this,yu(this,t))}minus(e){if(!this.isValid)return this;const t=_t.fromDurationLike(e).negate();return lr(this,yu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=_t.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 o=Math.ceil(this.month/3);t.month=(o-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?vn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):la}toLocaleString(e=qa,t={}){return this.isValid?vn.create(this.loc.clone(t),e).formatDateTime(this):la}toLocaleParts(e={}){return this.isValid?vn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:o=!0,extendedZone:r=!1}={}){if(!this.isValid)return null;const l=e==="extended";let s=aa(this,l);return s+="T",s+=ku(this,l,t,i,o,r),s}toISODate({format:e="extended"}={}){return this.isValid?aa(this,e==="extended"):null}toISOWeekDate(){return yl(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:o=!1,extendedZone:r=!1,format:l="extended"}={}){return this.isValid?(o?"T":"")+ku(this,l==="extended",t,e,i,r):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?aa(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let o="HH:mm:ss.SSS";return(t||e)&&(i&&(o+=" "),t?o+="z":e&&(o+="ZZ")),yl(this,o,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():la}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 _t.invalid("created by diffing an invalid DateTime");const o={locale:this.locale,numberingSystem:this.numberingSystem,...i},r=Gv(t).map(_t.normalizeUnit),l=e.valueOf()>this.valueOf(),s=l?this:e,a=l?e:this,f=g2(s,a,r,o);return l?f.negate():f}diffNow(e="milliseconds",t={}){return this.diff(Qe.now(),e,t)}until(e){return this.isValid?It.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const i=e.valueOf(),o=this.setZone(e.zone,{keepLocalTime:!0});return o.startOf(t)<=i&&i<=o.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 o=["years","months","days","hours","minutes","seconds"],r=e.unit;return Array.isArray(e.unit)&&(o=e.unit,r=void 0),Cu(t,this.plus(i),{...e,numeric:"always",units:o,unit:r})}toRelativeCalendar(e={}){return this.isValid?Cu(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 jn("min requires all arguments be DateTimes");return nu(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(Qe.isDateTime))throw new jn("max requires all arguments be DateTimes");return nu(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:o=null,numberingSystem:r=null}=i,l=Lt.fromOpts({locale:o,numberingSystem:r,defaultToEN:!0});return m0(l,e,t)}static fromStringExplain(e,t,i={}){return Qe.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return qa}static get DATE_MED(){return Og}static get DATE_MED_WITH_WEEKDAY(){return Bv}static get DATE_FULL(){return Tg}static get DATE_HUGE(){return Eg}static get TIME_SIMPLE(){return Pg}static get TIME_WITH_SECONDS(){return Fg}static get TIME_WITH_SHORT_OFFSET(){return Lg}static get TIME_WITH_LONG_OFFSET(){return Ig}static get TIME_24_SIMPLE(){return Rg}static get TIME_24_WITH_SECONDS(){return Ng}static get TIME_24_WITH_SHORT_OFFSET(){return jg}static get TIME_24_WITH_LONG_OFFSET(){return zg}static get DATETIME_SHORT(){return Hg}static get DATETIME_SHORT_WITH_SECONDS(){return qg}static get DATETIME_MED(){return Vg}static get DATETIME_MED_WITH_SECONDS(){return Bg}static get DATETIME_MED_WITH_WEEKDAY(){return Uv}static get DATETIME_FULL(){return Ug}static get DATETIME_FULL_WITH_SECONDS(){return Wg}static get DATETIME_HUGE(){return Yg}static get DATETIME_HUGE_WITH_SECONDS(){return Gg}}function ar(n){if(Qe.isDateTime(n))return n;if(n&&n.valueOf&&uo(n.valueOf()))return Qe.fromJSDate(n);if(n&&typeof n=="object")return Qe.fromObject(n);throw new jn(`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=="undefined"||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 isObjectArrayWithKeys(e,t){if(!Array.isArray(e)||typeof e[0]!="object")return!1;if(e.length==0)return!0;let i=B.toArray(t);for(let o of i)if(!(o in e[0]))return!1;return!0}static toArray(e,t=!1){return Array.isArray(e)?e:(t||e!==null)&&typeof e!="undefined"?[e]:[]}static inArray(e,t){for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){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){for(let o in e)if(e[o][t]==i)return e[o];return null}static groupByKey(e,t){let i={};for(let o in e)i[e[o][t]]=i[e[o][t]]||[],i[e[o][t]].push(e[o]);return i}static removeByKey(e,t,i){for(let o in e)if(e[o][t]==i){e.splice(o,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let o=e.length-1;o>=0;o--)if(e[o][i]==t[i]){e[o]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){const i={};for(const o of e)i[o[t]]=o;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let o in i)typeof i[o]=="object"&&i[o]!==null?i[o]=B.filterRedactedProps(i[o],t):i[o]===t&&delete i[o];return i}static getNestedVal(e,t,i=null,o="."){let r=e||{},l=t.split(o);for(const s of l){if(!B.isObject(r)&&!Array.isArray(r)||typeof r[s]=="undefined")return i;r=r[s]}return r}static setByPath(e,t,i,o="."){if(!B.isObject(e)&&!Array.isArray(e)){console.warn("setByPath: data not an object or array.");return}let r=e,l=t.split(o),s=l.pop();for(const a of l)(!B.isObject(r)&&!Array.isArray(r)||!B.isObject(r[a])&&!Array.isArray(r[a]))&&(r[a]={}),r=r[a];r[s]=i}static deleteByPath(e,t,i="."){let o=e||{},r=t.split(i),l=r.pop();for(const s of r)(!B.isObject(o)&&!Array.isArray(o)||!B.isObject(o[s])&&!Array.isArray(o[s]))&&(o[s]={}),o=o[s];Array.isArray(o)?o.splice(l,1):B.isObject(o)&&delete o[l],r.length>0&&(Array.isArray(o)&&!o.length||B.isObject(o)&&!Object.keys(o).length)&&(Array.isArray(e)&&e.length>0||B.isObject(e)&&Object.keys(e).length>0)&&B.deleteByPath(e,r.join(i),i)}static randomString(e){e=e||10;let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let o=0;o<e;o++)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 o={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 l in o)e=e.replace(o[l],l);const r=e.replace(new RegExp("["+i.join("")+"]","g")," ").replace(/[^\w\ ]/gi,"").replace(/\s+/g,t);return r.charAt(0).toLowerCase()+r.slice(1)}static escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}static splitNonEmpty(e,t=","){const i=(e||"").split(t),o=[];for(let r of i)r=r.trim(),B.isEmpty(r)||o.push(r);return o}static joinNonEmpty(e,t=", "){const i=[];for(let o of e)o=typeof o=="string"?o.trim():"",B.isEmpty(o)||i.push(o);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",o=e.length===i.length?i:t;return Qe.fromFormat(e,o,{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 openInWindow(e,t,i,o){t=t||1024,i=i||768,o=o||"popup";let r=window.innerWidth,l=window.innerHeight;t=t>r?r:t,i=i>l?l:i;let s=r/2-t/2,a=l/2-i/2;return window.open(e,o,"width="+t+",height="+i+",top="+a+",left="+s+",resizable,menubar=no")}static getQueryString(e){let t=e.indexOf("?");if(t<0)return"";let i=e.indexOf("#");return e.substring(t+1,i>t?i:e.length)}static getQueryParams(e){let t={},i=B.getQueryString(e).split("&");for(let o in i){let r=i[o].split("=");if(r.length===2){let l=decodeURIComponent(r[1]);if(l.startsWith("{")||l.startsWith("["))try{l=JSON.parse(l)}catch{}t[decodeURIComponent(r[0])]=l}}return t}static setQueryParams(e,t,i=!0){let o=B.getQueryString(e),r=i&&o?B.getQueryParams(e):{},l=Object.assign(r,t),s="";for(let a in l)B.isEmpty(l[a])||(s&&(s+="&"),s+=encodeURIComponent(a)+"=",B.isObject(l[a])?s+=encodeURIComponent(JSON.stringify(l[a])):s+=encodeURIComponent(l[a]));return s=s?"?"+s:"",B.isEmpty(o)?e+s:e.replace("?"+o,s)}static replaceClientQueryParams(e){let t=B.setQueryParams(window.location.href,e);window.location.replace(t)}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|\.webp|\.avif$/.test(e)}static checkImageUrl(e){return new Promise((t,i)=>{const o=new Image;o.onload=function(){return t(!0)},o.onerror=function(r){return i(r)},o.src=e})}static generateThumb(e,t=100,i=100){return new Promise(o=>{let r=new FileReader;r.onload=function(l){let s=new Image;s.onload=function(){let a=document.createElement("canvas"),f=a.getContext("2d"),c=s.width,u=s.height;return a.width=t,a.height=i,f.drawImage(s,c>u?(c-u)/2:0,0,c>u?u:c,c>u?u:c,0,0,t,i),o(a.toDataURL(e.type))},s.src=l.target.result},r.readAsDataURL(e)})}static setDocumentTitle(e,t="PocketBase"){let i=[];B.isEmpty(e)||i.push(e.trim()),B.isEmpty(t)||i.push(t.trim()),document.title=i.join(" - ")}static addValueToFormData(e,t,i){if(typeof i!="undefined")if(B.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const o of i)B.addValueToFormData(e,t,o);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 o,r,l,s,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 f of t){let c=null;f.type==="number"?c=123:f.type==="date"?c="2022-01-01 10:00:00":f.type==="bool"?c=!0:f.type==="email"?c="test@example.com":f.type==="url"?c="https://example.com":f.type==="json"?c="JSON (array/object)":f.type==="file"?(c="filename.jpg",((o=f.options)==null?void 0:o.maxSelect)>1&&(c=[c])):f.type==="select"?(c=(l=(r=f.options)==null?void 0:r.values)==null?void 0:l[0],((s=f.options)==null?void 0:s.maxSelect)>1&&(c=[c])):f.type==="relation"||f.type==="user"?(c="RELATION_RECORD_ID",((a=f.options)==null?void 0:a.maxSelect)>1&&(c=[c])):c="test",i[f.name]=c}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"}}}const zf=Mi([]);function VO(n,e=4e3){return Hf(n,"info",e)}function hn(n,e=3e3){return Hf(n,"success",e)}function M0(n,e=4500){return Hf(n,"error",e)}function Hf(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{$0(i)},t)};zf.update(o=>(A0(o,i.message),B.pushOrReplaceByKey(o,i,"message"),o))}function $0(n){zf.update(e=>(A0(e,n),e))}function A0(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 go=Mi({});function Ui(n){go.set(n||{})}function D0(n){go.update(e=>(B.deleteByPath(e,n),e))}const qf=Mi({});function Ka(n){qf.set(n||{})}Tf.prototype.logout=function(n=!0){this.AuthStore.clear(),n&&Ss("/login")};Tf.prototype.errorResponseHandler=function(n,e=!0,t=""){var r,l;if(!n||!(n instanceof Error))return;const i=((r=n==null?void 0:n.response)==null?void 0:r.status)<<0||400,o=((l=n==null?void 0:n.response)==null?void 0:l.data)||{};if(e&&i!==404){let s=o.message||n.message||t;s&&M0(s)}if(B.isEmpty(o.data)||Ui(o.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Ss("/")};class z2 extends Mg{save(e,t){super.save(e,t),t instanceof Bo&&Ka(t)}clear(){super.clear(),Ka(null)}}const Se=new Tf("/","en-US",new z2("pb_admin_auth"));Se.AuthStore.model instanceof Bo&&Ka(Se.AuthStore.model);let Ja,Qi;const Za="app-tooltip";function Mu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function zi(){return Qi=Qi||document.querySelector("."+Za),Qi||(Qi=document.createElement("div"),Qi.classList.add(Za),document.body.appendChild(Qi)),Qi}function O0(n,e){let t=zi();if(!t.classList.contains("active")||!(e!=null&&e.text)){Xa();return}t.textContent=e.text,t.className=Za+" active",e.class&&t.classList.add(e.class),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,o=t.offsetWidth,r=n.getBoundingClientRect(),l=0,s=0,a=5;e.position=="left"?(l=r.top+r.height/2-i/2,s=r.left-o-a):e.position=="right"?(l=r.top+r.height/2-i/2,s=r.right+a):e.position=="top"?(l=r.top-i-a,s=r.left+r.width/2-o/2):e.position=="top-left"?(l=r.top-i-a,s=r.left):e.position=="top-right"?(l=r.top-i-a,s=r.right-o):e.position=="bottom-left"?(l=r.top+r.height+a,s=r.left):e.position=="bottom-right"?(l=r.top+r.height+a,s=r.right-o):(l=r.top+r.height+a,s=r.left+r.width/2-o/2),s+o>document.documentElement.clientWidth&&(s=document.documentElement.clientWidth-o),s=s>=0?s:0,l+i>document.documentElement.clientHeight&&(l=document.documentElement.clientHeight-i),l=l>=0?l:0,t.style.top=l+"px",t.style.left=s+"px"}function Xa(){clearTimeout(Ja),zi().classList.remove("active"),zi().activeNode=void 0}function H2(n,e){zi().activeNode=n,clearTimeout(Ja),Ja=setTimeout(()=>{zi().classList.add("active"),O0(n,e)},isNaN(e.delay)?250:e.delay)}function St(n,e){let t=Mu(e);function i(){H2(n,t)}function o(){Xa()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",o),n.addEventListener("blur",o),(t.hideOnClick===!0||t.hideOnClick===null&&B.isFocusable(n))&&n.addEventListener("click",o),zi(),{update(r){var l,s;t=Mu(r),(s=(l=zi())==null?void 0:l.activeNode)!=null&&s.contains(n)&&O0(n,t)},destroy(){var r,l;(l=(r=zi())==null?void 0:r.activeNode)!=null&&l.contains(n)&&Xa(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",o),n.removeEventListener("blur",o),n.removeEventListener("click",o)}}}function $u(n,e,t){const i=n.slice();return i[11]=e[t],i}const q2=n=>({}),Au=n=>({uniqueId:n[3]});function V2(n){let e=(n[11]||os)+"",t;return{c(){t=j(e)},m(i,o){w(i,t,o)},p(i,o){o&4&&e!==(e=(i[11]||os)+"")&&ge(t,e)},d(i){i&&k(t)}}}function B2(n){var i,o;let e=(((i=n[11])==null?void 0:i.message)||((o=n[11])==null?void 0:o.code)||os)+"",t;return{c(){t=j(e)},m(r,l){w(r,t,l)},p(r,l){var s,a;l&4&&e!==(e=(((s=r[11])==null?void 0:s.message)||((a=r[11])==null?void 0:a.code)||os)+"")&&ge(t,e)},d(r){r&&k(t)}}}function Du(n){let e,t;function i(l,s){return typeof l[11]=="object"?B2:V2}let o=i(n),r=o(n);return{c(){e=g("div"),r.c(),t=$(),p(e,"class","help-block help-block-error")},m(l,s){w(l,e,s),r.m(e,null),m(e,t)},p(l,s){o===(o=i(l))&&r?r.p(l,s):(r.d(1),r=o(l),r&&(r.c(),r.m(e,t)))},d(l){l&&k(e),r.d()}}}function U2(n){let e,t,i,o,r;const l=n[7].default,s=$n(l,n,n[6],Au);let a=n[2],f=[];for(let c=0;c<a.length;c+=1)f[c]=Du($u(n,a,c));return{c(){e=g("div"),s&&s.c(),t=$();for(let c=0;c<f.length;c+=1)f[c].c();p(e,"class",n[0]),ne(e,"error",n[2].length)},m(c,u){w(c,e,u),s&&s.m(e,null),m(e,t);for(let d=0;d<f.length;d+=1)f[d].m(e,null);n[9](e),i=!0,o||(r=X(e,"click",n[8]),o=!0)},p(c,[u]){if(s&&s.p&&(!i||u&64)&&Dn(s,l,c,c[6],i?An(l,c[6],u,q2):On(c[6]),Au),u&4){a=c[2];let d;for(d=0;d<a.length;d+=1){const h=$u(c,a,d);f[d]?f[d].p(h,u):(f[d]=Du(h),f[d].c(),f[d].m(e,null))}for(;d<f.length;d+=1)f[d].d(1);f.length=a.length}(!i||u&1)&&p(e,"class",c[0]),u&5&&ne(e,"error",c[2].length)},i(c){i||(T(s,c),i=!0)},o(c){F(s,c),i=!1},d(c){c&&k(e),s&&s.d(c),qn(f,c),n[9](null),o=!1,r()}}}const os="Invalid value";function W2(n,e,t){let i;pn(n,go,b=>t(5,i=b));let{$$slots:o={},$$scope:r}=e;const l="field_"+B.randomString(7);let{name:s=""}=e,{class:a=void 0}=e,f,c=[];function u(){D0(s)}di(()=>(f.addEventListener("change",u),()=>{f.removeEventListener("change",u)}));function d(b){ft.call(this,n,b)}function h(b){he[b?"unshift":"push"](()=>{f=b,t(1,f)})}return n.$$set=b=>{"name"in b&&t(4,s=b.name),"class"in b&&t(0,a=b.class),"$$scope"in b&&t(6,r=b.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,c=B.toArray(B.getNestedVal(i,s)))},[a,f,c,l,s,i,r,o,d,h]}class je extends Ie{constructor(e){super(),Le(this,e,W2,U2,Ee,{name:4,class:0})}}function As(n){const e=n-1;return e*e*e+1}function rs(n,{delay:e=0,duration:t=400,easing:i=Vr}={}){const o=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:r=>`opacity: ${r*o}`}}function ti(n,{delay:e=0,duration:t=400,easing:i=As,x:o=0,y:r=0,opacity:l=0}={}){const s=getComputedStyle(n),a=+s.opacity,f=s.transform==="none"?"":s.transform,c=a*(1-l);return{delay:e,duration:t,easing:i,css:(u,d)=>`
transform: ${f} translate(${(1-u)*o}px, ${(1-u)*r}px);
opacity: ${a-c*d}`}}function fn(n,{delay:e=0,duration:t=400,easing:i=As}={}){const o=getComputedStyle(n),r=+o.opacity,l=parseFloat(o.height),s=parseFloat(o.paddingTop),a=parseFloat(o.paddingBottom),f=parseFloat(o.marginTop),c=parseFloat(o.marginBottom),u=parseFloat(o.borderTopWidth),d=parseFloat(o.borderBottomWidth);return{delay:e,duration:t,easing:i,css:h=>`overflow: hidden;opacity: ${Math.min(h*20,1)*r};height: ${h*l}px;padding-top: ${h*s}px;padding-bottom: ${h*a}px;margin-top: ${h*f}px;margin-bottom: ${h*c}px;border-top-width: ${h*u}px;border-bottom-width: ${h*d}px;`}}function Bn(n,{delay:e=0,duration:t=400,easing:i=As,start:o=0,opacity:r=0}={}){const l=getComputedStyle(n),s=+l.opacity,a=l.transform==="none"?"":l.transform,f=1-o,c=s*(1-r);return{delay:e,duration:t,easing:i,css:(u,d)=>`
transform: ${a} scale(${1-f*d});
opacity: ${s-c*d}
`}}function Y2(n){let e,t,i,o;return{c(){e=g("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(r,l){w(r,e,l),n[13](e),Me(e,n[7]),i||(o=X(e,"input",n[14]),i=!0)},p(r,l){l&3&&t!==(t=r[0]||r[1])&&p(e,"placeholder",t),l&128&&e.value!==r[7]&&Me(e,r[7])},i:le,o:le,d(r){r&&k(e),n[13](null),i=!1,o()}}}function G2(n){let e,t,i,o;function r(a){n[12](a)}var l=n[4];function s(a){let f={singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(f.value=a[7]),{props:f}}return l&&(e=new l(s(n)),he.push(()=>Fe(e,"value",r)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=lt()},m(a,f){e&&H(e,a,f),w(a,i,f),o=!0},p(a,f){const c={};if(f&8&&(c.extraAutocompleteKeys=a[3]),f&4&&(c.baseCollection=a[2]),f&3&&(c.placeholder=a[0]||a[1]),!t&&f&128&&(t=!0,c.value=a[7],Re(()=>t=!1)),l!==(l=a[4])){if(e){Ae();const u=e;F(u.$$.fragment,1,0,()=>{q(u,1)}),De()}l?(e=new l(s(a)),he.push(()=>Fe(e,"value",r)),e.$on("submit",a[10]),V(e.$$.fragment),T(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else l&&e.$set(c)},i(a){o||(e&&T(e.$$.fragment,a),o=!0)},o(a){e&&F(e.$$.fragment,a),o=!1},d(a){a&&k(i),e&&q(e,a)}}}function Ou(n){let e,t,i,o,r,l,s=n[7]!==n[0]&&Tu();return{c(){s&&s.c(),e=$(),t=g("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,f){s&&s.m(a,f),w(a,e,f),w(a,t,f),o=!0,r||(l=X(t,"click",n[15]),r=!0)},p(a,f){a[7]!==a[0]?s?f&129&&T(s,1):(s=Tu(),s.c(),T(s,1),s.m(e.parentNode,e)):s&&(Ae(),F(s,1,1,()=>{s=null}),De())},i(a){o||(T(s),Dt(()=>{i||(i=ct(t,ti,{duration:150,x:5},!0)),i.run(1)}),o=!0)},o(a){F(s),i||(i=ct(t,ti,{duration:150,x:5},!1)),i.run(0),o=!1},d(a){s&&s.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),r=!1,l()}}}function Tu(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(o,r){w(o,e,r),i=!0},i(o){i||(Dt(()=>{t||(t=ct(e,ti,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(o){t||(t=ct(e,ti,{duration:150,x:5},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end()}}}function K2(n){let e,t,i,o,r,l,s,a,f,c,u;const d=[G2,Y2],h=[];function b(_,y){return _[4]&&!_[5]?0:1}l=b(n),s=h[l]=d[l](n);let v=(n[0].length||n[7].length)&&Ou(n);return{c(){e=g("div"),t=g("form"),i=g("label"),o=g("i"),r=$(),s.c(),a=$(),v&&v.c(),p(o,"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(_,y){w(_,e,y),m(e,t),m(t,i),m(i,o),m(t,r),h[l].m(t,null),m(t,a),v&&v.m(t,null),f=!0,c||(u=[X(t,"submit",Gt(n[10])),X(e,"click",Vn(n[11]))],c=!0)},p(_,[y]){let S=l;l=b(_),l===S?h[l].p(_,y):(Ae(),F(h[S],1,1,()=>{h[S]=null}),De(),s=h[l],s?s.p(_,y):(s=h[l]=d[l](_),s.c()),T(s,1),s.m(t,a)),_[0].length||_[7].length?v?(v.p(_,y),y&129&&T(v,1)):(v=Ou(_),v.c(),T(v,1),v.m(t,null)):v&&(Ae(),F(v,1,1,()=>{v=null}),De())},i(_){f||(T(s),T(v),f=!0)},o(_){F(s),F(v),f=!1},d(_){_&&k(e),h[l].d(),v&&v.d(),c=!1,rt(u)}}}function J2(n,e,t){const i=yn(),o="search_"+B.randomString(7);let{value:r=""}=e,{placeholder:l='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:s=new En}=e,{extraAutocompleteKeys:a=[]}=e,f,c=!1,u,d="";function h(M=!0){t(7,d=""),M&&(u==null||u.focus()),i("clear")}function b(){t(0,r=d),i("submit",r)}async function v(){f||c||(t(5,c=!0),t(4,f=(await _i(()=>import("./FilterAutocompleteInput.3cd8dab2.js"),[])).default),t(5,c=!1))}di(()=>{v()});function _(M){ft.call(this,n,M)}function y(M){d=M,t(7,d),t(0,r)}function S(M){he[M?"unshift":"push"](()=>{u=M,t(6,u)})}function C(){d=this.value,t(7,d),t(0,r)}const x=()=>{h(!1),b()};return n.$$set=M=>{"value"in M&&t(0,r=M.value),"placeholder"in M&&t(1,l=M.placeholder),"autocompleteCollection"in M&&t(2,s=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof r=="string"&&t(7,d=r)},[r,l,s,a,f,c,u,d,o,h,b,_,y,S,C,x]}class Ds extends Ie{constructor(e){super(),Le(this,e,J2,K2,Ee,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function Z2(n){let e,t,i,o,r;const l=n[6].default,s=$n(l,n,n[5],null);return{c(){e=g("th"),s&&s.c(),p(e,"tabindex","0"),p(e,"class",t="col-sort "+n[1]),ne(e,"col-sort-disabled",n[3]),ne(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),ne(e,"sort-desc",n[0]==="-"+n[2]),ne(e,"sort-asc",n[0]==="+"+n[2])},m(a,f){w(a,e,f),s&&s.m(e,null),i=!0,o||(r=[X(e,"click",n[7]),X(e,"keydown",n[8])],o=!0)},p(a,[f]){s&&s.p&&(!i||f&32)&&Dn(s,l,a,a[5],i?An(l,a[5],f,null):On(a[5]),null),(!i||f&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),f&10&&ne(e,"col-sort-disabled",a[3]),f&7&&ne(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),f&7&&ne(e,"sort-desc",a[0]==="-"+a[2]),f&7&&ne(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(T(s,a),i=!0)},o(a){F(s,a),i=!1},d(a){a&&k(e),s&&s.d(a),o=!1,rt(r)}}}function X2(n,e,t){let{$$slots:i={},$$scope:o}=e,{class:r=""}=e,{name:l}=e,{sort:s=""}=e,{disable:a=!1}=e;function f(){a||("-"+l===s?t(0,s="+"+l):t(0,s="-"+l))}const c=()=>f(),u=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),f())};return n.$$set=d=>{"class"in d&&t(1,r=d.class),"name"in d&&t(2,l=d.name),"sort"in d&&t(0,s=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,o=d.$$scope)},[s,r,l,a,f,o,i,c,u]}class en extends Ie{constructor(e){super(),Le(this,e,X2,Z2,Ee,{class:1,name:2,sort:0,disable:3})}}function Q2(n){let e;return{c(){e=g("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function ek(n){let e,t=B.formatToUTCDate(n[0])+"",i,o,r,l,s;return{c(){e=g("span"),i=j(t),o=j(" UTC"),p(e,"class","txt")},m(a,f){w(a,e,f),m(e,i),m(e,o),l||(s=Xe(r=St.call(null,e,B.formatToLocalDate(n[0])+" Local")),l=!0)},p(a,f){f&1&&t!==(t=B.formatToUTCDate(a[0])+"")&&ge(i,t),r&&Yn(r.update)&&f&1&&r.update.call(null,B.formatToLocalDate(a[0])+" Local")},d(a){a&&k(e),l=!1,s()}}}function tk(n){let e;function t(r,l){return r[0]?ek:Q2}let i=t(n),o=i(n);return{c(){o.c(),e=lt()},m(r,l){o.m(r,l),w(r,e,l)},p(r,[l]){i===(i=t(r))&&o?o.p(r,l):(o.d(1),o=i(r),o&&(o.c(),o.m(e.parentNode,e)))},i:le,o:le,d(r){o.d(r),r&&k(e)}}}function nk(n,e,t){let{date:i=""}=e;return n.$$set=o=>{"date"in o&&t(0,i=o.date)},[i]}class Ci extends Ie{constructor(e){super(),Le(this,e,nk,tk,Ee,{date:0})}}function Eu(n,e,t){const i=n.slice();return i[21]=e[t],i}function ik(n){let e;return{c(){e=g("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:le,d(t){t&&k(e)}}}function ok(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="url",p(t,"class",B.getFieldTypeIcon("url")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function rk(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="referer",p(t,"class",B.getFieldTypeIcon("url")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function lk(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="status",p(t,"class",B.getFieldTypeIcon("number")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function sk(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function Pu(n){let e;function t(r,l){return r[6]?fk:ak}let i=t(n),o=i(n);return{c(){o.c(),e=lt()},m(r,l){o.m(r,l),w(r,e,l)},p(r,l){i===(i=t(r))&&o?o.p(r,l):(o.d(1),o=i(r),o&&(o.c(),o.m(e.parentNode,e)))},d(r){o.d(r),r&&k(e)}}}function ak(n){var s;let e,t,i,o,r,l=((s=n[0])==null?void 0:s.length)&&Fu(n);return{c(){e=g("tr"),t=g("td"),i=g("h6"),i.textContent="No logs found.",o=$(),l&&l.c(),r=$(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),m(e,t),m(t,i),m(t,o),l&&l.m(t,null),m(e,r)},p(a,f){var c;(c=a[0])!=null&&c.length?l?l.p(a,f):(l=Fu(a),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},d(a){a&&k(e),l&&l.d()}}}function fk(n){let e;return{c(){e=g("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Fu(n){let e,t,i;return{c(){e=g("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(o,r){w(o,e,r),t||(i=X(e,"click",n[18]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function Lu(n){let e;return{c(){e=g("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 Iu(n,e){var oe,J,$e;let t,i,o,r=((oe=e[21].method)==null?void 0:oe.toUpperCase())+"",l,s,a,f,c,u=e[21].url+"",d,h,b,v,_,y,S=(e[21].referer||"N/A")+"",C,x,M,A,O,D=e[21].status+"",E,P,I,R,G,U,z,K,Y,W,te=(((J=e[21].meta)==null?void 0:J.errorMessage)||(($e=e[21].meta)==null?void 0:$e.errorData))&&Lu();R=new Ci({props:{date:e[21].created}});function ce(){return e[16](e[21])}function ve(...ee){return e[17](e[21],...ee)}return{key:n,first:null,c(){t=g("tr"),i=g("td"),o=g("span"),l=j(r),a=$(),f=g("td"),c=g("span"),d=j(u),b=$(),te&&te.c(),v=$(),_=g("td"),y=g("span"),C=j(S),M=$(),A=g("td"),O=g("span"),E=j(D),P=$(),I=g("td"),V(R.$$.fragment),G=$(),U=g("td"),U.innerHTML='<i class="ri-arrow-right-line"></i>',z=$(),p(o,"class",s="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(c,"class","txt txt-ellipsis"),p(c,"title",h=e[21].url),p(f,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",x=e[21].referer),ne(y,"txt-hint",!e[21].referer),p(_,"class","col-type-text col-field-referer"),p(O,"class","label"),ne(O,"label-danger",e[21].status>=400),p(A,"class","col-type-number col-field-status"),p(I,"class","col-type-date col-field-created"),p(U,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ee,_e){w(ee,t,_e),m(t,i),m(i,o),m(o,l),m(t,a),m(t,f),m(f,c),m(c,d),m(f,b),te&&te.m(f,null),m(t,v),m(t,_),m(_,y),m(y,C),m(t,M),m(t,A),m(A,O),m(O,E),m(t,P),m(t,I),H(R,I,null),m(t,G),m(t,U),m(t,z),K=!0,Y||(W=[X(t,"click",ce),X(t,"keydown",ve)],Y=!0)},p(ee,_e){var ie,ye,Ne;e=ee,(!K||_e&8)&&r!==(r=((ie=e[21].method)==null?void 0:ie.toUpperCase())+"")&&ge(l,r),(!K||_e&8&&s!==(s="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(o,"class",s),(!K||_e&8)&&u!==(u=e[21].url+"")&&ge(d,u),(!K||_e&8&&h!==(h=e[21].url))&&p(c,"title",h),((ye=e[21].meta)==null?void 0:ye.errorMessage)||((Ne=e[21].meta)==null?void 0:Ne.errorData)?te||(te=Lu(),te.c(),te.m(f,null)):te&&(te.d(1),te=null),(!K||_e&8)&&S!==(S=(e[21].referer||"N/A")+"")&&ge(C,S),(!K||_e&8&&x!==(x=e[21].referer))&&p(y,"title",x),_e&8&&ne(y,"txt-hint",!e[21].referer),(!K||_e&8)&&D!==(D=e[21].status+"")&&ge(E,D),_e&8&&ne(O,"label-danger",e[21].status>=400);const fe={};_e&8&&(fe.date=e[21].created),R.$set(fe)},i(ee){K||(T(R.$$.fragment,ee),K=!0)},o(ee){F(R.$$.fragment,ee),K=!1},d(ee){ee&&k(t),te&&te.d(),q(R),Y=!1,rt(W)}}}function Ru(n){let e,t,i=n[3].length+"",o,r,l;return{c(){e=g("small"),t=j("Showing "),o=j(i),r=j(" of "),l=j(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(s,a){w(s,e,a),m(e,t),m(e,o),m(e,r),m(e,l)},p(s,a){a&8&&i!==(i=s[3].length+"")&&ge(o,i),a&16&&ge(l,s[4])},d(s){s&&k(e)}}}function Nu(n){let e,t,i,o,r=n[4]-n[3].length+"",l,s,a,f;return{c(){e=g("div"),t=g("button"),i=g("span"),o=j("Load more ("),l=j(r),s=j(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ne(t,"btn-loading",n[6]),ne(t,"btn-disabled",n[6]),p(e,"class","block txt-center m-t-xs")},m(c,u){w(c,e,u),m(e,t),m(t,i),m(i,o),m(i,l),m(i,s),a||(f=X(t,"click",n[19]),a=!0)},p(c,u){u&24&&r!==(r=c[4]-c[3].length+"")&&ge(l,r),u&64&&ne(t,"btn-loading",c[6]),u&64&&ne(t,"btn-disabled",c[6])},d(c){c&&k(e),a=!1,f()}}}function ck(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C,x,M,A,O=[],D=new Map,E,P,I,R;function G(ie){n[11](ie)}let U={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[ik]},$$scope:{ctx:n}};n[1]!==void 0&&(U.sort=n[1]),r=new en({props:U}),he.push(()=>Fe(r,"sort",G));function z(ie){n[12](ie)}let K={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[ok]},$$scope:{ctx:n}};n[1]!==void 0&&(K.sort=n[1]),a=new en({props:K}),he.push(()=>Fe(a,"sort",z));function Y(ie){n[13](ie)}let W={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[rk]},$$scope:{ctx:n}};n[1]!==void 0&&(W.sort=n[1]),u=new en({props:W}),he.push(()=>Fe(u,"sort",Y));function te(ie){n[14](ie)}let ce={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[lk]},$$scope:{ctx:n}};n[1]!==void 0&&(ce.sort=n[1]),b=new en({props:ce}),he.push(()=>Fe(b,"sort",te));function ve(ie){n[15](ie)}let oe={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[sk]},$$scope:{ctx:n}};n[1]!==void 0&&(oe.sort=n[1]),y=new en({props:oe}),he.push(()=>Fe(y,"sort",ve));let J=n[3];const $e=ie=>ie[21].id;for(let ie=0;ie<J.length;ie+=1){let ye=Eu(n,J,ie),Ne=$e(ye);D.set(Ne,O[ie]=Iu(Ne,ye))}let ee=null;J.length||(ee=Pu(n));let _e=n[3].length&&Ru(n),fe=n[3].length&&n[7]&&Nu(n);return{c(){e=g("div"),t=g("table"),i=g("thead"),o=g("tr"),V(r.$$.fragment),s=$(),V(a.$$.fragment),c=$(),V(u.$$.fragment),h=$(),V(b.$$.fragment),_=$(),V(y.$$.fragment),C=$(),x=g("th"),M=$(),A=g("tbody");for(let ie=0;ie<O.length;ie+=1)O[ie].c();ee&&ee.c(),E=$(),_e&&_e.c(),P=$(),fe&&fe.c(),I=lt(),p(x,"class","col-type-action min-width"),p(t,"class","table"),ne(t,"table-loading",n[6]),p(e,"class","table-wrapper")},m(ie,ye){w(ie,e,ye),m(e,t),m(t,i),m(i,o),H(r,o,null),m(o,s),H(a,o,null),m(o,c),H(u,o,null),m(o,h),H(b,o,null),m(o,_),H(y,o,null),m(o,C),m(o,x),m(t,M),m(t,A);for(let Ne=0;Ne<O.length;Ne+=1)O[Ne].m(A,null);ee&&ee.m(A,null),w(ie,E,ye),_e&&_e.m(ie,ye),w(ie,P,ye),fe&&fe.m(ie,ye),w(ie,I,ye),R=!0},p(ie,[ye]){const Ne={};ye&16777216&&(Ne.$$scope={dirty:ye,ctx:ie}),!l&&ye&2&&(l=!0,Ne.sort=ie[1],Re(()=>l=!1)),r.$set(Ne);const Pe={};ye&16777216&&(Pe.$$scope={dirty:ye,ctx:ie}),!f&&ye&2&&(f=!0,Pe.sort=ie[1],Re(()=>f=!1)),a.$set(Pe);const ze={};ye&16777216&&(ze.$$scope={dirty:ye,ctx:ie}),!d&&ye&2&&(d=!0,ze.sort=ie[1],Re(()=>d=!1)),u.$set(ze);const se={};ye&16777216&&(se.$$scope={dirty:ye,ctx:ie}),!v&&ye&2&&(v=!0,se.sort=ie[1],Re(()=>v=!1)),b.$set(se);const re={};ye&16777216&&(re.$$scope={dirty:ye,ctx:ie}),!S&&ye&2&&(S=!0,re.sort=ie[1],Re(()=>S=!1)),y.$set(re),ye&841&&(J=ie[3],Ae(),O=st(O,ye,$e,1,ie,J,D,A,Pt,Iu,null,Eu),De(),!J.length&&ee?ee.p(ie,ye):J.length?ee&&(ee.d(1),ee=null):(ee=Pu(ie),ee.c(),ee.m(A,null))),ye&64&&ne(t,"table-loading",ie[6]),ie[3].length?_e?_e.p(ie,ye):(_e=Ru(ie),_e.c(),_e.m(P.parentNode,P)):_e&&(_e.d(1),_e=null),ie[3].length&&ie[7]?fe?fe.p(ie,ye):(fe=Nu(ie),fe.c(),fe.m(I.parentNode,I)):fe&&(fe.d(1),fe=null)},i(ie){if(!R){T(r.$$.fragment,ie),T(a.$$.fragment,ie),T(u.$$.fragment,ie),T(b.$$.fragment,ie),T(y.$$.fragment,ie);for(let ye=0;ye<J.length;ye+=1)T(O[ye]);R=!0}},o(ie){F(r.$$.fragment,ie),F(a.$$.fragment,ie),F(u.$$.fragment,ie),F(b.$$.fragment,ie),F(y.$$.fragment,ie);for(let ye=0;ye<O.length;ye+=1)F(O[ye]);R=!1},d(ie){ie&&k(e),q(r),q(a),q(u),q(b),q(y);for(let ye=0;ye<O.length;ye+=1)O[ye].d();ee&&ee.d(),ie&&k(E),_e&&_e.d(ie),ie&&k(P),fe&&fe.d(ie),ie&&k(I)}}}function uk(n,e,t){let i;const o=yn(),r={get:"label-info",post:"label-success",patch:"label-warning",delete:"label-danger"};let{filter:l=""}=e,{presets:s=""}=e,{sort:a="-rowid"}=e,f=[],c=1,u=0,d=!1;async function h(D=1){return t(6,d=!0),Se.Logs.getRequestsList(D,40,{sort:a,filter:[s,l].filter(Boolean).join("&&")}).then(E=>{D<=1&&b(),t(6,d=!1),t(3,f=f.concat(E.items)),t(5,c=E.page),t(4,u=E.totalItems),o("load",f)}).catch(E=>{E!==null&&(t(6,d=!1),console.warn(E),b(),Se.errorResponseHandler(E,!1))})}function b(){t(3,f=[]),t(5,c=1),t(4,u=0)}function v(D){a=D,t(1,a)}function _(D){a=D,t(1,a)}function y(D){a=D,t(1,a)}function S(D){a=D,t(1,a)}function C(D){a=D,t(1,a)}const x=D=>o("select",D),M=(D,E)=>{E.code==="Enter"&&(E.preventDefault(),o("select",D))},A=()=>t(0,l=""),O=()=>h(c+1);return n.$$set=D=>{"filter"in D&&t(0,l=D.filter),"presets"in D&&t(10,s=D.presets),"sort"in D&&t(1,a=D.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a!="undefined"||typeof l!="undefined"||typeof s!="undefined")&&(b(),h(1)),n.$$.dirty&24&&t(7,i=u>f.length)},[l,a,h,f,u,c,d,i,o,r,s,v,_,y,S,C,x,M,A,O]}class dk extends Ie{constructor(e){super(),Le(this,e,uk,ck,Ee,{filter:0,presets:10,sort:1,load:2})}get load(){return this.$$.ctx[2]}}/*!
* Chart.js v3.8.0
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/const T0=function(){return typeof window=="undefined"?function(n){return n()}:window.requestAnimationFrame}();function E0(n,e,t){const i=t||(l=>Array.prototype.slice.call(l));let o=!1,r=[];return function(...l){r=i(l),o||(o=!0,T0.call(window,()=>{o=!1,n.apply(e,r)}))}}function pk(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const hk=n=>n==="start"?"left":n==="end"?"right":"center",ju=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function mi(){}const mk=function(){let n=0;return function(){return n++}}();function xt(n){return n===null||typeof n=="undefined"}function Et(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 dt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Ht=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Rn(n,e){return Ht(n)?n:e}function ht(n,e){return typeof n=="undefined"?e:n}const bk=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,P0=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Rt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function Ct(n,e,t,i){let o,r,l;if(Et(n))if(r=n.length,i)for(o=r-1;o>=0;o--)e.call(t,n[o],o);else for(o=0;o<r;o++)e.call(t,n[o],o);else if(dt(n))for(l=Object.keys(n),r=l.length,o=0;o<r;o++)e.call(t,n[l[o]],l[o])}function ls(n,e){let t,i,o,r;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(o=n[t],r=e[t],o.datasetIndex!==r.datasetIndex||o.index!==r.index)return!1;return!0}function ss(n){if(Et(n))return n.map(ss);if(dt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let o=0;for(;o<i;++o)e[t[o]]=ss(n[t[o]]);return e}return n}function F0(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function gk(n,e,t,i){if(!F0(n))return;const o=e[n],r=t[n];dt(o)&&dt(r)?Lr(o,r,i):e[n]=ss(r)}function Lr(n,e,t){const i=Et(e)?e:[e],o=i.length;if(!dt(n))return n;t=t||{};const r=t.merger||gk;for(let l=0;l<o;++l){if(e=i[l],!dt(e))continue;const s=Object.keys(e);for(let a=0,f=s.length;a<f;++a)r(s[a],n,e,t)}return n}function Mr(n,e){return Lr(n,e,{merger:_k})}function _k(n,e,t){if(!F0(n))return;const i=e[n],o=t[n];dt(i)&&dt(o)?Mr(i,o):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=ss(o))}const vk="",yk=".";function zu(n,e){const t=n.indexOf(yk,e);return t===-1?n.length:t}function qi(n,e){if(e===vk)return n;let t=0,i=zu(e,t);for(;n&&i>t;)n=n[e.slice(t,i)],t=i+1,i=zu(e,t);return n}function Vf(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Un=n=>typeof n!="undefined",Vi=n=>typeof n=="function",Hu=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function kk(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const jt=Math.PI,Tt=2*jt,wk=Tt+jt,as=Number.POSITIVE_INFINITY,Sk=jt/180,Nt=jt/2,fr=jt/4,qu=jt*2/3,zn=Math.log10,ai=Math.sign;function Vu(n){const e=Math.round(n);n=$r(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(zn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Ck(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((o,r)=>o-r).pop(),e}function Ir(n){return!isNaN(parseFloat(n))&&isFinite(n)}function $r(n,e,t){return Math.abs(n-e)<t}function xk(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function L0(n,e,t){let i,o,r;for(i=0,o=n.length;i<o;i++)r=n[i][t],isNaN(r)||(e.min=Math.min(e.min,r),e.max=Math.max(e.max,r))}function Xn(n){return n*(jt/180)}function Bf(n){return n*(180/jt)}function Bu(n){if(!Ht(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function I0(n,e){const t=e.x-n.x,i=e.y-n.y,o=Math.sqrt(t*t+i*i);let r=Math.atan2(i,t);return r<-.5*jt&&(r+=Tt),{angle:r,distance:o}}function Qa(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Mk(n,e){return(n-e+wk)%Tt-jt}function Cn(n){return(n%Tt+Tt)%Tt}function Rr(n,e,t,i){const o=Cn(n),r=Cn(e),l=Cn(t),s=Cn(r-o),a=Cn(l-o),f=Cn(o-r),c=Cn(o-l);return o===r||o===l||i&&r===l||s>a&&f<c}function sn(n,e,t){return Math.max(e,Math.min(t,n))}function $k(n){return sn(n,-32768,32767)}function Nr(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}const kl=n=>n===0||n===1,Uu=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Tt/t)),Wu=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Tt/t)+1,Ar={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*Nt)+1,easeOutSine:n=>Math.sin(n*Nt),easeInOutSine:n=>-.5*(Math.cos(jt*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:Uu(n,.075,.3),easeOutElastic:n=>kl(n)?n:Wu(n,.075,.3),easeInOutElastic(n){return kl(n)?n:n<.5?.5*Uu(n*2,.1125,.45):.5+.5*Wu(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-Ar.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?Ar.easeInBounce(n*2)*.5:Ar.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 Jr(n){return n+.5|0}const Ni=(n,e,t)=>Math.max(Math.min(n,t),e);function yr(n){return Ni(Jr(n*2.55),0,255)}function Hi(n){return Ni(Jr(n*255),0,255)}function yi(n){return Ni(Jr(n/2.55)/100,0,1)}function Yu(n){return Ni(Jr(n*100),0,100)}const In={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ef=[..."0123456789ABCDEF"],Ak=n=>ef[n&15],Dk=n=>ef[(n&240)>>4]+ef[n&15],wl=n=>(n&240)>>4===(n&15),Ok=n=>wl(n.r)&&wl(n.g)&&wl(n.b)&&wl(n.a);function Tk(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&In[n[1]]*17,g:255&In[n[2]]*17,b:255&In[n[3]]*17,a:e===5?In[n[4]]*17:255}:(e===7||e===9)&&(t={r:In[n[1]]<<4|In[n[2]],g:In[n[3]]<<4|In[n[4]],b:In[n[5]]<<4|In[n[6]],a:e===9?In[n[7]]<<4|In[n[8]]:255})),t}const Ek=(n,e)=>n<255?e(n):"";function Pk(n){var e=Ok(n)?Ak:Dk;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Ek(n.a,e):void 0}const Fk=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function R0(n,e,t){const i=e*Math.min(t,1-t),o=(r,l=(r+n/30)%12)=>t-i*Math.max(Math.min(l-3,9-l,1),-1);return[o(0),o(8),o(4)]}function Lk(n,e,t){const i=(o,r=(o+n/60)%6)=>t-t*e*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function Ik(n,e,t){const i=R0(n,1,.5);let o;for(e+t>1&&(o=1/(e+t),e*=o,t*=o),o=0;o<3;o++)i[o]*=1-e-t,i[o]+=e;return i}function Rk(n,e,t,i,o){return n===o?(e-t)/i+(e<t?6:0):e===o?(t-n)/i+2:(n-e)/i+4}function Uf(n){const t=n.r/255,i=n.g/255,o=n.b/255,r=Math.max(t,i,o),l=Math.min(t,i,o),s=(r+l)/2;let a,f,c;return r!==l&&(c=r-l,f=s>.5?c/(2-r-l):c/(r+l),a=Rk(t,i,o,c,r),a=a*60+.5),[a|0,f||0,s]}function Wf(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Hi)}function Yf(n,e,t){return Wf(R0,n,e,t)}function Nk(n,e,t){return Wf(Ik,n,e,t)}function jk(n,e,t){return Wf(Lk,n,e,t)}function N0(n){return(n%360+360)%360}function zk(n){const e=Fk.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?yr(+e[5]):Hi(+e[5]));const o=N0(+e[2]),r=+e[3]/100,l=+e[4]/100;return e[1]==="hwb"?i=Nk(o,r,l):e[1]==="hsv"?i=jk(o,r,l):i=Yf(o,r,l),{r:i[0],g:i[1],b:i[2],a:t}}function Hk(n,e){var t=Uf(n);t[0]=N0(t[0]+e),t=Yf(t),n.r=t[0],n.g=t[1],n.b=t[2]}function qk(n){if(!n)return;const e=Uf(n),t=e[0],i=Yu(e[1]),o=Yu(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${o}%, ${yi(n.a)})`:`hsl(${t}, ${i}%, ${o}%)`}const Gu={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"},Ku={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 Vk(){const n={},e=Object.keys(Ku),t=Object.keys(Gu);let i,o,r,l,s;for(i=0;i<e.length;i++){for(l=s=e[i],o=0;o<t.length;o++)r=t[o],s=s.replace(r,Gu[r]);r=parseInt(Ku[l],16),n[s]=[r>>16&255,r>>8&255,r&255]}return n}let Sl;function Bk(n){Sl||(Sl=Vk(),Sl.transparent=[0,0,0,0]);const e=Sl[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const Uk=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Wk(n){const e=Uk.exec(n);let t=255,i,o,r;if(!!e){if(e[7]!==i){const l=+e[7];t=e[8]?yr(l):Ni(l*255,0,255)}return i=+e[1],o=+e[3],r=+e[5],i=255&(e[2]?yr(i):Ni(i,0,255)),o=255&(e[4]?yr(o):Ni(o,0,255)),r=255&(e[6]?yr(r):Ni(r,0,255)),{r:i,g:o,b:r,a:t}}}function Yk(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${yi(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const fa=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Oo=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Gk(n,e,t){const i=Oo(yi(n.r)),o=Oo(yi(n.g)),r=Oo(yi(n.b));return{r:Hi(fa(i+t*(Oo(yi(e.r))-i))),g:Hi(fa(o+t*(Oo(yi(e.g))-o))),b:Hi(fa(r+t*(Oo(yi(e.b))-r))),a:n.a+t*(e.a-n.a)}}function Cl(n,e,t){if(n){let i=Uf(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Yf(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function j0(n,e){return n&&Object.assign(e||{},n)}function Ju(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=j0(n,{r:0,g:0,b:0,a:1}),e.a=Hi(e.a)),e}function Kk(n){return n.charAt(0)==="r"?Wk(n):zk(n)}class fs{constructor(e){if(e instanceof fs)return e;const t=typeof e;let i;t==="object"?i=Ju(e):t==="string"&&(i=Tk(e)||Bk(e)||Kk(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=j0(this._rgb);return e&&(e.a=yi(e.a)),e}set rgb(e){this._rgb=Ju(e)}rgbString(){return this._valid?Yk(this._rgb):void 0}hexString(){return this._valid?Pk(this._rgb):void 0}hslString(){return this._valid?qk(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,o=e.rgb;let r;const l=t===r?.5:t,s=2*l-1,a=i.a-o.a,f=((s*a===-1?s:(s+a)/(1+s*a))+1)/2;r=1-f,i.r=255&f*i.r+r*o.r+.5,i.g=255&f*i.g+r*o.g+.5,i.b=255&f*i.b+r*o.b+.5,i.a=l*i.a+(1-l)*o.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=Gk(this._rgb,e._rgb,t)),this}clone(){return new fs(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=Jr(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 Cl(this._rgb,2,e),this}darken(e){return Cl(this._rgb,2,-e),this}saturate(e){return Cl(this._rgb,1,e),this}desaturate(e){return Cl(this._rgb,1,-e),this}rotate(e){return Hk(this._rgb,e),this}}function z0(n){return new fs(n)}function H0(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Zu(n){return H0(n)?n:z0(n)}function ca(n){return H0(n)?n:z0(n).saturate(.5).darken(.1).hexString()}const mo=Object.create(null),tf=Object.create(null);function Dr(n,e){if(!e)return n;const t=e.split(".");for(let i=0,o=t.length;i<o;++i){const r=t[i];n=n[r]||(n[r]=Object.create(null))}return n}function ua(n,e,t){return typeof e=="string"?Lr(Dr(n,e),t):Lr(Dr(n,""),e)}class Jk{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)=>ca(i.backgroundColor),this.hoverBorderColor=(t,i)=>ca(i.borderColor),this.hoverColor=(t,i)=>ca(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 ua(this,e,t)}get(e){return Dr(this,e)}describe(e,t){return ua(tf,e,t)}override(e,t){return ua(mo,e,t)}route(e,t,i,o){const r=Dr(this,e),l=Dr(this,i),s="_"+t;Object.defineProperties(r,{[s]:{value:r[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[s],f=l[o];return dt(a)?Object.assign({},f,a):ht(a,f)},set(a){this[s]=a}}})}}var mt=new Jk({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function Zk(n){return!n||xt(n.size)||xt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function cs(n,e,t,i,o){let r=e[o];return r||(r=e[o]=n.measureText(o).width,t.push(o)),r>i&&(i=r),i}function Xk(n,e,t,i){i=i||{};let o=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(o=i.data={},r=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let l=0;const s=t.length;let a,f,c,u,d;for(a=0;a<s;a++)if(u=t[a],u!=null&&Et(u)!==!0)l=cs(n,o,r,l,u);else if(Et(u))for(f=0,c=u.length;f<c;f++)d=u[f],d!=null&&!Et(d)&&(l=cs(n,o,r,l,d));n.restore();const h=r.length/2;if(h>t.length){for(a=0;a<h;a++)delete o[r[a]];r.splice(0,h)}return l}function eo(n,e,t){const i=n.currentDevicePixelRatio,o=t!==0?Math.max(t/2,.5):0;return Math.round((e-o)*i)/i+o}function Xu(n,e){e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore()}function nf(n,e,t,i){let o,r,l,s,a;const f=e.pointStyle,c=e.rotation,u=e.radius;let d=(c||0)*Sk;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(d),n.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),n.restore();return}if(!(isNaN(u)||u<=0)){switch(n.beginPath(),f){default:n.arc(t,i,u,0,Tt),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(d)*u,i-Math.cos(d)*u),d+=qu,n.lineTo(t+Math.sin(d)*u,i-Math.cos(d)*u),d+=qu,n.lineTo(t+Math.sin(d)*u,i-Math.cos(d)*u),n.closePath();break;case"rectRounded":a=u*.516,s=u-a,r=Math.cos(d+fr)*s,l=Math.sin(d+fr)*s,n.arc(t-r,i-l,a,d-jt,d-Nt),n.arc(t+l,i-r,a,d-Nt,d),n.arc(t+r,i+l,a,d,d+Nt),n.arc(t-l,i+r,a,d+Nt,d+jt),n.closePath();break;case"rect":if(!c){s=Math.SQRT1_2*u,n.rect(t-s,i-s,2*s,2*s);break}d+=fr;case"rectRot":r=Math.cos(d)*u,l=Math.sin(d)*u,n.moveTo(t-r,i-l),n.lineTo(t+l,i-r),n.lineTo(t+r,i+l),n.lineTo(t-l,i+r),n.closePath();break;case"crossRot":d+=fr;case"cross":r=Math.cos(d)*u,l=Math.sin(d)*u,n.moveTo(t-r,i-l),n.lineTo(t+r,i+l),n.moveTo(t+l,i-r),n.lineTo(t-l,i+r);break;case"star":r=Math.cos(d)*u,l=Math.sin(d)*u,n.moveTo(t-r,i-l),n.lineTo(t+r,i+l),n.moveTo(t+l,i-r),n.lineTo(t-l,i+r),d+=fr,r=Math.cos(d)*u,l=Math.sin(d)*u,n.moveTo(t-r,i-l),n.lineTo(t+r,i+l),n.moveTo(t+l,i-r),n.lineTo(t-l,i+r);break;case"line":r=Math.cos(d)*u,l=Math.sin(d)*u,n.moveTo(t-r,i-l),n.lineTo(t+r,i+l);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(d)*u,i+Math.sin(d)*u);break}n.fill(),e.borderWidth>0&&n.stroke()}}function jr(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 Gf(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function Kf(n){n.restore()}function Qk(n,e,t,i,o){if(!e)return n.lineTo(t.x,t.y);if(o==="middle"){const r=(e.x+t.x)/2;n.lineTo(r,e.y),n.lineTo(r,t.y)}else o==="after"!=!!i?n.lineTo(e.x,t.y):n.lineTo(t.x,e.y);n.lineTo(t.x,t.y)}function ew(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 us(n,e,t,i,o,r={}){const l=Et(e)?e:[e],s=r.strokeWidth>0&&r.strokeColor!=="";let a,f;for(n.save(),n.font=o.string,tw(n,r),a=0;a<l.length;++a)f=l[a],s&&(r.strokeColor&&(n.strokeStyle=r.strokeColor),xt(r.strokeWidth)||(n.lineWidth=r.strokeWidth),n.strokeText(f,t,i,r.maxWidth)),n.fillText(f,t,i,r.maxWidth),nw(n,t,i,f,r),i+=o.lineHeight;n.restore()}function tw(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),xt(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 nw(n,e,t,i,o){if(o.strikethrough||o.underline){const r=n.measureText(i),l=e-r.actualBoundingBoxLeft,s=e+r.actualBoundingBoxRight,a=t-r.actualBoundingBoxAscent,f=t+r.actualBoundingBoxDescent,c=o.strikethrough?(a+f)/2:f;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=o.decorationWidth||2,n.moveTo(l,c),n.lineTo(s,c),n.stroke()}}function ds(n,e){const{x:t,y:i,w:o,h:r,radius:l}=e;n.arc(t+l.topLeft,i+l.topLeft,l.topLeft,-Nt,jt,!0),n.lineTo(t,i+r-l.bottomLeft),n.arc(t+l.bottomLeft,i+r-l.bottomLeft,l.bottomLeft,jt,Nt,!0),n.lineTo(t+o-l.bottomRight,i+r),n.arc(t+o-l.bottomRight,i+r-l.bottomRight,l.bottomRight,Nt,0,!0),n.lineTo(t+o,i+l.topRight),n.arc(t+o-l.topRight,i+l.topRight,l.topRight,0,-Nt,!0),n.lineTo(t+l.topLeft,i)}const iw=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),ow=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function rw(n,e){const t=(""+n).match(iw);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 lw=n=>+n||0;function Jf(n,e){const t={},i=dt(e),o=i?Object.keys(e):e,r=dt(n)?i?l=>ht(n[l],n[e[l]]):l=>n[l]:()=>n;for(const l of o)t[l]=lw(r(l));return t}function q0(n){return Jf(n,{top:"y",right:"x",bottom:"y",left:"x"})}function jo(n){return Jf(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Wn(n){const e=q0(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Mn(n,e){n=n||{},e=e||mt.font;let t=ht(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=ht(n.style,e.style);i&&!(""+i).match(ow)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const o={family:ht(n.family,e.family),lineHeight:rw(ht(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:ht(n.weight,e.weight),string:""};return o.string=Zk(o),o}function xl(n,e,t,i){let o=!0,r,l,s;for(r=0,l=n.length;r<l;++r)if(s=n[r],s!==void 0&&(e!==void 0&&typeof s=="function"&&(s=s(e),o=!1),t!==void 0&&Et(s)&&(s=s[t%s.length],o=!1),s!==void 0))return i&&!o&&(i.cacheable=!1),s}function sw(n,e,t){const{min:i,max:o}=n,r=P0(e,(o-i)/2),l=(s,a)=>t&&s===0?0:s+a;return{min:l(i,-Math.abs(r)),max:l(o,r)}}function Wi(n,e){return Object.assign(Object.create(n),e)}function Zf(n,e,t){t=t||(l=>n[l]<e);let i=n.length-1,o=0,r;for(;i-o>1;)r=o+i>>1,t(r)?o=r:i=r;return{lo:o,hi:i}}const ao=(n,e,t)=>Zf(n,t,i=>n[i][e]<t),aw=(n,e,t)=>Zf(n,t,i=>n[i][e]>=t);function fw(n,e,t){let i=0,o=n.length;for(;i<o&&n[i]<e;)i++;for(;o>i&&n[o-1]>t;)o--;return i>0||o<n.length?n.slice(i,o):n}const V0=["push","pop","shift","splice","unshift"];function cw(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),V0.forEach(t=>{const i="_onData"+Vf(t),o=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...r){const l=o.apply(this,r);return n._chartjs.listeners.forEach(s=>{typeof s[i]=="function"&&s[i](...r)}),l}})})}function Qu(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,o=i.indexOf(e);o!==-1&&i.splice(o,1),!(i.length>0)&&(V0.forEach(r=>{delete n[r]}),delete n._chartjs)}function B0(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)}function Xf(n,e=[""],t=n,i,o=()=>n[0]){Un(i)||(i=G0("_fallback",n));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:o,override:l=>Xf([l,...n],e,t,i)};return new Proxy(r,{deleteProperty(l,s){return delete l[s],delete l._keys,delete n[0][s],!0},get(l,s){return W0(l,s,()=>_w(s,e,n,l))},getOwnPropertyDescriptor(l,s){return Reflect.getOwnPropertyDescriptor(l._scopes[0],s)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,s){return td(l).includes(s)},ownKeys(l){return td(l)},set(l,s,a){const f=l._storage||(l._storage=o());return l[s]=f[s]=a,delete l._keys,!0}})}function Wo(n,e,t,i){const o={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:U0(n,i),setContext:r=>Wo(n,r,t,i),override:r=>Wo(n.override(r),e,t,i)};return new Proxy(o,{deleteProperty(r,l){return delete r[l],delete n[l],!0},get(r,l,s){return W0(r,l,()=>dw(r,l,s))},getOwnPropertyDescriptor(r,l){return r._descriptors.allKeys?Reflect.has(n,l)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,l)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(r,l){return Reflect.has(n,l)},ownKeys(){return Reflect.ownKeys(n)},set(r,l,s){return n[l]=s,delete r[l],!0}})}function U0(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:o=e.allKeys}=n;return{allKeys:o,scriptable:t,indexable:i,isScriptable:Vi(t)?t:()=>t,isIndexable:Vi(i)?i:()=>i}}const uw=(n,e)=>n?n+Vf(e):e,Qf=(n,e)=>dt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function W0(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function dw(n,e,t){const{_proxy:i,_context:o,_subProxy:r,_descriptors:l}=n;let s=i[e];return Vi(s)&&l.isScriptable(e)&&(s=pw(e,s,n,t)),Et(s)&&s.length&&(s=hw(e,s,n,l.isIndexable)),Qf(e,s)&&(s=Wo(s,o,r&&r[e],l)),s}function pw(n,e,t,i){const{_proxy:o,_context:r,_subProxy:l,_stack:s}=t;if(s.has(n))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+n);return s.add(n),e=e(r,l||i),s.delete(n),Qf(n,e)&&(e=ec(o._scopes,o,n,e)),e}function hw(n,e,t,i){const{_proxy:o,_context:r,_subProxy:l,_descriptors:s}=t;if(Un(r.index)&&i(n))e=e[r.index%e.length];else if(dt(e[0])){const a=e,f=o._scopes.filter(c=>c!==a);e=[];for(const c of a){const u=ec(f,o,n,c);e.push(Wo(u,r,l&&l[n],s))}}return e}function Y0(n,e,t){return Vi(n)?n(e,t):n}const mw=(n,e)=>n===!0?e:typeof n=="string"?qi(e,n):void 0;function bw(n,e,t,i,o){for(const r of e){const l=mw(t,r);if(l){n.add(l);const s=Y0(l._fallback,t,o);if(Un(s)&&s!==t&&s!==i)return s}else if(l===!1&&Un(i)&&t!==i)return null}return!1}function ec(n,e,t,i){const o=e._rootScopes,r=Y0(e._fallback,t,i),l=[...n,...o],s=new Set;s.add(i);let a=ed(s,l,t,r||t,i);return a===null||Un(r)&&r!==t&&(a=ed(s,l,r,a,i),a===null)?!1:Xf(Array.from(s),[""],o,r,()=>gw(e,t,i))}function ed(n,e,t,i,o){for(;t;)t=bw(n,e,t,i,o);return t}function gw(n,e,t){const i=n._getTarget();e in i||(i[e]={});const o=i[e];return Et(o)&&dt(t)?t:o}function _w(n,e,t,i){let o;for(const r of e)if(o=G0(uw(r,n),t),Un(o))return Qf(n,o)?ec(t,i,n,o):o}function G0(n,e){for(const t of e){if(!t)continue;const i=t[n];if(Un(i))return i}}function td(n){let e=n._keys;return e||(e=n._keys=vw(n._scopes)),e}function vw(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(o=>!o.startsWith("_")))e.add(i);return Array.from(e)}function K0(n,e,t,i){const{iScale:o}=n,{key:r="r"}=this._parsing,l=new Array(i);let s,a,f,c;for(s=0,a=i;s<a;++s)f=s+t,c=e[f],l[s]={r:o.parse(qi(c,r),f)};return l}const yw=Number.EPSILON||1e-14,Yo=(n,e)=>e<n.length&&!n[e].skip&&n[e],J0=n=>n==="x"?"y":"x";function kw(n,e,t,i){const o=n.skip?e:n,r=e,l=t.skip?e:t,s=Qa(r,o),a=Qa(l,r);let f=s/(s+a),c=a/(s+a);f=isNaN(f)?0:f,c=isNaN(c)?0:c;const u=i*f,d=i*c;return{previous:{x:r.x-u*(l.x-o.x),y:r.y-u*(l.y-o.y)},next:{x:r.x+d*(l.x-o.x),y:r.y+d*(l.y-o.y)}}}function ww(n,e,t){const i=n.length;let o,r,l,s,a,f=Yo(n,0);for(let c=0;c<i-1;++c)if(a=f,f=Yo(n,c+1),!(!a||!f)){if($r(e[c],0,yw)){t[c]=t[c+1]=0;continue}o=t[c]/e[c],r=t[c+1]/e[c],s=Math.pow(o,2)+Math.pow(r,2),!(s<=9)&&(l=3/Math.sqrt(s),t[c]=o*l*e[c],t[c+1]=r*l*e[c])}}function Sw(n,e,t="x"){const i=J0(t),o=n.length;let r,l,s,a=Yo(n,0);for(let f=0;f<o;++f){if(l=s,s=a,a=Yo(n,f+1),!s)continue;const c=s[t],u=s[i];l&&(r=(c-l[t])/3,s[`cp1${t}`]=c-r,s[`cp1${i}`]=u-r*e[f]),a&&(r=(a[t]-c)/3,s[`cp2${t}`]=c+r,s[`cp2${i}`]=u+r*e[f])}}function Cw(n,e="x"){const t=J0(e),i=n.length,o=Array(i).fill(0),r=Array(i);let l,s,a,f=Yo(n,0);for(l=0;l<i;++l)if(s=a,a=f,f=Yo(n,l+1),!!a){if(f){const c=f[e]-a[e];o[l]=c!==0?(f[t]-a[t])/c:0}r[l]=s?f?ai(o[l-1])!==ai(o[l])?0:(o[l-1]+o[l])/2:o[l-1]:o[l]}ww(n,o,r),Sw(n,r,e)}function Ml(n,e,t){return Math.max(Math.min(n,t),e)}function xw(n,e){let t,i,o,r,l,s=jr(n[0],e);for(t=0,i=n.length;t<i;++t)l=r,r=s,s=t<i-1&&jr(n[t+1],e),r&&(o=n[t],l&&(o.cp1x=Ml(o.cp1x,e.left,e.right),o.cp1y=Ml(o.cp1y,e.top,e.bottom)),s&&(o.cp2x=Ml(o.cp2x,e.left,e.right),o.cp2y=Ml(o.cp2y,e.top,e.bottom)))}function Mw(n,e,t,i,o){let r,l,s,a;if(e.spanGaps&&(n=n.filter(f=>!f.skip)),e.cubicInterpolationMode==="monotone")Cw(n,o);else{let f=i?n[n.length-1]:n[0];for(r=0,l=n.length;r<l;++r)s=n[r],a=kw(f,s,n[Math.min(r+1,l-(i?0:1))%l],e.tension),s.cp1x=a.previous.x,s.cp1y=a.previous.y,s.cp2x=a.next.x,s.cp2y=a.next.y,f=s}e.capBezierPoints&&xw(n,t)}function Z0(){return typeof window!="undefined"&&typeof document!="undefined"}function tc(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function ps(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 Os=n=>window.getComputedStyle(n,null);function $w(n,e){return Os(n).getPropertyValue(e)}const Aw=["top","right","bottom","left"];function po(n,e,t){const i={};t=t?"-"+t:"";for(let o=0;o<4;o++){const r=Aw[o];i[r]=parseFloat(n[e+"-"+r+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Dw=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Ow(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:o,offsetY:r}=i;let l=!1,s,a;if(Dw(o,r,n.target))s=o,a=r;else{const f=e.getBoundingClientRect();s=i.clientX-f.left,a=i.clientY-f.top,l=!0}return{x:s,y:a,box:l}}function oo(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,o=Os(t),r=o.boxSizing==="border-box",l=po(o,"padding"),s=po(o,"border","width"),{x:a,y:f,box:c}=Ow(n,t),u=l.left+(c&&s.left),d=l.top+(c&&s.top);let{width:h,height:b}=e;return r&&(h-=l.width+s.width,b-=l.height+s.height),{x:Math.round((a-u)/h*t.width/i),y:Math.round((f-d)/b*t.height/i)}}function Tw(n,e,t){let i,o;if(e===void 0||t===void 0){const r=tc(n);if(!r)e=n.clientWidth,t=n.clientHeight;else{const l=r.getBoundingClientRect(),s=Os(r),a=po(s,"border","width"),f=po(s,"padding");e=l.width-f.width-a.width,t=l.height-f.height-a.height,i=ps(s.maxWidth,r,"clientWidth"),o=ps(s.maxHeight,r,"clientHeight")}}return{width:e,height:t,maxWidth:i||as,maxHeight:o||as}}const da=n=>Math.round(n*10)/10;function Ew(n,e,t,i){const o=Os(n),r=po(o,"margin"),l=ps(o.maxWidth,n,"clientWidth")||as,s=ps(o.maxHeight,n,"clientHeight")||as,a=Tw(n,e,t);let{width:f,height:c}=a;if(o.boxSizing==="content-box"){const u=po(o,"border","width"),d=po(o,"padding");f-=d.width+u.width,c-=d.height+u.height}return f=Math.max(0,f-r.width),c=Math.max(0,i?Math.floor(f/i):c-r.height),f=da(Math.min(f,l,a.maxWidth)),c=da(Math.min(c,s,a.maxHeight)),f&&!c&&(c=da(f/2)),{width:f,height:c}}function nd(n,e,t){const i=e||1,o=Math.floor(n.height*i),r=Math.floor(n.width*i);n.height=o/i,n.width=r/i;const l=n.canvas;return l.style&&(t||!l.style.height&&!l.style.width)&&(l.style.height=`${n.height}px`,l.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||l.height!==o||l.width!==r?(n.currentDevicePixelRatio=i,l.height=o,l.width=r,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Pw=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 id(n,e){const t=$w(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function ro(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function Fw(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 Lw(n,e,t,i){const o={x:n.cp2x,y:n.cp2y},r={x:e.cp1x,y:e.cp1y},l=ro(n,o,t),s=ro(o,r,t),a=ro(r,e,t),f=ro(l,s,t),c=ro(s,a,t);return ro(f,c,t)}const od=new Map;function Iw(n,e){e=e||{};const t=n+JSON.stringify(e);let i=od.get(t);return i||(i=new Intl.NumberFormat(n,e),od.set(t,i)),i}function Zr(n,e,t){return Iw(e,t).format(n)}const Rw=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}}},Nw=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function pa(n,e,t){return n?Rw(e,t):Nw()}function jw(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 zw(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function X0(n){return n==="angle"?{between:Rr,compare:Mk,normalize:Cn}:{between:Nr,compare:(e,t)=>e-t,normalize:e=>e}}function rd({start:n,end:e,count:t,loop:i,style:o}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:o}}function Hw(n,e,t){const{property:i,start:o,end:r}=t,{between:l,normalize:s}=X0(i),a=e.length;let{start:f,end:c,loop:u}=n,d,h;if(u){for(f+=a,c+=a,d=0,h=a;d<h&&l(s(e[f%a][i]),o,r);++d)f--,c--;f%=a,c%=a}return c<f&&(c+=a),{start:f,end:c,loop:u,style:n.style}}function Q0(n,e,t){if(!t)return[n];const{property:i,start:o,end:r}=t,l=e.length,{compare:s,between:a,normalize:f}=X0(i),{start:c,end:u,loop:d,style:h}=Hw(n,e,t),b=[];let v=!1,_=null,y,S,C;const x=()=>a(o,C,y)&&s(o,C)!==0,M=()=>s(r,y)===0||a(r,C,y),A=()=>v||x(),O=()=>!v||M();for(let D=c,E=c;D<=u;++D)S=e[D%l],!S.skip&&(y=f(S[i]),y!==C&&(v=a(y,o,r),_===null&&A()&&(_=s(y,o)===0?D:E),_!==null&&O()&&(b.push(rd({start:_,end:D,loop:d,count:l,style:h})),_=null),E=D,C=y));return _!==null&&b.push(rd({start:_,end:u,loop:d,count:l,style:h})),b}function e1(n,e){const t=[],i=n.segments;for(let o=0;o<i.length;o++){const r=Q0(i[o],n.points,e);r.length&&t.push(...r)}return t}function qw(n,e,t,i){let o=0,r=e-1;if(t&&!i)for(;o<e&&!n[o].skip;)o++;for(;o<e&&n[o].skip;)o++;for(o%=e,t&&(r+=o);r>o&&n[r%e].skip;)r--;return r%=e,{start:o,end:r}}function Vw(n,e,t,i){const o=n.length,r=[];let l=e,s=n[e],a;for(a=e+1;a<=t;++a){const f=n[a%o];f.skip||f.stop?s.skip||(i=!1,r.push({start:e%o,end:(a-1)%o,loop:i}),e=l=f.stop?a:null):(l=a,s.skip&&(e=a)),s=f}return l!==null&&r.push({start:e%o,end:l%o,loop:i}),r}function Bw(n,e){const t=n.points,i=n.options.spanGaps,o=t.length;if(!o)return[];const r=!!n._loop,{start:l,end:s}=qw(t,o,r,i);if(i===!0)return ld(n,[{start:l,end:s,loop:r}],t,e);const a=s<l?s+o:s,f=!!n._fullLoop&&l===0&&s===o-1;return ld(n,Vw(t,l,a,f),t,e)}function ld(n,e,t,i){return!i||!i.setContext||!t?e:Uw(n,e,t,i)}function Uw(n,e,t,i){const o=n._chart.getContext(),r=sd(n.options),{_datasetIndex:l,options:{spanGaps:s}}=n,a=t.length,f=[];let c=r,u=e[0].start,d=u;function h(b,v,_,y){const S=s?-1:1;if(b!==v){for(b+=a;t[b%a].skip;)b-=S;for(;t[v%a].skip;)v+=S;b%a!==v%a&&(f.push({start:b%a,end:v%a,loop:_,style:y}),c=y,u=v%a)}}for(const b of e){u=s?u:b.start;let v=t[u%a],_;for(d=u+1;d<=b.end;d++){const y=t[d%a];_=sd(i.setContext(Wi(o,{type:"segment",p0:v,p1:y,p0DataIndex:(d-1)%a,p1DataIndex:d%a,datasetIndex:l}))),Ww(_,c)&&h(u,d-1,b.loop,c),v=y,c=_}u<d-1&&h(u,d-1,b.loop,c)}return f}function sd(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Ww(n,e){return e&&JSON.stringify(n)!==JSON.stringify(e)}/*!
* Chart.js v3.8.0
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class Yw{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,o){const r=t.listeners[o],l=t.duration;r.forEach(s=>s({chart:e,initial:t.initial,numSteps:l,currentStep:Math.min(i-t.start,l)}))}_refresh(){this._request||(this._running=!0,this._request=T0.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,o)=>{if(!i.running||!i.items.length)return;const r=i.items;let l=r.length-1,s=!1,a;for(;l>=0;--l)a=r[l],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),s=!0):(r[l]=r[r.length-1],r.pop());s&&(o.draw(),this._notify(o,i,e,"progress")),r.length||(i.running=!1,this._notify(o,i,e,"complete"),i.initial=!1),t+=r.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,o)=>Math.max(i,o._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 o=i.length-1;for(;o>=0;--o)i[o].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var bi=new Yw;const ad="transparent",Gw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Zu(n||ad),o=i.valid&&Zu(e||ad);return o&&o.valid?o.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Kw{constructor(e,t,i,o){const r=t[i];o=xl([e.to,o,r,e.from]);const l=xl([e.from,r,o]);this._active=!0,this._fn=e.fn||Gw[e.type||typeof l],this._easing=Ar[e.easing]||Ar.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=l,this._to=o,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const o=this._target[this._prop],r=i-this._start,l=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(l,e.duration)),this._total+=r,this._loop=!!e.loop,this._to=xl([e.to,t,o,e.from]),this._from=xl([e.from,o,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,o=this._prop,r=this._from,l=this._loop,s=this._to;let a;if(this._active=r!==s&&(l||t<i),!this._active){this._target[o]=s,this._notify(!0);return}if(t<0){this._target[o]=r;return}a=t/i%2,a=l&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[o]=this._fn(r,s,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 o=0;o<i.length;o++)i[o][t]()}}const Jw=["x","y","borderWidth","radius","tension"],Zw=["color","borderColor","backgroundColor"];mt.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 Xw=Object.keys(mt.animation);mt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});mt.set("animations",{colors:{type:"color",properties:Zw},numbers:{type:"number",properties:Jw}});mt.describe("animations",{_fallback:"animation"});mt.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 t1{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!dt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const o=e[i];if(!dt(o))return;const r={};for(const l of Xw)r[l]=o[l];(Et(o.properties)&&o.properties||[i]).forEach(l=>{(l===i||!t.has(l))&&t.set(l,r)})})}_animateOptions(e,t){const i=t.options,o=e3(e,i);if(!o)return[];const r=this._createAnimations(o,i);return i.$shared&&Qw(e.options.$animations,i).then(()=>{e.options=i},()=>{}),r}_createAnimations(e,t){const i=this._properties,o=[],r=e.$animations||(e.$animations={}),l=Object.keys(t),s=Date.now();let a;for(a=l.length-1;a>=0;--a){const f=l[a];if(f.charAt(0)==="$")continue;if(f==="options"){o.push(...this._animateOptions(e,t));continue}const c=t[f];let u=r[f];const d=i.get(f);if(u)if(d&&u.active()){u.update(d,c,s);continue}else u.cancel();if(!d||!d.duration){e[f]=c;continue}r[f]=u=new Kw(d,e,f,c),o.push(u)}return o}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 Qw(n,e){const t=[],i=Object.keys(e);for(let o=0;o<i.length;o++){const r=n[i[o]];r&&r.active()&&t.push(r.wait())}return Promise.all(t)}function e3(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 fd(n,e){const t=n&&n.options||{},i=t.reverse,o=t.min===void 0?e:0,r=t.max===void 0?e:0;return{start:i?r:o,end:i?o:r}}function t3(n,e,t){if(t===!1)return!1;const i=fd(n,t),o=fd(e,t);return{top:o.end,right:i.end,bottom:o.start,left:i.start}}function n3(n){let e,t,i,o;return dt(n)?(e=n.top,t=n.right,i=n.bottom,o=n.left):e=t=i=o=n,{top:e,right:t,bottom:i,left:o,disabled:n===!1}}function n1(n,e){const t=[],i=n._getSortedDatasetMetas(e);let o,r;for(o=0,r=i.length;o<r;++o)t.push(i[o].index);return t}function cd(n,e,t,i={}){const o=n.keys,r=i.mode==="single";let l,s,a,f;if(e!==null){for(l=0,s=o.length;l<s;++l){if(a=+o[l],a===t){if(i.all)continue;break}f=n.values[a],Ht(f)&&(r||e===0||ai(e)===ai(f))&&(e+=f)}return e}}function i3(n){const e=Object.keys(n),t=new Array(e.length);let i,o,r;for(i=0,o=e.length;i<o;++i)r=e[i],t[i]={x:r,y:n[r]};return t}function ud(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function o3(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function r3(n){const{min:e,max:t,minDefined:i,maxDefined:o}=n.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:o?t:Number.POSITIVE_INFINITY}}function l3(n,e,t){const i=n[e]||(n[e]={});return i[t]||(i[t]={})}function dd(n,e,t,i){for(const o of e.getMatchingVisibleMetas(i).reverse()){const r=n[o.index];if(t&&r>0||!t&&r<0)return o.index}return null}function pd(n,e){const{chart:t,_cachedMeta:i}=n,o=t._stacks||(t._stacks={}),{iScale:r,vScale:l,index:s}=i,a=r.axis,f=l.axis,c=o3(r,l,i),u=e.length;let d;for(let h=0;h<u;++h){const b=e[h],{[a]:v,[f]:_}=b,y=b._stacks||(b._stacks={});d=y[f]=l3(o,c,v),d[s]=_,d._top=dd(d,l,!0,i.type),d._bottom=dd(d,l,!1,i.type)}}function ha(n,e){const t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function s3(n,e){return Wi(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function a3(n,e,t){return Wi(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function cr(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(!!i){e=e||n._parsed;for(const o of e){const r=o._stacks;if(!r||r[i]===void 0||r[i][t]===void 0)return;delete r[i][t]}}}const ma=n=>n==="reset"||n==="none",hd=(n,e)=>e?n:Object.assign({},n),f3=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:n1(t,!0),values:null};class hi{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=ud(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&cr(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),o=(u,d,h,b)=>u==="x"?d:u==="r"?b:h,r=t.xAxisID=ht(i.xAxisID,ha(e,"x")),l=t.yAxisID=ht(i.yAxisID,ha(e,"y")),s=t.rAxisID=ht(i.rAxisID,ha(e,"r")),a=t.indexAxis,f=t.iAxisID=o(a,r,l,s),c=t.vAxisID=o(a,l,r,s);t.xScale=this.getScaleForId(r),t.yScale=this.getScaleForId(l),t.rScale=this.getScaleForId(s),t.iScale=this.getScaleForId(f),t.vScale=this.getScaleForId(c)}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&&Qu(this._data,this),e._stacked&&cr(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(dt(t))this._data=i3(t);else if(i!==t){if(i){Qu(i,this);const o=this._cachedMeta;cr(o),o._parsed=[]}t&&Object.isExtensible(t)&&cw(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 o=!1;this._dataCheck();const r=t._stacked;t._stacked=ud(t.vScale,t),t.stack!==i.stack&&(o=!0,cr(t),t.stack=i.stack),this._resyncElements(e),(o||r!==t._stacked)&&pd(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:o}=this,{iScale:r,_stacked:l}=i,s=r.axis;let a=e===0&&t===o.length?!0:i._sorted,f=e>0&&i._parsed[e-1],c,u,d;if(this._parsing===!1)i._parsed=o,i._sorted=!0,d=o;else{Et(o[e])?d=this.parseArrayData(i,o,e,t):dt(o[e])?d=this.parseObjectData(i,o,e,t):d=this.parsePrimitiveData(i,o,e,t);const h=()=>u[s]===null||f&&u[s]<f[s];for(c=0;c<t;++c)i._parsed[c+e]=u=d[c],a&&(h()&&(a=!1),f=u);i._sorted=a}l&&pd(this,d)}parsePrimitiveData(e,t,i,o){const{iScale:r,vScale:l}=e,s=r.axis,a=l.axis,f=r.getLabels(),c=r===l,u=new Array(o);let d,h,b;for(d=0,h=o;d<h;++d)b=d+i,u[d]={[s]:c||r.parse(f[b],b),[a]:l.parse(t[b],b)};return u}parseArrayData(e,t,i,o){const{xScale:r,yScale:l}=e,s=new Array(o);let a,f,c,u;for(a=0,f=o;a<f;++a)c=a+i,u=t[c],s[a]={x:r.parse(u[0],c),y:l.parse(u[1],c)};return s}parseObjectData(e,t,i,o){const{xScale:r,yScale:l}=e,{xAxisKey:s="x",yAxisKey:a="y"}=this._parsing,f=new Array(o);let c,u,d,h;for(c=0,u=o;c<u;++c)d=c+i,h=t[d],f[c]={x:r.parse(qi(h,s),d),y:l.parse(qi(h,a),d)};return f}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,i){const o=this.chart,r=this._cachedMeta,l=t[e.axis],s={keys:n1(o,!0),values:t._stacks[e.axis]};return cd(s,l,r.index,{mode:i})}updateRangeFromParsed(e,t,i,o){const r=i[t.axis];let l=r===null?NaN:r;const s=o&&i._stacks[t.axis];o&&s&&(o.values=s,l=cd(o,r,this._cachedMeta.index)),e.min=Math.min(e.min,l),e.max=Math.max(e.max,l)}getMinMax(e,t){const i=this._cachedMeta,o=i._parsed,r=i._sorted&&e===i.iScale,l=o.length,s=this._getOtherScale(e),a=f3(t,i,this.chart),f={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=r3(s);let d,h;function b(){h=o[d];const v=h[s.axis];return!Ht(h[e.axis])||c>v||u<v}for(d=0;d<l&&!(!b()&&(this.updateRangeFromParsed(f,e,h,a),r));++d);if(r){for(d=l-1;d>=0;--d)if(!b()){this.updateRangeFromParsed(f,e,h,a);break}}return f}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let o,r,l;for(o=0,r=t.length;o<r;++o)l=t[o][e.axis],Ht(l)&&i.push(l);return i}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,i=t.iScale,o=t.vScale,r=this.getParsed(e);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:o?""+o.getLabelForValue(r[o.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=n3(ht(this.options.clip,t3(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,i=this._cachedMeta,o=i.data||[],r=t.chartArea,l=[],s=this._drawStart||0,a=this._drawCount||o.length-s,f=this.options.drawActiveElementsOnTop;let c;for(i.dataset&&i.dataset.draw(e,r,s,a),c=s;c<s+a;++c){const u=o[c];u.hidden||(u.active&&f?l.push(u):u.draw(e,r))}for(c=0;c<l.length;++c)l[c].draw(e,r)}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 o=this.getDataset();let r;if(e>=0&&e<this._cachedMeta.data.length){const l=this._cachedMeta.data[e];r=l.$context||(l.$context=a3(this.getContext(),e,l)),r.parsed=this.getParsed(e),r.raw=o.data[e],r.index=r.dataIndex=e}else r=this.$context||(this.$context=s3(this.chart.getContext(),this.index)),r.dataset=o,r.index=r.datasetIndex=this.index;return r.active=!!t,r.mode=i,r}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 o=t==="active",r=this._cachedDataOpts,l=e+"-"+t,s=r[l],a=this.enableOptionSharing&&Un(i);if(s)return hd(s,a);const f=this.chart.config,c=f.datasetElementScopeKeys(this._type,e),u=o?[`${e}Hover`,"hover",e,""]:[e,""],d=f.getOptionScopes(this.getDataset(),c),h=Object.keys(mt.elements[e]),b=()=>this.getContext(i,o),v=f.resolveNamedOptions(d,h,b,u);return v.$shared&&(v.$shared=a,r[l]=Object.freeze(hd(v,a))),v}_resolveAnimations(e,t,i){const o=this.chart,r=this._cachedDataOpts,l=`animation-${t}`,s=r[l];if(s)return s;let a;if(o.options.animation!==!1){const c=this.chart.config,u=c.datasetAnimationScopeKeys(this._type,t),d=c.getOptionScopes(this.getDataset(),u);a=c.createResolver(d,this.getContext(e,i,t))}const f=new t1(o,a&&a.animations);return a&&a._cacheable&&(r[l]=Object.freeze(f)),f}getSharedOptions(e){if(!!e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||ma(e)||this.chart._animationsDisabled}updateElement(e,t,i,o){ma(o)?Object.assign(e,i):this._resolveAnimations(t,o).update(e,i)}updateSharedOptions(e,t,i){e&&!ma(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,o){e.active=o;const r=this.getStyle(t,o);this._resolveAnimations(t,i,o).update(e,{options:!o&&this.getSharedOptions(r)||r})}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[s,a,f]of this._syncList)this[s](a,f);this._syncList=[];const o=i.length,r=t.length,l=Math.min(r,o);l&&this.parse(0,l),r>o?this._insertElements(o,r-o,e):r<o&&this._removeElements(r,o-r)}_insertElements(e,t,i=!0){const o=this._cachedMeta,r=o.data,l=e+t;let s;const a=f=>{for(f.length+=t,s=f.length-1;s>=l;s--)f[s]=f[s-t]};for(a(r),s=e;s<l;++s)r[s]=new this.dataElementType;this._parsing&&a(o._parsed),this.parse(e,t),i&&this.updateElements(r,e,t,"reset")}updateElements(e,t,i,o){}_removeElements(e,t){const i=this._cachedMeta;if(this._parsing){const o=i._parsed.splice(e,t);i._stacked&&cr(i,o)}i.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,i,o]=e;this[t](i,o)}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])}}hi.defaults={};hi.prototype.datasetElementType=null;hi.prototype.dataElementType=null;function c3(n,e){if(!n._cache.$bar){const t=n.getMatchingVisibleMetas(e);let i=[];for(let o=0,r=t.length;o<r;o++)i=i.concat(t[o].controller.getAllParsedValues(n));n._cache.$bar=B0(i.sort((o,r)=>o-r))}return n._cache.$bar}function u3(n){const e=n.iScale,t=c3(e,n.type);let i=e._length,o,r,l,s;const a=()=>{l===32767||l===-32768||(Un(s)&&(i=Math.min(i,Math.abs(l-s)||i)),s=l)};for(o=0,r=t.length;o<r;++o)l=e.getPixelForValue(t[o]),a();for(s=void 0,o=0,r=e.ticks.length;o<r;++o)l=e.getPixelForTick(o),a();return i}function d3(n,e,t,i){const o=t.barThickness;let r,l;return xt(o)?(r=e.min*t.categoryPercentage,l=t.barPercentage):(r=o*i,l=1),{chunk:r/i,ratio:l,start:e.pixels[n]-r/2}}function p3(n,e,t,i){const o=e.pixels,r=o[n];let l=n>0?o[n-1]:null,s=n<o.length-1?o[n+1]:null;const a=t.categoryPercentage;l===null&&(l=r-(s===null?e.end-e.start:s-r)),s===null&&(s=r+r-l);const f=r-(r-Math.min(l,s))/2*a;return{chunk:Math.abs(s-l)/2*a/i,ratio:t.barPercentage,start:f}}function h3(n,e,t,i){const o=t.parse(n[0],i),r=t.parse(n[1],i),l=Math.min(o,r),s=Math.max(o,r);let a=l,f=s;Math.abs(l)>Math.abs(s)&&(a=s,f=l),e[t.axis]=f,e._custom={barStart:a,barEnd:f,start:o,end:r,min:l,max:s}}function i1(n,e,t,i){return Et(n)?h3(n,e,t,i):e[t.axis]=t.parse(n,i),e}function md(n,e,t,i){const o=n.iScale,r=n.vScale,l=o.getLabels(),s=o===r,a=[];let f,c,u,d;for(f=t,c=t+i;f<c;++f)d=e[f],u={},u[o.axis]=s||o.parse(l[f],f),a.push(i1(d,u,r,f));return a}function ba(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function m3(n,e,t){return n!==0?ai(n):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function b3(n){let e,t,i,o,r;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.base<n.y,t="bottom",i="top"),e?(o="end",r="start"):(o="start",r="end"),{start:t,end:i,reverse:e,top:o,bottom:r}}function g3(n,e,t,i){let o=e.borderSkipped;const r={};if(!o){n.borderSkipped=r;return}const{start:l,end:s,reverse:a,top:f,bottom:c}=b3(n);o==="middle"&&t&&(n.enableBorderRadius=!0,(t._top||0)===i?o=f:(t._bottom||0)===i?o=c:(r[bd(c,l,s,a)]=!0,o=f)),r[bd(o,l,s,a)]=!0,n.borderSkipped=r}function bd(n,e,t,i){return i?(n=_3(n,e,t),n=gd(n,t,e)):n=gd(n,e,t),n}function _3(n,e,t){return n===e?t:n===t?e:n}function gd(n,e,t){return n==="start"?e:n==="end"?t:n}function v3(n,{inflateAmount:e},t){n.inflateAmount=e==="auto"?t===1?.33:0:e}class nc extends hi{parsePrimitiveData(e,t,i,o){return md(e,t,i,o)}parseArrayData(e,t,i,o){return md(e,t,i,o)}parseObjectData(e,t,i,o){const{iScale:r,vScale:l}=e,{xAxisKey:s="x",yAxisKey:a="y"}=this._parsing,f=r.axis==="x"?s:a,c=l.axis==="x"?s:a,u=[];let d,h,b,v;for(d=i,h=i+o;d<h;++d)v=t[d],b={},b[r.axis]=r.parse(qi(v,f),d),u.push(i1(qi(v,c),b,l,d));return u}updateRangeFromParsed(e,t,i,o){super.updateRangeFromParsed(e,t,i,o);const r=i._custom;r&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,r.min),e.max=Math.max(e.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:i,vScale:o}=t,r=this.getParsed(e),l=r._custom,s=ba(l)?"["+l.start+", "+l.end+"]":""+o.getLabelForValue(r[o.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:s}}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,o){const r=o==="reset",{index:l,_cachedMeta:{vScale:s}}=this,a=s.getBasePixel(),f=s.isHorizontal(),c=this._getRuler(),u=this.resolveDataElementOptions(t,o),d=this.getSharedOptions(u),h=this.includeOptions(o,d);this.updateSharedOptions(d,o,u);for(let b=t;b<t+i;b++){const v=this.getParsed(b),_=r||xt(v[s.axis])?{base:a,head:a}:this._calculateBarValuePixels(b),y=this._calculateBarIndexPixels(b,c),S=(v._stacks||{})[s.axis],C={horizontal:f,base:_.base,enableBorderRadius:!S||ba(v._custom)||l===S._top||l===S._bottom,x:f?_.head:y.center,y:f?y.center:_.head,height:f?y.size:Math.abs(_.size),width:f?Math.abs(_.size):y.size};h&&(C.options=d||this.resolveDataElementOptions(b,e[b].active?"active":o));const x=C.options||e[b].options;g3(C,x,S,l),v3(C,x,c.ratio),this.updateElement(e[b],b,C,o)}}_getStacks(e,t){const o=this._cachedMeta.iScale,r=o.getMatchingVisibleMetas(this._type),l=o.options.stacked,s=r.length,a=[];let f,c;for(f=0;f<s;++f)if(c=r[f],!!c.controller.options.grouped){if(typeof t!="undefined"){const u=c.controller.getParsed(t)[c.controller._cachedMeta.vScale.axis];if(xt(u)||isNaN(u))continue}if((l===!1||a.indexOf(c.stack)===-1||l===void 0&&c.stack===void 0)&&a.push(c.stack),c.index===e)break}return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const o=this._getStacks(e,i),r=t!==void 0?o.indexOf(t):-1;return r===-1?o.length-1:r}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,o=[];let r,l;for(r=0,l=t.data.length;r<l;++r)o.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const s=e.barThickness;return{min:s||u3(t),pixels:o,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:s?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:i},options:{base:o,minBarLength:r}}=this,l=o||0,s=this.getParsed(e),a=s._custom,f=ba(a);let c=s[t.axis],u=0,d=i?this.applyStack(t,s,i):c,h,b;d!==c&&(u=d-c,d=c),f&&(c=a.barStart,d=a.barEnd-a.barStart,c!==0&&ai(c)!==ai(a.barEnd)&&(u=0),u+=c);const v=!xt(o)&&!f?o:u;let _=t.getPixelForValue(v);if(this.chart.getDataVisibility(e)?h=t.getPixelForValue(u+d):h=_,b=h-_,Math.abs(b)<r){b=m3(b,t,l)*r,c===l&&(_-=b/2);const y=t.getPixelForDecimal(0),S=t.getPixelForDecimal(1),C=Math.min(y,S),x=Math.max(y,S);_=Math.max(Math.min(_,x),C),h=_+b}if(_===t.getPixelForValue(l)){const y=ai(b)*t.getLineWidthForValue(l)/2;_+=y,b-=y}return{size:b,base:_,head:h,center:h+b/2}}_calculateBarIndexPixels(e,t){const i=t.scale,o=this.options,r=o.skipNull,l=ht(o.maxBarThickness,1/0);let s,a;if(t.grouped){const f=r?this._getStackCount(e):t.stackCount,c=o.barThickness==="flex"?p3(e,t,o,f):d3(e,t,o,f),u=this._getStackIndex(this.index,this._cachedMeta.stack,r?e:void 0);s=c.start+c.chunk*u+c.chunk/2,a=Math.min(l,c.chunk*c.ratio)}else s=i.getPixelForValue(this.getParsed(e)[i.axis],e),a=Math.min(l,t.min*t.ratio);return{base:s-a/2,head:s+a/2,center:s,size:a}}draw(){const e=this._cachedMeta,t=e.vScale,i=e.data,o=i.length;let r=0;for(;r<o;++r)this.getParsed(r)[t.axis]!==null&&i[r].draw(this._ctx)}}nc.id="bar";nc.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};nc.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class ic extends hi{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,i,o){const r=super.parsePrimitiveData(e,t,i,o);for(let l=0;l<r.length;l++)r[l]._custom=this.resolveDataElementOptions(l+i).radius;return r}parseArrayData(e,t,i,o){const r=super.parseArrayData(e,t,i,o);for(let l=0;l<r.length;l++){const s=t[i+l];r[l]._custom=ht(s[2],this.resolveDataElementOptions(l+i).radius)}return r}parseObjectData(e,t,i,o){const r=super.parseObjectData(e,t,i,o);for(let l=0;l<r.length;l++){const s=t[i+l];r[l]._custom=ht(s&&s.r&&+s.r,this.resolveDataElementOptions(l+i).radius)}return r}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:o}=t,r=this.getParsed(e),l=i.getLabelForValue(r.x),s=o.getLabelForValue(r.y),a=r._custom;return{label:t.label,value:"("+l+", "+s+(a?", "+a:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,o){const r=o==="reset",{iScale:l,vScale:s}=this._cachedMeta,a=this.resolveDataElementOptions(t,o),f=this.getSharedOptions(a),c=this.includeOptions(o,f),u=l.axis,d=s.axis;for(let h=t;h<t+i;h++){const b=e[h],v=!r&&this.getParsed(h),_={},y=_[u]=r?l.getPixelForDecimal(.5):l.getPixelForValue(v[u]),S=_[d]=r?s.getBasePixel():s.getPixelForValue(v[d]);_.skip=isNaN(y)||isNaN(S),c&&(_.options=this.resolveDataElementOptions(h,b.active?"active":o),r&&(_.options.radius=0)),this.updateElement(b,h,_,o)}this.updateSharedOptions(f,o,a)}resolveDataElementOptions(e,t){const i=this.getParsed(e);let o=super.resolveDataElementOptions(e,t);o.$shared&&(o=Object.assign({},o,{$shared:!1}));const r=o.radius;return t!=="active"&&(o.radius=0),o.radius+=ht(i&&i._custom,r),o}}ic.id="bubble";ic.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};ic.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};function y3(n,e,t){let i=1,o=1,r=0,l=0;if(e<Tt){const s=n,a=s+e,f=Math.cos(s),c=Math.sin(s),u=Math.cos(a),d=Math.sin(a),h=(C,x,M)=>Rr(C,s,a,!0)?1:Math.max(x,x*t,M,M*t),b=(C,x,M)=>Rr(C,s,a,!0)?-1:Math.min(x,x*t,M,M*t),v=h(0,f,u),_=h(Nt,c,d),y=b(jt,f,u),S=b(jt+Nt,c,d);i=(v-y)/2,o=(_-S)/2,r=-(v+y)/2,l=-(_+S)/2}return{ratioX:i,ratioY:o,offsetX:r,offsetY:l}}class Xr extends hi{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,o=this._cachedMeta;if(this._parsing===!1)o._parsed=i;else{let r=a=>+i[a];if(dt(i[e])){const{key:a="value"}=this._parsing;r=f=>+qi(i[f],a)}let l,s;for(l=e,s=e+t;l<s;++l)o._parsed[l]=r(l)}}_getRotation(){return Xn(this.options.rotation-90)}_getCircumference(){return Xn(this.options.circumference)}_getRotationExtents(){let e=Tt,t=-Tt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){const o=this.chart.getDatasetMeta(i).controller,r=o._getRotation(),l=o._getCircumference();e=Math.min(e,r),t=Math.max(t,r+l)}return{rotation:e,circumference:t-e}}update(e){const t=this.chart,{chartArea:i}=t,o=this._cachedMeta,r=o.data,l=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,s=Math.max((Math.min(i.width,i.height)-l)/2,0),a=Math.min(bk(this.options.cutout,s),1),f=this._getRingWeight(this.index),{circumference:c,rotation:u}=this._getRotationExtents(),{ratioX:d,ratioY:h,offsetX:b,offsetY:v}=y3(u,c,a),_=(i.width-l)/d,y=(i.height-l)/h,S=Math.max(Math.min(_,y)/2,0),C=P0(this.options.radius,S),x=Math.max(C*a,0),M=(C-x)/this._getVisibleDatasetWeightTotal();this.offsetX=b*C,this.offsetY=v*C,o.total=this.calculateTotal(),this.outerRadius=C-M*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-M*f,0),this.updateElements(r,0,r.length,e)}_circumference(e,t){const i=this.options,o=this._cachedMeta,r=this._getCircumference();return t&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||o._parsed[e]===null||o.data[e].hidden?0:this.calculateCircumference(o._parsed[e]*r/Tt)}updateElements(e,t,i,o){const r=o==="reset",l=this.chart,s=l.chartArea,f=l.options.animation,c=(s.left+s.right)/2,u=(s.top+s.bottom)/2,d=r&&f.animateScale,h=d?0:this.innerRadius,b=d?0:this.outerRadius,v=this.resolveDataElementOptions(t,o),_=this.getSharedOptions(v),y=this.includeOptions(o,_);let S=this._getRotation(),C;for(C=0;C<t;++C)S+=this._circumference(C,r);for(C=t;C<t+i;++C){const x=this._circumference(C,r),M=e[C],A={x:c+this.offsetX,y:u+this.offsetY,startAngle:S,endAngle:S+x,circumference:x,outerRadius:b,innerRadius:h};y&&(A.options=_||this.resolveDataElementOptions(C,M.active?"active":o)),S+=x,this.updateElement(M,C,A,o)}this.updateSharedOptions(_,o,v)}calculateTotal(){const e=this._cachedMeta,t=e.data;let i=0,o;for(o=0;o<t.length;o++){const r=e._parsed[o];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(o)&&!t[o].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?Tt*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,o=i.data.labels||[],r=Zr(t._parsed[e],i.options.locale);return{label:o[e]||"",value:r}}getMaxBorderWidth(e){let t=0;const i=this.chart;let o,r,l,s,a;if(!e){for(o=0,r=i.data.datasets.length;o<r;++o)if(i.isDatasetVisible(o)){l=i.getDatasetMeta(o),e=l.data,s=l.controller;break}}if(!e)return 0;for(o=0,r=e.length;o<r;++o)a=s.resolveDataElementOptions(o),a.borderAlign!=="inner"&&(t=Math.max(t,a.borderWidth||0,a.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let i=0,o=e.length;i<o;++i){const r=this.resolveDataElementOptions(i);t=Math.max(t,r.offset||0,r.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(ht(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Xr.id="doughnut";Xr.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"};Xr.descriptors={_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"};Xr.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,o)=>{const l=n.getDatasetMeta(0).controller.getStyle(o);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,lineWidth:l.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(o),index:o}})}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 Et(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Qr extends hi{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:o=[],_dataset:r}=t,l=this.chart._animationsDisabled;let{start:s,count:a}=k3(t,o,l);this._drawStart=s,this._drawCount=a,w3(t)&&(s=0,a=o.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=o;const f=this.resolveDatasetElementOptions(e);this.options.showLine||(f.borderWidth=0),f.segment=this.options.segment,this.updateElement(i,void 0,{animated:!l,options:f},e),this.updateElements(o,s,a,e)}updateElements(e,t,i,o){const r=o==="reset",{iScale:l,vScale:s,_stacked:a,_dataset:f}=this._cachedMeta,c=this.resolveDataElementOptions(t,o),u=this.getSharedOptions(c),d=this.includeOptions(o,u),h=l.axis,b=s.axis,{spanGaps:v,segment:_}=this.options,y=Ir(v)?v:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||r||o==="none";let C=t>0&&this.getParsed(t-1);for(let x=t;x<t+i;++x){const M=e[x],A=this.getParsed(x),O=S?M:{},D=xt(A[b]),E=O[h]=l.getPixelForValue(A[h],x),P=O[b]=r||D?s.getBasePixel():s.getPixelForValue(a?this.applyStack(s,A,a):A[b],x);O.skip=isNaN(E)||isNaN(P)||D,O.stop=x>0&&Math.abs(A[h]-C[h])>y,_&&(O.parsed=A,O.raw=f.data[x]),d&&(O.options=u||this.resolveDataElementOptions(x,M.active?"active":o)),S||this.updateElement(M,x,O,o),C=A}this.updateSharedOptions(u,o,c)}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,o=e.data||[];if(!o.length)return i;const r=o[0].size(this.resolveDataElementOptions(0)),l=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(i,r,l)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Qr.id="line";Qr.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Qr.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};function k3(n,e,t){const i=e.length;let o=0,r=i;if(n._sorted){const{iScale:l,_parsed:s}=n,a=l.axis,{min:f,max:c,minDefined:u,maxDefined:d}=l.getUserBounds();u&&(o=sn(Math.min(ao(s,l.axis,f).lo,t?i:ao(e,a,l.getPixelForValue(f)).lo),0,i-1)),d?r=sn(Math.max(ao(s,l.axis,c).hi+1,t?0:ao(e,a,l.getPixelForValue(c)).hi+1),o,i)-o:r=i-o}return{start:o,count:r}}function w3(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,o={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=o,!0;const r=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,o),r}class oc extends hi{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,o=i.data.labels||[],r=Zr(t._parsed[e].r,i.options.locale);return{label:o[e]||"",value:r}}parseObjectData(e,t,i,o){return K0.bind(this)(e,t,i,o)}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,o)=>{const r=this.getParsed(o).r;!isNaN(r)&&this.chart.getDataVisibility(o)&&(r<t.min&&(t.min=r),r>t.max&&(t.max=r))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,i=e.options,o=Math.min(t.right-t.left,t.bottom-t.top),r=Math.max(o/2,0),l=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),s=(r-l)/e.getVisibleDatasetCount();this.outerRadius=r-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(e,t,i,o){const r=o==="reset",l=this.chart,a=l.options.animation,f=this._cachedMeta.rScale,c=f.xCenter,u=f.yCenter,d=f.getIndexAngle(0)-.5*jt;let h=d,b;const v=360/this.countVisibleElements();for(b=0;b<t;++b)h+=this._computeAngle(b,o,v);for(b=t;b<t+i;b++){const _=e[b];let y=h,S=h+this._computeAngle(b,o,v),C=l.getDataVisibility(b)?f.getDistanceFromCenterForValue(this.getParsed(b).r):0;h=S,r&&(a.animateScale&&(C=0),a.animateRotate&&(y=S=d));const x={x:c,y:u,innerRadius:0,outerRadius:C,startAngle:y,endAngle:S,options:this.resolveDataElementOptions(b,_.active?"active":o)};this.updateElement(_,b,x,o)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach((i,o)=>{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?Xn(this.resolveDataElementOptions(e,t).angle||i):0}}oc.id="polarArea";oc.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};oc.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,o)=>{const l=n.getDatasetMeta(0).controller.getStyle(o);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,lineWidth:l.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(o),index:o}})}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 o1 extends Xr{}o1.id="pie";o1.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class rc extends hi{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,o){return K0.bind(this)(e,t,i,o)}update(e){const t=this._cachedMeta,i=t.dataset,o=t.data||[],r=t.iScale.getLabels();if(i.points=o,e!=="resize"){const l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0);const s={_loop:!0,_fullLoop:r.length===o.length,options:l};this.updateElement(i,void 0,s,e)}this.updateElements(o,0,o.length,e)}updateElements(e,t,i,o){const r=this._cachedMeta.rScale,l=o==="reset";for(let s=t;s<t+i;s++){const a=e[s],f=this.resolveDataElementOptions(s,a.active?"active":o),c=r.getPointPositionForValue(s,this.getParsed(s).r),u=l?r.xCenter:c.x,d=l?r.yCenter:c.y,h={x:u,y:d,angle:c.angle,skip:isNaN(u)||isNaN(d),options:f};this.updateElement(a,s,h,o)}}}rc.id="radar";rc.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};rc.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class lc extends Qr{}lc.id="scatter";lc.defaults={showLine:!1,fill:!1};lc.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function to(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class of{constructor(e){this.options=e||{}}formats(){return to()}parse(e,t){return to()}format(e,t){return to()}add(e,t,i){return to()}diff(e,t,i){return to()}startOf(e,t,i){return to()}endOf(e,t){return to()}}of.override=function(n){Object.assign(of.prototype,n)};var r1={_date:of};function S3(n,e,t,i){const{controller:o,data:r,_sorted:l}=n,s=o._cachedMeta.iScale;if(s&&e===s.axis&&e!=="r"&&l&&r.length){const a=s._reversePixels?aw:ao;if(i){if(o._sharedOptions){const f=r[0],c=typeof f.getRange=="function"&&f.getRange(e);if(c){const u=a(r,e,t-c),d=a(r,e,t+c);return{lo:u.lo,hi:d.hi}}}}else return a(r,e,t)}return{lo:0,hi:r.length-1}}function el(n,e,t,i,o){const r=n.getSortedVisibleDatasetMetas(),l=t[e];for(let s=0,a=r.length;s<a;++s){const{index:f,data:c}=r[s],{lo:u,hi:d}=S3(r[s],e,l,o);for(let h=u;h<=d;++h){const b=c[h];b.skip||i(b,f,h)}}}function C3(n){const e=n.indexOf("x")!==-1,t=n.indexOf("y")!==-1;return function(i,o){const r=e?Math.abs(i.x-o.x):0,l=t?Math.abs(i.y-o.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(l,2))}}function ga(n,e,t,i,o){const r=[];return!o&&!n.isPointInArea(e)||el(n,t,e,function(s,a,f){!o&&!jr(s,n.chartArea,0)||s.inRange(e.x,e.y,i)&&r.push({element:s,datasetIndex:a,index:f})},!0),r}function x3(n,e,t,i){let o=[];function r(l,s,a){const{startAngle:f,endAngle:c}=l.getProps(["startAngle","endAngle"],i),{angle:u}=I0(l,{x:e.x,y:e.y});Rr(u,f,c)&&o.push({element:l,datasetIndex:s,index:a})}return el(n,t,e,r),o}function M3(n,e,t,i,o,r){let l=[];const s=C3(t);let a=Number.POSITIVE_INFINITY;function f(c,u,d){const h=c.inRange(e.x,e.y,o);if(i&&!h)return;const b=c.getCenterPoint(o);if(!(!!r||n.isPointInArea(b))&&!h)return;const _=s(e,b);_<a?(l=[{element:c,datasetIndex:u,index:d}],a=_):_===a&&l.push({element:c,datasetIndex:u,index:d})}return el(n,t,e,f),l}function _a(n,e,t,i,o,r){return!r&&!n.isPointInArea(e)?[]:t==="r"&&!i?x3(n,e,t,o):M3(n,e,t,i,o,r)}function _d(n,e,t,i,o){const r=[],l=t==="x"?"inXRange":"inYRange";let s=!1;return el(n,t,e,(a,f,c)=>{a[l](e[t],o)&&(r.push({element:a,datasetIndex:f,index:c}),s=s||a.inRange(e.x,e.y,o))}),i&&!s?[]:r}var $3={evaluateInteractionItems:el,modes:{index(n,e,t,i){const o=oo(e,n),r=t.axis||"x",l=t.includeInvisible||!1,s=t.intersect?ga(n,o,r,i,l):_a(n,o,r,!1,i,l),a=[];return s.length?(n.getSortedVisibleDatasetMetas().forEach(f=>{const c=s[0].index,u=f.data[c];u&&!u.skip&&a.push({element:u,datasetIndex:f.index,index:c})}),a):[]},dataset(n,e,t,i){const o=oo(e,n),r=t.axis||"xy",l=t.includeInvisible||!1;let s=t.intersect?ga(n,o,r,i,l):_a(n,o,r,!1,i,l);if(s.length>0){const a=s[0].datasetIndex,f=n.getDatasetMeta(a).data;s=[];for(let c=0;c<f.length;++c)s.push({element:f[c],datasetIndex:a,index:c})}return s},point(n,e,t,i){const o=oo(e,n),r=t.axis||"xy",l=t.includeInvisible||!1;return ga(n,o,r,i,l)},nearest(n,e,t,i){const o=oo(e,n),r=t.axis||"xy",l=t.includeInvisible||!1;return _a(n,o,r,t.intersect,i,l)},x(n,e,t,i){const o=oo(e,n);return _d(n,o,"x",t.intersect,i)},y(n,e,t,i){const o=oo(e,n);return _d(n,o,"y",t.intersect,i)}}};const l1=["left","top","right","bottom"];function ur(n,e){return n.filter(t=>t.pos===e)}function vd(n,e){return n.filter(t=>l1.indexOf(t.pos)===-1&&t.box.axis===e)}function dr(n,e){return n.sort((t,i)=>{const o=e?i:t,r=e?t:i;return o.weight===r.weight?o.index-r.index:o.weight-r.weight})}function A3(n){const e=[];let t,i,o,r,l,s;for(t=0,i=(n||[]).length;t<i;++t)o=n[t],{position:r,options:{stack:l,stackWeight:s=1}}=o,e.push({index:t,box:o,pos:r,horizontal:o.isHorizontal(),weight:o.weight,stack:l&&r+l,stackWeight:s});return e}function D3(n){const e={};for(const t of n){const{stack:i,pos:o,stackWeight:r}=t;if(!i||!l1.includes(o))continue;const l=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});l.count++,l.weight+=r}return e}function O3(n,e){const t=D3(n),{vBoxMaxWidth:i,hBoxMaxHeight:o}=e;let r,l,s;for(r=0,l=n.length;r<l;++r){s=n[r];const{fullSize:a}=s.box,f=t[s.stack],c=f&&s.stackWeight/f.weight;s.horizontal?(s.width=c?c*i:a&&e.availableWidth,s.height=o):(s.width=i,s.height=c?c*o:a&&e.availableHeight)}return t}function T3(n){const e=A3(n),t=dr(e.filter(f=>f.box.fullSize),!0),i=dr(ur(e,"left"),!0),o=dr(ur(e,"right")),r=dr(ur(e,"top"),!0),l=dr(ur(e,"bottom")),s=vd(e,"x"),a=vd(e,"y");return{fullSize:t,leftAndTop:i.concat(r),rightAndBottom:o.concat(a).concat(l).concat(s),chartArea:ur(e,"chartArea"),vertical:i.concat(o).concat(a),horizontal:r.concat(l).concat(s)}}function yd(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function s1(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 E3(n,e,t,i){const{pos:o,box:r}=t,l=n.maxPadding;if(!dt(o)){t.size&&(n[o]-=t.size);const u=i[t.stack]||{size:0,count:1};u.size=Math.max(u.size,t.horizontal?r.height:r.width),t.size=u.size/u.count,n[o]+=t.size}r.getPadding&&s1(l,r.getPadding());const s=Math.max(0,e.outerWidth-yd(l,n,"left","right")),a=Math.max(0,e.outerHeight-yd(l,n,"top","bottom")),f=s!==n.w,c=a!==n.h;return n.w=s,n.h=a,t.horizontal?{same:f,other:c}:{same:c,other:f}}function P3(n){const e=n.maxPadding;function t(i){const o=Math.max(e[i]-n[i],0);return n[i]+=o,o}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function F3(n,e){const t=e.maxPadding;function i(o){const r={left:0,top:0,right:0,bottom:0};return o.forEach(l=>{r[l]=Math.max(e[l],t[l])}),r}return i(n?["left","right"]:["top","bottom"])}function kr(n,e,t,i){const o=[];let r,l,s,a,f,c;for(r=0,l=n.length,f=0;r<l;++r){s=n[r],a=s.box,a.update(s.width||e.w,s.height||e.h,F3(s.horizontal,e));const{same:u,other:d}=E3(e,t,s,i);f|=u&&o.length,c=c||d,a.fullSize||o.push(s)}return f&&kr(o,e,t,i)||c}function $l(n,e,t,i,o){n.top=t,n.left=e,n.right=e+i,n.bottom=t+o,n.width=i,n.height=o}function kd(n,e,t,i){const o=t.padding;let{x:r,y:l}=e;for(const s of n){const a=s.box,f=i[s.stack]||{count:1,placed:0,weight:1},c=s.stackWeight/f.weight||1;if(s.horizontal){const u=e.w*c,d=f.size||a.height;Un(f.start)&&(l=f.start),a.fullSize?$l(a,o.left,l,t.outerWidth-o.right-o.left,d):$l(a,e.left+f.placed,l,u,d),f.start=l,f.placed+=u,l=a.bottom}else{const u=e.h*c,d=f.size||a.width;Un(f.start)&&(r=f.start),a.fullSize?$l(a,r,o.top,d,t.outerHeight-o.bottom-o.top):$l(a,r,e.top+f.placed,d,u),f.start=r,f.placed+=u,r=a.right}}e.x=r,e.y=l}mt.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var Al={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 o=Wn(n.options.layout.padding),r=Math.max(e-o.width,0),l=Math.max(t-o.height,0),s=T3(n.boxes),a=s.vertical,f=s.horizontal;Ct(n.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const c=a.reduce((v,_)=>_.box.options&&_.box.options.display===!1?v:v+1,0)||1,u=Object.freeze({outerWidth:e,outerHeight:t,padding:o,availableWidth:r,availableHeight:l,vBoxMaxWidth:r/2/c,hBoxMaxHeight:l/2}),d=Object.assign({},o);s1(d,Wn(i));const h=Object.assign({maxPadding:d,w:r,h:l,x:o.left,y:o.top},o),b=O3(a.concat(f),u);kr(s.fullSize,h,u,b),kr(a,h,u,b),kr(f,h,u,b)&&kr(a,h,u,b),P3(h),kd(s.leftAndTop,h,u,b),h.x+=h.w,h.y+=h.h,kd(s.rightAndBottom,h,u,b),n.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Ct(s.chartArea,v=>{const _=v.box;Object.assign(_,n.chartArea),_.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class a1{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,o){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,o?Math.floor(t/o):i)}}isAttached(e){return!0}updateConfig(e){}}class L3 extends a1{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Gl="$chartjs",I3={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},wd=n=>n===null||n==="";function R3(n,e){const t=n.style,i=n.getAttribute("height"),o=n.getAttribute("width");if(n[Gl]={initial:{height:i,width:o,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",wd(o)){const r=id(n,"width");r!==void 0&&(n.width=r)}if(wd(i))if(n.style.height==="")n.height=n.width/(e||2);else{const r=id(n,"height");r!==void 0&&(n.height=r)}return n}const f1=Pw?{passive:!0}:!1;function N3(n,e,t){n.addEventListener(e,t,f1)}function j3(n,e,t){n.canvas.removeEventListener(e,t,f1)}function z3(n,e){const t=I3[n.type]||n.type,{x:i,y:o}=oo(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:o!==void 0?o:null}}function hs(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function H3(n,e,t){const i=n.canvas,o=new MutationObserver(r=>{let l=!1;for(const s of r)l=l||hs(s.addedNodes,i),l=l&&!hs(s.removedNodes,i);l&&t()});return o.observe(document,{childList:!0,subtree:!0}),o}function q3(n,e,t){const i=n.canvas,o=new MutationObserver(r=>{let l=!1;for(const s of r)l=l||hs(s.removedNodes,i),l=l&&!hs(s.addedNodes,i);l&&t()});return o.observe(document,{childList:!0,subtree:!0}),o}const zr=new Map;let Sd=0;function c1(){const n=window.devicePixelRatio;n!==Sd&&(Sd=n,zr.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function V3(n,e){zr.size||window.addEventListener("resize",c1),zr.set(n,e)}function B3(n){zr.delete(n),zr.size||window.removeEventListener("resize",c1)}function U3(n,e,t){const i=n.canvas,o=i&&tc(i);if(!o)return;const r=E0((s,a)=>{const f=o.clientWidth;t(s,a),f<o.clientWidth&&t()},window),l=new ResizeObserver(s=>{const a=s[0],f=a.contentRect.width,c=a.contentRect.height;f===0&&c===0||r(f,c)});return l.observe(o),V3(n,r),l}function va(n,e,t){t&&t.disconnect(),e==="resize"&&B3(n)}function W3(n,e,t){const i=n.canvas,o=E0(r=>{n.ctx!==null&&t(z3(r,n))},n,r=>{const l=r[0];return[l,l.offsetX,l.offsetY]});return N3(i,e,o),o}class Y3 extends a1{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(R3(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[Gl])return!1;const i=t[Gl].initial;["height","width"].forEach(r=>{const l=i[r];xt(l)?t.removeAttribute(r):t.setAttribute(r,l)});const o=i.style||{};return Object.keys(o).forEach(r=>{t.style[r]=o[r]}),t.width=t.width,delete t[Gl],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const o=e.$proxies||(e.$proxies={}),l={attach:H3,detach:q3,resize:U3}[t]||W3;o[t]=l(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),o=i[t];if(!o)return;({attach:va,detach:va,resize:va}[t]||j3)(e,t,o),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,o){return Ew(e,t,i,o)}isAttached(e){const t=tc(e);return!!(t&&t.isConnected)}}function G3(n){return!Z0()||typeof OffscreenCanvas!="undefined"&&n instanceof OffscreenCanvas?L3:Y3}class $i{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 Ir(this.x)&&Ir(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const o={};return e.forEach(r=>{o[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),o}}$i.defaults={};$i.defaultRoutes=void 0;const u1={values(n){return Et(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let o,r=n;if(t.length>1){const f=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(f<1e-4||f>1e15)&&(o="scientific"),r=K3(n,t)}const l=zn(Math.abs(r)),s=Math.max(Math.min(-1*Math.floor(l),20),0),a={notation:o,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(a,this.options.ticks.format),Zr(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(zn(n)));return i===1||i===2||i===5?u1.numeric.call(this,n,e,t):""}};function K3(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 Ts={formatters:u1};mt.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:Ts.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});mt.route("scale.ticks","color","","color");mt.route("scale.grid","color","","borderColor");mt.route("scale.grid","borderColor","","borderColor");mt.route("scale.title","color","","color");mt.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});mt.describe("scales",{_fallback:"scale"});mt.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function J3(n,e){const t=n.options.ticks,i=t.maxTicksLimit||Z3(n),o=t.major.enabled?Q3(e):[],r=o.length,l=o[0],s=o[r-1],a=[];if(r>i)return eS(e,a,o,r/i),a;const f=X3(o,e,i);if(r>0){let c,u;const d=r>1?Math.round((s-l)/(r-1)):null;for(Dl(e,a,f,xt(d)?0:l-d,l),c=0,u=r-1;c<u;c++)Dl(e,a,f,o[c],o[c+1]);return Dl(e,a,f,s,xt(d)?e.length:s+d),a}return Dl(e,a,f),a}function Z3(n){const e=n.options.offset,t=n._tickSize(),i=n._length/t+(e?0:1),o=n._maxLength/t;return Math.floor(Math.min(i,o))}function X3(n,e,t){const i=tS(n),o=e.length/t;if(!i)return Math.max(o,1);const r=Ck(i);for(let l=0,s=r.length-1;l<s;l++){const a=r[l];if(a>o)return a}return Math.max(o,1)}function Q3(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function eS(n,e,t,i){let o=0,r=t[0],l;for(i=Math.ceil(i),l=0;l<n.length;l++)l===r&&(e.push(n[l]),o++,r=t[o*i])}function Dl(n,e,t,i,o){const r=ht(i,0),l=Math.min(ht(o,n.length),n.length);let s=0,a,f,c;for(t=Math.ceil(t),o&&(a=o-i,t=a/Math.floor(a/t)),c=r;c<0;)s++,c=Math.round(r+s*t);for(f=Math.max(r,0);f<l;f++)f===c&&(e.push(n[f]),s++,c=Math.round(r+s*t))}function tS(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 nS=n=>n==="left"?"right":n==="right"?"left":n,Cd=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function xd(n,e){const t=[],i=n.length/e,o=n.length;let r=0;for(;r<o;r+=i)t.push(n[Math.floor(r)]);return t}function iS(n,e,t){const i=n.ticks.length,o=Math.min(e,i-1),r=n._startPixel,l=n._endPixel,s=1e-6;let a=n.getPixelForTick(o),f;if(!(t&&(i===1?f=Math.max(a-r,l-a):e===0?f=(n.getPixelForTick(1)-a)/2:f=(a-n.getPixelForTick(o-1))/2,a+=o<e?f:-f,a<r-s||a>l+s)))return a}function oS(n,e){Ct(n,t=>{const i=t.gc,o=i.length/2;let r;if(o>e){for(r=0;r<o;++r)delete t.data[i[r]];i.splice(0,o)}})}function pr(n){return n.drawTicks?n.tickLength:0}function Md(n,e){if(!n.display)return 0;const t=Mn(n.font,e),i=Wn(n.padding);return(Et(n.text)?n.text.length:1)*t.lineHeight+i.height}function rS(n,e){return Wi(n,{scale:e,type:"scale"})}function lS(n,e,t){return Wi(n,{tick:t,index:e,type:"tick"})}function sS(n,e,t){let i=hk(n);return(t&&e!=="right"||!t&&e==="right")&&(i=nS(i)),i}function aS(n,e,t,i){const{top:o,left:r,bottom:l,right:s,chart:a}=n,{chartArea:f,scales:c}=a;let u=0,d,h,b;const v=l-o,_=s-r;if(n.isHorizontal()){if(h=ju(i,r,s),dt(t)){const y=Object.keys(t)[0],S=t[y];b=c[y].getPixelForValue(S)+v-e}else t==="center"?b=(f.bottom+f.top)/2+v-e:b=Cd(n,t,e);d=s-r}else{if(dt(t)){const y=Object.keys(t)[0],S=t[y];h=c[y].getPixelForValue(S)-_+e}else t==="center"?h=(f.left+f.right)/2-_+e:h=Cd(n,t,e);b=ju(i,l,o),u=t==="left"?-Nt:Nt}return{titleX:h,titleY:b,maxWidth:d,rotation:u}}class _o extends $i{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:o}=this;return e=Rn(e,Number.POSITIVE_INFINITY),t=Rn(t,Number.NEGATIVE_INFINITY),i=Rn(i,Number.POSITIVE_INFINITY),o=Rn(o,Number.NEGATIVE_INFINITY),{min:Rn(e,i),max:Rn(t,o),minDefined:Ht(e),maxDefined:Ht(t)}}getMinMax(e){let{min:t,max:i,minDefined:o,maxDefined:r}=this.getUserBounds(),l;if(o&&r)return{min:t,max:i};const s=this.getMatchingVisibleMetas();for(let a=0,f=s.length;a<f;++a)l=s[a].controller.getMinMax(this,e),o||(t=Math.min(t,l.min)),r||(i=Math.max(i,l.max));return t=r&&t>i?i:t,i=o&&t>i?t:i,{min:Rn(t,Rn(i,t)),max:Rn(i,Rn(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(){Rt(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:o,grace:r,ticks:l}=this.options,s=l.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=sw(this,r,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=s<this.ticks.length;this._convertTicksToLabels(a?xd(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),l.display&&(l.autoSkip||l.source==="auto")&&(this.ticks=J3(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(){Rt(this.options.afterUpdate,[this])}beforeSetDimensions(){Rt(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(){Rt(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Rt(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Rt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let i,o,r;for(i=0,o=e.length;i<o;i++)r=e[i],r.label=Rt(t.callback,[r.value,i,e],this)}afterTickToLabelConversion(){Rt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Rt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,i=this.ticks.length,o=t.minRotation||0,r=t.maxRotation;let l=o,s,a,f;if(!this._isVisible()||!t.display||o>=r||i<=1||!this.isHorizontal()){this.labelRotation=o;return}const c=this._getLabelSizes(),u=c.widest.width,d=c.highest.height,h=sn(this.chart.width-u,0,this.maxWidth);s=e.offset?this.maxWidth/i:h/(i-1),u+6>s&&(s=h/(i-(e.offset?.5:1)),a=this.maxHeight-pr(e.grid)-t.padding-Md(e.title,this.chart.options.font),f=Math.sqrt(u*u+d*d),l=Bf(Math.min(Math.asin(sn((c.highest.height+6)/s,-1,1)),Math.asin(sn(a/f,-1,1))-Math.asin(sn(d/f,-1,1)))),l=Math.max(o,Math.min(r,l))),this.labelRotation=l}afterCalculateLabelRotation(){Rt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Rt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:o,grid:r}}=this,l=this._isVisible(),s=this.isHorizontal();if(l){const a=Md(o,t.options.font);if(s?(e.width=this.maxWidth,e.height=pr(r)+a):(e.height=this.maxHeight,e.width=pr(r)+a),i.display&&this.ticks.length){const{first:f,last:c,widest:u,highest:d}=this._getLabelSizes(),h=i.padding*2,b=Xn(this.labelRotation),v=Math.cos(b),_=Math.sin(b);if(s){const y=i.mirror?0:_*u.width+v*d.height;e.height=Math.min(this.maxHeight,e.height+y+h)}else{const y=i.mirror?0:v*u.width+_*d.height;e.width=Math.min(this.maxWidth,e.width+y+h)}this._calculatePadding(f,c,_,v)}}this._handleMargins(),s?(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,o){const{ticks:{align:r,padding:l},position:s}=this.options,a=this.labelRotation!==0,f=s!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,h=0;a?f?(d=o*e.width,h=i*t.height):(d=i*e.height,h=o*t.width):r==="start"?h=t.width:r==="end"?d=e.width:r!=="inner"&&(d=e.width/2,h=t.width/2),this.paddingLeft=Math.max((d-c+l)*this.width/(this.width-c),0),this.paddingRight=Math.max((h-u+l)*this.width/(this.width-u),0)}else{let c=t.height/2,u=e.height/2;r==="start"?(c=0,u=e.height):r==="end"&&(c=t.height,u=0),this.paddingTop=c+l,this.paddingBottom=u+l}}_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(){Rt(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++)xt(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=xd(i,t)),this._labelSizes=e=this._computeLabelSizes(i,i.length)}return e}_computeLabelSizes(e,t){const{ctx:i,_longestTextCache:o}=this,r=[],l=[];let s=0,a=0,f,c,u,d,h,b,v,_,y,S,C;for(f=0;f<t;++f){if(d=e[f].label,h=this._resolveTickFontOptions(f),i.font=b=h.string,v=o[b]=o[b]||{data:{},gc:[]},_=h.lineHeight,y=S=0,!xt(d)&&!Et(d))y=cs(i,v.data,v.gc,y,d),S=_;else if(Et(d))for(c=0,u=d.length;c<u;++c)C=d[c],!xt(C)&&!Et(C)&&(y=cs(i,v.data,v.gc,y,C),S+=_);r.push(y),l.push(S),s=Math.max(y,s),a=Math.max(S,a)}oS(o,t);const x=r.indexOf(s),M=l.indexOf(a),A=O=>({width:r[O]||0,height:l[O]||0});return{first:A(0),last:A(t-1),widest:A(x),highest:A(M),widths:r,heights:l}}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 $k(this._alignToPixels?eo(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=lS(this.getContext(),e,i))}return this.$context||(this.$context=rS(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=Xn(this.labelRotation),i=Math.abs(Math.cos(t)),o=Math.abs(Math.sin(t)),r=this._getLabelSizes(),l=e.autoSkipPadding||0,s=r?r.widest.width+l:0,a=r?r.highest.height+l:0;return this.isHorizontal()?a*i>s*o?s/i:a/o:a*o<s*i?a/i:s/o}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,i=this.chart,o=this.options,{grid:r,position:l}=o,s=r.offset,a=this.isHorizontal(),c=this.ticks.length+(s?1:0),u=pr(r),d=[],h=r.setContext(this.getContext()),b=h.drawBorder?h.borderWidth:0,v=b/2,_=function(z){return eo(i,z,b)};let y,S,C,x,M,A,O,D,E,P,I,R;if(l==="top")y=_(this.bottom),A=this.bottom-u,D=y-v,P=_(e.top)+v,R=e.bottom;else if(l==="bottom")y=_(this.top),P=e.top,R=_(e.bottom)-v,A=y+v,D=this.top+u;else if(l==="left")y=_(this.right),M=this.right-u,O=y-v,E=_(e.left)+v,I=e.right;else if(l==="right")y=_(this.left),E=e.left,I=_(e.right)-v,M=y+v,O=this.left+u;else if(t==="x"){if(l==="center")y=_((e.top+e.bottom)/2+.5);else if(dt(l)){const z=Object.keys(l)[0],K=l[z];y=_(this.chart.scales[z].getPixelForValue(K))}P=e.top,R=e.bottom,A=y+v,D=A+u}else if(t==="y"){if(l==="center")y=_((e.left+e.right)/2);else if(dt(l)){const z=Object.keys(l)[0],K=l[z];y=_(this.chart.scales[z].getPixelForValue(K))}M=y-v,O=M-u,E=e.left,I=e.right}const G=ht(o.ticks.maxTicksLimit,c),U=Math.max(1,Math.ceil(c/G));for(S=0;S<c;S+=U){const z=r.setContext(this.getContext(S)),K=z.lineWidth,Y=z.color,W=r.borderDash||[],te=z.borderDashOffset,ce=z.tickWidth,ve=z.tickColor,oe=z.tickBorderDash||[],J=z.tickBorderDashOffset;C=iS(this,S,s),C!==void 0&&(x=eo(i,C,K),a?M=O=E=I=x:A=D=P=R=x,d.push({tx1:M,ty1:A,tx2:O,ty2:D,x1:E,y1:P,x2:I,y2:R,width:K,color:Y,borderDash:W,borderDashOffset:te,tickWidth:ce,tickColor:ve,tickBorderDash:oe,tickBorderDashOffset:J}))}return this._ticksLength=c,this._borderValue=y,d}_computeLabelItems(e){const t=this.axis,i=this.options,{position:o,ticks:r}=i,l=this.isHorizontal(),s=this.ticks,{align:a,crossAlign:f,padding:c,mirror:u}=r,d=pr(i.grid),h=d+c,b=u?-c:h,v=-Xn(this.labelRotation),_=[];let y,S,C,x,M,A,O,D,E,P,I,R,G="middle";if(o==="top")A=this.bottom-b,O=this._getXAxisLabelAlignment();else if(o==="bottom")A=this.top+b,O=this._getXAxisLabelAlignment();else if(o==="left"){const z=this._getYAxisLabelAlignment(d);O=z.textAlign,M=z.x}else if(o==="right"){const z=this._getYAxisLabelAlignment(d);O=z.textAlign,M=z.x}else if(t==="x"){if(o==="center")A=(e.top+e.bottom)/2+h;else if(dt(o)){const z=Object.keys(o)[0],K=o[z];A=this.chart.scales[z].getPixelForValue(K)+h}O=this._getXAxisLabelAlignment()}else if(t==="y"){if(o==="center")M=(e.left+e.right)/2-h;else if(dt(o)){const z=Object.keys(o)[0],K=o[z];M=this.chart.scales[z].getPixelForValue(K)}O=this._getYAxisLabelAlignment(d).textAlign}t==="y"&&(a==="start"?G="top":a==="end"&&(G="bottom"));const U=this._getLabelSizes();for(y=0,S=s.length;y<S;++y){C=s[y],x=C.label;const z=r.setContext(this.getContext(y));D=this.getPixelForTick(y)+r.labelOffset,E=this._resolveTickFontOptions(y),P=E.lineHeight,I=Et(x)?x.length:1;const K=I/2,Y=z.color,W=z.textStrokeColor,te=z.textStrokeWidth;let ce=O;l?(M=D,O==="inner"&&(y===S-1?ce=this.options.reverse?"left":"right":y===0?ce=this.options.reverse?"right":"left":ce="center"),o==="top"?f==="near"||v!==0?R=-I*P+P/2:f==="center"?R=-U.highest.height/2-K*P+P:R=-U.highest.height+P/2:f==="near"||v!==0?R=P/2:f==="center"?R=U.highest.height/2-K*P:R=U.highest.height-I*P,u&&(R*=-1)):(A=D,R=(1-I)*P/2);let ve;if(z.showLabelBackdrop){const oe=Wn(z.backdropPadding),J=U.heights[y],$e=U.widths[y];let ee=A+R-oe.top,_e=M-oe.left;switch(G){case"middle":ee-=J/2;break;case"bottom":ee-=J;break}switch(O){case"center":_e-=$e/2;break;case"right":_e-=$e;break}ve={left:_e,top:ee,width:$e+oe.width,height:J+oe.height,color:z.backdropColor}}_.push({rotation:v,label:x,font:E,color:Y,strokeColor:W,strokeWidth:te,textOffset:R,textAlign:ce,textBaseline:G,translation:[M,A],backdrop:ve})}return _}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Xn(this.labelRotation))return e==="top"?"left":"right";let o="center";return t.align==="start"?o="left":t.align==="end"?o="right":t.align==="inner"&&(o="inner"),o}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:o,padding:r}}=this.options,l=this._getLabelSizes(),s=e+r,a=l.widest.width;let f,c;return t==="left"?o?(c=this.right+r,i==="near"?f="left":i==="center"?(f="center",c+=a/2):(f="right",c+=a)):(c=this.right-s,i==="near"?f="right":i==="center"?(f="center",c-=a/2):(f="left",c=this.left)):t==="right"?o?(c=this.left+r,i==="near"?f="right":i==="center"?(f="center",c-=a/2):(f="left",c-=a)):(c=this.left+s,i==="near"?f="left":i==="center"?(f="center",c+=a/2):(f="right",c=this.right)):f="right",{textAlign:f,x:c}}_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:o,width:r,height:l}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,o,r,l),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const o=this.ticks.findIndex(r=>r.value===e);return o>=0?t.setContext(this.getContext(o)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let r,l;const s=(a,f,c)=>{!c.width||!c.color||(i.save(),i.lineWidth=c.width,i.strokeStyle=c.color,i.setLineDash(c.borderDash||[]),i.lineDashOffset=c.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(f.x,f.y),i.stroke(),i.restore())};if(t.display)for(r=0,l=o.length;r<l;++r){const a=o[r];t.drawOnChartArea&&s({x:a.x1,y:a.y1},{x:a.x2,y:a.y2},a),t.drawTicks&&s({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,o=i.setContext(this.getContext()),r=i.drawBorder?o.borderWidth:0;if(!r)return;const l=i.setContext(this.getContext(0)).lineWidth,s=this._borderValue;let a,f,c,u;this.isHorizontal()?(a=eo(e,this.left,r)-r/2,f=eo(e,this.right,l)+l/2,c=u=s):(c=eo(e,this.top,r)-r/2,u=eo(e,this.bottom,l)+l/2,a=f=s),t.save(),t.lineWidth=o.borderWidth,t.strokeStyle=o.borderColor,t.beginPath(),t.moveTo(a,c),t.lineTo(f,u),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,o=this._computeLabelArea();o&&Gf(i,o);const r=this._labelItems||(this._labelItems=this._computeLabelItems(e));let l,s;for(l=0,s=r.length;l<s;++l){const a=r[l],f=a.font,c=a.label;a.backdrop&&(i.fillStyle=a.backdrop.color,i.fillRect(a.backdrop.left,a.backdrop.top,a.backdrop.width,a.backdrop.height));let u=a.textOffset;us(i,c,0,u,f,a)}o&&Kf(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:o}}=this;if(!i.display)return;const r=Mn(i.font),l=Wn(i.padding),s=i.align;let a=r.lineHeight/2;t==="bottom"||t==="center"||dt(t)?(a+=l.bottom,Et(i.text)&&(a+=r.lineHeight*(i.text.length-1))):a+=l.top;const{titleX:f,titleY:c,maxWidth:u,rotation:d}=aS(this,a,t,s);us(e,i.text,0,0,r,{color:i.color,maxWidth:u,rotation:d,textAlign:sS(s,t,o),textBaseline:"middle",translation:[f,c]})}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=ht(e.grid&&e.grid.z,-1);return!this._isVisible()||this.draw!==_o.prototype.draw?[{z:t,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:t,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",o=[];let r,l;for(r=0,l=t.length;r<l;++r){const s=t[r];s[i]===this.id&&(!e||s.type===e)&&o.push(s)}return o}_resolveTickFontOptions(e){const t=this.options.ticks.setContext(this.getContext(e));return Mn(t.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class Ol{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;uS(t)&&(i=this.register(t));const o=this.items,r=e.id,l=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+e);return r in o||(o[r]=e,fS(e,l,i),this.override&&mt.override(e.id,e.overrides)),l}get(e){return this.items[e]}unregister(e){const t=this.items,i=e.id,o=this.scope;i in t&&delete t[i],o&&i in mt[o]&&(delete mt[o][i],this.override&&delete mo[i])}}function fS(n,e,t){const i=Lr(Object.create(null),[t?mt.get(t):{},mt.get(e),n.defaults]);mt.set(e,i),n.defaultRoutes&&cS(e,n.defaultRoutes),n.descriptors&&mt.describe(e,n.descriptors)}function cS(n,e){Object.keys(e).forEach(t=>{const i=t.split("."),o=i.pop(),r=[n].concat(i).join("."),l=e[t].split("."),s=l.pop(),a=l.join(".");mt.route(r,o,a,s)})}function uS(n){return"id"in n&&"defaults"in n}class dS{constructor(){this.controllers=new Ol(hi,"datasets",!0),this.elements=new Ol($i,"elements"),this.plugins=new Ol(Object,"plugins"),this.scales=new Ol(_o,"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(o=>{const r=i||this._getRegistryForType(o);i||r.isForType(o)||r===this.plugins&&o.id?this._exec(e,r,o):Ct(o,l=>{const s=i||this._getRegistryForType(l);this._exec(e,s,l)})})}_exec(e,t,i){const o=Vf(e);Rt(i["before"+o],[],i),t[e](i),Rt(i["after"+o],[],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 o=t.get(e);if(o===void 0)throw new Error('"'+e+'" is not a registered '+i+".");return o}}var wi=new dS;class pS{constructor(){this._init=[]}notify(e,t,i,o){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const r=o?this._descriptors(e).filter(o):this._descriptors(e),l=this._notify(r,e,t,i);return t==="afterDestroy"&&(this._notify(r,e,"stop"),this._notify(this._init,e,"uninstall")),l}_notify(e,t,i,o){o=o||{};for(const r of e){const l=r.plugin,s=l[i],a=[t,o,r.options];if(Rt(s,a,l)===!1&&o.cancelable)return!1}return!0}invalidate(){xt(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,o=ht(i.options&&i.options.plugins,{}),r=hS(i);return o===!1&&!t?[]:bS(e,r,o,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,o=(r,l)=>r.filter(s=>!l.some(a=>s.plugin.id===a.plugin.id));this._notify(o(t,i),e,"stop"),this._notify(o(i,t),e,"start")}}function hS(n){const e=[],t=Object.keys(wi.plugins.items);for(let o=0;o<t.length;o++)e.push(wi.getPlugin(t[o]));const i=n.plugins||[];for(let o=0;o<i.length;o++){const r=i[o];e.indexOf(r)===-1&&e.push(r)}return e}function mS(n,e){return!e&&n===!1?null:n===!0?{}:n}function bS(n,e,t,i){const o=[],r=n.getContext();for(let l=0;l<e.length;l++){const s=e[l],a=s.id,f=mS(t[a],i);f!==null&&o.push({plugin:s,options:gS(n.config,s,f,r)})}return o}function gS(n,e,t,i){const o=n.pluginScopeKeys(e),r=n.getOptionScopes(t,o);return n.createResolver(r,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function rf(n,e){const t=mt.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function _S(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function vS(n,e){return n===e?"_index_":"_value_"}function yS(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function lf(n,e){return n==="x"||n==="y"?n:e.axis||yS(e.position)||n.charAt(0).toLowerCase()}function kS(n,e){const t=mo[n.type]||{scales:{}},i=e.scales||{},o=rf(n.type,e),r=Object.create(null),l=Object.create(null);return Object.keys(i).forEach(s=>{const a=i[s];if(!dt(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const f=lf(s,a),c=vS(f,o),u=t.scales||{};r[f]=r[f]||s,l[s]=Mr(Object.create(null),[{axis:f},a,u[f],u[c]])}),n.data.datasets.forEach(s=>{const a=s.type||n.type,f=s.indexAxis||rf(a,e),u=(mo[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=_S(d,f),b=s[h+"AxisID"]||r[h]||h;l[b]=l[b]||Object.create(null),Mr(l[b],[{axis:h},i[b],u[d]])})}),Object.keys(l).forEach(s=>{const a=l[s];Mr(a,[mt.scales[a.type],mt.scale])}),l}function d1(n){const e=n.options||(n.options={});e.plugins=ht(e.plugins,{}),e.scales=kS(n,e)}function p1(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function wS(n){return n=n||{},n.data=p1(n.data),d1(n),n}const $d=new Map,h1=new Set;function Tl(n,e){let t=$d.get(n);return t||(t=e(),$d.set(n,t),h1.add(t)),t}const hr=(n,e,t)=>{const i=qi(e,t);i!==void 0&&n.add(i)};class SS{constructor(e){this._config=wS(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=p1(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(),d1(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Tl(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Tl(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Tl(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Tl(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let o=i.get(e);return(!o||t)&&(o=new Map,i.set(e,o)),o}getOptionScopes(e,t,i){const{options:o,type:r}=this,l=this._cachedScopes(e,i),s=l.get(t);if(s)return s;const a=new Set;t.forEach(c=>{e&&(a.add(e),c.forEach(u=>hr(a,e,u))),c.forEach(u=>hr(a,o,u)),c.forEach(u=>hr(a,mo[r]||{},u)),c.forEach(u=>hr(a,mt,u)),c.forEach(u=>hr(a,tf,u))});const f=Array.from(a);return f.length===0&&f.push(Object.create(null)),h1.has(t)&&l.set(t,f),f}chartOptionScopes(){const{options:e,type:t}=this;return[e,mo[t]||{},mt.datasets[t]||{},{type:t},mt,tf]}resolveNamedOptions(e,t,i,o=[""]){const r={$shared:!0},{resolver:l,subPrefixes:s}=Ad(this._resolverCache,e,o);let a=l;if(xS(l,t)){r.$shared=!1,i=Vi(i)?i():i;const f=this.createResolver(e,i,s);a=Wo(l,i,f)}for(const f of t)r[f]=a[f];return r}createResolver(e,t,i=[""],o){const{resolver:r}=Ad(this._resolverCache,e,i);return dt(t)?Wo(r,t,void 0,o):r}}function Ad(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const o=t.join();let r=i.get(o);return r||(r={resolver:Xf(e,t),subPrefixes:t.filter(s=>!s.toLowerCase().includes("hover"))},i.set(o,r)),r}const CS=n=>dt(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||Vi(n[t]),!1);function xS(n,e){const{isScriptable:t,isIndexable:i}=U0(n);for(const o of e){const r=t(o),l=i(o),s=(l||r)&&n[o];if(r&&(Vi(s)||CS(s))||l&&Et(s))return!0}return!1}var MS="3.8.0";const $S=["top","bottom","left","right","chartArea"];function Dd(n,e){return n==="top"||n==="bottom"||$S.indexOf(n)===-1&&e==="x"}function Od(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Td(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Rt(t&&t.onComplete,[n],e)}function AS(n){const e=n.chart,t=e.options.animation;Rt(t&&t.onProgress,[n],e)}function m1(n){return Z0()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const ms={},b1=n=>{const e=m1(n);return Object.values(ms).filter(t=>t.canvas===e).pop()};function DS(n,e,t){const i=Object.keys(n);for(const o of i){const r=+o;if(r>=e){const l=n[o];delete n[o],(t>0||r>e)&&(n[r+t]=l)}}}function OS(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class bs{constructor(e,t){const i=this.config=new SS(t),o=m1(e),r=b1(o);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas can be reused.");const l=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||G3(o)),this.platform.updateConfig(i);const s=this.platform.acquireContext(o,l.aspectRatio),a=s&&s.canvas,f=a&&a.height,c=a&&a.width;if(this.id=mk(),this.ctx=s,this.canvas=a,this.width=c,this.height=f,this._options=l,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 pS,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=pk(u=>this.update(u),l.resizeDelay||0),this._dataChanges=[],ms[this.id]=this,!s||!a){console.error("Failed to create chart: can't acquire context from the given item");return}bi.listen(this,"complete",Td),bi.listen(this,"progress",AS),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:o,_aspectRatio:r}=this;return xt(e)?t&&r?r:o?i/o: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():nd(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Xu(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,o=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,l=this.platform.getMaximumSize(o,e,t,r),s=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=l.width,this.height=l.height,this._aspectRatio=this.aspectRatio,nd(this,s,!0)&&(this.notifyPlugins("resize",{size:l}),Rt(i.onResize,[this,l],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};Ct(t,(i,o)=>{i.id=o})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,o=Object.keys(i).reduce((l,s)=>(l[s]=!1,l),{});let r=[];t&&(r=r.concat(Object.keys(t).map(l=>{const s=t[l],a=lf(l,s),f=a==="r",c=a==="x";return{options:s,dposition:f?"chartArea":c?"bottom":"left",dtype:f?"radialLinear":c?"category":"linear"}}))),Ct(r,l=>{const s=l.options,a=s.id,f=lf(a,s),c=ht(s.type,l.dtype);(s.position===void 0||Dd(s.position,f)!==Dd(l.dposition))&&(s.position=l.dposition),o[a]=!0;let u=null;if(a in i&&i[a].type===c)u=i[a];else{const d=wi.getScale(c);u=new d({id:a,type:c,ctx:this.ctx,chart:this}),i[u.id]=u}u.init(s,e)}),Ct(o,(l,s)=>{l||delete i[s]}),Ct(i,l=>{Al.configure(this,l,l.options),Al.addBox(this,l)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((o,r)=>o.index-r.index),i>t){for(let o=t;o<i;++o)this._destroyDatasetMeta(o);e.splice(t,i-t)}this._sortedMetasets=e.slice(0).sort(Od("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((i,o)=>{t.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,o;for(this._removeUnreferencedMetasets(),i=0,o=t.length;i<o;i++){const r=t[i];let l=this.getDatasetMeta(i);const s=r.type||this.config.type;if(l.type&&l.type!==s&&(this._destroyDatasetMeta(i),l=this.getDatasetMeta(i)),l.type=s,l.indexAxis=r.indexAxis||rf(s,this.options),l.order=r.order||0,l.index=i,l.label=""+r.label,l.visible=this.isDatasetVisible(i),l.controller)l.controller.updateIndex(i),l.controller.linkScales();else{const a=wi.getController(s),{datasetElementType:f,dataElementType:c}=mt.datasets[s];Object.assign(a.prototype,{dataElementType:wi.getElement(c),datasetElementType:f&&wi.getElement(f)}),l.controller=new a(this,i),e.push(l.controller)}}return this._updateMetasets(),e}_resetElements(){Ct(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()),o=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let l=0;for(let f=0,c=this.data.datasets.length;f<c;f++){const{controller:u}=this.getDatasetMeta(f),d=!o&&r.indexOf(u)===-1;u.buildOrUpdateElements(d),l=Math.max(+u.getMaxOverflow(),l)}l=this._minPadding=i.layout.autoPadding?l:0,this._updateLayout(l),o||Ct(r,f=>{f.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Od("z","_idx"));const{_active:s,_lastEvent:a}=this;a?this._eventHandler(a,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){Ct(this.scales,e=>{Al.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!Hu(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:o,count:r}of t){const l=i==="_removeElements"?-r:r;DS(e,o,l)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=r=>new Set(e.filter(l=>l[0]===r).map((l,s)=>s+","+l.splice(1).join(","))),o=i(0);for(let r=1;r<t;r++)if(!Hu(o,i(r)))return;return Array.from(o).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Al.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],Ct(this.boxes,o=>{i&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,r)=>{o._idx=r}),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,Vi(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const i=this.getDatasetMeta(e),o={meta:i,index:e,mode:t,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(i.controller._update(t),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(bi.has(this)?this.attached&&!bi.running(this)&&bi.start(this):(this.draw(),Td({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:i,height:o}=this._resizeBeforeDraw;this._resize(i,o),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 o,r;for(o=0,r=t.length;o<r;++o){const l=t[o];(!e||l.visible)&&i.push(l)}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,o=!i.disabled,r=this.chartArea,l={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",l)!==!1&&(o&&Gf(t,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),e.controller.draw(),o&&Kf(t),l.cancelable=!1,this.notifyPlugins("afterDatasetDraw",l))}isPointInArea(e){return jr(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,o){const r=$3.modes[t];return typeof r=="function"?r(this,e,i,o):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let o=i.filter(r=>r&&r._dataset===t).pop();return o||(o={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(o)),o}getContext(){return this.$context||(this.$context=Wi(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 o=i?"show":"hide",r=this.getDatasetMeta(e),l=r.controller._resolveAnimations(void 0,o);Un(t)?(r.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),l.update(r,{visible:i}),this.update(s=>s.datasetIndex===e?o: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(),Xu(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete ms[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=(r,l)=>{t.addEventListener(this,r,l),e[r]=l},o=(r,l,s)=>{r.offsetX=l,r.offsetY=s,this._eventHandler(r)};Ct(this.options.events,r=>i(r,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,f)=>{t.addEventListener(this,a,f),e[a]=f},o=(a,f)=>{e[a]&&(t.removeEventListener(this,a,f),delete e[a])},r=(a,f)=>{this.canvas&&this.resize(a,f)};let l;const s=()=>{o("attach",s),this.attached=!0,this.resize(),i("resize",r),i("detach",l)};l=()=>{this.attached=!1,o("resize",r),this._stop(),this._resize(0,0),i("attach",s)},t.isAttached(this.canvas)?s():l()}unbindEvents(){Ct(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},Ct(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const o=i?"set":"remove";let r,l,s,a;for(t==="dataset"&&(r=this.getDatasetMeta(e[0].datasetIndex),r.controller["_"+o+"DatasetHoverStyle"]()),s=0,a=e.length;s<a;++s){l=e[s];const f=l&&this.getDatasetMeta(l.datasetIndex).controller;f&&f[o+"HoverStyle"](l.element,l.datasetIndex,l.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],i=e.map(({datasetIndex:r,index:l})=>{const s=this.getDatasetMeta(r);if(!s)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:s.data[l],index:l}});!ls(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 o=this.options.hover,r=(a,f)=>a.filter(c=>!f.some(u=>c.datasetIndex===u.datasetIndex&&c.index===u.index)),l=r(t,e),s=i?e:r(e,t);l.length&&this.updateHoverStyle(l,o.mode,!1),s.length&&o.mode&&this.updateHoverStyle(s,o.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},o=l=>(l.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,o)===!1)return;const r=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,o),(r||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:o=[],options:r}=this,l=t,s=this._getActiveElements(e,o,i,l),a=kk(e),f=OS(e,this._lastEvent,i,a);i&&(this._lastEvent=null,Rt(r.onHover,[e,s,this],this),a&&Rt(r.onClick,[e,s,this],this));const c=!ls(s,o);return(c||t)&&(this._active=s,this._updateHoverStyles(s,o,t)),this._lastEvent=f,c}_getActiveElements(e,t,i,o){if(e.type==="mouseout")return[];if(!i)return t;const r=this.options.hover;return this.getElementsAtEventForMode(e,r.mode,r,o)}}const Ed=()=>Ct(bs.instances,n=>n._plugins.invalidate()),Oi=!0;Object.defineProperties(bs,{defaults:{enumerable:Oi,value:mt},instances:{enumerable:Oi,value:ms},overrides:{enumerable:Oi,value:mo},registry:{enumerable:Oi,value:wi},version:{enumerable:Oi,value:MS},getChart:{enumerable:Oi,value:b1},register:{enumerable:Oi,value:(...n)=>{wi.add(...n),Ed()}},unregister:{enumerable:Oi,value:(...n)=>{wi.remove(...n),Ed()}}});function g1(n,e,t){const{startAngle:i,pixelMargin:o,x:r,y:l,outerRadius:s,innerRadius:a}=e;let f=o/s;n.beginPath(),n.arc(r,l,s,i-f,t+f),a>o?(f=o/a,n.arc(r,l,a,t+f,i-f,!0)):n.arc(r,l,o,t+Nt,i-Nt),n.closePath(),n.clip()}function TS(n){return Jf(n,["outerStart","outerEnd","innerStart","innerEnd"])}function ES(n,e,t,i){const o=TS(n.options.borderRadius),r=(t-e)/2,l=Math.min(r,i*e/2),s=a=>{const f=(t-Math.min(r,a))*i/2;return sn(a,0,Math.min(r,f))};return{outerStart:s(o.outerStart),outerEnd:s(o.outerEnd),innerStart:sn(o.innerStart,0,l),innerEnd:sn(o.innerEnd,0,l)}}function To(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function sf(n,e,t,i,o){const{x:r,y:l,startAngle:s,pixelMargin:a,innerRadius:f}=e,c=Math.max(e.outerRadius+i+t-a,0),u=f>0?f+i+t+a:0;let d=0;const h=o-s;if(i){const K=f>0?f-i:0,Y=c>0?c-i:0,W=(K+Y)/2,te=W!==0?h*W/(W+i):h;d=(h-te)/2}const b=Math.max(.001,h*c-t/jt)/c,v=(h-b)/2,_=s+v+d,y=o-v-d,{outerStart:S,outerEnd:C,innerStart:x,innerEnd:M}=ES(e,u,c,y-_),A=c-S,O=c-C,D=_+S/A,E=y-C/O,P=u+x,I=u+M,R=_+x/P,G=y-M/I;if(n.beginPath(),n.arc(r,l,c,D,E),C>0){const K=To(O,E,r,l);n.arc(K.x,K.y,C,E,y+Nt)}const U=To(I,y,r,l);if(n.lineTo(U.x,U.y),M>0){const K=To(I,G,r,l);n.arc(K.x,K.y,M,y+Nt,G+Math.PI)}if(n.arc(r,l,u,y-M/u,_+x/u,!0),x>0){const K=To(P,R,r,l);n.arc(K.x,K.y,x,R+Math.PI,_-Nt)}const z=To(A,_,r,l);if(n.lineTo(z.x,z.y),S>0){const K=To(A,D,r,l);n.arc(K.x,K.y,S,_-Nt,D)}n.closePath()}function PS(n,e,t,i){const{fullCircles:o,startAngle:r,circumference:l}=e;let s=e.endAngle;if(o){sf(n,e,t,i,r+Tt);for(let a=0;a<o;++a)n.fill();isNaN(l)||(s=r+l%Tt,l%Tt===0&&(s+=Tt))}return sf(n,e,t,i,s),n.fill(),s}function FS(n,e,t){const{x:i,y:o,startAngle:r,pixelMargin:l,fullCircles:s}=e,a=Math.max(e.outerRadius-l,0),f=e.innerRadius+l;let c;for(t&&g1(n,e,r+Tt),n.beginPath(),n.arc(i,o,f,r+Tt,r,!0),c=0;c<s;++c)n.stroke();for(n.beginPath(),n.arc(i,o,a,r,r+Tt),c=0;c<s;++c)n.stroke()}function LS(n,e,t,i,o){const{options:r}=e,{borderWidth:l,borderJoinStyle:s}=r,a=r.borderAlign==="inner";!l||(a?(n.lineWidth=l*2,n.lineJoin=s||"round"):(n.lineWidth=l,n.lineJoin=s||"bevel"),e.fullCircles&&FS(n,e,a),a&&g1(n,e,o),sf(n,e,t,i,o),n.stroke())}class sc extends $i{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 o=this.getProps(["x","y"],i),{angle:r,distance:l}=I0(o,{x:e,y:t}),{startAngle:s,endAngle:a,innerRadius:f,outerRadius:c,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,b=ht(u,a-s)>=Tt||Rr(r,s,a),v=Nr(l,f+d,c+d);return b&&v}getCenterPoint(e){const{x:t,y:i,startAngle:o,endAngle:r,innerRadius:l,outerRadius:s}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:a,spacing:f}=this.options,c=(o+r)/2,u=(l+s+f+a)/2;return{x:t+Math.cos(c)*u,y:i+Math.sin(c)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:i}=this,o=(t.offset||0)/2,r=(t.spacing||0)/2;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>Tt?Math.floor(i/Tt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let l=0;if(o){l=o/2;const a=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(a)*l,Math.sin(a)*l),this.circumference>=jt&&(l=o)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const s=PS(e,this,l,r);LS(e,this,l,r,s),e.restore()}}sc.id="arc";sc.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0};sc.defaultRoutes={backgroundColor:"backgroundColor"};function _1(n,e,t=e){n.lineCap=ht(t.borderCapStyle,e.borderCapStyle),n.setLineDash(ht(t.borderDash,e.borderDash)),n.lineDashOffset=ht(t.borderDashOffset,e.borderDashOffset),n.lineJoin=ht(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=ht(t.borderWidth,e.borderWidth),n.strokeStyle=ht(t.borderColor,e.borderColor)}function IS(n,e,t){n.lineTo(t.x,t.y)}function RS(n){return n.stepped?Qk:n.tension||n.cubicInterpolationMode==="monotone"?ew:IS}function v1(n,e,t={}){const i=n.length,{start:o=0,end:r=i-1}=t,{start:l,end:s}=e,a=Math.max(o,l),f=Math.min(r,s),c=o<l&&r<l||o>s&&r>s;return{count:i,start:a,loop:e.loop,ilen:f<a&&!c?i+f-a:f-a}}function NS(n,e,t,i){const{points:o,options:r}=e,{count:l,start:s,loop:a,ilen:f}=v1(o,t,i),c=RS(r);let{move:u=!0,reverse:d}=i||{},h,b,v;for(h=0;h<=f;++h)b=o[(s+(d?f-h:h))%l],!b.skip&&(u?(n.moveTo(b.x,b.y),u=!1):c(n,v,b,d,r.stepped),v=b);return a&&(b=o[(s+(d?f:0))%l],c(n,v,b,d,r.stepped)),!!a}function jS(n,e,t,i){const o=e.points,{count:r,start:l,ilen:s}=v1(o,t,i),{move:a=!0,reverse:f}=i||{};let c=0,u=0,d,h,b,v,_,y;const S=x=>(l+(f?s-x:x))%r,C=()=>{v!==_&&(n.lineTo(c,_),n.lineTo(c,v),n.lineTo(c,y))};for(a&&(h=o[S(0)],n.moveTo(h.x,h.y)),d=0;d<=s;++d){if(h=o[S(d)],h.skip)continue;const x=h.x,M=h.y,A=x|0;A===b?(M<v?v=M:M>_&&(_=M),c=(u*c+x)/++u):(C(),n.lineTo(x,M),b=A,u=0,v=_=M),y=M}C()}function af(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?jS:NS}function zS(n){return n.stepped?Fw:n.tension||n.cubicInterpolationMode==="monotone"?Lw:ro}function HS(n,e,t,i){let o=e._path;o||(o=e._path=new Path2D,e.path(o,t,i)&&o.closePath()),_1(n,e.options),n.stroke(o)}function qS(n,e,t,i){const{segments:o,options:r}=e,l=af(e);for(const s of o)_1(n,r,s.style),n.beginPath(),l(n,e,s,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const VS=typeof Path2D=="function";function BS(n,e,t,i){VS&&!e.options.segment?HS(n,e,t,i):qS(n,e,t,i)}class Yi extends $i{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 o=i.spanGaps?this._loop:this._fullLoop;Mw(this._points,i,e,o,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=Bw(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,o=e[t],r=this.points,l=e1(this,{property:t,start:o,end:o});if(!l.length)return;const s=[],a=zS(i);let f,c;for(f=0,c=l.length;f<c;++f){const{start:u,end:d}=l[f],h=r[u],b=r[d];if(h===b){s.push(h);continue}const v=Math.abs((o-h[t])/(b[t]-h[t])),_=a(h,b,v,i.stepped);_[t]=e[t],s.push(_)}return s.length===1?s[0]:s}pathSegment(e,t,i){return af(this)(e,this,t,i)}path(e,t,i){const o=this.segments,r=af(this);let l=this._loop;t=t||0,i=i||this.points.length-t;for(const s of o)l&=r(e,this,s,{start:t,end:t+i-1});return!!l}draw(e,t,i,o){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(e.save(),BS(e,this,i,o),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Yi.id="line";Yi.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};Yi.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};Yi.descriptors={_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"};function Pd(n,e,t,i){const o=n.options,{[t]:r}=n.getProps([t],i);return Math.abs(e-r)<o.radius+o.hitRadius}class Es extends $i{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 o=this.options,{x:r,y:l}=this.getProps(["x","y"],i);return Math.pow(e-r,2)+Math.pow(t-l,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,t){return Pd(this,e,"x",t)}inYRange(e,t){return Pd(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||!jr(this,t,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,nf(e,i,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}Es.id="point";Es.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};Es.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function y1(n,e){const{x:t,y:i,base:o,width:r,height:l}=n.getProps(["x","y","base","width","height"],e);let s,a,f,c,u;return n.horizontal?(u=l/2,s=Math.min(t,o),a=Math.max(t,o),f=i-u,c=i+u):(u=r/2,s=t-u,a=t+u,f=Math.min(i,o),c=Math.max(i,o)),{left:s,top:f,right:a,bottom:c}}function ji(n,e,t,i){return n?0:sn(e,t,i)}function US(n,e,t){const i=n.options.borderWidth,o=n.borderSkipped,r=q0(i);return{t:ji(o.top,r.top,0,t),r:ji(o.right,r.right,0,e),b:ji(o.bottom,r.bottom,0,t),l:ji(o.left,r.left,0,e)}}function WS(n,e,t){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),o=n.options.borderRadius,r=jo(o),l=Math.min(e,t),s=n.borderSkipped,a=i||dt(o);return{topLeft:ji(!a||s.top||s.left,r.topLeft,0,l),topRight:ji(!a||s.top||s.right,r.topRight,0,l),bottomLeft:ji(!a||s.bottom||s.left,r.bottomLeft,0,l),bottomRight:ji(!a||s.bottom||s.right,r.bottomRight,0,l)}}function YS(n){const e=y1(n),t=e.right-e.left,i=e.bottom-e.top,o=US(n,t/2,i/2),r=WS(n,t/2,i/2);return{outer:{x:e.left,y:e.top,w:t,h:i,radius:r},inner:{x:e.left+o.l,y:e.top+o.t,w:t-o.l-o.r,h:i-o.t-o.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,r.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(o.b,o.r))}}}}function ya(n,e,t,i){const o=e===null,r=t===null,s=n&&!(o&&r)&&y1(n,i);return s&&(o||Nr(e,s.left,s.right))&&(r||Nr(t,s.top,s.bottom))}function GS(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function KS(n,e){n.rect(e.x,e.y,e.w,e.h)}function ka(n,e,t={}){const i=n.x!==t.x?-e:0,o=n.y!==t.y?-e:0,r=(n.x+n.w!==t.x+t.w?e:0)-i,l=(n.y+n.h!==t.y+t.h?e:0)-o;return{x:n.x+i,y:n.y+o,w:n.w+r,h:n.h+l,radius:n.radius}}class ac extends $i{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:o}}=this,{inner:r,outer:l}=YS(this),s=GS(l.radius)?ds:KS;e.save(),(l.w!==r.w||l.h!==r.h)&&(e.beginPath(),s(e,ka(l,t,r)),e.clip(),s(e,ka(r,-t,l)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),s(e,ka(r,t)),e.fillStyle=o,e.fill(),e.restore()}inRange(e,t,i){return ya(this,e,t,i)}inXRange(e,t){return ya(this,e,null,t)}inYRange(e,t){return ya(this,null,e,t)}getCenterPoint(e){const{x:t,y:i,base:o,horizontal:r}=this.getProps(["x","y","base","horizontal"],e);return{x:r?(t+o)/2:t,y:r?i:(i+o)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}ac.id="bar";ac.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};ac.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function JS(n,e,t){const i=n.segments,o=n.points,r=e.points,l=[];for(const s of i){let{start:a,end:f}=s;f=fc(a,f,o);const c=ff(t,o[a],o[f],s.loop);if(!e.segments){l.push({source:s,target:c,start:o[a],end:o[f]});continue}const u=e1(e,c);for(const d of u){const h=ff(t,r[d.start],r[d.end],d.loop),b=Q0(s,o,h);for(const v of b)l.push({source:v,target:d,start:{[t]:Fd(c,h,"start",Math.max)},end:{[t]:Fd(c,h,"end",Math.min)}})}}return l}function ff(n,e,t,i){if(i)return;let o=e[n],r=t[n];return n==="angle"&&(o=Cn(o),r=Cn(r)),{property:n,start:o,end:r}}function ZS(n,e){const{x:t=null,y:i=null}=n||{},o=e.points,r=[];return e.segments.forEach(({start:l,end:s})=>{s=fc(l,s,o);const a=o[l],f=o[s];i!==null?(r.push({x:a.x,y:i}),r.push({x:f.x,y:i})):t!==null&&(r.push({x:t,y:a.y}),r.push({x:t,y:f.y}))}),r}function fc(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Fd(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function k1(n,e){let t=[],i=!1;return Et(n)?(i=!0,t=n):t=ZS(n,e),t.length?new Yi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function XS(n,e,t){let o=n[e].fill;const r=[e];let l;if(!t)return o;for(;o!==!1&&r.indexOf(o)===-1;){if(!Ht(o))return o;if(l=n[o],!l)return!1;if(l.visible)return o;r.push(o),o=l.fill}return!1}function QS(n,e,t){const i=i4(n);if(dt(i))return isNaN(i.value)?!1:i;let o=parseFloat(i);return Ht(o)&&Math.floor(o)===o?e4(i[0],e,o,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function e4(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function t4(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:dt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function n4(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:dt(n)?i=n.value:i=e.getBaseValue(),i}function i4(n){const e=n.options,t=e.fill;let i=ht(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function o4(n){const{scale:e,index:t,line:i}=n,o=[],r=i.segments,l=i.points,s=r4(e,t);s.push(k1({x:null,y:e.bottom},i));for(let a=0;a<r.length;a++){const f=r[a];for(let c=f.start;c<=f.end;c++)l4(o,l[c],s)}return new Yi({points:o,options:{}})}function r4(n,e){const t=[],i=n.getMatchingVisibleMetas("line");for(let o=0;o<i.length;o++){const r=i[o];if(r.index===e)break;r.hidden||t.unshift(r.dataset)}return t}function l4(n,e,t){const i=[];for(let o=0;o<t.length;o++){const r=t[o],{first:l,last:s,point:a}=s4(r,e,"x");if(!(!a||l&&s)){if(l)i.unshift(a);else if(n.push(a),!s)break}}n.push(...i)}function s4(n,e,t){const i=n.interpolate(e,t);if(!i)return{};const o=i[t],r=n.segments,l=n.points;let s=!1,a=!1;for(let f=0;f<r.length;f++){const c=r[f],u=l[c.start][t],d=l[c.end][t];if(Nr(o,u,d)){s=o===u,a=o===d;break}}return{first:s,last:a,point:i}}class w1{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,i){const{x:o,y:r,radius:l}=this;return t=t||{start:0,end:Tt},e.arc(o,r,l,t.end,t.start,!0),!i.bounds}interpolate(e){const{x:t,y:i,radius:o}=this,r=e.angle;return{x:t+Math.cos(r)*o,y:i+Math.sin(r)*o,angle:r}}}function a4(n){const{chart:e,fill:t,line:i}=n;if(Ht(t))return f4(e,t);if(t==="stack")return o4(n);if(t==="shape")return!0;const o=c4(n);return o instanceof w1?o:k1(o,i)}function f4(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function c4(n){return(n.scale||{}).getPointPositionForValue?d4(n):u4(n)}function u4(n){const{scale:e={},fill:t}=n,i=t4(t,e);if(Ht(i)){const o=e.isHorizontal();return{x:o?i:null,y:o?null:i}}return null}function d4(n){const{scale:e,fill:t}=n,i=e.options,o=e.getLabels().length,r=i.reverse?e.max:e.min,l=n4(t,e,r),s=[];if(i.grid.circular){const a=e.getPointPositionForValue(0,r);return new w1({x:a.x,y:a.y,radius:e.getDistanceFromCenterForValue(l)})}for(let a=0;a<o;++a)s.push(e.getPointPositionForValue(a,l));return s}function wa(n,e,t){const i=a4(e),{line:o,scale:r,axis:l}=e,s=o.options,a=s.fill,f=s.backgroundColor,{above:c=f,below:u=f}=a||{};i&&o.points.length&&(Gf(n,t),p4(n,{line:o,target:i,above:c,below:u,area:t,scale:r,axis:l}),Kf(n))}function p4(n,e){const{line:t,target:i,above:o,below:r,area:l,scale:s}=e,a=t._loop?"angle":e.axis;n.save(),a==="x"&&r!==o&&(Ld(n,i,l.top),Id(n,{line:t,target:i,color:o,scale:s,property:a}),n.restore(),n.save(),Ld(n,i,l.bottom)),Id(n,{line:t,target:i,color:r,scale:s,property:a}),n.restore()}function Ld(n,e,t){const{segments:i,points:o}=e;let r=!0,l=!1;n.beginPath();for(const s of i){const{start:a,end:f}=s,c=o[a],u=o[fc(a,f,o)];r?(n.moveTo(c.x,c.y),r=!1):(n.lineTo(c.x,t),n.lineTo(c.x,c.y)),l=!!e.pathSegment(n,s,{move:l}),l?n.closePath():n.lineTo(u.x,t)}n.lineTo(e.first().x,t),n.closePath(),n.clip()}function Id(n,e){const{line:t,target:i,property:o,color:r,scale:l}=e,s=JS(t,i,o);for(const{source:a,target:f,start:c,end:u}of s){const{style:{backgroundColor:d=r}={}}=a,h=i!==!0;n.save(),n.fillStyle=d,h4(n,l,h&&ff(o,c,u)),n.beginPath();const b=!!t.pathSegment(n,a);let v;if(h){b?n.closePath():Rd(n,i,u,o);const _=!!i.pathSegment(n,f,{move:b,reverse:!0});v=b&&_,v||Rd(n,i,c,o)}n.closePath(),n.fill(v?"evenodd":"nonzero"),n.restore()}}function h4(n,e,t){const{top:i,bottom:o}=e.chart.chartArea,{property:r,start:l,end:s}=t||{};r==="x"&&(n.beginPath(),n.rect(l,i,s-l,o-i),n.clip())}function Rd(n,e,t,i){const o=e.interpolate(t,i);o&&n.lineTo(o.x,o.y)}var m4={id:"filler",afterDatasetsUpdate(n,e,t){const i=(n.data.datasets||[]).length,o=[];let r,l,s,a;for(l=0;l<i;++l)r=n.getDatasetMeta(l),s=r.dataset,a=null,s&&s.options&&s instanceof Yi&&(a={visible:n.isDatasetVisible(l),index:l,fill:QS(s,l,i),chart:n,axis:r.controller.options.indexAxis,scale:r.vScale,line:s}),r.$filler=a,o.push(a);for(l=0;l<i;++l)a=o[l],!(!a||a.fill===!1)&&(a.fill=XS(o,l,t.propagate))},beforeDraw(n,e,t){const i=t.drawTime==="beforeDraw",o=n.getSortedVisibleDatasetMetas(),r=n.chartArea;for(let l=o.length-1;l>=0;--l){const s=o[l].$filler;!s||(s.line.updateControlPoints(r,s.axis),i&&wa(n.ctx,s,r))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let o=i.length-1;o>=0;--o){const r=i[o].$filler;r&&wa(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!i||i.fill===!1||t.drawTime!=="beforeDatasetDraw"||wa(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Or={average(n){if(!n.length)return!1;let e,t,i=0,o=0,r=0;for(e=0,t=n.length;e<t;++e){const l=n[e].element;if(l&&l.hasValue()){const s=l.tooltipPosition();i+=s.x,o+=s.y,++r}}return{x:i/r,y:o/r}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,o=Number.POSITIVE_INFINITY,r,l,s;for(r=0,l=n.length;r<l;++r){const a=n[r].element;if(a&&a.hasValue()){const f=a.getCenterPoint(),c=Qa(e,f);c<o&&(o=c,s=a)}}if(s){const a=s.tooltipPosition();t=a.x,i=a.y}return{x:t,y:i}}};function oi(n,e){return e&&(Et(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function gi(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
`)>-1?n.split(`
`):n}function b4(n,e){const{element:t,datasetIndex:i,index:o}=e,r=n.getDatasetMeta(i).controller,{label:l,value:s}=r.getLabelAndValue(o);return{chart:n,label:l,parsed:r.getParsed(o),raw:n.data.datasets[i].data[o],formattedValue:s,dataset:r.getDataset(),dataIndex:o,datasetIndex:i,element:t}}function Nd(n,e){const t=n.chart.ctx,{body:i,footer:o,title:r}=n,{boxWidth:l,boxHeight:s}=e,a=Mn(e.bodyFont),f=Mn(e.titleFont),c=Mn(e.footerFont),u=r.length,d=o.length,h=i.length,b=Wn(e.padding);let v=b.height,_=0,y=i.reduce((x,M)=>x+M.before.length+M.lines.length+M.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,u&&(v+=u*f.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),y){const x=e.displayColors?Math.max(s,a.lineHeight):a.lineHeight;v+=h*x+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*c.lineHeight+(d-1)*e.footerSpacing);let S=0;const C=function(x){_=Math.max(_,t.measureText(x).width+S)};return t.save(),t.font=f.string,Ct(n.title,C),t.font=a.string,Ct(n.beforeBody.concat(n.afterBody),C),S=e.displayColors?l+2+e.boxPadding:0,Ct(i,x=>{Ct(x.before,C),Ct(x.lines,C),Ct(x.after,C)}),S=0,t.font=c.string,Ct(n.footer,C),t.restore(),_+=b.width,{width:_,height:v}}function g4(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function _4(n,e,t,i){const{x:o,width:r}=i,l=t.caretSize+t.caretPadding;if(n==="left"&&o+r+l>e.width||n==="right"&&o-r-l<0)return!0}function v4(n,e,t,i){const{x:o,width:r}=t,{width:l,chartArea:{left:s,right:a}}=n;let f="center";return i==="center"?f=o<=(s+a)/2?"left":"right":o<=r/2?f="left":o>=l-r/2&&(f="right"),_4(f,n,e,t)&&(f="center"),f}function jd(n,e,t){const i=t.yAlign||e.yAlign||g4(n,t);return{xAlign:t.xAlign||e.xAlign||v4(n,e,t,i),yAlign:i}}function y4(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function k4(n,e,t){let{y:i,height:o}=n;return e==="top"?i+=t:e==="bottom"?i-=o+t:i-=o/2,i}function zd(n,e,t,i){const{caretSize:o,caretPadding:r,cornerRadius:l}=n,{xAlign:s,yAlign:a}=t,f=o+r,{topLeft:c,topRight:u,bottomLeft:d,bottomRight:h}=jo(l);let b=y4(e,s);const v=k4(e,a,f);return a==="center"?s==="left"?b+=f:s==="right"&&(b-=f):s==="left"?b-=Math.max(c,d)+o:s==="right"&&(b+=Math.max(u,h)+o),{x:sn(b,0,i.width-e.width),y:sn(v,0,i.height-e.height)}}function El(n,e,t){const i=Wn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Hd(n){return oi([],gi(n))}function w4(n,e,t){return Wi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function qd(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class cf extends $i{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()),o=i.enabled&&t.options.animation&&i.animations,r=new t1(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=w4(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,o=i.beforeTitle.apply(this,[e]),r=i.title.apply(this,[e]),l=i.afterTitle.apply(this,[e]);let s=[];return s=oi(s,gi(o)),s=oi(s,gi(r)),s=oi(s,gi(l)),s}getBeforeBody(e,t){return Hd(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,o=[];return Ct(e,r=>{const l={before:[],lines:[],after:[]},s=qd(i,r);oi(l.before,gi(s.beforeLabel.call(this,r))),oi(l.lines,s.label.call(this,r)),oi(l.after,gi(s.afterLabel.call(this,r))),o.push(l)}),o}getAfterBody(e,t){return Hd(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){const{callbacks:i}=t,o=i.beforeFooter.apply(this,[e]),r=i.footer.apply(this,[e]),l=i.afterFooter.apply(this,[e]);let s=[];return s=oi(s,gi(o)),s=oi(s,gi(r)),s=oi(s,gi(l)),s}_createItems(e){const t=this._active,i=this.chart.data,o=[],r=[],l=[];let s=[],a,f;for(a=0,f=t.length;a<f;++a)s.push(b4(this.chart,t[a]));return e.filter&&(s=s.filter((c,u,d)=>e.filter(c,u,d,i))),e.itemSort&&(s=s.sort((c,u)=>e.itemSort(c,u,i))),Ct(s,c=>{const u=qd(e.callbacks,c);o.push(u.labelColor.call(this,c)),r.push(u.labelPointStyle.call(this,c)),l.push(u.labelTextColor.call(this,c))}),this.labelColors=o,this.labelPointStyles=r,this.labelTextColors=l,this.dataPoints=s,s}update(e,t){const i=this.options.setContext(this.getContext()),o=this._active;let r,l=[];if(!o.length)this.opacity!==0&&(r={opacity:0});else{const s=Or[i.position].call(this,o,this._eventPosition);l=this._createItems(i),this.title=this.getTitle(l,i),this.beforeBody=this.getBeforeBody(l,i),this.body=this.getBody(l,i),this.afterBody=this.getAfterBody(l,i),this.footer=this.getFooter(l,i);const a=this._size=Nd(this,i),f=Object.assign({},s,a),c=jd(this.chart,i,f),u=zd(i,f,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,r={opacity:1,x:u.x,y:u.y,width:a.width,height:a.height,caretX:s.x,caretY:s.y}}this._tooltipItems=l,this.$context=void 0,r&&this._resolveAnimations().update(this,r),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,o){const r=this.getCaretPosition(e,i,o);t.lineTo(r.x1,r.y1),t.lineTo(r.x2,r.y2),t.lineTo(r.x3,r.y3)}getCaretPosition(e,t,i){const{xAlign:o,yAlign:r}=this,{caretSize:l,cornerRadius:s}=i,{topLeft:a,topRight:f,bottomLeft:c,bottomRight:u}=jo(s),{x:d,y:h}=e,{width:b,height:v}=t;let _,y,S,C,x,M;return r==="center"?(x=h+v/2,o==="left"?(_=d,y=_-l,C=x+l,M=x-l):(_=d+b,y=_+l,C=x-l,M=x+l),S=_):(o==="left"?y=d+Math.max(a,c)+l:o==="right"?y=d+b-Math.max(f,u)-l:y=this.caretX,r==="top"?(C=h,x=C-l,_=y-l,S=y+l):(C=h+v,x=C+l,_=y+l,S=y-l),M=C),{x1:_,x2:y,x3:S,y1:C,y2:x,y3:M}}drawTitle(e,t,i){const o=this.title,r=o.length;let l,s,a;if(r){const f=pa(i.rtl,this.x,this.width);for(e.x=El(this,i.titleAlign,i),t.textAlign=f.textAlign(i.titleAlign),t.textBaseline="middle",l=Mn(i.titleFont),s=i.titleSpacing,t.fillStyle=i.titleColor,t.font=l.string,a=0;a<r;++a)t.fillText(o[a],f.x(e.x),e.y+l.lineHeight/2),e.y+=l.lineHeight+s,a+1===r&&(e.y+=i.titleMarginBottom-s)}}_drawColorBox(e,t,i,o,r){const l=this.labelColors[i],s=this.labelPointStyles[i],{boxHeight:a,boxWidth:f,boxPadding:c}=r,u=Mn(r.bodyFont),d=El(this,"left",r),h=o.x(d),b=a<u.lineHeight?(u.lineHeight-a)/2:0,v=t.y+b;if(r.usePointStyle){const _={radius:Math.min(f,a)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},y=o.leftForLtr(h,f)+f/2,S=v+a/2;e.strokeStyle=r.multiKeyBackground,e.fillStyle=r.multiKeyBackground,nf(e,_,y,S),e.strokeStyle=l.borderColor,e.fillStyle=l.backgroundColor,nf(e,_,y,S)}else{e.lineWidth=l.borderWidth||1,e.strokeStyle=l.borderColor,e.setLineDash(l.borderDash||[]),e.lineDashOffset=l.borderDashOffset||0;const _=o.leftForLtr(h,f-c),y=o.leftForLtr(o.xPlus(h,1),f-c-2),S=jo(l.borderRadius);Object.values(S).some(C=>C!==0)?(e.beginPath(),e.fillStyle=r.multiKeyBackground,ds(e,{x:_,y:v,w:f,h:a,radius:S}),e.fill(),e.stroke(),e.fillStyle=l.backgroundColor,e.beginPath(),ds(e,{x:y,y:v+1,w:f-2,h:a-2,radius:S}),e.fill()):(e.fillStyle=r.multiKeyBackground,e.fillRect(_,v,f,a),e.strokeRect(_,v,f,a),e.fillStyle=l.backgroundColor,e.fillRect(y,v+1,f-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:o}=this,{bodySpacing:r,bodyAlign:l,displayColors:s,boxHeight:a,boxWidth:f,boxPadding:c}=i,u=Mn(i.bodyFont);let d=u.lineHeight,h=0;const b=pa(i.rtl,this.x,this.width),v=function(D){t.fillText(D,b.x(e.x+h),e.y+d/2),e.y+=d+r},_=b.textAlign(l);let y,S,C,x,M,A,O;for(t.textAlign=l,t.textBaseline="middle",t.font=u.string,e.x=El(this,_,i),t.fillStyle=i.bodyColor,Ct(this.beforeBody,v),h=s&&_!=="right"?l==="center"?f/2+c:f+2+c:0,x=0,A=o.length;x<A;++x){for(y=o[x],S=this.labelTextColors[x],t.fillStyle=S,Ct(y.before,v),C=y.lines,s&&C.length&&(this._drawColorBox(t,e,x,b,i),d=Math.max(u.lineHeight,a)),M=0,O=C.length;M<O;++M)v(C[M]),d=u.lineHeight;Ct(y.after,v)}h=0,d=u.lineHeight,Ct(this.afterBody,v),e.y-=r}drawFooter(e,t,i){const o=this.footer,r=o.length;let l,s;if(r){const a=pa(i.rtl,this.x,this.width);for(e.x=El(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=a.textAlign(i.footerAlign),t.textBaseline="middle",l=Mn(i.footerFont),t.fillStyle=i.footerColor,t.font=l.string,s=0;s<r;++s)t.fillText(o[s],a.x(e.x),e.y+l.lineHeight/2),e.y+=l.lineHeight+i.footerSpacing}}drawBackground(e,t,i,o){const{xAlign:r,yAlign:l}=this,{x:s,y:a}=e,{width:f,height:c}=i,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:b}=jo(o.cornerRadius);t.fillStyle=o.backgroundColor,t.strokeStyle=o.borderColor,t.lineWidth=o.borderWidth,t.beginPath(),t.moveTo(s+u,a),l==="top"&&this.drawCaret(e,t,i,o),t.lineTo(s+f-d,a),t.quadraticCurveTo(s+f,a,s+f,a+d),l==="center"&&r==="right"&&this.drawCaret(e,t,i,o),t.lineTo(s+f,a+c-b),t.quadraticCurveTo(s+f,a+c,s+f-b,a+c),l==="bottom"&&this.drawCaret(e,t,i,o),t.lineTo(s+h,a+c),t.quadraticCurveTo(s,a+c,s,a+c-h),l==="center"&&r==="left"&&this.drawCaret(e,t,i,o),t.lineTo(s,a+u),t.quadraticCurveTo(s,a,s+u,a),t.closePath(),t.fill(),o.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,o=i&&i.x,r=i&&i.y;if(o||r){const l=Or[e.position].call(this,this._active,this._eventPosition);if(!l)return;const s=this._size=Nd(this,e),a=Object.assign({},l,this._size),f=jd(t,e,a),c=zd(e,a,f,t);(o._to!==c.x||r._to!==c.y)&&(this.xAlign=f.xAlign,this.yAlign=f.yAlign,this.width=s.width,this.height=s.height,this.caretX=l.x,this.caretY=l.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const o={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const l=Wn(t.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&s&&(e.save(),e.globalAlpha=i,this.drawBackground(r,e,o,t),jw(e,t.textDirection),r.y+=l.top,this.drawTitle(r,e,t),this.drawBody(r,e,t),this.drawFooter(r,e,t),zw(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,o=e.map(({datasetIndex:s,index:a})=>{const f=this.chart.getDatasetMeta(s);if(!f)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:f.data[a],index:a}}),r=!ls(i,o),l=this._positionChanged(o,t);(r||l)&&(this._active=o,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const o=this.options,r=this._active||[],l=this._getActiveElements(e,r,t,i),s=this._positionChanged(l,e),a=t||!ls(l,r)||s;return a&&(this._active=l,(o.enabled||o.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,o){const r=this.options;if(e.type==="mouseout")return[];if(!o)return t;const l=this.chart.getElementsAtEventForMode(e,r.mode,r,i);return r.reverse&&l.reverse(),l}_positionChanged(e,t){const{caretX:i,caretY:o,options:r}=this,l=Or[r.position].call(this,e,t);return l!==!1&&(i!==l.x||o!==l.y)}}cf.positioners=Or;var S4={id:"tooltip",_element:cf,positioners:Or,afterInit(n,e,t){t&&(n.tooltip=new cf({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:mi,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:mi,beforeBody:mi,beforeLabel:mi,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 xt(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:mi,afterBody:mi,beforeFooter:mi,footer:mi,afterFooter:mi}},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 C4=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function x4(n,e,t,i){const o=n.indexOf(e);if(o===-1)return C4(n,e,t,i);const r=n.lastIndexOf(e);return o!==r?t:o}const M4=(n,e)=>n===null?null:sn(Math.round(n),0,e);class uf extends _o{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:o,label:r}of t)i[o]===r&&i.splice(o,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(xt(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:x4(i,e,ht(t,e),this._addedLabels),M4(t,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(o=this.getLabels().length-1)),this.min=i,this.max=o}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,o=[];let r=this.getLabels();r=e===0&&t===r.length-1?r:r.slice(e,t+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let l=e;l<=t;l++)o.push({value:l});return o}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}}uf.id="category";uf.defaults={ticks:{callback:uf.prototype.getLabelForValue}};function $4(n,e){const t=[],{bounds:o,step:r,min:l,max:s,precision:a,count:f,maxTicks:c,maxDigits:u,includeBounds:d}=n,h=r||1,b=c-1,{min:v,max:_}=e,y=!xt(l),S=!xt(s),C=!xt(f),x=(_-v)/(u+1);let M=Vu((_-v)/b/h)*h,A,O,D,E;if(M<1e-14&&!y&&!S)return[{value:v},{value:_}];E=Math.ceil(_/M)-Math.floor(v/M),E>b&&(M=Vu(E*M/b/h)*h),xt(a)||(A=Math.pow(10,a),M=Math.ceil(M*A)/A),o==="ticks"?(O=Math.floor(v/M)*M,D=Math.ceil(_/M)*M):(O=v,D=_),y&&S&&r&&xk((s-l)/r,M/1e3)?(E=Math.round(Math.min((s-l)/M,c)),M=(s-l)/E,O=l,D=s):C?(O=y?l:O,D=S?s:D,E=f-1,M=(D-O)/E):(E=(D-O)/M,$r(E,Math.round(E),M/1e3)?E=Math.round(E):E=Math.ceil(E));const P=Math.max(Bu(M),Bu(O));A=Math.pow(10,xt(a)?P:a),O=Math.round(O*A)/A,D=Math.round(D*A)/A;let I=0;for(y&&(d&&O!==l?(t.push({value:l}),O<l&&I++,$r(Math.round((O+I*M)*A)/A,l,Vd(l,x,n))&&I++):O<l&&I++);I<E;++I)t.push({value:Math.round((O+I*M)*A)/A});return S&&d&&D!==s?t.length&&$r(t[t.length-1].value,s,Vd(s,x,n))?t[t.length-1].value=s:t.push({value:s}):(!S||D===s)&&t.push({value:D}),t}function Vd(n,e,{horizontal:t,minRotation:i}){const o=Xn(i),r=(t?Math.sin(o):Math.cos(o))||.001,l=.75*e*(""+n).length;return Math.min(e/r,l)}class gs extends _o{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 xt(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:o,max:r}=this;const l=a=>o=t?o:a,s=a=>r=i?r:a;if(e){const a=ai(o),f=ai(r);a<0&&f<0?s(0):a>0&&f>0&&l(0)}if(o===r){let a=1;(r>=Number.MAX_SAFE_INTEGER||o<=Number.MIN_SAFE_INTEGER)&&(a=Math.abs(r*.05)),s(r+a),e||l(o-a)}this.min=o,this.max=r}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,o;return i?(o=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,o>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${o} ticks. Limiting to 1000.`),o=1e3)):(o=this.computeTickLimit(),t=t||11),t&&(o=Math.min(t,o)),o}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const o={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},r=this._range||this,l=$4(o,r);return e.bounds==="ticks"&&L0(l,this,"value"),e.reverse?(l.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),l}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const o=(i-t)/Math.max(e.length-1,1)/2;t-=o,i+=o}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return Zr(e,this.chart.options.locale,this.options.ticks.format)}}class cc extends gs{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Ht(e)?e:0,this.max=Ht(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Xn(this.options.ticks.minRotation),o=(e?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,r.lineHeight/o))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}cc.id="linear";cc.defaults={ticks:{callback:Ts.formatters.numeric}};function Bd(n){return n/Math.pow(10,Math.floor(zn(n)))===1}function A4(n,e){const t=Math.floor(zn(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),o=[];let r=Rn(n.min,Math.pow(10,Math.floor(zn(e.min)))),l=Math.floor(zn(r)),s=Math.floor(r/Math.pow(10,l)),a=l<0?Math.pow(10,Math.abs(l)):1;do o.push({value:r,major:Bd(r)}),++s,s===10&&(s=1,++l,a=l>=0?1:a),r=Math.round(s*Math.pow(10,l)*a)/a;while(l<t||l===t&&s<i);const f=Rn(n.max,r);return o.push({value:f,major:Bd(r)}),o}class S1 extends _o{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=gs.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return Ht(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Ht(e)?Math.max(0,e):null,this.max=Ht(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,o=this.max;const r=a=>i=e?i:a,l=a=>o=t?o:a,s=(a,f)=>Math.pow(10,Math.floor(zn(a))+f);i===o&&(i<=0?(r(1),l(10)):(r(s(i,-1)),l(s(o,1)))),i<=0&&r(s(o,-1)),o<=0&&l(s(i,1)),this._zero&&this.min!==this._suggestedMin&&i===s(this.min,0)&&r(s(i,-1)),this.min=i,this.max=o}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=A4(t,this);return e.bounds==="ticks"&&L0(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":Zr(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=zn(e),this._valueRange=zn(this.max)-zn(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(zn(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}S1.id="logarithmic";S1.defaults={ticks:{callback:Ts.formatters.logarithmic,major:{enabled:!0}}};function df(n){const e=n.ticks;if(e.display&&n.display){const t=Wn(e.backdropPadding);return ht(e.font&&e.font.size,mt.font.size)+t.height}return 0}function D4(n,e,t){return t=Et(t)?t:[t],{w:Xk(n,e.string,t),h:t.length*e.lineHeight}}function Ud(n,e,t,i,o){return n===i||n===o?{start:e-t/2,end:e+t/2}:n<i||n>o?{start:e-t,end:e}:{start:e,end:e+t}}function O4(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=[],o=[],r=n._pointLabels.length,l=n.options.pointLabels,s=l.centerPointLabels?jt/r:0;for(let a=0;a<r;a++){const f=l.setContext(n.getPointLabelContext(a));o[a]=f.padding;const c=n.getPointPosition(a,n.drawingArea+o[a],s),u=Mn(f.font),d=D4(n.ctx,u,n._pointLabels[a]);i[a]=d;const h=Cn(n.getIndexAngle(a)+s),b=Math.round(Bf(h)),v=Ud(b,c.x,d.w,0,180),_=Ud(b,c.y,d.h,90,270);T4(t,e,h,v,_)}n.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),n._pointLabelItems=E4(n,i,o)}function T4(n,e,t,i,o){const r=Math.abs(Math.sin(t)),l=Math.abs(Math.cos(t));let s=0,a=0;i.start<e.l?(s=(e.l-i.start)/r,n.l=Math.min(n.l,e.l-s)):i.end>e.r&&(s=(i.end-e.r)/r,n.r=Math.max(n.r,e.r+s)),o.start<e.t?(a=(e.t-o.start)/l,n.t=Math.min(n.t,e.t-a)):o.end>e.b&&(a=(o.end-e.b)/l,n.b=Math.max(n.b,e.b+a))}function E4(n,e,t){const i=[],o=n._pointLabels.length,r=n.options,l=df(r)/2,s=n.drawingArea,a=r.pointLabels.centerPointLabels?jt/o:0;for(let f=0;f<o;f++){const c=n.getPointPosition(f,s+l+t[f],a),u=Math.round(Bf(Cn(c.angle+Nt))),d=e[f],h=L4(c.y,d.h,u),b=P4(u),v=F4(c.x,d.w,b);i.push({x:c.x,y:h,textAlign:b,left:v,top:h,right:v+d.w,bottom:h+d.h})}return i}function P4(n){return n===0||n===180?"center":n<180?"left":"right"}function F4(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function L4(n,e,t){return t===90||t===270?n-=e/2:(t>270||t<90)&&(n-=e),n}function I4(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let o=e-1;o>=0;o--){const r=i.setContext(n.getPointLabelContext(o)),l=Mn(r.font),{x:s,y:a,textAlign:f,left:c,top:u,right:d,bottom:h}=n._pointLabelItems[o],{backdropColor:b}=r;if(!xt(b)){const v=jo(r.borderRadius),_=Wn(r.backdropPadding);t.fillStyle=b;const y=c-_.left,S=u-_.top,C=d-c+_.width,x=h-u+_.height;Object.values(v).some(M=>M!==0)?(t.beginPath(),ds(t,{x:y,y:S,w:C,h:x,radius:v}),t.fill()):t.fillRect(y,S,C,x)}us(t,n._pointLabels[o],s,a+l.lineHeight/2,l,{color:r.color,textAlign:f,textBaseline:"middle"})}}function C1(n,e,t,i){const{ctx:o}=n;if(t)o.arc(n.xCenter,n.yCenter,e,0,Tt);else{let r=n.getPointPosition(0,e);o.moveTo(r.x,r.y);for(let l=1;l<i;l++)r=n.getPointPosition(l,e),o.lineTo(r.x,r.y)}}function R4(n,e,t,i){const o=n.ctx,r=e.circular,{color:l,lineWidth:s}=e;!r&&!i||!l||!s||t<0||(o.save(),o.strokeStyle=l,o.lineWidth=s,o.setLineDash(e.borderDash),o.lineDashOffset=e.borderDashOffset,o.beginPath(),C1(n,t,r,i),o.closePath(),o.stroke(),o.restore())}function N4(n,e,t){return Wi(n,{label:t,index:e,type:"pointLabel"})}class Ps extends gs{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=Wn(df(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=Ht(e)&&!isNaN(e)?e:0,this.max=Ht(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/df(this.options))}generateTickLabels(e){gs.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,i)=>{const o=Rt(this.options.pointLabels.callback,[t,i],this);return o||o===0?o:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?O4(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,o){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-o)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,o))}getIndexAngle(e){const t=Tt/(this._pointLabels.length||1),i=this.options.startAngle||0;return Cn(e*t+Xn(i))}getDistanceFromCenterForValue(e){if(xt(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(xt(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 N4(this.getContext(),e,i)}}getPointPosition(e,t,i=0){const o=this.getIndexAngle(e)-Nt+i;return{x:Math.cos(o)*t+this.xCenter,y:Math.sin(o)*t+this.yCenter,angle:o}}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:o,bottom:r}=this._pointLabelItems[e];return{left:t,top:i,right:o,bottom:r}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const i=this.ctx;i.save(),i.beginPath(),C1(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:o}=t,r=this._pointLabels.length;let l,s,a;if(t.pointLabels.display&&I4(this,r),o.display&&this.ticks.forEach((f,c)=>{if(c!==0){s=this.getDistanceFromCenterForValue(f.value);const u=o.setContext(this.getContext(c-1));R4(this,u,s,r)}}),i.display){for(e.save(),l=r-1;l>=0;l--){const f=i.setContext(this.getPointLabelContext(l)),{color:c,lineWidth:u}=f;!u||!c||(e.lineWidth=u,e.strokeStyle=c,e.setLineDash(f.borderDash),e.lineDashOffset=f.borderDashOffset,s=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),a=this.getPointPosition(l,s),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 o=this.getIndexAngle(0);let r,l;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(o),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((s,a)=>{if(a===0&&!t.reverse)return;const f=i.setContext(this.getContext(a)),c=Mn(f.font);if(r=this.getDistanceFromCenterForValue(this.ticks[a].value),f.showLabelBackdrop){e.font=c.string,l=e.measureText(s.label).width,e.fillStyle=f.backdropColor;const u=Wn(f.backdropPadding);e.fillRect(-l/2-u.left,-r-c.size/2-u.top,l+u.width,c.size+u.height)}us(e,s.label,0,-r,c,{color:f.color})}),e.restore()}drawTitle(){}}Ps.id="radialLinear";Ps.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ts.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};Ps.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Ps.descriptors={angleLines:{_fallback:"grid"}};const Fs={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}},_n=Object.keys(Fs);function j4(n,e){return n-e}function Wd(n,e){if(xt(e))return null;const t=n._adapter,{parser:i,round:o,isoWeekday:r}=n._parseOpts;let l=e;return typeof i=="function"&&(l=i(l)),Ht(l)||(l=typeof i=="string"?t.parse(l,i):t.parse(l)),l===null?null:(o&&(l=o==="week"&&(Ir(r)||r===!0)?t.startOf(l,"isoWeek",r):t.startOf(l,o)),+l)}function Yd(n,e,t,i){const o=_n.length;for(let r=_n.indexOf(n);r<o-1;++r){const l=Fs[_n[r]],s=l.steps?l.steps:Number.MAX_SAFE_INTEGER;if(l.common&&Math.ceil((t-e)/(s*l.size))<=i)return _n[r]}return _n[o-1]}function z4(n,e,t,i,o){for(let r=_n.length-1;r>=_n.indexOf(t);r--){const l=_n[r];if(Fs[l].common&&n._adapter.diff(o,i,l)>=e-1)return l}return _n[t?_n.indexOf(t):0]}function H4(n){for(let e=_n.indexOf(n)+1,t=_n.length;e<t;++e)if(Fs[_n[e]].common)return _n[e]}function Gd(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:o}=Zf(t,e),r=t[i]>=e?t[i]:t[o];n[r]=!0}}function q4(n,e,t,i){const o=n._adapter,r=+o.startOf(e[0].value,i),l=e[e.length-1].value;let s,a;for(s=r;s<=l;s=+o.add(s,1,i))a=t[s],a>=0&&(e[a].major=!0);return e}function Kd(n,e,t){const i=[],o={},r=e.length;let l,s;for(l=0;l<r;++l)s=e[l],o[s]=l,i.push({value:s,major:!1});return r===0||!t?i:q4(n,i,o,t)}class tl extends _o{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={}),o=this._adapter=new r1._date(e.adapters.date);Mr(i.displayFormats,o.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:Wd(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:o,max:r,minDefined:l,maxDefined:s}=this.getUserBounds();function a(f){!l&&!isNaN(f.min)&&(o=Math.min(o,f.min)),!s&&!isNaN(f.max)&&(r=Math.max(r,f.max))}(!l||!s)&&(a(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&a(this.getMinMax(!1))),o=Ht(o)&&!isNaN(o)?o:+t.startOf(Date.now(),i),r=Ht(r)&&!isNaN(r)?r:+t.endOf(Date.now(),i)+1,this.min=Math.min(o,r-1),this.max=Math.max(o+1,r)}_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,o=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);const r=this.min,l=this.max,s=fw(o,r,l);return this._unit=t.unit||(i.autoSkip?Yd(t.minUnit,this.min,this.max,this._getLabelCapacity(r)):z4(this,s.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:H4(this._unit),this.initOffsets(o),e.reverse&&s.reverse(),Kd(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e){let t=0,i=0,o,r;this.options.offset&&e.length&&(o=this.getDecimalForValue(e[0]),e.length===1?t=1-o:t=(this.getDecimalForValue(e[1])-o)/2,r=this.getDecimalForValue(e[e.length-1]),e.length===1?i=r:i=(r-this.getDecimalForValue(e[e.length-2]))/2);const l=e.length<3?.5:.25;t=sn(t,0,l),i=sn(i,0,l),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,o=this.options,r=o.time,l=r.unit||Yd(r.minUnit,t,i,this._getLabelCapacity(t)),s=ht(r.stepSize,1),a=l==="week"?r.isoWeekday:!1,f=Ir(a)||a===!0,c={};let u=t,d,h;if(f&&(u=+e.startOf(u,"isoWeek",a)),u=+e.startOf(u,f?"day":l),e.diff(i,t,l)>1e5*s)throw new Error(t+" and "+i+" are too far apart with stepSize of "+s+" "+l);const b=o.ticks.source==="data"&&this.getDataTimestamps();for(d=u,h=0;d<i;d=+e.add(d,s,l),h++)Gd(c,d,b);return(d===i||o.bounds==="ticks"||h===1)&&Gd(c,d,b),Object.keys(c).sort((v,_)=>v-_).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,o){const r=this.options,l=r.time.displayFormats,s=this._unit,a=this._majorUnit,f=s&&l[s],c=a&&l[a],u=i[t],d=a&&c&&u&&u.major,h=this._adapter.format(e,o||(d?c:f)),b=r.ticks.callback;return b?Rt(b,[h,t,i],this):h}generateTickLabels(e){let t,i,o;for(t=0,i=e.length;t<i;++t)o=e[t],o.label=this._tickFormatFunction(o.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,o=Xn(this.isHorizontal()?t.maxRotation:t.minRotation),r=Math.cos(o),l=Math.sin(o),s=this._resolveTickFontOptions(0).size;return{w:i*r+s*l,h:i*l+s*r}}_getLabelCapacity(e){const t=this.options.time,i=t.displayFormats,o=i[t.unit]||i.millisecond,r=this._tickFormatFunction(e,0,Kd(this,[e],this._majorUnit),o),l=this._getLabelSize(r),s=Math.floor(this.isHorizontal()?this.width/l.w:this.height/l.h)-1;return s>0?s:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(t=0,i=o.length;t<i;++t)e=e.concat(o[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 o=this.getLabels();for(t=0,i=o.length;t<i;++t)e.push(Wd(this,o[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return B0(e.sort(j4))}}tl.id="time";tl.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};function Pl(n,e,t){let i=0,o=n.length-1,r,l,s,a;t?(e>=n[i].pos&&e<=n[o].pos&&({lo:i,hi:o}=ao(n,"pos",e)),{pos:r,time:s}=n[i],{pos:l,time:a}=n[o]):(e>=n[i].time&&e<=n[o].time&&({lo:i,hi:o}=ao(n,"time",e)),{time:r,pos:s}=n[i],{time:l,pos:a}=n[o]);const f=l-r;return f?s+(a-s)*(e-r)/f:s}class x1 extends tl{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=Pl(t,this.min),this._tableRange=Pl(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,o=[],r=[];let l,s,a,f,c;for(l=0,s=e.length;l<s;++l)f=e[l],f>=t&&f<=i&&o.push(f);if(o.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(l=0,s=o.length;l<s;++l)c=o[l+1],a=o[l-1],f=o[l],Math.round((c+a)/2)!==f&&r.push({time:f,pos:l/(s-1)});return r}_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(Pl(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return Pl(this._table,i*this._tableRange+this._minPos,!0)}}x1.id="timeseries";x1.defaults=tl.defaults;/*!
* chartjs-adapter-luxon v1.1.0
* https://www.chartjs.org
* (c) 2021 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const V4={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"}};r1._date.override({_id:"luxon",_create:function(n){return Qe.fromMillis(n,this.options)},formats:function(){return V4},parse:function(n,e){const t=this.options;if(n===null||typeof n=="undefined")return null;const i=typeof n;return 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)),n.isValid?n.valueOf():null},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e,this.options):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 Jd(n){let e,t,i;return{c(){e=g("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(o,r){w(o,e,r),i=!0},i(o){i||(Dt(()=>{t||(t=ct(e,Bn,{duration:150},!0)),t.run(1)}),i=!0)},o(o){t||(t=ct(e,Bn,{duration:150},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end()}}}function B4(n){let e,t,i=n[1]===1?"log":"logs",o;return{c(){e=j(n[1]),t=$(),o=j(i)},m(r,l){w(r,e,l),w(r,t,l),w(r,o,l)},p(r,l){l&2&&ge(e,r[1]),l&2&&i!==(i=r[1]===1?"log":"logs")&&ge(o,i)},d(r){r&&k(e),r&&k(t),r&&k(o)}}}function U4(n){let e;return{c(){e=j("Loading...")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function W4(n){let e,t,i,o,r,l,s=n[2]&&Jd();function a(u,d){return u[2]?U4:B4}let f=a(n),c=f(n);return{c(){e=g("div"),s&&s.c(),t=$(),i=g("canvas"),o=$(),r=g("div"),c.c(),p(i,"class","chart-canvas svelte-vh4sl8"),_c(i,"height","250px"),_c(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),ne(e,"loading",n[2]),p(r,"class","txt-hint m-t-xs txt-right")},m(u,d){w(u,e,d),s&&s.m(e,null),m(e,t),m(e,i),n[8](i),w(u,o,d),w(u,r,d),c.m(r,null),l=!0},p(u,[d]){u[2]?s?d&4&&T(s,1):(s=Jd(),s.c(),T(s,1),s.m(e,t)):s&&(Ae(),F(s,1,1,()=>{s=null}),De()),d&4&&ne(e,"loading",u[2]),f===(f=a(u))&&c?c.p(u,d):(c.d(1),c=f(u),c&&(c.c(),c.m(r,null)))},i(u){l||(T(s),l=!0)},o(u){F(s),l=!1},d(u){u&&k(e),s&&s.d(),n[8](null),u&&k(o),u&&k(r),c.d()}}}function Y4(n,e,t){let{filter:i=""}=e,{presets:o=""}=e,r,l,s=[],a=0,f=!1;async function c(){return t(2,f=!0),Se.Logs.getRequestsStats({filter:[o,i].filter(Boolean).join("&&")}).then(h=>{u();for(let b of h)s.push({x:B.getDateTime(b.date).toLocal().toJSDate(),y:b.total}),t(1,a+=b.total);s.push({x:new Date,y:void 0})}).catch(h=>{h!==null&&(u(),console.warn(h),Se.errorResponseHandler(h,!1))}).finally(()=>{t(2,f=!1)})}function u(){t(1,a=0),t(7,s=[])}di(()=>(bs.register(Yi,Es,Qr,cc,tl,m4,S4),t(6,l=new bs(r,{type:"line",data:{datasets:[{label:"Total requests",data:s,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,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}}}})),()=>l==null?void 0:l.destroy()));function d(h){he[h?"unshift":"push"](()=>{r=h,t(0,r)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,o=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i!="undefined"||typeof o!="undefined")&&c(),n.$$.dirty&192&&typeof s!="undefined"&&l&&(t(6,l.data.datasets[0].data=s,l),l.update())},[r,a,f,i,o,c,l,s,d]}class G4 extends Ie{constructor(e){super(),Le(this,e,Y4,W4,Ee,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var Zd=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},M1={exports:{}};(function(n){var e=typeof window!="undefined"?window:typeof WorkerGlobalScope!="undefined"&&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 o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,r=0,l={},s={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function S(C){return C instanceof a?new a(C.type,S(C.content),C.alias):Array.isArray(C)?C.map(S):C.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(S){return Object.prototype.toString.call(S).slice(8,-1)},objId:function(S){return S.__id||Object.defineProperty(S,"__id",{value:++r}),S.__id},clone:function S(C,x){x=x||{};var M,A;switch(s.util.type(C)){case"Object":if(A=s.util.objId(C),x[A])return x[A];M={},x[A]=M;for(var O in C)C.hasOwnProperty(O)&&(M[O]=S(C[O],x));return M;case"Array":return A=s.util.objId(C),x[A]?x[A]:(M=[],x[A]=M,C.forEach(function(D,E){M[E]=S(D,x)}),M);default:return C}},getLanguage:function(S){for(;S;){var C=o.exec(S.className);if(C)return C[1].toLowerCase();S=S.parentElement}return"none"},setLanguage:function(S,C){S.className=S.className.replace(RegExp(o,"gi"),""),S.classList.add("language-"+C)},currentScript:function(){if(typeof document=="undefined")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(S){var C=document.getElementsByTagName("script");for(var x in C)if(C[x].src==S)return C[x]}return null}},isActive:function(S,C,x){for(var M="no-"+C;S;){var A=S.classList;if(A.contains(C))return!0;if(A.contains(M))return!1;S=S.parentElement}return!!x}},languages:{plain:l,plaintext:l,text:l,txt:l,extend:function(S,C){var x=s.util.clone(s.languages[S]);for(var M in C)x[M]=C[M];return x},insertBefore:function(S,C,x,M){M=M||s.languages;var A=M[S],O={};for(var D in A)if(A.hasOwnProperty(D)){if(D==C)for(var E in x)x.hasOwnProperty(E)&&(O[E]=x[E]);x.hasOwnProperty(D)||(O[D]=A[D])}var P=M[S];return M[S]=O,s.languages.DFS(s.languages,function(I,R){R===P&&I!=S&&(this[I]=O)}),O},DFS:function S(C,x,M,A){A=A||{};var O=s.util.objId;for(var D in C)if(C.hasOwnProperty(D)){x.call(C,D,C[D],M||D);var E=C[D],P=s.util.type(E);P==="Object"&&!A[O(E)]?(A[O(E)]=!0,S(E,x,null,A)):P==="Array"&&!A[O(E)]&&(A[O(E)]=!0,S(E,x,D,A))}}},plugins:{},highlightAll:function(S,C){s.highlightAllUnder(document,S,C)},highlightAllUnder:function(S,C,x){var M={callback:x,container:S,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};s.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),s.hooks.run("before-all-elements-highlight",M);for(var A=0,O;O=M.elements[A++];)s.highlightElement(O,C===!0,M.callback)},highlightElement:function(S,C,x){var M=s.util.getLanguage(S),A=s.languages[M];s.util.setLanguage(S,M);var O=S.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&s.util.setLanguage(O,M);var D=S.textContent,E={element:S,language:M,grammar:A,code:D};function P(R){E.highlightedCode=R,s.hooks.run("before-insert",E),E.element.innerHTML=E.highlightedCode,s.hooks.run("after-highlight",E),s.hooks.run("complete",E),x&&x.call(E.element)}if(s.hooks.run("before-sanity-check",E),O=E.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!E.code){s.hooks.run("complete",E),x&&x.call(E.element);return}if(s.hooks.run("before-highlight",E),!E.grammar){P(s.util.encode(E.code));return}if(C&&i.Worker){var I=new Worker(s.filename);I.onmessage=function(R){P(R.data)},I.postMessage(JSON.stringify({language:E.language,code:E.code,immediateClose:!0}))}else P(s.highlight(E.code,E.grammar,E.language))},highlight:function(S,C,x){var M={code:S,grammar:C,language:x};if(s.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=s.tokenize(M.code,M.grammar),s.hooks.run("after-tokenize",M),a.stringify(s.util.encode(M.tokens),M.language)},tokenize:function(S,C){var x=C.rest;if(x){for(var M in x)C[M]=x[M];delete C.rest}var A=new u;return d(A,A.head,S),c(S,A,C,A.head,0),b(A)},hooks:{all:{},add:function(S,C){var x=s.hooks.all;x[S]=x[S]||[],x[S].push(C)},run:function(S,C){var x=s.hooks.all[S];if(!(!x||!x.length))for(var M=0,A;A=x[M++];)A(C)}},Token:a};i.Prism=s;function a(S,C,x,M){this.type=S,this.content=C,this.alias=x,this.length=(M||"").length|0}a.stringify=function S(C,x){if(typeof C=="string")return C;if(Array.isArray(C)){var M="";return C.forEach(function(P){M+=S(P,x)}),M}var A={type:C.type,content:S(C.content,x),tag:"span",classes:["token",C.type],attributes:{},language:x},O=C.alias;O&&(Array.isArray(O)?Array.prototype.push.apply(A.classes,O):A.classes.push(O)),s.hooks.run("wrap",A);var D="";for(var E in A.attributes)D+=" "+E+'="'+(A.attributes[E]||"").replace(/"/g,"&quot;")+'"';return"<"+A.tag+' class="'+A.classes.join(" ")+'"'+D+">"+A.content+"</"+A.tag+">"};function f(S,C,x,M){S.lastIndex=C;var A=S.exec(x);if(A&&M&&A[1]){var O=A[1].length;A.index+=O,A[0]=A[0].slice(O)}return A}function c(S,C,x,M,A,O){for(var D in x)if(!(!x.hasOwnProperty(D)||!x[D])){var E=x[D];E=Array.isArray(E)?E:[E];for(var P=0;P<E.length;++P){if(O&&O.cause==D+","+P)return;var I=E[P],R=I.inside,G=!!I.lookbehind,U=!!I.greedy,z=I.alias;if(U&&!I.pattern.global){var K=I.pattern.toString().match(/[imsuy]*$/)[0];I.pattern=RegExp(I.pattern.source,K+"g")}for(var Y=I.pattern||I,W=M.next,te=A;W!==C.tail&&!(O&&te>=O.reach);te+=W.value.length,W=W.next){var ce=W.value;if(C.length>S.length)return;if(!(ce instanceof a)){var ve=1,oe;if(U){if(oe=f(Y,te,S,G),!oe||oe.index>=S.length)break;var _e=oe.index,J=oe.index+oe[0].length,$e=te;for($e+=W.value.length;_e>=$e;)W=W.next,$e+=W.value.length;if($e-=W.value.length,te=$e,W.value instanceof a)continue;for(var ee=W;ee!==C.tail&&($e<J||typeof ee.value=="string");ee=ee.next)ve++,$e+=ee.value.length;ve--,ce=S.slice(te,$e),oe.index-=te}else if(oe=f(Y,0,ce,G),!oe)continue;var _e=oe.index,fe=oe[0],ie=ce.slice(0,_e),ye=ce.slice(_e+fe.length),Ne=te+ce.length;O&&Ne>O.reach&&(O.reach=Ne);var Pe=W.prev;ie&&(Pe=d(C,Pe,ie),te+=ie.length),h(C,Pe,ve);var ze=new a(D,R?s.tokenize(fe,R):fe,z,fe);if(W=d(C,Pe,ze),ye&&d(C,W,ye),ve>1){var se={cause:D+","+P,reach:Ne};c(S,C,x,W.prev,te,se),O&&se.reach>O.reach&&(O.reach=se.reach)}}}}}}function u(){var S={value:null,prev:null,next:null},C={value:null,prev:S,next:null};S.next=C,this.head=S,this.tail=C,this.length=0}function d(S,C,x){var M=C.next,A={value:x,prev:C,next:M};return C.next=A,M.prev=A,S.length++,A}function h(S,C,x){for(var M=C.next,A=0;A<x&&M!==S.tail;A++)M=M.next;C.next=M,M.prev=C,S.length-=A}function b(S){for(var C=[],x=S.head.next;x!==S.tail;)C.push(x.value),x=x.next;return C}if(!i.document)return i.addEventListener&&(s.disableWorkerMessageHandler||i.addEventListener("message",function(S){var C=JSON.parse(S.data),x=C.language,M=C.code,A=C.immediateClose;i.postMessage(s.highlight(M,s.languages[x],x)),A&&i.close()},!1)),s;var v=s.util.currentScript();v&&(s.filename=v.src,v.hasAttribute("data-manual")&&(s.manual=!0));function _(){s.manual||s.highlightAll()}if(!s.manual){var y=document.readyState;y==="loading"||y==="interactive"&&v&&v.defer?document.addEventListener("DOMContentLoaded",_):window.requestAnimationFrame?window.requestAnimationFrame(_):window.setTimeout(_,16)}return s}(e);n.exports&&(n.exports=t),typeof Zd!="undefined"&&(Zd.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"},/"|'/]}},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(o,r){var l={};l["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[r]},l.cdata=/^<!\[CDATA\[|\]\]>$/i;var s={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:l}};s["language-"+r]={pattern:/[\s\S]+/,inside:t.languages[r]};var a={};a[o]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return o}),"i"),lookbehind:!0,greedy:!0,inside:s},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(i,o){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:[o,"language-"+o],inside:t.languages[o]},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 o=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,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\\((?:"+o.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+o.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+o.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:o,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 r=i.languages.markup;r&&(r.tag.addInlined("style","css"),r.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=="undefined"||typeof document=="undefined")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var i="Loading\u2026",o=function(v,_){return"\u2716 Error "+v+" while fetching file: "+_},r="\u2716 Error: File does not exist or is empty",l={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},s="data-src-status",a="loading",f="loaded",c="failed",u="pre[data-src]:not(["+s+'="'+f+'"]):not(['+s+'="'+a+'"])';function d(v,_,y){var S=new XMLHttpRequest;S.open("GET",v,!0),S.onreadystatechange=function(){S.readyState==4&&(S.status<400&&S.responseText?_(S.responseText):S.status>=400?y(o(S.status,S.statusText)):y(r))},S.send(null)}function h(v){var _=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v||"");if(_){var y=Number(_[1]),S=_[2],C=_[3];return S?C?[y,Number(C)]:[y,void 0]:[y,y]}}t.hooks.add("before-highlightall",function(v){v.selector+=", "+u}),t.hooks.add("before-sanity-check",function(v){var _=v.element;if(_.matches(u)){v.code="",_.setAttribute(s,a);var y=_.appendChild(document.createElement("CODE"));y.textContent=i;var S=_.getAttribute("data-src"),C=v.language;if(C==="none"){var x=(/\.(\w+)$/.exec(S)||[,"none"])[1];C=l[x]||x}t.util.setLanguage(y,C),t.util.setLanguage(_,C);var M=t.plugins.autoloader;M&&M.loadLanguages(C),d(S,function(A){_.setAttribute(s,f);var O=h(_.getAttribute("data-range"));if(O){var D=A.split(/\r\n?|\n/g),E=O[0],P=O[1]==null?D.length:O[1];E<0&&(E+=D.length),E=Math.max(0,Math.min(E-1,D.length)),P<0&&(P+=D.length),P=Math.max(0,Math.min(P,D.length)),A=D.slice(E,P).join(`
`),_.hasAttribute("data-start")||_.setAttribute("data-start",String(E+1))}y.textContent=A,t.highlightElement(y)},function(A){_.setAttribute(s,c),y.textContent=A})}}),t.plugins.fileHighlight={highlight:function(_){for(var y=(_||document).querySelectorAll(u),S=0,C;C=y[S++];)t.highlightElement(C)}};var b=!1;t.fileHighlight=function(){b||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),b=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(M1);var mr=M1.exports,K4={exports:{}};(function(n){(function(){if(typeof Prism=="undefined")return;var e=Object.assign||function(r,l){for(var s in l)l.hasOwnProperty(s)&&(r[s]=l[s]);return r};function t(r){this.defaults=e({},r)}function i(r){return r.replace(/-(\w)/g,function(l,s){return s.toUpperCase()})}function o(r){for(var l=0,s=0;s<r.length;++s)r.charCodeAt(s)==" ".charCodeAt(0)&&(l+=3);return r.length+l}t.prototype={setDefaults:function(r){this.defaults=e(this.defaults,r)},normalize:function(r,l){l=e(this.defaults,l);for(var s in l){var a=i(s);s!=="normalize"&&a!=="setDefaults"&&l[s]&&this[a]&&(r=this[a].call(this,r,l[s]))}return r},leftTrim:function(r){return r.replace(/^\s+/,"")},rightTrim:function(r){return r.replace(/\s+$/,"")},tabsToSpaces:function(r,l){return l=l|0||4,r.replace(/\t/g,new Array(++l).join(" "))},spacesToTabs:function(r,l){return l=l|0||4,r.replace(RegExp(" {"+l+"}","g")," ")},removeTrailing:function(r){return r.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(r){return r.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(r){var l=r.match(/^[^\S\n\r]*(?=\S)/gm);return!l||!l[0].length||(l.sort(function(s,a){return s.length-a.length}),!l[0].length)?r:r.replace(RegExp("^"+l[0],"gm"),"")},indent:function(r,l){return r.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++l).join(" ")+"$&")},breakLines:function(r,l){l=l===!0?80:l|0||80;for(var s=r.split(`
`),a=0;a<s.length;++a)if(!(o(s[a])<=l)){for(var f=s[a].split(/(\s+)/g),c=0,u=0;u<f.length;++u){var d=o(f[u]);c+=d,c>l&&(f[u]=`
`+f[u],c=d)}s[a]=f.join("")}return s.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(r){var l=Prism.plugins.NormalizeWhitespace;if(!(r.settings&&r.settings["whitespace-normalization"]===!1)&&!!Prism.util.isActive(r.element,"whitespace-normalization",!0)){if((!r.element||!r.element.parentNode)&&r.code){r.code=l.normalize(r.code,r.settings);return}var s=r.element.parentNode;if(!(!r.code||!s||s.nodeName.toLowerCase()!=="pre")){for(var a=s.childNodes,f="",c="",u=!1,d=0;d<a.length;++d){var h=a[d];h==r.element?u=!0:h.nodeName==="#text"&&(u?c+=h.nodeValue:f+=h.nodeValue,s.removeChild(h),--d)}if(!r.element.children.length||!Prism.plugins.KeepMarkup)r.code=f+r.code+c,r.code=l.normalize(r.code,r.settings);else{var b=f+r.element.innerHTML+c;r.element.innerHTML=l.normalize(b,r.settings),r.code=r.element.textContent}}}})})()})(K4);function J4(n){let e,t;return{c(){e=g("div"),t=g("code"),p(t,"class","svelte-tv7jme"),p(e,"class","code-wrapper prism-light svelte-tv7jme")},m(i,o){w(i,e,o),m(e,t),t.innerHTML=n[0]},p(i,[o]){o&1&&(t.innerHTML=i[0])},i:le,o:le,d(i){i&&k(e)}}}function Z4(n,e,t){let{content:i=""}=e,{language:o="javascript"}=e,r="";function l(s){return s=typeof s=="string"?s:"",s=mr.plugins.NormalizeWhitespace.normalize(s,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),mr.highlight(s,mr.languages[o]||mr.languages.javascript,o)}return n.$$set=s=>{"content"in s&&t(1,i=s.content),"language"in s&&t(2,o=s.language)},n.$$.update=()=>{n.$$.dirty&2&&typeof mr!="undefined"&&i&&t(0,r=l(i))},[r,i,o]}class tn extends Ie{constructor(e){super(),Le(this,e,Z4,J4,Ee,{content:1,language:2})}}const X4=n=>({}),Xd=n=>({}),Q4=n=>({}),Qd=n=>({});function ep(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C=n[4]&&!n[2]&&tp(n);const x=n[18].header,M=$n(x,n,n[17],Qd);let A=n[4]&&n[2]&&np(n);const O=n[18].default,D=$n(O,n,n[17],null),E=n[18].footer,P=$n(E,n,n[17],Xd);return{c(){e=g("div"),t=g("div"),o=$(),r=g("div"),l=g("div"),C&&C.c(),s=$(),M&&M.c(),a=$(),A&&A.c(),f=$(),c=g("div"),D&&D.c(),u=$(),d=g("div"),P&&P.c(),p(t,"class","overlay"),p(l,"class","overlay-panel-section panel-header"),p(c,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(r,"class",h="overlay-panel "+n[1]+" "+n[8]),ne(r,"popup",n[2]),p(e,"class","overlay-panel-container"),ne(e,"padded",n[2]),ne(e,"active",n[0])},m(I,R){w(I,e,R),m(e,t),m(e,o),m(e,r),m(r,l),C&&C.m(l,null),m(l,s),M&&M.m(l,null),m(l,a),A&&A.m(l,null),m(r,f),m(r,c),D&&D.m(c,null),n[20](c),m(r,u),m(r,d),P&&P.m(d,null),_=!0,y||(S=[X(t,"click",Gt(n[19])),X(c,"scroll",n[21])],y=!0)},p(I,R){n=I,n[4]&&!n[2]?C?C.p(n,R):(C=tp(n),C.c(),C.m(l,s)):C&&(C.d(1),C=null),M&&M.p&&(!_||R&131072)&&Dn(M,x,n,n[17],_?An(x,n[17],R,Q4):On(n[17]),Qd),n[4]&&n[2]?A?A.p(n,R):(A=np(n),A.c(),A.m(l,null)):A&&(A.d(1),A=null),D&&D.p&&(!_||R&131072)&&Dn(D,O,n,n[17],_?An(O,n[17],R,null):On(n[17]),null),P&&P.p&&(!_||R&131072)&&Dn(P,E,n,n[17],_?An(E,n[17],R,X4):On(n[17]),Xd),(!_||R&258&&h!==(h="overlay-panel "+n[1]+" "+n[8]))&&p(r,"class",h),R&262&&ne(r,"popup",n[2]),R&4&&ne(e,"padded",n[2]),R&1&&ne(e,"active",n[0])},i(I){_||(Dt(()=>{i||(i=ct(t,rs,{duration:Eo,opacity:0},!0)),i.run(1)}),T(M,I),T(D,I),T(P,I),Dt(()=>{v&&v.end(1),b=yf(r,ti,n[2]?{duration:Eo,y:-10}:{duration:Eo,x:50}),b.start()}),_=!0)},o(I){i||(i=ct(t,rs,{duration:Eo,opacity:0},!1)),i.run(0),F(M,I),F(D,I),F(P,I),b&&b.invalidate(),v=Kb(r,ti,n[2]?{duration:Eo,y:10}:{duration:Eo,x:50}),_=!1},d(I){I&&k(e),I&&i&&i.end(),C&&C.d(),M&&M.d(I),A&&A.d(),D&&D.d(I),n[20](null),P&&P.d(I),I&&v&&v.end(),y=!1,rt(S)}}}function tp(n){let e,t,i;return{c(){e=g("div"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"class","overlay-close")},m(o,r){w(o,e,r),t||(i=X(e,"click",Gt(n[5])),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function np(n){let e,t,i;return{c(){e=g("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(o,r){w(o,e,r),t||(i=X(e,"click",Gt(n[5])),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function eC(n){let e,t,i,o,r=n[0]&&ep(n);return{c(){e=g("div"),r&&r.c(),p(e,"class","overlay-panel-wrapper")},m(l,s){w(l,e,s),r&&r.m(e,null),n[22](e),t=!0,i||(o=[X(window,"resize",n[10]),X(window,"keydown",n[9])],i=!0)},p(l,[s]){l[0]?r?(r.p(l,s),s&1&&T(r,1)):(r=ep(l),r.c(),T(r,1),r.m(e,null)):r&&(Ae(),F(r,1,1,()=>{r=null}),De())},i(l){t||(T(r),t=!0)},o(l){F(r),t=!1},d(l){l&&k(e),r&&r.d(),n[22](null),i=!1,rt(o)}}}let no;function $1(){return no=no||document.querySelector(".overlays"),no||(no=document.createElement("div"),no.classList.add("overlays"),document.body.appendChild(no)),no}let Eo=150;function ip(){return 1e3+$1().querySelectorAll(".overlay-panel-container.active").length}function tC(n,e,t){let{$$slots:i={},$$scope:o}=e,{class:r=""}=e,{active:l=!1}=e,{popup:s=!1}=e,{overlayClose:a=!0}=e,{btnClose:f=!0}=e,{escClose:c=!0}=e,{beforeOpen:u=void 0}=e,{beforeHide:d=void 0}=e;const h=yn();let b,v,_,y,S="";function C(){typeof u=="function"&&u()===!1||t(0,l=!0)}function x(){typeof d=="function"&&d()===!1||t(0,l=!1)}function M(){return l}async function A(z){z?(_=document.activeElement,b==null||b.focus(),h("show")):(clearTimeout(y),_==null||_.focus(),h("hide")),await Bi(),O()}function O(){!b||(l?t(6,b.style.zIndex=ip(),b):t(6,b.style="",b))}function D(z){l&&c&&z.code=="Escape"&&!B.isInput(z.target)&&b&&b.style.zIndex==ip()&&(z.preventDefault(),x())}function E(z){l&&P(v)}function P(z,K){K&&t(8,S=""),z&&(y||(y=setTimeout(()=>{if(clearTimeout(y),y=null,!z)return;if(z.scrollHeight-z.offsetHeight>0)t(8,S="scrollable");else{t(8,S="");return}z.scrollTop==0?t(8,S+=" scroll-top-reached"):z.scrollTop+z.offsetHeight==z.scrollHeight&&t(8,S+=" scroll-bottom-reached")},100)))}di(()=>($1().appendChild(b),()=>{var z;clearTimeout(y),(z=b==null?void 0:b.classList)==null||z.add("hidden")}));const I=()=>a?x():!0;function R(z){he[z?"unshift":"push"](()=>{v=z,t(7,v)})}const G=z=>P(z.target);function U(z){he[z?"unshift":"push"](()=>{b=z,t(6,b)})}return n.$$set=z=>{"class"in z&&t(1,r=z.class),"active"in z&&t(0,l=z.active),"popup"in z&&t(2,s=z.popup),"overlayClose"in z&&t(3,a=z.overlayClose),"btnClose"in z&&t(4,f=z.btnClose),"escClose"in z&&t(12,c=z.escClose),"beforeOpen"in z&&t(13,u=z.beforeOpen),"beforeHide"in z&&t(14,d=z.beforeHide),"$$scope"in z&&t(17,o=z.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&A(l),n.$$.dirty&128&&P(v,!0),n.$$.dirty&64&&b&&O()},[l,r,s,a,f,x,b,v,S,D,E,P,c,u,d,C,M,o,i,I,R,G,U]}class Ai extends Ie{constructor(e){super(),Le(this,e,tC,eC,Ee,{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 nC(n){let e;return{c(){e=g("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function iC(n){let e,t=n[2].referer+"",i,o;return{c(){e=g("a"),i=j(t),p(e,"href",o=n[2].referer),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(r,l){w(r,e,l),m(e,i)},p(r,l){l&4&&t!==(t=r[2].referer+"")&&ge(i,t),l&4&&o!==(o=r[2].referer)&&p(e,"href",o)},d(r){r&&k(e)}}}function oC(n){let e;return{c(){e=g("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function rC(n){let e,t;return e=new tn({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,o){const r={};o&4&&(r.content=JSON.stringify(i[2].meta,null,2)),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function lC(n){var ni;let e,t,i,o,r,l,s=n[2].id+"",a,f,c,u,d,h,b,v=n[2].status+"",_,y,S,C,x,M,A=((ni=n[2].method)==null?void 0:ni.toUpperCase())+"",O,D,E,P,I,R,G=n[2].auth+"",U,z,K,Y,W,te,ce=n[2].url+"",ve,oe,J,$e,ee,_e,fe,ie,ye,Ne,Pe,ze=n[2].ip+"",se,re,ke,He,qe,Je,be=n[2].userAgent+"",Oe,Z,ae,Ve,yt,it,bt,at,vt,qt,Mt,$t,me,Ce,Ye,ot;function cn(pe,L){return pe[2].referer?iC:nC}let ue=cn(n),we=ue(n);const Ze=[rC,oC],Kt=[];function zt(pe,L){return L&4&&(bt=null),bt==null&&(bt=!B.isEmpty(pe[2].meta)),bt?0:1}return at=zt(n,-1),vt=Kt[at]=Ze[at](n),Ye=new Ci({props:{date:n[2].created}}),{c(){e=g("table"),t=g("tbody"),i=g("tr"),o=g("td"),o.textContent="ID",r=$(),l=g("td"),a=j(s),f=$(),c=g("tr"),u=g("td"),u.textContent="Status",d=$(),h=g("td"),b=g("span"),_=j(v),y=$(),S=g("tr"),C=g("td"),C.textContent="Method",x=$(),M=g("td"),O=j(A),D=$(),E=g("tr"),P=g("td"),P.textContent="Auth",I=$(),R=g("td"),U=j(G),z=$(),K=g("tr"),Y=g("td"),Y.textContent="URL",W=$(),te=g("td"),ve=j(ce),oe=$(),J=g("tr"),$e=g("td"),$e.textContent="Referer",ee=$(),_e=g("td"),we.c(),fe=$(),ie=g("tr"),ye=g("td"),ye.textContent="IP",Ne=$(),Pe=g("td"),se=j(ze),re=$(),ke=g("tr"),He=g("td"),He.textContent="UserAgent",qe=$(),Je=g("td"),Oe=j(be),Z=$(),ae=g("tr"),Ve=g("td"),Ve.textContent="Meta",yt=$(),it=g("td"),vt.c(),qt=$(),Mt=g("tr"),$t=g("td"),$t.textContent="Created",me=$(),Ce=g("td"),V(Ye.$$.fragment),p(o,"class","min-width txt-hint txt-bold"),p(u,"class","min-width txt-hint txt-bold"),p(b,"class","label"),ne(b,"label-danger",n[2].status>=400),p(C,"class","min-width txt-hint txt-bold"),p(P,"class","min-width txt-hint txt-bold"),p(Y,"class","min-width txt-hint txt-bold"),p($e,"class","min-width txt-hint txt-bold"),p(ye,"class","min-width txt-hint txt-bold"),p(He,"class","min-width txt-hint txt-bold"),p(Ve,"class","min-width txt-hint txt-bold"),p($t,"class","min-width txt-hint txt-bold"),p(e,"class","table-compact table-border")},m(pe,L){w(pe,e,L),m(e,t),m(t,i),m(i,o),m(i,r),m(i,l),m(l,a),m(t,f),m(t,c),m(c,u),m(c,d),m(c,h),m(h,b),m(b,_),m(t,y),m(t,S),m(S,C),m(S,x),m(S,M),m(M,O),m(t,D),m(t,E),m(E,P),m(E,I),m(E,R),m(R,U),m(t,z),m(t,K),m(K,Y),m(K,W),m(K,te),m(te,ve),m(t,oe),m(t,J),m(J,$e),m(J,ee),m(J,_e),we.m(_e,null),m(t,fe),m(t,ie),m(ie,ye),m(ie,Ne),m(ie,Pe),m(Pe,se),m(t,re),m(t,ke),m(ke,He),m(ke,qe),m(ke,Je),m(Je,Oe),m(t,Z),m(t,ae),m(ae,Ve),m(ae,yt),m(ae,it),Kt[at].m(it,null),m(t,qt),m(t,Mt),m(Mt,$t),m(Mt,me),m(Mt,Ce),H(Ye,Ce,null),ot=!0},p(pe,L){var de;(!ot||L&4)&&s!==(s=pe[2].id+"")&&ge(a,s),(!ot||L&4)&&v!==(v=pe[2].status+"")&&ge(_,v),L&4&&ne(b,"label-danger",pe[2].status>=400),(!ot||L&4)&&A!==(A=((de=pe[2].method)==null?void 0:de.toUpperCase())+"")&&ge(O,A),(!ot||L&4)&&G!==(G=pe[2].auth+"")&&ge(U,G),(!ot||L&4)&&ce!==(ce=pe[2].url+"")&&ge(ve,ce),ue===(ue=cn(pe))&&we?we.p(pe,L):(we.d(1),we=ue(pe),we&&(we.c(),we.m(_e,null))),(!ot||L&4)&&ze!==(ze=pe[2].ip+"")&&ge(se,ze),(!ot||L&4)&&be!==(be=pe[2].userAgent+"")&&ge(Oe,be);let N=at;at=zt(pe,L),at===N?Kt[at].p(pe,L):(Ae(),F(Kt[N],1,1,()=>{Kt[N]=null}),De(),vt=Kt[at],vt?vt.p(pe,L):(vt=Kt[at]=Ze[at](pe),vt.c()),T(vt,1),vt.m(it,null));const Q={};L&4&&(Q.date=pe[2].created),Ye.$set(Q)},i(pe){ot||(T(vt),T(Ye.$$.fragment,pe),ot=!0)},o(pe){F(vt),F(Ye.$$.fragment,pe),ot=!1},d(pe){pe&&k(e),we.d(),Kt[at].d(),q(Ye)}}}function sC(n){let e;return{c(){e=g("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function aC(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[4]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function fC(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[aC],header:[sC],default:[lC]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,[r]){const l={};r&260&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[5](null),q(e,o)}}}function cC(n,e,t){let i,o=new Ha;function r(u){return t(2,o=u),i==null?void 0:i.show()}function l(){return i==null?void 0:i.hide()}const s=()=>l();function a(u){he[u?"unshift":"push"](()=>{i=u,t(1,i)})}function f(u){ft.call(this,n,u)}function c(u){ft.call(this,n,u)}return[l,i,o,r,s,a,f,c]}class uC extends Ie{constructor(e){super(),Le(this,e,cC,fC,Ee,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function dC(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(o,"for",l=n[12])},m(f,c){w(f,e,c),e.checked=n[0],w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[6]),s=!0)},p(f,c){c&4096&&t!==(t=f[12])&&p(e,"id",t),c&1&&(e.checked=f[0]),c&4096&&l!==(l=f[12])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function op(n){let e,t,i;function o(l){n[8](l)}let r={presets:n[4]};return n[2]!==void 0&&(r.filter=n[2]),e=new G4({props:r}),he.push(()=>Fe(e,"filter",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){const a={};s&16&&(a.presets=l[4]),!t&&s&4&&(t=!0,a.filter=l[2],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function rp(n){let e,t,i;function o(l){n[9](l)}let r={presets:n[4]};return n[2]!==void 0&&(r.filter=n[2]),e=new dk({props:r}),he.push(()=>Fe(e,"filter",o)),e.$on("select",n[10]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){const a={};s&16&&(a.presets=l[4]),!t&&s&4&&(t=!0,a.filter=l[2],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function pC(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y=n[3],S,C=n[3],x,M,A,O,D;u=new je({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[dC,({uniqueId:R})=>({12:R}),({uniqueId:R})=>R?4096:0]},$$scope:{ctx:n}}}),h=new Ds({props:{value:n[2],placeholder:"Search logs, ex. status > 200",extraAutocompleteKeys:["method","url","ip","referer","status","auth","userAgent"]}}),h.$on("submit",n[7]);let E=op(n),P=rp(n),I={};return M=new uC({props:I}),n[11](M),{c(){e=g("main"),t=g("div"),i=g("header"),o=g("nav"),o.innerHTML='<div class="breadcrumb-item">Request logs</div>',r=$(),l=g("button"),l.innerHTML='<i class="ri-refresh-line"></i>',s=$(),a=g("div"),f=$(),c=g("div"),V(u.$$.fragment),d=$(),V(h.$$.fragment),b=$(),v=g("div"),_=$(),E.c(),S=$(),P.c(),x=$(),V(M.$$.fragment),p(o,"class","breadcrumbs"),p(l,"type","button"),p(l,"class","btn btn-circle btn-secondary"),p(a,"class","flex-fill"),p(c,"class","inline-flex"),p(i,"class","page-header"),p(v,"class","clearfix m-b-xs"),p(t,"class","page-header-wrapper m-b-0"),p(e,"class","page-wrapper")},m(R,G){w(R,e,G),m(e,t),m(t,i),m(i,o),m(i,r),m(i,l),m(i,s),m(i,a),m(i,f),m(i,c),H(u,c,null),m(t,d),H(h,t,null),m(t,b),m(t,v),m(t,_),E.m(t,null),m(e,S),P.m(e,null),w(R,x,G),H(M,R,G),A=!0,O||(D=[Xe(St.call(null,l,{text:"Refresh",position:"right"})),X(l,"click",n[5])],O=!0)},p(R,[G]){const U={};G&12289&&(U.$$scope={dirty:G,ctx:R}),u.$set(U);const z={};G&4&&(z.value=R[2]),h.$set(z),G&8&&Ee(y,y=R[3])?(Ae(),F(E,1,1,le),De(),E=op(R),E.c(),T(E,1),E.m(t,null)):E.p(R,G),G&8&&Ee(C,C=R[3])?(Ae(),F(P,1,1,le),De(),P=rp(R),P.c(),T(P,1),P.m(e,null)):P.p(R,G);const K={};M.$set(K)},i(R){A||(T(u.$$.fragment,R),T(h.$$.fragment,R),T(E),T(P),T(M.$$.fragment,R),A=!0)},o(R){F(u.$$.fragment,R),F(h.$$.fragment,R),F(E),F(P),F(M.$$.fragment,R),A=!1},d(R){R&&k(e),q(u),q(h),E.d(R),P.d(R),R&&k(x),n[11](null),q(M,R),O=!1,rt(D)}}}const lp="includeAdminLogs";function hC(n,e,t){var v;let i,o,r="",l=((v=window.localStorage)==null?void 0:v.getItem(lp))<<0,s=1;function a(){t(3,s++,s)}B.setDocumentTitle("Request logs");function f(){l=this.checked,t(0,l)}const c=_=>t(2,r=_.detail);function u(_){r=_,t(2,r)}function d(_){r=_,t(2,r)}const h=_=>o==null?void 0:o.show(_==null?void 0:_.detail);function b(_){he[_?"unshift":"push"](()=>{o=_,t(1,o)})}return n.$$.update=()=>{n.$$.dirty&1&&t(4,i=l?"":'auth!="admin"'),n.$$.dirty&1&&typeof l!="undefined"&&window.localStorage&&window.localStorage.setItem(lp,l<<0)},[l,o,r,s,i,a,f,c,u,d,h,b]}class mC extends Ie{constructor(e){super(),Le(this,e,hC,pC,Ee,{})}}const Go=Mi([]),fi=Mi({}),pf=Mi(!1);function bC(n){fi.update(e=>B.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Go.update(e=>(B.pushOrReplaceByKey(e,n,"id"),e))}function gC(n){Go.update(e=>(B.removeByKey(e,"id",n.id),fi.update(t=>t.id===n.id?e.find(i=>i.name!="profiles")||{}:t),e))}async function _C(n=null){return pf.set(!0),fi.set({}),Go.set([]),Se.Collections.getFullList(200,{sort:"+created"}).then(e=>{Go.set(e);const t=n&&B.findByKey(e,"id",n);if(t)fi.set(t);else if(e.length){const i=e.find(o=>o.name!="profiles");i&&fi.set(i)}}).catch(e=>{Se.errorResponseHandler(e)}).finally(()=>{pf.set(!1)})}const uc=Mi({});function xi(n,e,t){uc.set({text:n,yesCallback:e,noCallback:t})}function A1(){uc.set({})}function sp(n){let e,t,i,o;const r=n[13].default,l=$n(r,n,n[12],null);return{c(){e=g("div"),l&&l.c(),p(e,"class",n[1]),ne(e,"active",n[0])},m(s,a){w(s,e,a),l&&l.m(e,null),o=!0},p(s,a){l&&l.p&&(!o||a&4096)&&Dn(l,r,s,s[12],o?An(r,s[12],a,null):On(s[12]),null),(!o||a&2)&&p(e,"class",s[1]),a&3&&ne(e,"active",s[0])},i(s){o||(T(l,s),s&&Dt(()=>{i&&i.end(1),t=yf(e,ti,{duration:150,y:-5}),t.start()}),o=!0)},o(s){F(l,s),t&&t.invalidate(),s&&(i=Kb(e,ti,{duration:150,y:2})),o=!1},d(s){s&&k(e),l&&l.d(s),s&&i&&i.end()}}}function vC(n){let e,t,i,o,r=n[0]&&sp(n);return{c(){e=g("div"),r&&r.c(),p(e,"class","toggler-container")},m(l,s){w(l,e,s),r&&r.m(e,null),n[14](e),t=!0,i||(o=[X(window,"click",n[3]),X(window,"keydown",n[4]),X(window,"focusin",n[5])],i=!0)},p(l,[s]){l[0]?r?(r.p(l,s),s&1&&T(r,1)):(r=sp(l),r.c(),T(r,1),r.m(e,null)):r&&(Ae(),F(r,1,1,()=>{r=null}),De())},i(l){t||(T(r),t=!0)},o(l){F(r),t=!1},d(l){l&&k(e),r&&r.d(),n[14](null),i=!1,rt(o)}}}function yC(n,e,t){let{$$slots:i={},$$scope:o}=e,{trigger:r=void 0}=e,{active:l=!1}=e,{escClose:s=!0}=e,{closableClass:a="closable"}=e,{class:f=""}=e,c;const u=yn();function d(){t(0,l=!1)}function h(){t(0,l=!0)}function b(){l?d():h()}function v(A){return!c||A.classList.contains(a)||(r==null?void 0:r.contains(A))&&!c.contains(A)||c.contains(A)&&A.closest&&A.closest("."+a)}function _(A){(!l||v(A.target))&&(A.preventDefault(),b())}function y(A){(A.code==="Enter"||A.code==="Space")&&(!l||v(A.target))&&(A.preventDefault(),A.stopPropagation(),b())}function S(A){l&&!(c!=null&&c.contains(A.target))&&!(r!=null&&r.contains(A.target))&&d()}function C(A){l&&s&&A.code=="Escape"&&(A.preventDefault(),d())}function x(A){return S(A)}di(()=>(t(6,r=r||c.parentNode),r.addEventListener("click",_),r.addEventListener("keydown",y),()=>{r.removeEventListener("click",_),r.removeEventListener("keydown",y)}));function M(A){he[A?"unshift":"push"](()=>{c=A,t(2,c)})}return n.$$set=A=>{"trigger"in A&&t(6,r=A.trigger),"active"in A&&t(0,l=A.active),"escClose"in A&&t(7,s=A.escClose),"closableClass"in A&&t(8,a=A.closableClass),"class"in A&&t(1,f=A.class),"$$scope"in A&&t(12,o=A.$$scope)},n.$$.update=()=>{var A,O;n.$$.dirty&65&&(l?((A=r==null?void 0:r.classList)==null||A.add("active"),u("show")):((O=r==null?void 0:r.classList)==null||O.remove("active"),u("hide")))},[l,f,c,S,C,x,r,s,a,d,h,b,o,i,M]}class vo extends Ie{constructor(e){super(),Le(this,e,yC,vC,Ee,{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 kC=n=>({active:n&1}),ap=n=>({active:n[0]});function fp(n){let e,t,i;const o=n[12].default,r=$n(o,n,n[11],null);return{c(){e=g("div"),r&&r.c(),p(e,"class","accordion-content")},m(l,s){w(l,e,s),r&&r.m(e,null),i=!0},p(l,s){r&&r.p&&(!i||s&2048)&&Dn(r,o,l,l[11],i?An(o,l[11],s,null):On(l[11]),null)},i(l){i||(T(r,l),l&&Dt(()=>{t||(t=ct(e,fn,{duration:150},!0)),t.run(1)}),i=!0)},o(l){F(r,l),l&&(t||(t=ct(e,fn,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&k(e),r&&r.d(l),l&&t&&t.end()}}}function wC(n){let e,t,i,o,r,l,s,a;const f=n[12].header,c=$n(f,n,n[11],ap);let u=n[0]&&fp(n);return{c(){e=g("div"),t=g("header"),c&&c.c(),i=$(),u&&u.c(),p(t,"class","accordion-header"),ne(t,"interactive",n[2]),p(e,"tabindex",o=n[2]?0:-1),p(e,"class",r="accordion "+n[1]),ne(e,"active",n[0])},m(d,h){w(d,e,h),m(e,t),c&&c.m(t,null),m(e,i),u&&u.m(e,null),n[14](e),l=!0,s||(a=[X(t,"click",Gt(n[13])),X(e,"keydown",Vb(n[5]))],s=!0)},p(d,[h]){c&&c.p&&(!l||h&2049)&&Dn(c,f,d,d[11],l?An(f,d[11],h,kC):On(d[11]),ap),h&4&&ne(t,"interactive",d[2]),d[0]?u?(u.p(d,h),h&1&&T(u,1)):(u=fp(d),u.c(),T(u,1),u.m(e,null)):u&&(Ae(),F(u,1,1,()=>{u=null}),De()),(!l||h&4&&o!==(o=d[2]?0:-1))&&p(e,"tabindex",o),(!l||h&2&&r!==(r="accordion "+d[1]))&&p(e,"class",r),h&3&&ne(e,"active",d[0])},i(d){l||(T(c,d),T(u),l=!0)},o(d){F(c,d),F(u),l=!1},d(d){d&&k(e),c&&c.d(d),u&&u.d(),n[14](null),s=!1,rt(a)}}}function SC(n,e,t){let{$$slots:i={},$$scope:o}=e;const r=yn();let l,s,{class:a=""}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:u=!1}=e;function d(){v(),t(0,f=!0),r("expand")}function h(){t(0,f=!1),clearTimeout(s),r("collapse")}function b(){r("toggle"),f?h():d()}function v(){if(u&&l.parentElement){const C=l.parentElement.querySelectorAll(".accordion.active .accordion-header.interactive");for(const x of C)x.click()}}function _(C){!c||(C.code==="Enter"||C.code==="Space")&&(C.preventDefault(),b())}di(()=>()=>clearTimeout(s));const y=()=>c&&b();function S(C){he[C?"unshift":"push"](()=>{l=C,t(4,l)})}return n.$$set=C=>{"class"in C&&t(1,a=C.class),"active"in C&&t(0,f=C.active),"interactive"in C&&t(2,c=C.interactive),"single"in C&&t(6,u=C.single),"$$scope"in C&&t(11,o=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1041&&f&&(clearTimeout(s),t(10,s=setTimeout(()=>{l!=null&&l.scrollIntoView&&l.scrollIntoView({behavior:"smooth",block:"nearest"})},250)))},[f,a,c,b,l,_,u,d,h,v,s,o,i,y,S]}class dc extends Ie{constructor(e){super(),Le(this,e,SC,wC,Ee,{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 CC=n=>({}),cp=n=>({});function up(n,e,t){const i=n.slice();return i[46]=e[t],i}function dp(n,e,t){const i=n.slice();return i[49]=e[t],i}const xC=n=>({}),pp=n=>({});function hp(n,e,t){const i=n.slice();return i[49]=e[t],i}function mp(n){let e,t;return{c(){e=g("div"),t=j(n[2]),p(e,"class","txt-placeholder")},m(i,o){w(i,e,o),m(e,t)},p(i,o){o[0]&4&&ge(t,i[2])},d(i){i&&k(e)}}}function MC(n){let e,t=n[49]+"",i;return{c(){e=g("span"),i=j(t),p(e,"class","txt")},m(o,r){w(o,e,r),m(e,i)},p(o,r){r[0]&1&&t!==(t=o[49]+"")&&ge(i,t)},i:le,o:le,d(o){o&&k(e)}}}function $C(n){let e,t,i;const o=[{item:n[49]},n[8]];var r=n[7];function l(s){let a={};for(let f=0;f<o.length;f+=1)a=ut(a,o[f]);return{props:a}}return r&&(e=new r(l())),{c(){e&&V(e.$$.fragment),t=lt()},m(s,a){e&&H(e,s,a),w(s,t,a),i=!0},p(s,a){const f=a[0]&257?bn(o,[a[0]&1&&{item:s[49]},a[0]&256&&pi(s[8])]):{};if(r!==(r=s[7])){if(e){Ae();const c=e;F(c.$$.fragment,1,0,()=>{q(c,1)}),De()}r?(e=new r(l()),V(e.$$.fragment),T(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else r&&e.$set(f)},i(s){i||(e&&T(e.$$.fragment,s),i=!0)},o(s){e&&F(e.$$.fragment,s),i=!1},d(s){s&&k(t),e&&q(e,s)}}}function bp(n){let e,t,i;function o(){return n[34](n[49])}return{c(){e=g("span"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"class","clear")},m(r,l){w(r,e,l),t||(i=[Xe(St.call(null,e,"Clear")),X(e,"click",Vn(Gt(o)))],t=!0)},p(r,l){n=r},d(r){r&&k(e),t=!1,rt(i)}}}function gp(n){let e,t,i,o,r,l;const s=[$C,MC],a=[];function f(u,d){return u[7]?0:1}t=f(n),i=a[t]=s[t](n);let c=(n[4]||n[6])&&bp(n);return{c(){e=g("div"),i.c(),o=$(),c&&c.c(),r=$(),p(e,"class","option")},m(u,d){w(u,e,d),a[t].m(e,null),m(e,o),c&&c.m(e,null),m(e,r),l=!0},p(u,d){let h=t;t=f(u),t===h?a[t].p(u,d):(Ae(),F(a[h],1,1,()=>{a[h]=null}),De(),i=a[t],i?i.p(u,d):(i=a[t]=s[t](u),i.c()),T(i,1),i.m(e,o)),u[4]||u[6]?c?c.p(u,d):(c=bp(u),c.c(),c.m(e,r)):c&&(c.d(1),c=null)},i(u){l||(T(i),l=!0)},o(u){F(i),l=!1},d(u){u&&k(e),a[t].d(),c&&c.d()}}}function _p(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[17],$$slots:{default:[OC]},$$scope:{ctx:n}};return e=new vo({props:i}),n[39](e),e.$on("show",n[23]),e.$on("hide",n[40]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,r){const l={};r[0]&131072&&(l.trigger=o[17]),r[0]&806410|r[1]&2048&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[39](null),q(e,o)}}}function vp(n){let e,t,i,o,r,l,s,a,f=n[14].length&&yp(n);return{c(){e=g("div"),t=g("label"),i=g("div"),i.innerHTML='<i class="ri-search-line"></i>',o=$(),r=g("input"),l=$(),f&&f.c(),p(i,"class","addon p-r-0"),r.autofocus=!0,p(r,"type","text"),p(r,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(c,u){w(c,e,u),m(e,t),m(t,i),m(t,o),m(t,r),Me(r,n[14]),m(t,l),f&&f.m(t,null),r.focus(),s||(a=X(r,"input",n[36]),s=!0)},p(c,u){u[0]&8&&p(r,"placeholder",c[3]),u[0]&16384&&r.value!==c[14]&&Me(r,c[14]),c[14].length?f?f.p(c,u):(f=yp(c),f.c(),f.m(t,null)):f&&(f.d(1),f=null)},d(c){c&&k(e),f&&f.d(),s=!1,a()}}}function yp(n){let e,t,i,o;return{c(){e=g("div"),t=g("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(r,l){w(r,e,l),m(e,t),i||(o=X(t,"click",Vn(Gt(n[20]))),i=!0)},p:le,d(r){r&&k(e),i=!1,o()}}}function kp(n){let e,t=n[1]&&wp(n);return{c(){t&&t.c(),e=lt()},m(i,o){t&&t.m(i,o),w(i,e,o)},p(i,o){i[1]?t?t.p(i,o):(t=wp(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function wp(n){let e,t;return{c(){e=g("div"),t=j(n[1]),p(e,"class","txt-missing")},m(i,o){w(i,e,o),m(e,t)},p(i,o){o[0]&2&&ge(t,i[1])},d(i){i&&k(e)}}}function Sp(n){let e,t=n[46].group+"",i;return{c(){e=g("div"),i=j(t),p(e,"class","dropdown-item separator")},m(o,r){w(o,e,r),m(e,i)},p(o,r){r[0]&524288&&t!==(t=o[46].group+"")&&ge(i,t)},d(o){o&&k(e)}}}function AC(n){let e=n[49]+"",t;return{c(){t=j(e)},m(i,o){w(i,t,o)},p(i,o){o[0]&524288&&e!==(e=i[49]+"")&&ge(t,e)},i:le,o:le,d(i){i&&k(t)}}}function DC(n){let e,t,i;const o=[{item:n[49]},n[10]];var r=n[9];function l(s){let a={};for(let f=0;f<o.length;f+=1)a=ut(a,o[f]);return{props:a}}return r&&(e=new r(l())),{c(){e&&V(e.$$.fragment),t=lt()},m(s,a){e&&H(e,s,a),w(s,t,a),i=!0},p(s,a){const f=a[0]&525312?bn(o,[a[0]&524288&&{item:s[49]},a[0]&1024&&pi(s[10])]):{};if(r!==(r=s[9])){if(e){Ae();const c=e;F(c.$$.fragment,1,0,()=>{q(c,1)}),De()}r?(e=new r(l()),V(e.$$.fragment),T(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else r&&e.$set(f)},i(s){i||(e&&T(e.$$.fragment,s),i=!0)},o(s){e&&F(e.$$.fragment,s),i=!1},d(s){s&&k(t),e&&q(e,s)}}}function Cp(n){let e,t,i,o,r,l,s;const a=[DC,AC],f=[];function c(h,b){return h[9]?0:1}t=c(n),i=f[t]=a[t](n);function u(...h){return n[37](n[49],...h)}function d(...h){return n[38](n[49],...h)}return{c(){e=g("div"),i.c(),o=$(),p(e,"tabindex","0"),p(e,"class","dropdown-item option closable"),ne(e,"selected",n[18](n[49]))},m(h,b){w(h,e,b),f[t].m(e,null),m(e,o),r=!0,l||(s=[X(e,"click",u),X(e,"keydown",d)],l=!0)},p(h,b){n=h;let v=t;t=c(n),t===v?f[t].p(n,b):(Ae(),F(f[v],1,1,()=>{f[v]=null}),De(),i=f[t],i?i.p(n,b):(i=f[t]=a[t](n),i.c()),T(i,1),i.m(e,o)),b[0]&786432&&ne(e,"selected",n[18](n[49]))},i(h){r||(T(i),r=!0)},o(h){F(i),r=!1},d(h){h&&k(e),f[t].d(),l=!1,rt(s)}}}function xp(n){let e,t,i,o=n[46].group!=hf&&Sp(n),r=n[46].items,l=[];for(let a=0;a<r.length;a+=1)l[a]=Cp(dp(n,r,a));const s=a=>F(l[a],1,1,()=>{l[a]=null});return{c(){o&&o.c(),e=$();for(let a=0;a<l.length;a+=1)l[a].c();t=lt()},m(a,f){o&&o.m(a,f),w(a,e,f);for(let c=0;c<l.length;c+=1)l[c].m(a,f);w(a,t,f),i=!0},p(a,f){if(a[46].group!=hf?o?o.p(a,f):(o=Sp(a),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),f[0]&7079424){r=a[46].items;let c;for(c=0;c<r.length;c+=1){const u=dp(a,r,c);l[c]?(l[c].p(u,f),T(l[c],1)):(l[c]=Cp(u),l[c].c(),T(l[c],1),l[c].m(t.parentNode,t))}for(Ae(),c=r.length;c<l.length;c+=1)s(c);De()}},i(a){if(!i){for(let f=0;f<r.length;f+=1)T(l[f]);i=!0}},o(a){l=l.filter(Boolean);for(let f=0;f<l.length;f+=1)F(l[f]);i=!1},d(a){o&&o.d(a),a&&k(e),qn(l,a),a&&k(t)}}}function OC(n){let e,t,i,o,r,l=n[11]&&vp(n);const s=n[33].beforeOptions,a=$n(s,n,n[42],pp);let f=n[19],c=[];for(let v=0;v<f.length;v+=1)c[v]=xp(up(n,f,v));const u=v=>F(c[v],1,1,()=>{c[v]=null});let d=null;f.length||(d=kp(n));const h=n[33].afterOptions,b=$n(h,n,n[42],cp);return{c(){l&&l.c(),e=$(),a&&a.c(),t=$(),i=g("div");for(let v=0;v<c.length;v+=1)c[v].c();d&&d.c(),o=$(),b&&b.c(),p(i,"class","options-list")},m(v,_){l&&l.m(v,_),w(v,e,_),a&&a.m(v,_),w(v,t,_),w(v,i,_);for(let y=0;y<c.length;y+=1)c[y].m(i,null);d&&d.m(i,null),w(v,o,_),b&&b.m(v,_),r=!0},p(v,_){if(v[11]?l?l.p(v,_):(l=vp(v),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),a&&a.p&&(!r||_[1]&2048)&&Dn(a,s,v,v[42],r?An(s,v[42],_,xC):On(v[42]),pp),_[0]&7079426){f=v[19];let y;for(y=0;y<f.length;y+=1){const S=up(v,f,y);c[y]?(c[y].p(S,_),T(c[y],1)):(c[y]=xp(S),c[y].c(),T(c[y],1),c[y].m(i,null))}for(Ae(),y=f.length;y<c.length;y+=1)u(y);De(),!f.length&&d?d.p(v,_):f.length?d&&(d.d(1),d=null):(d=kp(v),d.c(),d.m(i,null))}b&&b.p&&(!r||_[1]&2048)&&Dn(b,h,v,v[42],r?An(h,v[42],_,CC):On(v[42]),cp)},i(v){if(!r){T(a,v);for(let _=0;_<f.length;_+=1)T(c[_]);T(b,v),r=!0}},o(v){F(a,v),c=c.filter(Boolean);for(let _=0;_<c.length;_+=1)F(c[_]);F(b,v),r=!1},d(v){l&&l.d(v),v&&k(e),a&&a.d(v),v&&k(t),v&&k(i),qn(c,v),d&&d.d(),v&&k(o),b&&b.d(v)}}}function TC(n){let e,t,i,o,r,l,s=B.toArray(n[0]),a=[];for(let d=0;d<s.length;d+=1)a[d]=gp(hp(n,s,d));const f=d=>F(a[d],1,1,()=>{a[d]=null});let c=null;s.length||(c=mp(n));let u=!n[5]&&_p(n);return{c(){e=g("div"),t=g("div");for(let d=0;d<a.length;d+=1)a[d].c();c&&c.c(),o=$(),u&&u.c(),p(t,"tabindex",i=n[5]?"-1":"0"),p(t,"class","selected-container"),ne(t,"disabled",n[5]),p(e,"class",r="select "+n[12]),ne(e,"multiple",n[4]),ne(e,"disabled",n[5])},m(d,h){w(d,e,h),m(e,t);for(let b=0;b<a.length;b+=1)a[b].m(t,null);c&&c.m(t,null),n[35](t),m(e,o),u&&u.m(e,null),n[41](e),l=!0},p(d,h){if(h[0]&8661){s=B.toArray(d[0]);let b;for(b=0;b<s.length;b+=1){const v=hp(d,s,b);a[b]?(a[b].p(v,h),T(a[b],1)):(a[b]=gp(v),a[b].c(),T(a[b],1),a[b].m(t,null))}for(Ae(),b=s.length;b<a.length;b+=1)f(b);De(),!s.length&&c?c.p(d,h):s.length?c&&(c.d(1),c=null):(c=mp(d),c.c(),c.m(t,null))}(!l||h[0]&32&&i!==(i=d[5]?"-1":"0"))&&p(t,"tabindex",i),h[0]&32&&ne(t,"disabled",d[5]),d[5]?u&&(Ae(),F(u,1,1,()=>{u=null}),De()):u?(u.p(d,h),h[0]&32&&T(u,1)):(u=_p(d),u.c(),T(u,1),u.m(e,null)),(!l||h[0]&4096&&r!==(r="select "+d[12]))&&p(e,"class",r),h[0]&4112&&ne(e,"multiple",d[4]),h[0]&4128&&ne(e,"disabled",d[5])},i(d){if(!l){for(let h=0;h<s.length;h+=1)T(a[h]);T(u),l=!0}},o(d){a=a.filter(Boolean);for(let h=0;h<a.length;h+=1)F(a[h]);F(u),l=!1},d(d){d&&k(e),qn(a,d),c&&c.d(),n[35](null),u&&u.d(),n[41](null)}}}const hf="_base_";function EC(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 PC(n,e,t){let i,o,r,{$$slots:l={},$$scope:s}=e,{id:a=""}=e,{noOptionsText:f="No options found"}=e,{selectPlaceholder:c="- Select -"}=e,{searchPlaceholder:u="Search..."}=e,{items:d=[]}=e,{multiple:h=!1}=e,{disabled:b=!1}=e,{selected:v=h?[]:void 0}=e,{toggle:_=!1}=e,{labelComponent:y=void 0}=e,{labelComponentProps:S={}}=e,{optionComponent:C=void 0}=e,{optionComponentProps:x={}}=e,{searchable:M=!1}=e,{searchFunc:A=void 0}=e,{class:O=""}=e,D,E="",P,I;function R(se){if(B.isEmpty(v))return;let re=B.toArray(v);B.inArray(re,se)&&(B.removeByValue(re,se),t(0,v=re)),P==null||P.dispatchEvent(new CustomEvent("change",{detail:v,bubbles:!0}))}function G(se){if(h){let re=B.toArray(v);B.inArray(re,se)||t(0,v=[...re,se])}else t(0,v=se);P==null||P.dispatchEvent(new CustomEvent("change",{detail:v,bubbles:!0}))}function U(se){return r(se)?R(se):G(se)}function z(){t(0,v=h?[]:void 0)}function K(){D!=null&&D.show&&(D==null||D.show())}function Y(){D!=null&&D.hide&&(D==null||D.hide())}function W(){if(B.isEmpty(v)||B.isEmpty(i))return;let se=B.toArray(v),re=[];for(const ke of se){let He=!1;for(const qe of i)if(B.inArray(qe.items,ke)){He=!0;break}He||re.push(ke)}if(re.length){for(const ke of re)B.removeByValue(se,ke);t(0,v=h?se:se[0])}}function te(){t(14,E="")}function ce(se,re){var qe;const ke=[],He=A||EC;for(const Je of se){let be;typeof re=="string"&&re.length?be=((qe=Je.items)==null?void 0:qe.filter(Oe=>He(Oe,re)))||[]:be=Je.items||[],be.length&&ke.push({group:Je.group,items:be})}return ke}function ve(se,re){se.preventDefault(),_&&h?U(re):G(re)}function oe(se,re){(se.code==="Enter"||se.code==="Space")&&ve(se,re)}function J(){te(),setTimeout(()=>{const se=P==null?void 0:P.querySelector(".dropdown-item.option.selected");se&&(se.focus(),se.scrollIntoView({block:"nearest"}))},0)}function $e(se){se.stopPropagation(),!b&&(D==null||D.toggle())}di(()=>{const se=document.querySelectorAll(`label[for="${a}"]`);for(const re of se)re.addEventListener("click",$e);return()=>{for(const re of se)re.removeEventListener("click",$e)}});const ee=se=>R(se);function _e(se){he[se?"unshift":"push"](()=>{I=se,t(17,I)})}function fe(){E=this.value,t(14,E)}const ie=(se,re)=>ve(re,se),ye=(se,re)=>oe(re,se);function Ne(se){he[se?"unshift":"push"](()=>{D=se,t(15,D)})}function Pe(se){ft.call(this,n,se)}function ze(se){he[se?"unshift":"push"](()=>{P=se,t(16,P)})}return n.$$set=se=>{"id"in se&&t(24,a=se.id),"noOptionsText"in se&&t(1,f=se.noOptionsText),"selectPlaceholder"in se&&t(2,c=se.selectPlaceholder),"searchPlaceholder"in se&&t(3,u=se.searchPlaceholder),"items"in se&&t(25,d=se.items),"multiple"in se&&t(4,h=se.multiple),"disabled"in se&&t(5,b=se.disabled),"selected"in se&&t(0,v=se.selected),"toggle"in se&&t(6,_=se.toggle),"labelComponent"in se&&t(7,y=se.labelComponent),"labelComponentProps"in se&&t(8,S=se.labelComponentProps),"optionComponent"in se&&t(9,C=se.optionComponent),"optionComponentProps"in se&&t(10,x=se.optionComponentProps),"searchable"in se&&t(11,M=se.searchable),"searchFunc"in se&&t(26,A=se.searchFunc),"class"in se&&t(12,O=se.class),"$$scope"in se&&t(42,s=se.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&t(32,i=B.isObjectArrayWithKeys(d,["group"])?d:[{group:hf,items:d}]),n.$$.dirty[0]&33554432&&d&&(W(),te()),n.$$.dirty[0]&16384|n.$$.dirty[1]&2&&t(19,o=ce(i,E)),n.$$.dirty[0]&1&&t(18,r=function(se){let re=B.toArray(v);return B.inArray(re,se)})},[v,f,c,u,h,b,_,y,S,C,x,M,O,R,E,D,P,I,r,o,te,ve,oe,J,a,d,A,G,U,z,K,Y,i,l,ee,_e,fe,ie,ye,Ne,Pe,ze,s]}class D1 extends Ie{constructor(e){super(),Le(this,e,PC,TC,Ee,{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 Mp(n){let e,t;return{c(){e=g("i"),p(e,"class",t="icon "+n[0].icon)},m(i,o){w(i,e,o)},p(i,o){o&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&k(e)}}}function FC(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",o,r=n[0].icon&&Mp(n);return{c(){r&&r.c(),e=$(),t=g("span"),o=j(i),p(t,"class","txt")},m(l,s){r&&r.m(l,s),w(l,e,s),w(l,t,s),m(t,o)},p(l,[s]){l[0].icon?r?r.p(l,s):(r=Mp(l),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),s&1&&i!==(i=(l[0].label||l[0].name||l[0].title||l[0].id||l[0].value)+"")&&ge(o,i)},i:le,o:le,d(l){r&&r.d(l),l&&k(e),l&&k(t)}}}function LC(n,e,t){let{item:i={}}=e;return n.$$set=o=>{"item"in o&&t(0,i=o.item)},[i]}class $p extends Ie{constructor(e){super(),Le(this,e,LC,FC,Ee,{item:0})}}const IC=n=>({}),Ap=n=>({});function RC(n){let e;const t=n[8].afterOptions,i=$n(t,n,n[12],Ap);return{c(){i&&i.c()},m(o,r){i&&i.m(o,r),e=!0},p(o,r){i&&i.p&&(!e||r&4096)&&Dn(i,t,o,o[12],e?An(t,o[12],r,IC):On(o[12]),Ap)},i(o){e||(T(i,o),e=!0)},o(o){F(i,o),e=!1},d(o){i&&i.d(o)}}}function NC(n){let e,t,i;const o=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function r(s){n[9](s)}let l={$$slots:{afterOptions:[RC]},$$scope:{ctx:n}};for(let s=0;s<o.length;s+=1)l=ut(l,o[s]);return n[0]!==void 0&&(l.selected=n[0]),e=new D1({props:l}),he.push(()=>Fe(e,"selected",r)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){V(e.$$.fragment)},m(s,a){H(e,s,a),i=!0},p(s,[a]){const f=a&62?bn(o,[a&2&&{items:s[1]},a&4&&{multiple:s[2]},a&8&&{labelComponent:s[3]},a&16&&{optionComponent:s[4]},a&32&&pi(s[5])]):{};a&4096&&(f.$$scope={dirty:a,ctx:s}),!t&&a&1&&(t=!0,f.selected=s[0],Re(()=>t=!1)),e.$set(f)},i(s){i||(T(e.$$.fragment,s),i=!0)},o(s){F(e.$$.fragment,s),i=!1},d(s){q(e,s)}}}function jC(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let o=Wt(e,i),{$$slots:r={},$$scope:l}=e,{items:s=[]}=e,{multiple:a=!1}=e,{selected:f=a?[]:void 0}=e,{labelComponent:c=$p}=e,{optionComponent:u=$p}=e,{selectionKey:d="value"}=e,{keyOfSelected:h=a?[]:void 0}=e;function b(x){x=B.toArray(x,!0);let M=[],A=_();for(let O of A)B.inArray(x,O[d])&&M.push(O);x.length&&!M.length||t(0,f=a?M:M[0])}async function v(x){let M=B.toArray(x,!0).map(A=>A[d]);!s.length||t(6,h=a?M:M[0])}function _(){if(!B.isObjectArrayWithKeys(s,["group","items"]))return s;let x=[];for(const M of s)x=x.concat(M.items);return x}function y(x){f=x,t(0,f)}function S(x){ft.call(this,n,x)}function C(x){ft.call(this,n,x)}return n.$$set=x=>{e=ut(ut({},e),ui(x)),t(5,o=Wt(e,i)),"items"in x&&t(1,s=x.items),"multiple"in x&&t(2,a=x.multiple),"selected"in x&&t(0,f=x.selected),"labelComponent"in x&&t(3,c=x.labelComponent),"optionComponent"in x&&t(4,u=x.optionComponent),"selectionKey"in x&&t(7,d=x.selectionKey),"keyOfSelected"in x&&t(6,h=x.keyOfSelected),"$$scope"in x&&t(12,l=x.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&s&&b(h),n.$$.dirty&1&&v(f)},[f,s,a,c,u,o,h,d,r,y,S,C,l]}class yo extends Ie{constructor(e){super(),Le(this,e,jC,NC,Ee,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function zC(n){let e,t,i;const o=[{class:"field-type-select "+n[1]},{searchable:!0},{items:n[2]},n[3]];function r(s){n[4](s)}let l={};for(let s=0;s<o.length;s+=1)l=ut(l,o[s]);return n[0]!==void 0&&(l.keyOfSelected=n[0]),e=new yo({props:l}),he.push(()=>Fe(e,"keyOfSelected",r)),{c(){V(e.$$.fragment)},m(s,a){H(e,s,a),i=!0},p(s,[a]){const f=a&14?bn(o,[a&2&&{class:"field-type-select "+s[1]},o[1],a&4&&{items:s[2]},a&8&&pi(s[3])]):{};!t&&a&1&&(t=!0,f.keyOfSelected=s[0],Re(()=>t=!1)),e.$set(f)},i(s){i||(T(e.$$.fragment,s),i=!0)},o(s){F(e.$$.fragment,s),i=!1},d(s){q(e,s)}}}function HC(n,e,t){const i=["value","class"];let o=Wt(e,i),{value:r="text"}=e,{class:l=""}=e;const s=[{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(f){r=f,t(0,r)}return n.$$set=f=>{e=ut(ut({},e),ui(f)),t(3,o=Wt(e,i)),"value"in f&&t(0,r=f.value),"class"in f&&t(1,l=f.class)},[r,l,s,o,a]}class qC extends Ie{constructor(e){super(),Le(this,e,HC,zC,Ee,{value:0,class:1})}}function VC(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Min length"),o=$(),r=g("input"),p(e,"for",i=n[5]),p(r,"type","number"),p(r,"id",l=n[5]),p(r,"step","1"),p(r,"min","0")},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].min),s||(a=X(r,"input",n[2]),s=!0)},p(f,c){c&32&&i!==(i=f[5])&&p(e,"for",i),c&32&&l!==(l=f[5])&&p(r,"id",l),c&1&&At(r.value)!==f[0].min&&Me(r,f[0].min)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function BC(n){let e,t,i,o,r,l,s,a,f;return{c(){e=g("label"),t=j("Max length"),o=$(),r=g("input"),p(e,"for",i=n[5]),p(r,"type","number"),p(r,"id",l=n[5]),p(r,"step","1"),p(r,"min",s=n[0].min||0)},m(c,u){w(c,e,u),m(e,t),w(c,o,u),w(c,r,u),Me(r,n[0].max),a||(f=X(r,"input",n[3]),a=!0)},p(c,u){u&32&&i!==(i=c[5])&&p(e,"for",i),u&32&&l!==(l=c[5])&&p(r,"id",l),u&1&&s!==(s=c[0].min||0)&&p(r,"min",s),u&1&&At(r.value)!==c[0].max&&Me(r,c[0].max)},d(c){c&&k(e),c&&k(o),c&&k(r),a=!1,f()}}}function UC(n){let e,t,i,o,r,l,s,a,f,c;return{c(){e=g("label"),t=j("Regex pattern"),o=$(),r=g("input"),s=$(),a=g("div"),a.innerHTML="Valid Go regular expression, eg. <code>^\\w+$</code>.",p(e,"for",i=n[5]),p(r,"type","text"),p(r,"id",l=n[5]),p(a,"class","help-block")},m(u,d){w(u,e,d),m(e,t),w(u,o,d),w(u,r,d),Me(r,n[0].pattern),w(u,s,d),w(u,a,d),f||(c=X(r,"input",n[4]),f=!0)},p(u,d){d&32&&i!==(i=u[5])&&p(e,"for",i),d&32&&l!==(l=u[5])&&p(r,"id",l),d&1&&r.value!==u[0].pattern&&Me(r,u[0].pattern)},d(u){u&&k(e),u&&k(o),u&&k(r),u&&k(s),u&&k(a),f=!1,c()}}}function WC(n){let e,t,i,o,r,l,s,a,f,c;return i=new je({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[VC,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[BC,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),f=new je({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[UC,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),s=$(),a=g("div"),V(f.$$.fragment),p(t,"class","col-sm-6"),p(r,"class","col-sm-6"),p(a,"class","col-sm-12"),p(e,"class","grid")},m(u,d){w(u,e,d),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),m(e,s),m(e,a),H(f,a,null),c=!0},p(u,[d]){const h={};d&2&&(h.name="schema."+u[1]+".options.min"),d&97&&(h.$$scope={dirty:d,ctx:u}),i.$set(h);const b={};d&2&&(b.name="schema."+u[1]+".options.max"),d&97&&(b.$$scope={dirty:d,ctx:u}),l.$set(b);const v={};d&2&&(v.name="schema."+u[1]+".options.pattern"),d&97&&(v.$$scope={dirty:d,ctx:u}),f.$set(v)},i(u){c||(T(i.$$.fragment,u),T(l.$$.fragment,u),T(f.$$.fragment,u),c=!0)},o(u){F(i.$$.fragment,u),F(l.$$.fragment,u),F(f.$$.fragment,u),c=!1},d(u){u&&k(e),q(i),q(l),q(f)}}}function YC(n,e,t){let{key:i=""}=e,{options:o={}}=e;function r(){o.min=At(this.value),t(0,o)}function l(){o.max=At(this.value),t(0,o)}function s(){o.pattern=this.value,t(0,o)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"options"in a&&t(0,o=a.options)},[o,i,r,l,s]}class GC extends Ie{constructor(e){super(),Le(this,e,YC,WC,Ee,{key:1,options:0})}}function KC(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Min"),o=$(),r=g("input"),p(e,"for",i=n[4]),p(r,"type","number"),p(r,"id",l=n[4])},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].min),s||(a=X(r,"input",n[2]),s=!0)},p(f,c){c&16&&i!==(i=f[4])&&p(e,"for",i),c&16&&l!==(l=f[4])&&p(r,"id",l),c&1&&At(r.value)!==f[0].min&&Me(r,f[0].min)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function JC(n){let e,t,i,o,r,l,s,a,f;return{c(){e=g("label"),t=j("Max"),o=$(),r=g("input"),p(e,"for",i=n[4]),p(r,"type","number"),p(r,"id",l=n[4]),p(r,"min",s=n[0].min)},m(c,u){w(c,e,u),m(e,t),w(c,o,u),w(c,r,u),Me(r,n[0].max),a||(f=X(r,"input",n[3]),a=!0)},p(c,u){u&16&&i!==(i=c[4])&&p(e,"for",i),u&16&&l!==(l=c[4])&&p(r,"id",l),u&1&&s!==(s=c[0].min)&&p(r,"min",s),u&1&&At(r.value)!==c[0].max&&Me(r,c[0].max)},d(c){c&&k(e),c&&k(o),c&&k(r),a=!1,f()}}}function ZC(n){let e,t,i,o,r,l,s;return i=new je({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[KC,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[JC,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),p(t,"class","col-sm-6"),p(r,"class","col-sm-6"),p(e,"class","grid")},m(a,f){w(a,e,f),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),s=!0},p(a,[f]){const c={};f&2&&(c.name="schema."+a[1]+".options.min"),f&49&&(c.$$scope={dirty:f,ctx:a}),i.$set(c);const u={};f&2&&(u.name="schema."+a[1]+".options.max"),f&49&&(u.$$scope={dirty:f,ctx:a}),l.$set(u)},i(a){s||(T(i.$$.fragment,a),T(l.$$.fragment,a),s=!0)},o(a){F(i.$$.fragment,a),F(l.$$.fragment,a),s=!1},d(a){a&&k(e),q(i),q(l)}}}function XC(n,e,t){let{key:i=""}=e,{options:o={}}=e;function r(){o.min=At(this.value),t(0,o)}function l(){o.max=At(this.value),t(0,o)}return n.$$set=s=>{"key"in s&&t(1,i=s.key),"options"in s&&t(0,o=s.options)},[o,i,r,l]}class QC extends Ie{constructor(e){super(),Le(this,e,XC,ZC,Ee,{key:1,options:0})}}function e5(n,e,t){let{key:i=""}=e,{options:o={}}=e;return n.$$set=r=>{"key"in r&&t(0,i=r.key),"options"in r&&t(1,o=r.options)},[i,o]}class t5 extends Ie{constructor(e){super(),Le(this,e,e5,null,Ee,{key:0,options:1})}}function n5(n){let e,t,i,o,r=[{type:t=n[3].type||"text"},{value:n[2]},n[3]],l={};for(let s=0;s<r.length;s+=1)l=ut(l,r[s]);return{c(){e=g("input"),ci(e,l)},m(s,a){w(s,e,a),e.value=l.value,e.autofocus&&e.focus(),i||(o=X(e,"input",n[4]),i=!0)},p(s,[a]){ci(e,l=bn(r,[a&8&&t!==(t=s[3].type||"text")&&{type:t},a&4&&e.value!==s[2]&&{value:s[2]},a&8&&s[3]])),"value"in l&&(e.value=l.value)},i:le,o:le,d(s){s&&k(e),i=!1,o()}}}function i5(n,e,t){let i;const o=["value","separator"];let r=Wt(e,o),{value:l=[]}=e,{separator:s=","}=e;const a=f=>{t(0,l=B.splitNonEmpty(f.target.value,s))};return n.$$set=f=>{e=ut(ut({},e),ui(f)),t(3,r=Wt(e,o)),"value"in f&&t(0,l=f.value),"separator"in f&&t(1,s=f.separator)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=(l||[]).join(","))},[l,s,i,r,a]}class ko extends Ie{constructor(e){super(),Le(this,e,i5,n5,Ee,{value:0,separator:1})}}function o5(n){let e,t,i,o,r,l,s,a,f,c,u,d,h;function b(_){n[2](_)}let v={id:n[4],disabled:!B.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(v.value=n[0].exceptDomains),s=new ko({props:v}),he.push(()=>Fe(s,"value",b)),{c(){e=g("label"),t=g("span"),t.textContent="Except domains",i=$(),o=g("i"),l=$(),V(s.$$.fragment),f=$(),c=g("div"),c.textContent="Use comma as separator.",p(t,"class","txt"),p(o,"class","ri-information-line link-hint"),p(e,"for",r=n[4]),p(c,"class","help-block")},m(_,y){w(_,e,y),m(e,t),m(e,i),m(e,o),w(_,l,y),H(s,_,y),w(_,f,y),w(_,c,y),u=!0,d||(h=Xe(St.call(null,o,{text:`Domains that are NOT allowed as value.
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!u||y&16&&r!==(r=_[4]))&&p(e,"for",r);const S={};y&16&&(S.id=_[4]),y&1&&(S.disabled=!B.isEmpty(_[0].onlyDomains)),!a&&y&1&&(a=!0,S.value=_[0].exceptDomains,Re(()=>a=!1)),s.$set(S)},i(_){u||(T(s.$$.fragment,_),u=!0)},o(_){F(s.$$.fragment,_),u=!1},d(_){_&&k(e),_&&k(l),q(s,_),_&&k(f),_&&k(c),d=!1,h()}}}function r5(n){let e,t,i,o,r,l,s,a,f,c,u,d,h;function b(_){n[3](_)}let v={id:n[4]+".options.onlyDomains",disabled:!B.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),s=new ko({props:v}),he.push(()=>Fe(s,"value",b)),{c(){e=g("label"),t=g("span"),t.textContent="Only domains",i=$(),o=g("i"),l=$(),V(s.$$.fragment),f=$(),c=g("div"),c.textContent="Use comma as separator.",p(t,"class","txt"),p(o,"class","ri-information-line link-hint"),p(e,"for",r=n[4]+".options.onlyDomains"),p(c,"class","help-block")},m(_,y){w(_,e,y),m(e,t),m(e,i),m(e,o),w(_,l,y),H(s,_,y),w(_,f,y),w(_,c,y),u=!0,d||(h=Xe(St.call(null,o,{text:`Domains that are ONLY allowed as value.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!u||y&16&&r!==(r=_[4]+".options.onlyDomains"))&&p(e,"for",r);const S={};y&16&&(S.id=_[4]+".options.onlyDomains"),y&1&&(S.disabled=!B.isEmpty(_[0].exceptDomains)),!a&&y&1&&(a=!0,S.value=_[0].onlyDomains,Re(()=>a=!1)),s.$set(S)},i(_){u||(T(s.$$.fragment,_),u=!0)},o(_){F(s.$$.fragment,_),u=!1},d(_){_&&k(e),_&&k(l),q(s,_),_&&k(f),_&&k(c),d=!1,h()}}}function l5(n){let e,t,i,o,r,l,s;return i=new je({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[o5,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[r5,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),p(t,"class","col-sm-6"),p(r,"class","col-sm-6"),p(e,"class","grid")},m(a,f){w(a,e,f),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),s=!0},p(a,[f]){const c={};f&2&&(c.name="schema."+a[1]+".options.exceptDomains"),f&49&&(c.$$scope={dirty:f,ctx:a}),i.$set(c);const u={};f&2&&(u.name="schema."+a[1]+".options.onlyDomains"),f&49&&(u.$$scope={dirty:f,ctx:a}),l.$set(u)},i(a){s||(T(i.$$.fragment,a),T(l.$$.fragment,a),s=!0)},o(a){F(i.$$.fragment,a),F(l.$$.fragment,a),s=!1},d(a){a&&k(e),q(i),q(l)}}}function s5(n,e,t){let{key:i=""}=e,{options:o={}}=e;function r(s){n.$$.not_equal(o.exceptDomains,s)&&(o.exceptDomains=s,t(0,o))}function l(s){n.$$.not_equal(o.onlyDomains,s)&&(o.onlyDomains=s,t(0,o))}return n.$$set=s=>{"key"in s&&t(1,i=s.key),"options"in s&&t(0,o=s.options)},[o,i,r,l]}class O1 extends Ie{constructor(e){super(),Le(this,e,s5,l5,Ee,{key:1,options:0})}}function a5(n){let e,t,i,o;function r(a){n[2](a)}function l(a){n[3](a)}let s={};return n[0]!==void 0&&(s.key=n[0]),n[1]!==void 0&&(s.options=n[1]),e=new O1({props:s}),he.push(()=>Fe(e,"key",r)),he.push(()=>Fe(e,"options",l)),{c(){V(e.$$.fragment)},m(a,f){H(e,a,f),o=!0},p(a,[f]){const c={};!t&&f&1&&(t=!0,c.key=a[0],Re(()=>t=!1)),!i&&f&2&&(i=!0,c.options=a[1],Re(()=>i=!1)),e.$set(c)},i(a){o||(T(e.$$.fragment,a),o=!0)},o(a){F(e.$$.fragment,a),o=!1},d(a){q(e,a)}}}function f5(n,e,t){let{key:i=""}=e,{options:o={}}=e;function r(s){i=s,t(0,i)}function l(s){o=s,t(1,o)}return n.$$set=s=>{"key"in s&&t(0,i=s.key),"options"in s&&t(1,o=s.options)},[i,o,r,l]}class c5 extends Ie{constructor(e){super(),Le(this,e,f5,a5,Ee,{key:0,options:1})}}var Sa=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],zo={_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!="undefined"&&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},Hr={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},gn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Nn=function(n){return n===!0?1:0};function Dp(n,e){var t;return function(){var i=this,o=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,o)},e)}}var Ca=function(n){return n instanceof Array?n:[n]};function un(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function wt(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 Fl(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function T1(n,e){if(e(n))return n;if(n.parentNode)return T1(n.parentNode,e)}function Ll(n,e){var t=wt("div","numInputWrapper"),i=wt("input","numInput "+n),o=wt("span","arrowUp"),r=wt("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var l in e)i.setAttribute(l,e[l]);return t.appendChild(i),t.appendChild(o),t.appendChild(r),t}function wn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var xa=function(){},_s=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},u5={D:xa,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*Nn(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),o=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return o.setDate(o.getDate()-o.getDay()+t.firstDayOfWeek),o},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:xa,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:xa,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},lo={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})"},Tr={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[Tr.w(n,e,t)]},F:function(n,e,t){return _s(Tr.n(n,e,t)-1,!1,e)},G:function(n,e,t){return gn(Tr.h(n,e,t))},H:function(n){return gn(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[Nn(n.getHours()>11)]},M:function(n,e){return _s(n.getMonth(),!0,e)},S:function(n){return gn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return gn(n.getFullYear(),4)},d:function(n){return gn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return gn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return gn(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)}},E1=function(n){var e=n.config,t=e===void 0?zo:e,i=n.l10n,o=i===void 0?Hr:i,r=n.isMobile,l=r===void 0?!1:r;return function(s,a,f){var c=f||o;return t.formatDate!==void 0&&!l?t.formatDate(s,a,c):a.split("").map(function(u,d,h){return Tr[u]&&h[d-1]!=="\\"?Tr[u](s,c,t):u!=="\\"?u:""}).join("")}},mf=function(n){var e=n.config,t=e===void 0?zo:e,i=n.l10n,o=i===void 0?Hr:i;return function(r,l,s,a){if(!(r!==0&&!r)){var f=a||o,c,u=r;if(r instanceof Date)c=new Date(r.getTime());else if(typeof r!="string"&&r.toFixed!==void 0)c=new Date(r);else if(typeof r=="string"){var d=l||(t||zo).dateFormat,h=String(r).trim();if(h==="today")c=new Date,s=!0;else if(t&&t.parseDate)c=t.parseDate(r,d);else if(/Z$/.test(h)||/GMT$/.test(h))c=new Date(r);else{for(var b=void 0,v=[],_=0,y=0,S="";_<d.length;_++){var C=d[_],x=C==="\\",M=d[_-1]==="\\"||x;if(lo[C]&&!M){S+=lo[C];var A=new RegExp(S).exec(r);A&&(b=!0)&&v[C!=="Y"?"push":"unshift"]({fn:u5[C],val:A[++y]})}else x||(S+=".")}c=!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 D=O.fn,E=O.val;return c=D(c,E,f)||c}),c=b?c:void 0}}if(!(c instanceof Date&&!isNaN(c.getTime()))){t.errorHandler(new Error("Invalid date provided: "+u));return}return s===!0&&c.setHours(0,0,0,0),c}}};function Sn(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 d5=function(n,e,t){return n>Math.min(e,t)&&n<Math.max(e,t)},Ma=function(n,e,t){return n*3600+e*60+t},p5=function(n){var e=Math.floor(n/3600),t=(n-e*3600)/60;return[e,t,n-e*3600-t*60]},h5={DAY:864e5};function $a(n){var e=n.defaultHour,t=n.defaultMinute,i=n.defaultSeconds;if(n.minDate!==void 0){var o=n.minDate.getHours(),r=n.minDate.getMinutes(),l=n.minDate.getSeconds();e<o&&(e=o),e===o&&t<r&&(t=r),e===o&&t===r&&i<l&&(i=n.minDate.getSeconds())}if(n.maxDate!==void 0){var s=n.maxDate.getHours(),a=n.maxDate.getMinutes();e=Math.min(e,s),e===s&&(t=Math.min(a,t)),e===s&&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(s){s&&Object.keys(s).forEach(function(a){return n[a]=s[a]})},o=0,r=e;o<r.length;o++){var l=r[o];i(l)}return n});var ln=globalThis&&globalThis.__assign||function(){return ln=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},ln.apply(this,arguments)},Op=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),o=0,e=0;e<t;e++)for(var r=arguments[e],l=0,s=r.length;l<s;l++,o++)i[o]=r[l];return i},m5=300;function b5(n,e){var t={config:ln(ln({},zo),Ut.defaultConfig),l10n:Hr};t.parseDate=mf({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=v,t._setHoursFromDate=d,t._positionCalendar=be,t.changeMonth=ve,t.changeYear=fe,t.clear=oe,t.close=J,t.onMouseOver=ze,t._createElement=wt,t.createDay=A,t.destroy=$e,t.isEnabled=ie,t.jumpToDate=S,t.updateValue=zt,t.open=re,t.redraw=ae,t.set=bt,t.setDate=vt,t.toggle=Ye;function i(){t.utils={getDaysInMonth:function(L,N){return L===void 0&&(L=t.currentMonth),N===void 0&&(N=t.currentYear),L===1&&(N%4===0&&N%100!==0||N%400===0)?29:t.l10n.daysInMonth[L]}}}function o(){t.element=t.input=n,t.isOpen=!1,He(),Je(),$t(),Mt(),i(),t.isMobile||M(),y(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&d(t.config.noCalendar?t.latestSelectedDateObj:void 0),zt(!1)),s();var L=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&L&&be(),ot("onReady")}function r(){var L;return((L=t.calendarContainer)===null||L===void 0?void 0:L.getRootNode()).activeElement||document.activeElement}function l(L){return L.bind(t)}function s(){var L=t.config;L.weekNumbers===!1&&L.showMonths===1||L.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 N=(t.days.offsetWidth+1)*L.showMonths;t.daysContainer.style.width=N+"px",t.calendarContainer.style.width=N+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function a(L){if(t.selectedDates.length===0){var N=t.config.minDate===void 0||Sn(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),Q=$a(t.config);N.setHours(Q.hours,Q.minutes,Q.seconds,N.getMilliseconds()),t.selectedDates=[N],t.latestSelectedDateObj=N}L!==void 0&&L.type!=="blur"&&pe(L);var de=t._input.value;u(),zt(),t._input.value!==de&&t._debouncedChange()}function f(L,N){return L%12+12*Nn(N===t.l10n.amPM[1])}function c(L){switch(L%24){case 0:case 12:return 12;default:return L%12}}function u(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var L=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,N=(parseInt(t.minuteElement.value,10)||0)%60,Q=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(L=f(L,t.amPM.textContent));var de=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&Sn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Te=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&Sn(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 Ue=Ma(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),tt=Ma(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Ge=Ma(L,N,Q);if(Ge>tt&&Ge<Ue){var nt=p5(Ue);L=nt[0],N=nt[1],Q=nt[2]}}else{if(Te){var Ke=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;L=Math.min(L,Ke.getHours()),L===Ke.getHours()&&(N=Math.min(N,Ke.getMinutes())),N===Ke.getMinutes()&&(Q=Math.min(Q,Ke.getSeconds()))}if(de){var et=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;L=Math.max(L,et.getHours()),L===et.getHours()&&N<et.getMinutes()&&(N=et.getMinutes()),N===et.getMinutes()&&(Q=Math.max(Q,et.getSeconds()))}}h(L,N,Q)}}function d(L){var N=L||t.latestSelectedDateObj;N&&N instanceof Date&&h(N.getHours(),N.getMinutes(),N.getSeconds())}function h(L,N,Q){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(L%24,N,Q||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=gn(t.config.time_24hr?L:(12+L)%12+12*Nn(L%12===0)),t.minuteElement.value=gn(N),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[Nn(L>=12)]),t.secondElement!==void 0&&(t.secondElement.value=gn(Q)))}function b(L){var N=wn(L),Q=parseInt(N.value)+(L.delta||0);(Q/1e3>1||L.key==="Enter"&&!/[^\d]/.test(Q.toString()))&&fe(Q)}function v(L,N,Q,de){if(N instanceof Array)return N.forEach(function(Te){return v(L,Te,Q,de)});if(L instanceof Array)return L.forEach(function(Te){return v(Te,N,Q,de)});L.addEventListener(N,Q,de),t._handlers.push({remove:function(){return L.removeEventListener(N,Q,de)}})}function _(){ot("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(Q){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+Q+"]"),function(de){return v(de,"click",t[Q])})}),t.isMobile){Ce();return}var L=Dp(se,50);if(t._debouncedChange=Dp(_,m5),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&v(t.daysContainer,"mouseover",function(Q){t.config.mode==="range"&&ze(wn(Q))}),v(t._input,"keydown",Pe),t.calendarContainer!==void 0&&v(t.calendarContainer,"keydown",Pe),!t.config.inline&&!t.config.static&&v(window,"resize",L),window.ontouchstart!==void 0?v(window.document,"touchstart",_e):v(window.document,"mousedown",_e),v(window.document,"focus",_e,{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",ni),v(t.monthNav,["keyup","increment"],b),v(t.daysContainer,"click",yt)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var N=function(Q){return wn(Q).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"],N),t.secondElement!==void 0&&v(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&v(t.amPM,"click",function(Q){a(Q)})}t.config.allowInput&&v(t._input,"blur",Ne)}function S(L,N){var Q=L!==void 0?t.parseDate(L):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),de=t.currentYear,Te=t.currentMonth;try{Q!==void 0&&(t.currentYear=Q.getFullYear(),t.currentMonth=Q.getMonth())}catch(Ue){Ue.message="Invalid date supplied: "+Q,t.config.errorHandler(Ue)}N&&t.currentYear!==de&&(ot("onYearChange"),G()),N&&(t.currentYear!==de||t.currentMonth!==Te)&&ot("onMonthChange"),t.redraw()}function C(L){var N=wn(L);~N.className.indexOf("arrow")&&x(L,N.classList.contains("arrowUp")?1:-1)}function x(L,N,Q){var de=L&&wn(L),Te=Q||de&&de.parentNode&&de.parentNode.firstChild,Ue=cn("increment");Ue.delta=N,Te&&Te.dispatchEvent(Ue)}function M(){var L=window.document.createDocumentFragment();if(t.calendarContainer=wt("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(L.appendChild(K()),t.innerContainer=wt("div","flatpickr-innerContainer"),t.config.weekNumbers){var N=ce(),Q=N.weekWrapper,de=N.weekNumbers;t.innerContainer.appendChild(Q),t.weekNumbers=de,t.weekWrapper=Q}t.rContainer=wt("div","flatpickr-rContainer"),t.rContainer.appendChild(W()),t.daysContainer||(t.daysContainer=wt("div","flatpickr-days"),t.daysContainer.tabIndex=-1),R(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),L.appendChild(t.innerContainer)}t.config.enableTime&&L.appendChild(Y()),un(t.calendarContainer,"rangeMode",t.config.mode==="range"),un(t.calendarContainer,"animate",t.config.animate===!0),un(t.calendarContainer,"multiMonth",t.config.showMonths>1),t.calendarContainer.appendChild(L);var Te=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Te&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Ue=wt("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ue,t.element),Ue.appendChild(t.element),t.altInput&&Ue.appendChild(t.altInput),Ue.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function A(L,N,Q,de){var Te=ie(N,!0),Ue=wt("span",L,N.getDate().toString());return Ue.dateObj=N,Ue.$i=de,Ue.setAttribute("aria-label",t.formatDate(N,t.config.ariaDateFormat)),L.indexOf("hidden")===-1&&Sn(N,t.now)===0&&(t.todayDateElem=Ue,Ue.classList.add("today"),Ue.setAttribute("aria-current","date")),Te?(Ue.tabIndex=-1,ue(N)&&(Ue.classList.add("selected"),t.selectedDateElem=Ue,t.config.mode==="range"&&(un(Ue,"startRange",t.selectedDates[0]&&Sn(N,t.selectedDates[0],!0)===0),un(Ue,"endRange",t.selectedDates[1]&&Sn(N,t.selectedDates[1],!0)===0),L==="nextMonthDay"&&Ue.classList.add("inRange")))):Ue.classList.add("flatpickr-disabled"),t.config.mode==="range"&&we(N)&&!ue(N)&&Ue.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&L!=="prevMonthDay"&&de%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(N)+"</span>"),ot("onDayCreate",Ue),Ue}function O(L){L.focus(),t.config.mode==="range"&&ze(L)}function D(L){for(var N=L>0?0:t.config.showMonths-1,Q=L>0?t.config.showMonths:-1,de=N;de!=Q;de+=L)for(var Te=t.daysContainer.children[de],Ue=L>0?0:Te.children.length-1,tt=L>0?Te.children.length:-1,Ge=Ue;Ge!=tt;Ge+=L){var nt=Te.children[Ge];if(nt.className.indexOf("hidden")===-1&&ie(nt.dateObj))return nt}}function E(L,N){for(var Q=L.className.indexOf("Month")===-1?L.dateObj.getMonth():t.currentMonth,de=N>0?t.config.showMonths:-1,Te=N>0?1:-1,Ue=Q-t.currentMonth;Ue!=de;Ue+=Te)for(var tt=t.daysContainer.children[Ue],Ge=Q-t.currentMonth===Ue?L.$i+N:N<0?tt.children.length-1:0,nt=tt.children.length,Ke=Ge;Ke>=0&&Ke<nt&&Ke!=(N>0?nt:-1);Ke+=Te){var et=tt.children[Ke];if(et.className.indexOf("hidden")===-1&&ie(et.dateObj)&&Math.abs(L.$i-Ke)>=Math.abs(N))return O(et)}t.changeMonth(Te),P(D(Te),0)}function P(L,N){var Q=r(),de=ye(Q||document.body),Te=L!==void 0?L:de?Q:t.selectedDateElem!==void 0&&ye(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&ye(t.todayDateElem)?t.todayDateElem:D(N>0?1:-1);Te===void 0?t._input.focus():de?E(Te,N):O(Te)}function I(L,N){for(var Q=(new Date(L,N,1).getDay()-t.l10n.firstDayOfWeek+7)%7,de=t.utils.getDaysInMonth((N-1+12)%12,L),Te=t.utils.getDaysInMonth(N,L),Ue=window.document.createDocumentFragment(),tt=t.config.showMonths>1,Ge=tt?"prevMonthDay hidden":"prevMonthDay",nt=tt?"nextMonthDay hidden":"nextMonthDay",Ke=de+1-Q,et=0;Ke<=de;Ke++,et++)Ue.appendChild(A("flatpickr-day "+Ge,new Date(L,N-1,Ke),Ke,et));for(Ke=1;Ke<=Te;Ke++,et++)Ue.appendChild(A("flatpickr-day",new Date(L,N,Ke),Ke,et));for(var gt=Te+1;gt<=42-Q&&(t.config.showMonths===1||et%7!==0);gt++,et++)Ue.appendChild(A("flatpickr-day "+nt,new Date(L,N+1,gt%Te),gt,et));var Ft=wt("div","dayContainer");return Ft.appendChild(Ue),Ft}function R(){if(t.daysContainer!==void 0){Fl(t.daysContainer),t.weekNumbers&&Fl(t.weekNumbers);for(var L=document.createDocumentFragment(),N=0;N<t.config.showMonths;N++){var Q=new Date(t.currentYear,t.currentMonth,1);Q.setMonth(t.currentMonth+N),L.appendChild(I(Q.getFullYear(),Q.getMonth()))}t.daysContainer.appendChild(L),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&ze()}}function G(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var L=function(de){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&de<t.config.minDate.getMonth()?!1:!(t.config.maxDate!==void 0&&t.currentYear===t.config.maxDate.getFullYear()&&de>t.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var N=0;N<12;N++)if(!!L(N)){var Q=wt("option","flatpickr-monthDropdown-month");Q.value=new Date(t.currentYear,N).getMonth().toString(),Q.textContent=_s(N,t.config.shorthandCurrentMonth,t.l10n),Q.tabIndex=-1,t.currentMonth===N&&(Q.selected=!0),t.monthsDropdownContainer.appendChild(Q)}}}function U(){var L=wt("div","flatpickr-month"),N=window.document.createDocumentFragment(),Q;t.config.showMonths>1||t.config.monthSelectorType==="static"?Q=wt("span","cur-month"):(t.monthsDropdownContainer=wt("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),v(t.monthsDropdownContainer,"change",function(tt){var Ge=wn(tt),nt=parseInt(Ge.value,10);t.changeMonth(nt-t.currentMonth),ot("onMonthChange")}),G(),Q=t.monthsDropdownContainer);var de=Ll("cur-year",{tabindex:"-1"}),Te=de.getElementsByTagName("input")[0];Te.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Te.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Te.setAttribute("max",t.config.maxDate.getFullYear().toString()),Te.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Ue=wt("div","flatpickr-current-month");return Ue.appendChild(Q),Ue.appendChild(de),N.appendChild(Ue),L.appendChild(N),{container:L,yearElement:Te,monthElement:Q}}function z(){Fl(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var L=t.config.showMonths;L--;){var N=U();t.yearElements.push(N.yearElement),t.monthElements.push(N.monthElement),t.monthNav.appendChild(N.container)}t.monthNav.appendChild(t.nextMonthNav)}function K(){return t.monthNav=wt("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=wt("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=wt("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,z(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(L){t.__hidePrevMonthArrow!==L&&(un(t.prevMonthNav,"flatpickr-disabled",L),t.__hidePrevMonthArrow=L)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(L){t.__hideNextMonthArrow!==L&&(un(t.nextMonthNav,"flatpickr-disabled",L),t.__hideNextMonthArrow=L)}}),t.currentYearElement=t.yearElements[0],Ze(),t.monthNav}function Y(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var L=$a(t.config);t.timeContainer=wt("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var N=wt("span","flatpickr-time-separator",":"),Q=Ll("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=Q.getElementsByTagName("input")[0];var de=Ll("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=de.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=gn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?L.hours:c(L.hours)),t.minuteElement.value=gn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():L.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(Q),t.timeContainer.appendChild(N),t.timeContainer.appendChild(de),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Te=Ll("flatpickr-second");t.secondElement=Te.getElementsByTagName("input")[0],t.secondElement.value=gn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():L.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(wt("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Te)}return t.config.time_24hr||(t.amPM=wt("span","flatpickr-am-pm",t.l10n.amPM[Nn((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 W(){t.weekdayContainer?Fl(t.weekdayContainer):t.weekdayContainer=wt("div","flatpickr-weekdays");for(var L=t.config.showMonths;L--;){var N=wt("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(N)}return te(),t.weekdayContainer}function te(){if(!!t.weekdayContainer){var L=t.l10n.firstDayOfWeek,N=Op(t.l10n.weekdays.shorthand);L>0&&L<N.length&&(N=Op(N.splice(L,N.length),N.splice(0,L)));for(var Q=t.config.showMonths;Q--;)t.weekdayContainer.children[Q].innerHTML=`
<span class='flatpickr-weekday'>
`+N.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function ce(){t.calendarContainer.classList.add("hasWeeks");var L=wt("div","flatpickr-weekwrapper");L.appendChild(wt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var N=wt("div","flatpickr-weeks");return L.appendChild(N),{weekWrapper:L,weekNumbers:N}}function ve(L,N){N===void 0&&(N=!0);var Q=N?L:L-t.currentMonth;Q<0&&t._hidePrevMonthArrow===!0||Q>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=Q,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,ot("onYearChange"),G()),R(),ot("onMonthChange"),Ze())}function oe(L,N){if(L===void 0&&(L=!0),N===void 0&&(N=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,N===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var Q=$a(t.config),de=Q.hours,Te=Q.minutes,Ue=Q.seconds;h(de,Te,Ue)}t.redraw(),L&&ot("onChange")}function J(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),ot("onClose")}function $e(){t.config!==void 0&&ot("onDestroy");for(var L=t._handlers.length;L--;)t._handlers[L].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 N=t.calendarContainer.parentNode;if(N.lastChild&&N.removeChild(N.lastChild),N.parentNode){for(;N.firstChild;)N.parentNode.insertBefore(N.firstChild,N);N.parentNode.removeChild(N)}}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(Q){try{delete t[Q]}catch{}})}function ee(L){return t.calendarContainer.contains(L)}function _e(L){if(t.isOpen&&!t.config.inline){var N=wn(L),Q=ee(N),de=N===t.input||N===t.altInput||t.element.contains(N)||L.path&&L.path.indexOf&&(~L.path.indexOf(t.input)||~L.path.indexOf(t.altInput)),Te=!de&&!Q&&!ee(L.relatedTarget),Ue=!t.config.ignoredFocusElements.some(function(tt){return tt.contains(N)});Te&&Ue&&(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 fe(L){if(!(!L||t.config.minDate&&L<t.config.minDate.getFullYear()||t.config.maxDate&&L>t.config.maxDate.getFullYear())){var N=L,Q=t.currentYear!==N;t.currentYear=N||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)),Q&&(t.redraw(),ot("onYearChange"),G())}}function ie(L,N){var Q;N===void 0&&(N=!0);var de=t.parseDate(L,void 0,N);if(t.config.minDate&&de&&Sn(de,t.config.minDate,N!==void 0?N:!t.minDateHasTime)<0||t.config.maxDate&&de&&Sn(de,t.config.maxDate,N!==void 0?N:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(de===void 0)return!1;for(var Te=!!t.config.enable,Ue=(Q=t.config.enable)!==null&&Q!==void 0?Q:t.config.disable,tt=0,Ge=void 0;tt<Ue.length;tt++){if(Ge=Ue[tt],typeof Ge=="function"&&Ge(de))return Te;if(Ge instanceof Date&&de!==void 0&&Ge.getTime()===de.getTime())return Te;if(typeof Ge=="string"){var nt=t.parseDate(Ge,void 0,!0);return nt&&nt.getTime()===de.getTime()?Te:!Te}else if(typeof Ge=="object"&&de!==void 0&&Ge.from&&Ge.to&&de.getTime()>=Ge.from.getTime()&&de.getTime()<=Ge.to.getTime())return Te}return!Te}function ye(L){return t.daysContainer!==void 0?L.className.indexOf("hidden")===-1&&L.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(L):!1}function Ne(L){var N=L.target===t._input,Q=t._input.value.trimEnd()!==Kt();N&&Q&&!(L.relatedTarget&&ee(L.relatedTarget))&&t.setDate(t._input.value,!0,L.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Pe(L){var N=wn(L),Q=t.config.wrap?n.contains(N):N===t._input,de=t.config.allowInput,Te=t.isOpen&&(!de||!Q),Ue=t.config.inline&&Q&&!de;if(L.keyCode===13&&Q){if(de)return t.setDate(t._input.value,!0,N===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),N.blur();t.open()}else if(ee(N)||Te||Ue){var tt=!!t.timeContainer&&t.timeContainer.contains(N);switch(L.keyCode){case 13:tt?(L.preventDefault(),a(),Ve()):yt(L);break;case 27:L.preventDefault(),Ve();break;case 8:case 46:Q&&!t.config.allowInput&&(L.preventDefault(),t.clear());break;case 37:case 39:if(!tt&&!Q){L.preventDefault();var Ge=r();if(t.daysContainer!==void 0&&(de===!1||Ge&&ye(Ge))){var nt=L.keyCode===39?1:-1;L.ctrlKey?(L.stopPropagation(),ve(nt),P(D(1),0)):P(void 0,nt)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:L.preventDefault();var Ke=L.keyCode===40?1:-1;t.daysContainer&&N.$i!==void 0||N===t.input||N===t.altInput?L.ctrlKey?(L.stopPropagation(),fe(t.currentYear-Ke),P(D(1),0)):tt||P(void 0,Ke*7):N===t.currentYearElement?fe(t.currentYear-Ke):t.config.enableTime&&(!tt&&t.hourElement&&t.hourElement.focus(),a(L),t._debouncedChange());break;case 9:if(tt){var et=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(nn){return nn}),gt=et.indexOf(N);if(gt!==-1){var Ft=et[gt+(L.shiftKey?-1:1)];L.preventDefault(),(Ft||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(N)&&L.shiftKey&&(L.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&N===t.amPM)switch(L.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],u(),zt();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],u(),zt();break}(Q||ee(N))&&ot("onKeyDown",L)}function ze(L,N){if(N===void 0&&(N="flatpickr-day"),!(t.selectedDates.length!==1||L&&(!L.classList.contains(N)||L.classList.contains("flatpickr-disabled")))){for(var Q=L?L.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),de=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Te=Math.min(Q,t.selectedDates[0].getTime()),Ue=Math.max(Q,t.selectedDates[0].getTime()),tt=!1,Ge=0,nt=0,Ke=Te;Ke<Ue;Ke+=h5.DAY)ie(new Date(Ke),!0)||(tt=tt||Ke>Te&&Ke<Ue,Ke<de&&(!Ge||Ke>Ge)?Ge=Ke:Ke>de&&(!nt||Ke<nt)&&(nt=Ke));var et=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+N));et.forEach(function(gt){var Ft=gt.dateObj,nn=Ft.getTime(),Fn=Ge>0&&nn<Ge||nt>0&&nn>nt;if(Fn){gt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Vt){gt.classList.remove(Vt)});return}else if(tt&&!Fn)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Vt){gt.classList.remove(Vt)}),L!==void 0&&(L.classList.add(Q<=t.selectedDates[0].getTime()?"startRange":"endRange"),de<Q&&nn===de?gt.classList.add("startRange"):de>Q&&nn===de&&gt.classList.add("endRange"),nn>=Ge&&(nt===0||nn<=nt)&&d5(nn,de,Q)&&gt.classList.add("inRange"))})}}function se(){t.isOpen&&!t.config.static&&!t.config.inline&&be()}function re(L,N){if(N===void 0&&(N=t._positionElement),t.isMobile===!0){if(L){L.preventDefault();var Q=wn(L);Q&&Q.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),ot("onOpen");return}else if(t._input.disabled||t.config.inline)return;var de=t.isOpen;t.isOpen=!0,de||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),ot("onOpen"),be(N)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(L===void 0||!t.timeContainer.contains(L.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function ke(L){return function(N){var Q=t.config["_"+L+"Date"]=t.parseDate(N,t.config.dateFormat),de=t.config["_"+(L==="min"?"max":"min")+"Date"];Q!==void 0&&(t[L==="min"?"minDateHasTime":"maxDateHasTime"]=Q.getHours()>0||Q.getMinutes()>0||Q.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Te){return ie(Te)}),!t.selectedDates.length&&L==="min"&&d(Q),zt()),t.daysContainer&&(ae(),Q!==void 0?t.currentYearElement[L]=Q.getFullYear().toString():t.currentYearElement.removeAttribute(L),t.currentYearElement.disabled=!!de&&Q!==void 0&&de.getFullYear()===Q.getFullYear())}}function He(){var L=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],N=ln(ln({},JSON.parse(JSON.stringify(n.dataset||{}))),e),Q={};t.config.parseDate=N.parseDate,t.config.formatDate=N.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(et){t.config._enable=qt(et)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(et){t.config._disable=qt(et)}});var de=N.mode==="time";if(!N.dateFormat&&(N.enableTime||de)){var Te=Ut.defaultConfig.dateFormat||zo.dateFormat;Q.dateFormat=N.noCalendar||de?"H:i"+(N.enableSeconds?":S":""):Te+" H:i"+(N.enableSeconds?":S":"")}if(N.altInput&&(N.enableTime||de)&&!N.altFormat){var Ue=Ut.defaultConfig.altFormat||zo.altFormat;Q.altFormat=N.noCalendar||de?"h:i"+(N.enableSeconds?":S K":" K"):Ue+(" h:i"+(N.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:ke("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:ke("max")});var tt=function(et){return function(gt){t.config[et==="min"?"_minTime":"_maxTime"]=t.parseDate(gt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:tt("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:tt("max")}),N.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,Q,N);for(var Ge=0;Ge<L.length;Ge++)t.config[L[Ge]]=t.config[L[Ge]]===!0||t.config[L[Ge]]==="true";Sa.filter(function(et){return t.config[et]!==void 0}).forEach(function(et){t.config[et]=Ca(t.config[et]||[]).map(l)}),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 Ge=0;Ge<t.config.plugins.length;Ge++){var nt=t.config.plugins[Ge](t)||{};for(var Ke in nt)Sa.indexOf(Ke)>-1?t.config[Ke]=Ca(nt[Ke]).map(l).concat(t.config[Ke]):typeof N[Ke]=="undefined"&&(t.config[Ke]=nt[Ke])}N.altInputClass||(t.config.altInputClass=qe().className+" "+t.config.altInputClass),ot("onParseConfig")}function qe(){return t.config.wrap?n.querySelector("[data-input]"):n}function Je(){typeof t.config.locale!="object"&&typeof Ut.l10ns[t.config.locale]=="undefined"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=ln(ln({},Ut.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Ut.l10ns[t.config.locale]:void 0),lo.D="("+t.l10n.weekdays.shorthand.join("|")+")",lo.l="("+t.l10n.weekdays.longhand.join("|")+")",lo.M="("+t.l10n.months.shorthand.join("|")+")",lo.F="("+t.l10n.months.longhand.join("|")+")",lo.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var L=ln(ln({},e),JSON.parse(JSON.stringify(n.dataset||{})));L.time_24hr===void 0&&Ut.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=E1(t),t.parseDate=mf({config:t.config,l10n:t.l10n})}function be(L){if(typeof t.config.position=="function")return void t.config.position(t,L);if(t.calendarContainer!==void 0){ot("onPreCalendarPosition");var N=L||t._positionElement,Q=Array.prototype.reduce.call(t.calendarContainer.children,function(xe,We){return xe+We.offsetHeight},0),de=t.calendarContainer.offsetWidth,Te=t.config.position.split(" "),Ue=Te[0],tt=Te.length>1?Te[1]:null,Ge=N.getBoundingClientRect(),nt=window.innerHeight-Ge.bottom,Ke=Ue==="above"||Ue!=="below"&&nt<Q&&Ge.top>Q,et=window.pageYOffset+Ge.top+(Ke?-Q-2:N.offsetHeight+2);if(un(t.calendarContainer,"arrowTop",!Ke),un(t.calendarContainer,"arrowBottom",Ke),!t.config.inline){var gt=window.pageXOffset+Ge.left,Ft=!1,nn=!1;tt==="center"?(gt-=(de-Ge.width)/2,Ft=!0):tt==="right"&&(gt-=de-Ge.width,nn=!0),un(t.calendarContainer,"arrowLeft",!Ft&&!nn),un(t.calendarContainer,"arrowCenter",Ft),un(t.calendarContainer,"arrowRight",nn);var Fn=window.document.body.offsetWidth-(window.pageXOffset+Ge.right),Vt=gt+de>window.document.body.offsetWidth,wo=Fn+de>window.document.body.offsetWidth;if(un(t.calendarContainer,"rightMost",Vt),!t.config.static)if(t.calendarContainer.style.top=et+"px",!Vt)t.calendarContainer.style.left=gt+"px",t.calendarContainer.style.right="auto";else if(!wo)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Fn+"px";else{var So=Oe();if(So===void 0)return;var Gi=window.document.body.offsetWidth,nl=Math.max(0,Gi/2-de/2),Co=".flatpickr-calendar.centerMost:before",il=".flatpickr-calendar.centerMost:after",Ki=So.cssRules.length,ol="{left:"+Ge.left+"px;right:auto;}";un(t.calendarContainer,"rightMost",!1),un(t.calendarContainer,"centerMost",!0),So.insertRule(Co+","+il+ol,Ki),t.calendarContainer.style.left=nl+"px",t.calendarContainer.style.right="auto"}}}}function Oe(){for(var L=null,N=0;N<document.styleSheets.length;N++){var Q=document.styleSheets[N];if(!!Q.cssRules){try{Q.cssRules}catch{continue}L=Q;break}}return L!=null?L:Z()}function Z(){var L=document.createElement("style");return document.head.appendChild(L),L.sheet}function ae(){t.config.noCalendar||t.isMobile||(G(),Ze(),R())}function Ve(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function yt(L){L.preventDefault(),L.stopPropagation();var N=function(et){return et.classList&&et.classList.contains("flatpickr-day")&&!et.classList.contains("flatpickr-disabled")&&!et.classList.contains("notAllowed")},Q=T1(wn(L),N);if(Q!==void 0){var de=Q,Te=t.latestSelectedDateObj=new Date(de.dateObj.getTime()),Ue=(Te.getMonth()<t.currentMonth||Te.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=de,t.config.mode==="single")t.selectedDates=[Te];else if(t.config.mode==="multiple"){var tt=ue(Te);tt?t.selectedDates.splice(parseInt(tt),1):t.selectedDates.push(Te)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Te,t.selectedDates.push(Te),Sn(Te,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(et,gt){return et.getTime()-gt.getTime()}));if(u(),Ue){var Ge=t.currentYear!==Te.getFullYear();t.currentYear=Te.getFullYear(),t.currentMonth=Te.getMonth(),Ge&&(ot("onYearChange"),G()),ot("onMonthChange")}if(Ze(),R(),zt(),!Ue&&t.config.mode!=="range"&&t.config.showMonths===1?O(de):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 nt=t.config.mode==="single"&&!t.config.enableTime,Ke=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(nt||Ke)&&Ve()}_()}}var it={locale:[Je,te],showMonths:[z,s,W],minDate:[S],maxDate:[S],positionElement:[me],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 bt(L,N){if(L!==null&&typeof L=="object"){Object.assign(t.config,L);for(var Q in L)it[Q]!==void 0&&it[Q].forEach(function(de){return de()})}else t.config[L]=N,it[L]!==void 0?it[L].forEach(function(de){return de()}):Sa.indexOf(L)>-1&&(t.config[L]=Ca(N));t.redraw(),zt(!0)}function at(L,N){var Q=[];if(L instanceof Array)Q=L.map(function(de){return t.parseDate(de,N)});else if(L instanceof Date||typeof L=="number")Q=[t.parseDate(L,N)];else if(typeof L=="string")switch(t.config.mode){case"single":case"time":Q=[t.parseDate(L,N)];break;case"multiple":Q=L.split(t.config.conjunction).map(function(de){return t.parseDate(de,N)});break;case"range":Q=L.split(t.l10n.rangeSeparator).map(function(de){return t.parseDate(de,N)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(L)));t.selectedDates=t.config.allowInvalidPreload?Q:Q.filter(function(de){return de instanceof Date&&ie(de,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(de,Te){return de.getTime()-Te.getTime()})}function vt(L,N,Q){if(N===void 0&&(N=!1),Q===void 0&&(Q=t.config.dateFormat),L!==0&&!L||L instanceof Array&&L.length===0)return t.clear(N);at(L,Q),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,N),d(),t.selectedDates.length===0&&t.clear(!1),zt(N),N&&ot("onChange")}function qt(L){return L.slice().map(function(N){return typeof N=="string"||typeof N=="number"||N instanceof Date?t.parseDate(N,void 0,!0):N&&typeof N=="object"&&N.from&&N.to?{from:t.parseDate(N.from,void 0),to:t.parseDate(N.to,void 0)}:N}).filter(function(N){return N})}function Mt(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var L=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);L&&at(L,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 $t(){if(t.input=qe(),!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=wt(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"),me()}function me(){t._positionElement=t.config.positionElement||t._input}function Ce(){var L=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=wt("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=L,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=L==="datetime-local"?"Y-m-d\\TH:i:S":L==="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(N){t.setDate(wn(N).value,!1,t.mobileFormatStr),ot("onChange"),ot("onClose")})}function Ye(L){if(t.isOpen===!0)return t.close();t.open(L)}function ot(L,N){if(t.config!==void 0){var Q=t.config[L];if(Q!==void 0&&Q.length>0)for(var de=0;Q[de]&&de<Q.length;de++)Q[de](t.selectedDates,t.input.value,t,N);L==="onChange"&&(t.input.dispatchEvent(cn("change")),t.input.dispatchEvent(cn("input")))}}function cn(L){var N=document.createEvent("Event");return N.initEvent(L,!0,!0),N}function ue(L){for(var N=0;N<t.selectedDates.length;N++){var Q=t.selectedDates[N];if(Q instanceof Date&&Sn(Q,L)===0)return""+N}return!1}function we(L){return t.config.mode!=="range"||t.selectedDates.length<2?!1:Sn(L,t.selectedDates[0])>=0&&Sn(L,t.selectedDates[1])<=0}function Ze(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(L,N){var Q=new Date(t.currentYear,t.currentMonth,1);Q.setMonth(t.currentMonth+N),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[N].textContent=_s(Q.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=Q.getMonth().toString(),L.value=Q.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 Kt(L){var N=L||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(Q){return t.formatDate(Q,N)}).filter(function(Q,de,Te){return t.config.mode!=="range"||t.config.enableTime||Te.indexOf(Q)===de}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function zt(L){L===void 0&&(L=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=Kt(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=Kt(t.config.altFormat)),L!==!1&&ot("onValueUpdate")}function ni(L){var N=wn(L),Q=t.prevMonthNav.contains(N),de=t.nextMonthNav.contains(N);Q||de?ve(Q?-1:1):t.yearElements.indexOf(N)>=0?N.select():N.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):N.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function pe(L){L.preventDefault();var N=L.type==="keydown",Q=wn(L),de=Q;t.amPM!==void 0&&Q===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Nn(t.amPM.textContent===t.l10n.amPM[0])]);var Te=parseFloat(de.getAttribute("min")),Ue=parseFloat(de.getAttribute("max")),tt=parseFloat(de.getAttribute("step")),Ge=parseInt(de.value,10),nt=L.delta||(N?L.which===38?1:-1:0),Ke=Ge+tt*nt;if(typeof de.value!="undefined"&&de.value.length===2){var et=de===t.hourElement,gt=de===t.minuteElement;Ke<Te?(Ke=Ue+Ke+Nn(!et)+(Nn(et)&&Nn(!t.amPM)),gt&&x(void 0,-1,t.hourElement)):Ke>Ue&&(Ke=de===t.hourElement?Ke-Ue-Nn(!t.amPM):Te,gt&&x(void 0,1,t.hourElement)),t.amPM&&et&&(tt===1?Ke+Ge===23:Math.abs(Ke-Ge)>tt)&&(t.amPM.textContent=t.l10n.amPM[Nn(t.amPM.textContent===t.l10n.amPM[0])]),de.value=gn(Ke)}}return o(),t}function Ho(n,e){for(var t=Array.prototype.slice.call(n).filter(function(l){return l instanceof HTMLElement}),i=[],o=0;o<t.length;o++){var r=t[o];try{if(r.getAttribute("data-fp-omit")!==null)continue;r._flatpickr!==void 0&&(r._flatpickr.destroy(),r._flatpickr=void 0),r._flatpickr=b5(r,e||{}),i.push(r._flatpickr)}catch(l){console.error(l)}}return i.length===1?i[0]:i}typeof HTMLElement!="undefined"&&typeof HTMLCollection!="undefined"&&typeof NodeList!="undefined"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return Ho(this,n)},HTMLElement.prototype.flatpickr=function(n){return Ho([this],n)});var Ut=function(n,e){return typeof n=="string"?Ho(window.document.querySelectorAll(n),e):n instanceof Node?Ho([n],e):Ho(n,e)};Ut.defaultConfig={};Ut.l10ns={en:ln({},Hr),default:ln({},Hr)};Ut.localize=function(n){Ut.l10ns.default=ln(ln({},Ut.l10ns.default),n)};Ut.setDefaults=function(n){Ut.defaultConfig=ln(ln({},Ut.defaultConfig),n)};Ut.parseDate=mf({});Ut.formatDate=E1({});Ut.compareDates=Sn;typeof jQuery!="undefined"&&typeof jQuery.fn!="undefined"&&(jQuery.fn.flatpickr=function(n){return Ho(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!="undefined"&&(window.flatpickr=Ut);function g5(n){let e,t=[n[1]],i={};for(let o=0;o<t.length;o+=1)i=ut(i,t[o]);return{c(){e=g("input"),ci(e,i)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[11](e)},p(o,r){ci(e,i=bn(t,[r&2&&o[1]]))},d(o){o&&k(e),n[11](null)}}}function _5(n){let e;const t=n[10].default,i=$n(t,n,n[9],null),o=i||g5(n);return{c(){o&&o.c()},m(r,l){o&&o.m(r,l),e=!0},p(r,[l]){i?i.p&&(!e||l&512)&&Dn(i,t,r,r[9],e?An(t,r[9],l,null):On(r[9]),null):o&&o.p&&(!e||l&3)&&o.p(r,e?l:-1)},i(r){e||(T(o,r),e=!0)},o(r){F(o,r),e=!1},d(r){o&&o.d(r)}}}function v5(n){return n.charAt(2).toLowerCase()+n.substring(3)}function y5(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let o=Wt(e,i),{$$slots:r={},$$scope:l}=e;const s=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a="",formattedValue:f="",element:c=null,dateFormat:u=null}=e,{options:d={}}=e,h=!1,{input:b=void 0,flatpickr:v=void 0}=e;di(()=>{const x=c||b,M=y(d);return M.onReady.push(()=>{t(8,h=!0)}),t(3,v=Ut(x,Object.assign(M,c?{wrap:!0}:{}))),()=>{v.destroy()}});const _=yn();function y(x={}){x=Object.assign({},x);for(const M of s){const A=(O,D,E)=>{_(v5(M),[O,D,E])};M in x?(Array.isArray(x[M])||(x[M]=[x[M]]),x[M].push(A)):x[M]=[A]}return x.onChange&&!x.onChange.includes(S)&&x.onChange.push(S),x}function S(x,M,A){var D,E;const O=(E=(D=A==null?void 0:A.config)==null?void 0:D.mode)!=null?E:"single";t(2,a=O==="single"?x[0]:x),t(4,f=M)}function C(x){he[x?"unshift":"push"](()=>{b=x,t(0,b)})}return n.$$set=x=>{e=ut(ut({},e),ui(x)),t(1,o=Wt(e,i)),"value"in x&&t(2,a=x.value),"formattedValue"in x&&t(4,f=x.formattedValue),"element"in x&&t(5,c=x.element),"dateFormat"in x&&t(6,u=x.dateFormat),"options"in x&&t(7,d=x.options),"input"in x&&t(0,b=x.input),"flatpickr"in x&&t(3,v=x.flatpickr),"$$scope"in x&&t(9,l=x.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&v&&h&&v.setDate(a,!1,u),n.$$.dirty&392&&v&&h)for(const[x,M]of Object.entries(y(d)))v.set(x,M)},[b,o,a,v,f,c,u,d,h,l,r,C]}class pc extends Ie{constructor(e){super(),Le(this,e,y5,_5,Ee,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function k5(n){let e,t,i,o,r,l,s;function a(c){n[2](c)}let f={id:n[4],options:B.defaultFlatpickrOptions(),value:n[0].min};return n[0].min!==void 0&&(f.formattedValue=n[0].min),r=new pc({props:f}),he.push(()=>Fe(r,"formattedValue",a)),{c(){e=g("label"),t=j("Min date (UTC)"),o=$(),V(r.$$.fragment),p(e,"for",i=n[4])},m(c,u){w(c,e,u),m(e,t),w(c,o,u),H(r,c,u),s=!0},p(c,u){(!s||u&16&&i!==(i=c[4]))&&p(e,"for",i);const d={};u&16&&(d.id=c[4]),u&1&&(d.value=c[0].min),!l&&u&1&&(l=!0,d.formattedValue=c[0].min,Re(()=>l=!1)),r.$set(d)},i(c){s||(T(r.$$.fragment,c),s=!0)},o(c){F(r.$$.fragment,c),s=!1},d(c){c&&k(e),c&&k(o),q(r,c)}}}function w5(n){let e,t,i,o,r,l,s;function a(c){n[3](c)}let f={id:n[4],options:B.defaultFlatpickrOptions(),value:n[0].max};return n[0].max!==void 0&&(f.formattedValue=n[0].max),r=new pc({props:f}),he.push(()=>Fe(r,"formattedValue",a)),{c(){e=g("label"),t=j("Max date (UTC)"),o=$(),V(r.$$.fragment),p(e,"for",i=n[4])},m(c,u){w(c,e,u),m(e,t),w(c,o,u),H(r,c,u),s=!0},p(c,u){(!s||u&16&&i!==(i=c[4]))&&p(e,"for",i);const d={};u&16&&(d.id=c[4]),u&1&&(d.value=c[0].max),!l&&u&1&&(l=!0,d.formattedValue=c[0].max,Re(()=>l=!1)),r.$set(d)},i(c){s||(T(r.$$.fragment,c),s=!0)},o(c){F(r.$$.fragment,c),s=!1},d(c){c&&k(e),c&&k(o),q(r,c)}}}function S5(n){let e,t,i,o,r,l,s;return i=new je({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[k5,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[w5,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),p(t,"class","col-sm-6"),p(r,"class","col-sm-6"),p(e,"class","grid")},m(a,f){w(a,e,f),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),s=!0},p(a,[f]){const c={};f&2&&(c.name="schema."+a[1]+".options.min"),f&49&&(c.$$scope={dirty:f,ctx:a}),i.$set(c);const u={};f&2&&(u.name="schema."+a[1]+".options.max"),f&49&&(u.$$scope={dirty:f,ctx:a}),l.$set(u)},i(a){s||(T(i.$$.fragment,a),T(l.$$.fragment,a),s=!0)},o(a){F(i.$$.fragment,a),F(l.$$.fragment,a),s=!1},d(a){a&&k(e),q(i),q(l)}}}function C5(n,e,t){let{key:i=""}=e,{options:o={}}=e;function r(s){n.$$.not_equal(o.min,s)&&(o.min=s,t(0,o))}function l(s){n.$$.not_equal(o.max,s)&&(o.max=s,t(0,o))}return n.$$set=s=>{"key"in s&&t(1,i=s.key),"options"in s&&t(0,o=s.options)},[o,i,r,l]}class x5 extends Ie{constructor(e){super(),Le(this,e,C5,S5,Ee,{key:1,options:0})}}function M5(n){let e,t,i,o,r,l,s,a,f;function c(d){n[2](d)}let u={id:n[4],placeholder:"eg. optionA, optionB",required:!0};return n[0].values!==void 0&&(u.value=n[0].values),r=new ko({props:u}),he.push(()=>Fe(r,"value",c)),{c(){e=g("label"),t=j("Choices"),o=$(),V(r.$$.fragment),s=$(),a=g("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,o,h),H(r,d,h),w(d,s,h),w(d,a,h),f=!0},p(d,h){(!f||h&16&&i!==(i=d[4]))&&p(e,"for",i);const b={};h&16&&(b.id=d[4]),!l&&h&1&&(l=!0,b.value=d[0].values,Re(()=>l=!1)),r.$set(b)},i(d){f||(T(r.$$.fragment,d),f=!0)},o(d){F(r.$$.fragment,d),f=!1},d(d){d&&k(e),d&&k(o),q(r,d),d&&k(s),d&&k(a)}}}function $5(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Max select"),o=$(),r=g("input"),p(e,"for",i=n[4]),p(r,"type","number"),p(r,"id",l=n[4]),p(r,"step","1"),p(r,"min","1"),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].maxSelect),s||(a=X(r,"input",n[3]),s=!0)},p(f,c){c&16&&i!==(i=f[4])&&p(e,"for",i),c&16&&l!==(l=f[4])&&p(r,"id",l),c&1&&At(r.value)!==f[0].maxSelect&&Me(r,f[0].maxSelect)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function A5(n){let e,t,i,o,r,l,s;return i=new je({props:{class:"form-field required",name:"schema."+n[1]+".options.values",$$slots:{default:[M5,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[$5,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),p(t,"class","col-sm-9"),p(r,"class","col-sm-3"),p(e,"class","grid")},m(a,f){w(a,e,f),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),s=!0},p(a,[f]){const c={};f&2&&(c.name="schema."+a[1]+".options.values"),f&49&&(c.$$scope={dirty:f,ctx:a}),i.$set(c);const u={};f&2&&(u.name="schema."+a[1]+".options.maxSelect"),f&49&&(u.$$scope={dirty:f,ctx:a}),l.$set(u)},i(a){s||(T(i.$$.fragment,a),T(l.$$.fragment,a),s=!0)},o(a){F(i.$$.fragment,a),F(l.$$.fragment,a),s=!1},d(a){a&&k(e),q(i),q(l)}}}function D5(n,e,t){let{key:i=""}=e,{options:o={}}=e;function r(s){n.$$.not_equal(o.values,s)&&(o.values=s,t(0,o))}function l(){o.maxSelect=At(this.value),t(0,o)}return n.$$set=s=>{"key"in s&&t(1,i=s.key),"options"in s&&t(0,o=s.options)},n.$$.update=()=>{n.$$.dirty&1&&B.isEmpty(o)&&t(0,o={maxSelect:1,values:[]})},[o,i,r,l]}class O5 extends Ie{constructor(e){super(),Le(this,e,D5,A5,Ee,{key:1,options:0})}}function T5(n,e,t){return["",{}]}class E5 extends Ie{constructor(e){super(),Le(this,e,T5,null,Ee,{key:0,options:1})}get key(){return this.$$.ctx[0]}get options(){return this.$$.ctx[1]}}function P5(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Max file size (bytes)"),o=$(),r=g("input"),p(e,"for",i=n[9]),p(r,"type","number"),p(r,"id",l=n[9]),p(r,"step","1"),p(r,"min","0")},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].maxSize),s||(a=X(r,"input",n[2]),s=!0)},p(f,c){c&512&&i!==(i=f[9])&&p(e,"for",i),c&512&&l!==(l=f[9])&&p(r,"id",l),c&1&&At(r.value)!==f[0].maxSize&&Me(r,f[0].maxSize)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function F5(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Max files"),o=$(),r=g("input"),p(e,"for",i=n[9]),p(r,"type","number"),p(r,"id",l=n[9]),p(r,"step","1"),p(r,"min",""),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].maxSelect),s||(a=X(r,"input",n[3]),s=!0)},p(f,c){c&512&&i!==(i=f[9])&&p(e,"for",i),c&512&&l!==(l=f[9])&&p(r,"id",l),c&1&&At(r.value)!==f[0].maxSelect&&Me(r,f[0].maxSelect)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function L5(n){let e,t,i,o,r,l,s;return{c(){e=g("div"),e.innerHTML='<span class="txt">Images (jpg, png, svg, gif)</span>',t=$(),i=g("div"),i.innerHTML='<span class="txt">Documents (pdf, doc/docx, xls/xlsx)</span>',o=$(),r=g("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(r,"tabindex","0"),p(r,"class","dropdown-item closable")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,o,f),w(a,r,f),l||(s=[X(e,"click",n[5]),X(i,"click",n[6]),X(r,"click",n[7])],l=!0)},p:le,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(o),a&&k(r),l=!1,rt(s)}}}function I5(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S;function C(M){n[4](M)}let x={id:n[9],placeholder:"eg. image/png, application/pdf..."};return n[0].mimeTypes!==void 0&&(x.value=n[0].mimeTypes),s=new ko({props:x}),he.push(()=>Fe(s,"value",C)),v=new vo({props:{class:"dropdown dropdown-sm dropdown-nowrap",$$slots:{default:[L5]},$$scope:{ctx:n}}}),{c(){e=g("label"),t=g("span"),t.textContent="Mime types",i=$(),o=g("i"),l=$(),V(s.$$.fragment),f=$(),c=g("div"),u=j(`Use comma as separator.
`),d=g("span"),h=g("span"),h.textContent="Choose presets",b=$(),V(v.$$.fragment),p(t,"class","txt"),p(o,"class","ri-information-line link-hint"),p(e,"for",r=n[9]),p(h,"class","txt link-primary"),p(d,"class","inline-flex"),p(c,"class","help-block")},m(M,A){w(M,e,A),m(e,t),m(e,i),m(e,o),w(M,l,A),H(s,M,A),w(M,f,A),w(M,c,A),m(c,u),m(c,d),m(d,h),m(d,b),H(v,d,null),_=!0,y||(S=Xe(St.call(null,o,{text:`Allow uploading files ONLY with the listed mime types.
Leave empty for no restriction.`,position:"top"})),y=!0)},p(M,A){(!_||A&512&&r!==(r=M[9]))&&p(e,"for",r);const O={};A&512&&(O.id=M[9]),!a&&A&1&&(a=!0,O.value=M[0].mimeTypes,Re(()=>a=!1)),s.$set(O);const D={};A&1025&&(D.$$scope={dirty:A,ctx:M}),v.$set(D)},i(M){_||(T(s.$$.fragment,M),T(v.$$.fragment,M),_=!0)},o(M){F(s.$$.fragment,M),F(v.$$.fragment,M),_=!1},d(M){M&&k(e),M&&k(l),q(s,M),M&&k(f),M&&k(c),q(v),y=!1,S()}}}function R5(n){let e,t,i,o,r,l,s,a,f,c,u,d,h;function b(_){n[8](_)}let v={id:n[9],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(v.value=n[0].thumbs),s=new ko({props:v}),he.push(()=>Fe(s,"value",b)),{c(){e=g("label"),t=g("span"),t.textContent="Thumb sizes",i=$(),o=g("i"),l=$(),V(s.$$.fragment),f=$(),c=g("div"),c.textContent="Use comma as separator.",p(t,"class","txt"),p(o,"class","ri-information-line link-hint"),p(e,"for",r=n[9]),p(c,"class","help-block")},m(_,y){w(_,e,y),m(e,t),m(e,i),m(e,o),w(_,l,y),H(s,_,y),w(_,f,y),w(_,c,y),u=!0,d||(h=Xe(St.call(null,o,{text:"List of thumb sizes for image files. The thumbs will be generated lazily on first access.",position:"top"})),d=!0)},p(_,y){(!u||y&512&&r!==(r=_[9]))&&p(e,"for",r);const S={};y&512&&(S.id=_[9]),!a&&y&1&&(a=!0,S.value=_[0].thumbs,Re(()=>a=!1)),s.$set(S)},i(_){u||(T(s.$$.fragment,_),u=!0)},o(_){F(s.$$.fragment,_),u=!1},d(_){_&&k(e),_&&k(l),q(s,_),_&&k(f),_&&k(c),d=!1,h()}}}function N5(n){let e,t,i,o,r,l,s,a,f,c,u,d,h;return i=new je({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[P5,({uniqueId:b})=>({9:b}),({uniqueId:b})=>b?512:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[F5,({uniqueId:b})=>({9:b}),({uniqueId:b})=>b?512:0]},$$scope:{ctx:n}}}),f=new je({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[I5,({uniqueId:b})=>({9:b}),({uniqueId:b})=>b?512:0]},$$scope:{ctx:n}}}),d=new je({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[R5,({uniqueId:b})=>({9:b}),({uniqueId:b})=>b?512:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),s=$(),a=g("div"),V(f.$$.fragment),c=$(),u=g("div"),V(d.$$.fragment),p(t,"class","col-sm-6"),p(r,"class","col-sm-6"),p(a,"class","col-sm-12"),p(u,"class","col-sm-12"),p(e,"class","grid")},m(b,v){w(b,e,v),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),m(e,s),m(e,a),H(f,a,null),m(e,c),m(e,u),H(d,u,null),h=!0},p(b,[v]){const _={};v&2&&(_.name="schema."+b[1]+".options.maxSize"),v&1537&&(_.$$scope={dirty:v,ctx:b}),i.$set(_);const y={};v&2&&(y.name="schema."+b[1]+".options.maxSelect"),v&1537&&(y.$$scope={dirty:v,ctx:b}),l.$set(y);const S={};v&2&&(S.name="schema."+b[1]+".options.mimeTypes"),v&1537&&(S.$$scope={dirty:v,ctx:b}),f.$set(S);const C={};v&2&&(C.name="schema."+b[1]+".options.thumbs"),v&1537&&(C.$$scope={dirty:v,ctx:b}),d.$set(C)},i(b){h||(T(i.$$.fragment,b),T(l.$$.fragment,b),T(f.$$.fragment,b),T(d.$$.fragment,b),h=!0)},o(b){F(i.$$.fragment,b),F(l.$$.fragment,b),F(f.$$.fragment,b),F(d.$$.fragment,b),h=!1},d(b){b&&k(e),q(i),q(l),q(f),q(d)}}}function j5(n,e,t){let{key:i=""}=e,{options:o={}}=e;function r(){o.maxSize=At(this.value),t(0,o)}function l(){o.maxSelect=At(this.value),t(0,o)}function s(d){n.$$.not_equal(o.mimeTypes,d)&&(o.mimeTypes=d,t(0,o))}const a=()=>{t(0,o.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],o)},f=()=>{t(0,o.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],o)},c=()=>{t(0,o.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],o)};function u(d){n.$$.not_equal(o.thumbs,d)&&(o.thumbs=d,t(0,o))}return n.$$set=d=>{"key"in d&&t(1,i=d.key),"options"in d&&t(0,o=d.options)},n.$$.update=()=>{n.$$.dirty&1&&B.isEmpty(o)&&t(0,o={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]})},[o,i,r,l,s,a,f,c,u]}class z5 extends Ie{constructor(e){super(),Le(this,e,j5,N5,Ee,{key:1,options:0})}}function H5(n){let e,t,i,o,r,l,s;function a(c){n[5](c)}let f={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&&(f.keyOfSelected=n[0].collectionId),r=new yo({props:f}),he.push(()=>Fe(r,"keyOfSelected",a)),{c(){e=g("label"),t=j("Collection"),o=$(),V(r.$$.fragment),p(e,"for",i=n[9])},m(c,u){w(c,e,u),m(e,t),w(c,o,u),H(r,c,u),s=!0},p(c,u){(!s||u&512&&i!==(i=c[9]))&&p(e,"for",i);const d={};u&8&&(d.searchable=c[3].length>5),u&4&&(d.selectPlaceholder=c[2]?"Loading...":"Select collection"),u&8&&(d.items=c[3]),!l&&u&1&&(l=!0,d.keyOfSelected=c[0].collectionId,Re(()=>l=!1)),r.$set(d)},i(c){s||(T(r.$$.fragment,c),s=!0)},o(c){F(r.$$.fragment,c),s=!1},d(c){c&&k(e),c&&k(o),q(r,c)}}}function q5(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Max select"),o=$(),r=g("input"),p(e,"for",i=n[9]),p(r,"type","number"),p(r,"id",l=n[9]),p(r,"step","1"),p(r,"min","1"),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].maxSelect),s||(a=X(r,"input",n[6]),s=!0)},p(f,c){c&512&&i!==(i=f[9])&&p(e,"for",i),c&512&&l!==(l=f[9])&&p(r,"id",l),c&1&&At(r.value)!==f[0].maxSelect&&Me(r,f[0].maxSelect)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function V5(n){let e,t,i,o,r,l,s;function a(c){n[7](c)}let f={id:n[9],items:n[4]};return n[0].cascadeDelete!==void 0&&(f.keyOfSelected=n[0].cascadeDelete),r=new yo({props:f}),he.push(()=>Fe(r,"keyOfSelected",a)),{c(){e=g("label"),t=j("Delete record on relation delete"),o=$(),V(r.$$.fragment),p(e,"for",i=n[9])},m(c,u){w(c,e,u),m(e,t),w(c,o,u),H(r,c,u),s=!0},p(c,u){(!s||u&512&&i!==(i=c[9]))&&p(e,"for",i);const d={};u&512&&(d.id=c[9]),!l&&u&1&&(l=!0,d.keyOfSelected=c[0].cascadeDelete,Re(()=>l=!1)),r.$set(d)},i(c){s||(T(r.$$.fragment,c),s=!0)},o(c){F(r.$$.fragment,c),s=!1},d(c){c&&k(e),c&&k(o),q(r,c)}}}function B5(n){let e,t,i,o,r,l,s,a,f,c;return i=new je({props:{class:"form-field required",name:"schema."+n[1]+".options.collectionId",$$slots:{default:[H5,({uniqueId:u})=>({9:u}),({uniqueId:u})=>u?512:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[q5,({uniqueId:u})=>({9:u}),({uniqueId:u})=>u?512:0]},$$scope:{ctx:n}}}),f=new je({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[V5,({uniqueId:u})=>({9:u}),({uniqueId:u})=>u?512:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),s=$(),a=g("div"),V(f.$$.fragment),p(t,"class","col-sm-9"),p(r,"class","col-sm-3"),p(a,"class","col-sm-12"),p(e,"class","grid")},m(u,d){w(u,e,d),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),m(e,s),m(e,a),H(f,a,null),c=!0},p(u,[d]){const h={};d&2&&(h.name="schema."+u[1]+".options.collectionId"),d&1549&&(h.$$scope={dirty:d,ctx:u}),i.$set(h);const b={};d&2&&(b.name="schema."+u[1]+".options.maxSelect"),d&1537&&(b.$$scope={dirty:d,ctx:u}),l.$set(b);const v={};d&2&&(v.name="schema."+u[1]+".options.cascadeDelete"),d&1537&&(v.$$scope={dirty:d,ctx:u}),f.$set(v)},i(u){c||(T(i.$$.fragment,u),T(l.$$.fragment,u),T(f.$$.fragment,u),c=!0)},o(u){F(i.$$.fragment,u),F(l.$$.fragment,u),F(f.$$.fragment,u),c=!1},d(u){u&&k(e),q(i),q(l),q(f)}}}function U5(n,e,t){let{key:i=""}=e,{options:o={}}=e;const r=[{label:"False",value:!1},{label:"True",value:!0}];let l=!1,s=[];a();function a(){t(2,l=!0),Se.Collections.getFullList(200,{sort:"-created"}).then(d=>{t(3,s=d)}).catch(d=>{Se.errorResponseHandler(d)}).finally(()=>{t(2,l=!1)})}function f(d){n.$$.not_equal(o.collectionId,d)&&(o.collectionId=d,t(0,o))}function c(){o.maxSelect=At(this.value),t(0,o)}function u(d){n.$$.not_equal(o.cascadeDelete,d)&&(o.cascadeDelete=d,t(0,o))}return n.$$set=d=>{"key"in d&&t(1,i=d.key),"options"in d&&t(0,o=d.options)},n.$$.update=()=>{n.$$.dirty&1&&B.isEmpty(o)&&t(0,o={maxSelect:1,collectionId:null,cascadeDelete:!1})},[o,i,l,s,r,f,c,u]}class W5 extends Ie{constructor(e){super(),Le(this,e,U5,B5,Ee,{key:1,options:0})}}function Y5(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Max select"),o=$(),r=g("input"),p(e,"for",i=n[5]),p(r,"type","number"),p(r,"id",l=n[5]),p(r,"step","1"),p(r,"min","1"),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].maxSelect),s||(a=X(r,"input",n[3]),s=!0)},p(f,c){c&32&&i!==(i=f[5])&&p(e,"for",i),c&32&&l!==(l=f[5])&&p(r,"id",l),c&1&&At(r.value)!==f[0].maxSelect&&Me(r,f[0].maxSelect)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function G5(n){let e,t,i,o,r,l,s;function a(c){n[4](c)}let f={id:n[5],items:n[2]};return n[0].cascadeDelete!==void 0&&(f.keyOfSelected=n[0].cascadeDelete),r=new yo({props:f}),he.push(()=>Fe(r,"keyOfSelected",a)),{c(){e=g("label"),t=j("Delete record on user delete"),o=$(),V(r.$$.fragment),p(e,"for",i=n[5])},m(c,u){w(c,e,u),m(e,t),w(c,o,u),H(r,c,u),s=!0},p(c,u){(!s||u&32&&i!==(i=c[5]))&&p(e,"for",i);const d={};u&32&&(d.id=c[5]),!l&&u&1&&(l=!0,d.keyOfSelected=c[0].cascadeDelete,Re(()=>l=!1)),r.$set(d)},i(c){s||(T(r.$$.fragment,c),s=!0)},o(c){F(r.$$.fragment,c),s=!1},d(c){c&&k(e),c&&k(o),q(r,c)}}}function K5(n){let e,t,i,o,r,l,s;return i=new je({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[Y5,({uniqueId:a})=>({5:a}),({uniqueId:a})=>a?32:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[G5,({uniqueId:a})=>({5:a}),({uniqueId:a})=>a?32:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),p(t,"class","col-sm-6"),p(r,"class","col-sm-6"),p(e,"class","grid")},m(a,f){w(a,e,f),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),s=!0},p(a,[f]){const c={};f&2&&(c.name="schema."+a[1]+".options.maxSelect"),f&97&&(c.$$scope={dirty:f,ctx:a}),i.$set(c);const u={};f&2&&(u.name="schema."+a[1]+".options.cascadeDelete"),f&97&&(u.$$scope={dirty:f,ctx:a}),l.$set(u)},i(a){s||(T(i.$$.fragment,a),T(l.$$.fragment,a),s=!0)},o(a){F(i.$$.fragment,a),F(l.$$.fragment,a),s=!1},d(a){a&&k(e),q(i),q(l)}}}function J5(n,e,t){const i=[{label:"False",value:!1},{label:"True",value:!0}];let{key:o=""}=e,{options:r={}}=e;function l(){r.maxSelect=At(this.value),t(0,r)}function s(a){n.$$.not_equal(r.cascadeDelete,a)&&(r.cascadeDelete=a,t(0,r))}return n.$$set=a=>{"key"in a&&t(1,o=a.key),"options"in a&&t(0,r=a.options)},n.$$.update=()=>{n.$$.dirty&1&&B.isEmpty(r)&&t(0,r={maxSelect:1,cascadeDelete:!1})},[r,o,i,l,s]}class Z5 extends Ie{constructor(e){super(),Le(this,e,J5,K5,Ee,{key:1,options:0})}}function X5(n){let e,t,i,o,r,l,s;function a(c){n[15](c)}let f={id:n[37],disabled:n[0].id};return n[0].type!==void 0&&(f.value=n[0].type),r=new qC({props:f}),he.push(()=>Fe(r,"value",a)),{c(){e=g("label"),t=j("Type"),o=$(),V(r.$$.fragment),p(e,"for",i=n[37])},m(c,u){w(c,e,u),m(e,t),w(c,o,u),H(r,c,u),s=!0},p(c,u){(!s||u[1]&64&&i!==(i=c[37]))&&p(e,"for",i);const d={};u[1]&64&&(d.id=c[37]),u[0]&1&&(d.disabled=c[0].id),!l&&u[0]&1&&(l=!0,d.value=c[0].type,Re(()=>l=!1)),r.$set(d)},i(c){s||(T(r.$$.fragment,c),s=!0)},o(c){F(r.$$.fragment,c),s=!1},d(c){c&&k(e),c&&k(o),q(r,c)}}}function Q5(n){let e,t,i,o,r,l,s,a,f,c,u;return{c(){e=g("label"),t=j("Name"),o=$(),r=g("input"),p(e,"for",i=n[37]),p(r,"type","text"),p(r,"id",l=n[37]),r.required=!0,r.disabled=s=n[0].id&&n[0].system,p(r,"spellcheck","false"),r.autofocus=a=!n[0].id,r.value=f=n[0].name},m(d,h){w(d,e,h),m(e,t),w(d,o,h),w(d,r,h),n[0].id||r.focus(),c||(u=X(r,"input",n[16]),c=!0)},p(d,h){h[1]&64&&i!==(i=d[37])&&p(e,"for",i),h[1]&64&&l!==(l=d[37])&&p(r,"id",l),h[0]&1&&s!==(s=d[0].id&&d[0].system)&&(r.disabled=s),h[0]&1&&a!==(a=!d[0].id)&&(r.autofocus=a),h[0]&1&&f!==(f=d[0].name)&&r.value!==f&&(r.value=f)},d(d){d&&k(e),d&&k(o),d&&k(r),c=!1,u()}}}function ex(n){let e,t,i;function o(l){n[27](l)}let r={key:n[1]};return n[0].options!==void 0&&(r.options=n[0].options),e=new Z5({props:r}),he.push(()=>Fe(e,"options",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){const a={};s[0]&2&&(a.key=l[1]),!t&&s[0]&1&&(t=!0,a.options=l[0].options,Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function tx(n){let e,t,i;function o(l){n[26](l)}let r={key:n[1]};return n[0].options!==void 0&&(r.options=n[0].options),e=new W5({props:r}),he.push(()=>Fe(e,"options",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){const a={};s[0]&2&&(a.key=l[1]),!t&&s[0]&1&&(t=!0,a.options=l[0].options,Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function nx(n){let e,t,i;function o(l){n[25](l)}let r={key:n[1]};return n[0].options!==void 0&&(r.options=n[0].options),e=new z5({props:r}),he.push(()=>Fe(e,"options",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){const a={};s[0]&2&&(a.key=l[1]),!t&&s[0]&1&&(t=!0,a.options=l[0].options,Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function ix(n){let e,t,i;function o(l){n[24](l)}let r={key:n[1]};return n[0].options!==void 0&&(r.options=n[0].options),e=new E5({props:r}),he.push(()=>Fe(e,"options",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){const a={};s[0]&2&&(a.key=l[1]),!t&&s[0]&1&&(t=!0,a.options=l[0].options,Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function ox(n){let e,t,i;function o(l){n[23](l)}let r={key:n[1]};return n[0].options!==void 0&&(r.options=n[0].options),e=new O5({props:r}),he.push(()=>Fe(e,"options",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){const a={};s[0]&2&&(a.key=l[1]),!t&&s[0]&1&&(t=!0,a.options=l[0].options,Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function rx(n){let e,t,i;function o(l){n[22](l)}let r={key:n[1]};return n[0].options!==void 0&&(r.options=n[0].options),e=new x5({props:r}),he.push(()=>Fe(e,"options",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){const a={};s[0]&2&&(a.key=l[1]),!t&&s[0]&1&&(t=!0,a.options=l[0].options,Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function lx(n){let e,t,i;function o(l){n[21](l)}let r={key:n[1]};return n[0].options!==void 0&&(r.options=n[0].options),e=new c5({props:r}),he.push(()=>Fe(e,"options",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){const a={};s[0]&2&&(a.key=l[1]),!t&&s[0]&1&&(t=!0,a.options=l[0].options,Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function sx(n){let e,t,i;function o(l){n[20](l)}let r={key:n[1]};return n[0].options!==void 0&&(r.options=n[0].options),e=new O1({props:r}),he.push(()=>Fe(e,"options",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){const a={};s[0]&2&&(a.key=l[1]),!t&&s[0]&1&&(t=!0,a.options=l[0].options,Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function ax(n){let e,t,i;function o(l){n[19](l)}let r={key:n[1]};return n[0].options!==void 0&&(r.options=n[0].options),e=new t5({props:r}),he.push(()=>Fe(e,"options",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){const a={};s[0]&2&&(a.key=l[1]),!t&&s[0]&1&&(t=!0,a.options=l[0].options,Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function fx(n){let e,t,i;function o(l){n[18](l)}let r={key:n[1]};return n[0].options!==void 0&&(r.options=n[0].options),e=new QC({props:r}),he.push(()=>Fe(e,"options",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){const a={};s[0]&2&&(a.key=l[1]),!t&&s[0]&1&&(t=!0,a.options=l[0].options,Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function cx(n){let e,t,i;function o(l){n[17](l)}let r={key:n[1]};return n[0].options!==void 0&&(r.options=n[0].options),e=new GC({props:r}),he.push(()=>Fe(e,"options",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){const a={};s[0]&2&&(a.key=l[1]),!t&&s[0]&1&&(t=!0,a.options=l[0].options,Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function ux(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Required"),p(e,"type","checkbox"),p(e,"id",t=n[37]),p(o,"for",l=n[37])},m(f,c){w(f,e,c),e.checked=n[0].required,w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[28]),s=!0)},p(f,c){c[1]&64&&t!==(t=f[37])&&p(e,"id",t),c[0]&1&&(e.checked=f[0].required),c[1]&64&&l!==(l=f[37])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function Tp(n){let e,t;return e=new je({props:{class:"form-field form-field-toggle m-0",name:"unique",$$slots:{default:[dx,({uniqueId:i})=>({37:i}),({uniqueId:i})=>[0,i?64:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,o){const r={};o[0]&1|o[1]&192&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function dx(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[37]),p(o,"for",l=n[37])},m(f,c){w(f,e,c),e.checked=n[0].unique,w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[29]),s=!0)},p(f,c){c[1]&64&&t!==(t=f[37])&&p(e,"id",t),c[0]&1&&(e.checked=f[0].unique),c[1]&64&&l!==(l=f[37])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function px(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C,x,M;o=new je({props:{class:"form-field required "+(n[0].id?"disabled":""),name:"schema."+n[1]+".type",$$slots:{default:[X5,({uniqueId:P})=>({37:P}),({uniqueId:P})=>[0,P?64:0]]},$$scope:{ctx:n}}}),s=new je({props:{class:"form-field required "+(n[0].id&&n[0].system?"disabled":""),name:"schema."+n[1]+".name",$$slots:{default:[Q5,({uniqueId:P})=>({37:P}),({uniqueId:P})=>[0,P?64:0]]},$$scope:{ctx:n}}});const A=[cx,fx,ax,sx,lx,rx,ox,ix,nx,tx,ex],O=[];function D(P,I){return P[0].type==="text"?0:P[0].type==="number"?1:P[0].type==="bool"?2:P[0].type==="email"?3:P[0].type==="url"?4:P[0].type==="date"?5:P[0].type==="select"?6:P[0].type==="json"?7:P[0].type==="file"?8:P[0].type==="relation"?9:P[0].type==="user"?10:-1}~(c=D(n))&&(u=O[c]=A[c](n)),b=new je({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[ux,({uniqueId:P})=>({37:P}),({uniqueId:P})=>[0,P?64:0]]},$$scope:{ctx:n}}});let E=n[0].type!=="file"&&Tp(n);return{c(){e=g("form"),t=g("div"),i=g("div"),V(o.$$.fragment),r=$(),l=g("div"),V(s.$$.fragment),a=$(),f=g("div"),u&&u.c(),d=$(),h=g("div"),V(b.$$.fragment),v=$(),_=g("div"),E&&E.c(),y=$(),S=g("input"),p(i,"class","col-sm-6"),p(l,"class","col-sm-6"),p(f,"class","col-sm-12 hidden-empty"),p(h,"class","col-4"),p(_,"class","col-4"),p(t,"class","grid"),p(S,"type","submit"),p(S,"class","hidden"),p(S,"tabindex","-1"),p(e,"class","field-form")},m(P,I){w(P,e,I),m(e,t),m(t,i),H(o,i,null),m(t,r),m(t,l),H(s,l,null),m(t,a),m(t,f),~c&&O[c].m(f,null),m(t,d),m(t,h),H(b,h,null),m(t,v),m(t,_),E&&E.m(_,null),m(e,y),m(e,S),C=!0,x||(M=X(e,"submit",Gt(n[30])),x=!0)},p(P,I){const R={};I[0]&1&&(R.class="form-field required "+(P[0].id?"disabled":"")),I[0]&2&&(R.name="schema."+P[1]+".type"),I[0]&1|I[1]&192&&(R.$$scope={dirty:I,ctx:P}),o.$set(R);const G={};I[0]&1&&(G.class="form-field required "+(P[0].id&&P[0].system?"disabled":"")),I[0]&2&&(G.name="schema."+P[1]+".name"),I[0]&1|I[1]&192&&(G.$$scope={dirty:I,ctx:P}),s.$set(G);let U=c;c=D(P),c===U?~c&&O[c].p(P,I):(u&&(Ae(),F(O[U],1,1,()=>{O[U]=null}),De()),~c?(u=O[c],u?u.p(P,I):(u=O[c]=A[c](P),u.c()),T(u,1),u.m(f,null)):u=null);const z={};I[0]&1|I[1]&192&&(z.$$scope={dirty:I,ctx:P}),b.$set(z),P[0].type!=="file"?E?(E.p(P,I),I[0]&1&&T(E,1)):(E=Tp(P),E.c(),T(E,1),E.m(_,null)):E&&(Ae(),F(E,1,1,()=>{E=null}),De())},i(P){C||(T(o.$$.fragment,P),T(s.$$.fragment,P),T(u),T(b.$$.fragment,P),T(E),C=!0)},o(P){F(o.$$.fragment,P),F(s.$$.fragment,P),F(u),F(b.$$.fragment,P),F(E),C=!1},d(P){P&&k(e),q(o),q(s),~c&&O[c].d(),q(b),E&&E.d(),x=!1,M()}}}function Ep(n){let e,t,i,o,r=n[0].system&&Pp(),l=!n[0].id&&Fp(n),s=n[0].required&&Lp(),a=n[0].unique&&Ip();return{c(){e=g("div"),r&&r.c(),t=$(),l&&l.c(),i=$(),s&&s.c(),o=$(),a&&a.c(),p(e,"class","inline-flex")},m(f,c){w(f,e,c),r&&r.m(e,null),m(e,t),l&&l.m(e,null),m(e,i),s&&s.m(e,null),m(e,o),a&&a.m(e,null)},p(f,c){f[0].system?r||(r=Pp(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),f[0].id?l&&(l.d(1),l=null):l?l.p(f,c):(l=Fp(f),l.c(),l.m(e,i)),f[0].required?s||(s=Lp(),s.c(),s.m(e,o)):s&&(s.d(1),s=null),f[0].unique?a||(a=Ip(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(f){f&&k(e),r&&r.d(),l&&l.d(),s&&s.d(),a&&a.d()}}}function Pp(n){let e;return{c(){e=g("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Fp(n){let e;return{c(){e=g("span"),e.textContent="New",p(e,"class","label"),ne(e,"label-warning",n[7]&&!n[0].toDelete)},m(t,i){w(t,e,i)},p(t,i){i[0]&129&&ne(e,"label-warning",t[7]&&!t[0].toDelete)},d(t){t&&k(e)}}}function Lp(n){let e;return{c(){e=g("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ip(n){let e;return{c(){e=g("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Rp(n){let e,t,i,o,r,l;return{c(){e=g("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(s,a){w(s,e,a),o=!0,r||(l=Xe(t=St.call(null,e,{text:"Has errors",position:"left"})),r=!0)},i(s){o||(Dt(()=>{i||(i=ct(e,Bn,{duration:150,start:.7},!0)),i.run(1)}),o=!0)},o(s){i||(i=ct(e,Bn,{duration:150,start:.7},!1)),i.run(0),o=!1},d(s){s&&k(e),s&&i&&i.end(),r=!1,l()}}}function Np(n){let e,t,i,o,r,l,s=n[7]&&jp(n);return{c(){e=g("div"),t=g("button"),t.innerHTML='<span class="txt">Remove</span>',i=$(),s&&s.c(),p(t,"type","button"),p(t,"class","btn btn-sm fade p-l-0 p-r-0"),p(e,"class","inline-flex flex-gap-sm flex-nowrap")},m(a,f){w(a,e,f),m(e,t),m(e,i),s&&s.m(e,null),r||(l=X(t,"click",Vn(n[8])),r=!0)},p(a,f){a[7]?s?s.p(a,f):(s=jp(a),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},i(a){o||Dt(()=>{o=yf(e,ti,{duration:200,x:20,opacity:0}),o.start()})},o:le,d(a){a&&k(e),s&&s.d(),r=!1,l()}}}function jp(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<span class="txt">Done</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-outline btn-expanded-sm")},m(o,r){w(o,e,r),t||(i=X(e,"click",Vn(n[3])),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function zp(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-secondary")},m(o,r){w(o,e,r),t||(i=X(e,"click",Vn(n[14])),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function hx(n){let e,t,i,o,r,l,s=(n[0].name||"-")+"",a,f,c,u,d,h,b,v,_,y,S=!n[0].toDelete&&Ep(n),C=n[6]&&Rp(),x=n[36]&&!n[0].toDelete&&Np(n),M=n[0].toDelete&&zp(n);return{c(){e=g("div"),t=g("span"),i=g("i"),r=$(),l=g("strong"),a=j(s),c=$(),S&&S.c(),u=$(),d=g("div"),h=$(),C&&C.c(),b=$(),x&&x.c(),v=$(),M&&M.c(),_=lt(),p(i,"class",o=gc(B.getFieldTypeIcon(n[0].type))+" svelte-162uq6"),p(t,"class","icon field-type"),p(l,"class","title field-name svelte-162uq6"),p(l,"title",f=n[0].name),ne(l,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m(A,O){w(A,e,O),m(e,t),m(t,i),m(e,r),m(e,l),m(l,a),w(A,c,O),S&&S.m(A,O),w(A,u,O),w(A,d,O),w(A,h,O),C&&C.m(A,O),w(A,b,O),x&&x.m(A,O),w(A,v,O),M&&M.m(A,O),w(A,_,O),y=!0},p(A,O){(!y||O[0]&1&&o!==(o=gc(B.getFieldTypeIcon(A[0].type))+" svelte-162uq6"))&&p(i,"class",o),(!y||O[0]&1)&&s!==(s=(A[0].name||"-")+"")&&ge(a,s),(!y||O[0]&1&&f!==(f=A[0].name))&&p(l,"title",f),O[0]&1&&ne(l,"txt-strikethrough",A[0].toDelete),A[0].toDelete?S&&(S.d(1),S=null):S?S.p(A,O):(S=Ep(A),S.c(),S.m(u.parentNode,u)),A[6]?C?O[0]&64&&T(C,1):(C=Rp(),C.c(),T(C,1),C.m(b.parentNode,b)):C&&(Ae(),F(C,1,1,()=>{C=null}),De()),A[36]&&!A[0].toDelete?x?(x.p(A,O),O[0]&1|O[1]&32&&T(x,1)):(x=Np(A),x.c(),T(x,1),x.m(v.parentNode,v)):x&&(x.d(1),x=null),A[0].toDelete?M?M.p(A,O):(M=zp(A),M.c(),M.m(_.parentNode,_)):M&&(M.d(1),M=null)},i(A){y||(T(C),T(x),y=!0)},o(A){F(C),y=!1},d(A){A&&k(e),A&&k(c),S&&S.d(A),A&&k(u),A&&k(d),A&&k(h),C&&C.d(A),A&&k(b),x&&x.d(A),A&&k(v),M&&M.d(A),A&&k(_)}}}function mx(n){let e,t,i={single:!0,interactive:n[7],class:n[2]||n[0].toDelete||n[0].system?"field-accordion disabled":"field-accordion",$$slots:{header:[hx,({active:o})=>({36:o}),({active:o})=>[0,o?32:0]],default:[px]},$$scope:{ctx:n}};return e=new dc({props:i}),n[31](e),e.$on("expand",n[32]),e.$on("collapse",n[33]),e.$on("toggle",n[34]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,r){const l={};r[0]&128&&(l.interactive=o[7]),r[0]&5&&(l.class=o[2]||o[0].toDelete||o[0].system?"field-accordion disabled":"field-accordion"),r[0]&227|r[1]&160&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[31](null),q(e,o)}}}function bx(n,e,t){let i,o,r,l;pn(n,go,J=>t(13,l=J));const s=yn();let{key:a="0"}=e,{field:f=new kn}=e,{disabled:c=!1}=e,{excludeNames:u=[]}=e,d,h=f.type;function b(){d==null||d.expand()}function v(){d==null||d.collapse()}function _(){f.id?t(0,f.toDelete=!0,f):(v(),s("remove"))}function y(J){J=B.slugify(J);let $e="";for(;u.includes(J+$e);)++$e;return J+$e}di(()=>{f.id||b()});const S=()=>{t(0,f.toDelete=!1,f)};function C(J){n.$$.not_equal(f.type,J)&&(f.type=J,t(0,f),t(12,h),t(10,u),t(4,d))}const x=J=>{t(0,f.name=y(J.target.value),f),J.target.value=f.name};function M(J){n.$$.not_equal(f.options,J)&&(f.options=J,t(0,f),t(12,h),t(10,u),t(4,d))}function A(J){n.$$.not_equal(f.options,J)&&(f.options=J,t(0,f),t(12,h),t(10,u),t(4,d))}function O(J){n.$$.not_equal(f.options,J)&&(f.options=J,t(0,f),t(12,h),t(10,u),t(4,d))}function D(J){n.$$.not_equal(f.options,J)&&(f.options=J,t(0,f),t(12,h),t(10,u),t(4,d))}function E(J){n.$$.not_equal(f.options,J)&&(f.options=J,t(0,f),t(12,h),t(10,u),t(4,d))}function P(J){n.$$.not_equal(f.options,J)&&(f.options=J,t(0,f),t(12,h),t(10,u),t(4,d))}function I(J){n.$$.not_equal(f.options,J)&&(f.options=J,t(0,f),t(12,h),t(10,u),t(4,d))}function R(J){n.$$.not_equal(f.options,J)&&(f.options=J,t(0,f),t(12,h),t(10,u),t(4,d))}function G(J){n.$$.not_equal(f.options,J)&&(f.options=J,t(0,f),t(12,h),t(10,u),t(4,d))}function U(J){n.$$.not_equal(f.options,J)&&(f.options=J,t(0,f),t(12,h),t(10,u),t(4,d))}function z(J){n.$$.not_equal(f.options,J)&&(f.options=J,t(0,f),t(12,h),t(10,u),t(4,d))}function K(){f.required=this.checked,t(0,f),t(12,h),t(10,u),t(4,d)}function Y(){f.unique=this.checked,t(0,f),t(12,h),t(10,u),t(4,d)}const W=()=>{i&&v()};function te(J){he[J?"unshift":"push"](()=>{d=J,t(4,d)})}function ce(J){ft.call(this,n,J)}function ve(J){ft.call(this,n,J)}function oe(J){ft.call(this,n,J)}return n.$$set=J=>{"key"in J&&t(1,a=J.key),"field"in J&&t(0,f=J.field),"disabled"in J&&t(2,c=J.disabled),"excludeNames"in J&&t(10,u=J.excludeNames)},n.$$.update=()=>{if(n.$$.dirty[0]&4097&&h!=f.type&&(t(12,h=f.type),t(0,f.options={},f),t(0,f.unique=!1,f)),n.$$.dirty[0]&1025&&u.length){const J=y(f.name);f.name!==J&&t(0,f.name=J,f)}n.$$.dirty[0]&17&&f.toDelete&&(d&&v(),!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=="undefined"&&t(0,f.toDelete=!1,f),n.$$.dirty[0]&1&&t(5,i=!B.isEmpty(f.name)&&f.type),n.$$.dirty[0]&48&&(i||d&&b()),n.$$.dirty[0]&37&&t(7,o=!c&&!f.system&&!f.toDelete&&i),n.$$.dirty[0]&8194&&t(6,r=!B.isEmpty(B.getNestedVal(l,`schema.${a}`)))},[f,a,c,v,d,i,r,o,_,y,u,b,h,l,S,C,x,M,A,O,D,E,P,I,R,G,U,z,K,Y,W,te,ce,ve,oe]}class gx extends Ie{constructor(e){super(),Le(this,e,bx,mx,Ee,{key:1,field:0,disabled:2,excludeNames:10,expand:11,collapse:3},null,[-1,-1])}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[3]}}function Hp(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function qp(n,e){let t,i,o,r;function l(f){e[5](f,e[9],e[10],e[11])}function s(){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 gx({props:a}),he.push(()=>Fe(i,"field",l)),i.$on("remove",s),{key:n,first:null,c(){t=lt(),V(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),H(i,f,c),r=!0},p(f,c){e=f;const u={};c&1&&(u.key=e[11]),c&1&&(u.excludeNames=e[1].concat(e[4](e[9]))),!o&&c&1&&(o=!0,u.field=e[9],Re(()=>o=!1)),i.$set(u)},i(f){r||(T(i.$$.fragment,f),r=!0)},o(f){F(i.$$.fragment,f),r=!1},d(f){f&&k(t),q(i,f)}}}function _x(n){let e,t=[],i=new Map,o,r,l,s,a,f,c,u,d,h,b,v=n[0].schema;const _=y=>y[11];for(let y=0;y<v.length;y+=1){let S=Hp(n,v,y),C=_(S);i.set(C,t[y]=qp(C,S))}return{c(){var y;e=g("div");for(let S=0;S<t.length;S+=1)t[S].c();o=$(),r=g("div"),l=$(),s=g("button"),a=g("i"),f=$(),c=g("span"),c.textContent="New field",p(e,"class","accordions"),p(r,"class","clearfix m-t-xs"),p(a,"class","ri-add-line"),p(c,"class","txt"),p(s,"type","button"),p(s,"class",u="btn btn-block "+((y=n[0].schema)!=null&&y.length?"btn-secondary":"btn-success"))},m(y,S){w(y,e,S);for(let C=0;C<t.length;C+=1)t[C].m(e,null);w(y,o,S),w(y,r,S),w(y,l,S),w(y,s,S),m(s,a),m(s,f),m(s,c),d=!0,h||(b=X(s,"click",n[3]),h=!0)},p(y,[S]){var C;S&23&&(v=y[0].schema,Ae(),t=st(t,S,_,1,y,v,i,e,Pt,qp,null,Hp),De()),(!d||S&1&&u!==(u="btn btn-block "+((C=y[0].schema)!=null&&C.length?"btn-secondary":"btn-success")))&&p(s,"class",u)},i(y){if(!d){for(let S=0;S<v.length;S+=1)T(t[S]);d=!0}},o(y){for(let S=0;S<t.length;S+=1)F(t[S]);d=!1},d(y){y&&k(e);for(let S=0;S<t.length;S+=1)t[S].d();y&&k(o),y&&k(r),y&&k(l),y&&k(s),h=!1,b()}}}function vx(n,e,t){const i=["id","created","updated"];let{collection:o={}}=e;function r(d){o.schema[d]&&(o.schema.splice(d,1),t(0,o))}function l(){const d=new kn({name:s()});o.schema.push(d),t(0,o)}function s(d="field"){let h="";for(;a(d+h);)++h;return d+h}function a(d){return!!o.schema.find(h=>h.name===d)}function f(d){let h=[];for(let b of o.schema)b!==d&&(h.push(b.name),b.id&&b.originalName!==""&&b.originalName!==b.name&&h.push(b.originalName));return h}function c(d,h,b,v){b[v]=d,t(0,o)}const u=d=>r(d);return n.$$set=d=>{"collection"in d&&t(0,o=d.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof(o==null?void 0:o.schema)=="undefined"&&(t(0,o=o||{}),t(0,o.schema=[],o))},[o,i,r,l,f,c,u]}class yx extends Ie{constructor(e){super(),Le(this,e,vx,_x,Ee,{collection:0})}}function Vp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[16]=e,i[17]=t,i}function Bp(n,e,t){const i=n.slice();return i[19]=e[t],i}function Up(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C,x,M,A,O,D,E,P,I,R,G,U,z=n[0].schema,K=[];for(let Y=0;Y<z.length;Y+=1)K[Y]=Wp(Bp(n,z,Y));return{c(){e=g("div"),t=g("div"),i=g("div"),o=g("p"),o.textContent="The following record fields are available:",r=$(),l=g("div"),s=g("code"),s.textContent="id",a=$(),f=g("code"),f.textContent="created",c=$(),u=g("code"),u.textContent="updated",d=$();for(let Y=0;Y<K.length;Y+=1)K[Y].c();h=$(),b=g("hr"),v=$(),_=g("p"),_.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",y=$(),S=g("div"),S.innerHTML=`<code>@request.method</code>
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.user.*</code>`,C=$(),x=g("hr"),M=$(),A=g("p"),A.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",O=$(),D=g("div"),D.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",E=$(),P=g("hr"),I=$(),R=g("p"),R.innerHTML=`Example rule:
<br/>
<code>@request.user.id!=null &amp;&amp; created&gt;&quot;2022-01-01 00:00:00&quot;</code>`,p(o,"class","m-b-0"),p(l,"class","inline-flex flex-gap-5"),p(b,"class","m-t-10 m-b-5"),p(_,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(x,"class","m-t-10 m-b-5"),p(A,"class","m-b-0"),p(D,"class","inline-flex flex-gap-5"),p(P,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(Y,W){w(Y,e,W),m(e,t),m(t,i),m(i,o),m(i,r),m(i,l),m(l,s),m(l,a),m(l,f),m(l,c),m(l,u),m(l,d);for(let te=0;te<K.length;te+=1)K[te].m(l,null);m(i,h),m(i,b),m(i,v),m(i,_),m(i,y),m(i,S),m(i,C),m(i,x),m(i,M),m(i,A),m(i,O),m(i,D),m(i,E),m(i,P),m(i,I),m(i,R),U=!0},p(Y,W){if(W&1){z=Y[0].schema;let te;for(te=0;te<z.length;te+=1){const ce=Bp(Y,z,te);K[te]?K[te].p(ce,W):(K[te]=Wp(ce),K[te].c(),K[te].m(l,null))}for(;te<K.length;te+=1)K[te].d(1);K.length=z.length}},i(Y){U||(Y&&Dt(()=>{G||(G=ct(e,fn,{duration:150},!0)),G.run(1)}),U=!0)},o(Y){Y&&(G||(G=ct(e,fn,{duration:150},!1)),G.run(0)),U=!1},d(Y){Y&&k(e),qn(K,Y),Y&&G&&G.end()}}}function kx(n){let e,t=n[19].name+"",i;return{c(){e=g("code"),i=j(t)},m(o,r){w(o,e,r),m(e,i)},p(o,r){r&1&&t!==(t=o[19].name+"")&&ge(i,t)},d(o){o&&k(e)}}}function wx(n){let e,t=n[19].name+"",i,o;return{c(){e=g("code"),i=j(t),o=j(".*")},m(r,l){w(r,e,l),m(e,i),m(e,o)},p(r,l){l&1&&t!==(t=r[19].name+"")&&ge(i,t)},d(r){r&&k(e)}}}function Wp(n){let e;function t(r,l){return r[19].type==="relation"||r[19].type==="user"?wx:kx}let i=t(n),o=i(n);return{c(){o.c(),e=lt()},m(r,l){o.m(r,l),w(r,e,l)},p(r,l){i===(i=t(r))&&o?o.p(r,l):(o.d(1),o=i(r),o&&(o.c(),o.m(e.parentNode,e)))},d(r){o.d(r),r&&k(e)}}}function Sx(n){let e=[],t=new Map,i,o,r=Object.entries(n[6]);const l=s=>s[14];for(let s=0;s<r.length;s+=1){let a=Vp(n,r,s),f=l(a);t.set(f,e[s]=Yp(f,a))}return{c(){for(let s=0;s<e.length;s+=1)e[s].c();i=lt()},m(s,a){for(let f=0;f<e.length;f+=1)e[f].m(s,a);w(s,i,a),o=!0},p(s,a){a&262235&&(r=Object.entries(s[6]),Ae(),e=st(e,a,l,1,s,r,t,i.parentNode,Pt,Yp,i,Vp),De())},i(s){if(!o){for(let a=0;a<r.length;a+=1)T(e[a]);o=!0}},o(s){for(let a=0;a<e.length;a+=1)F(e[a]);o=!1},d(s){for(let a=0;a<e.length;a+=1)e[a].d(s);s&&k(i)}}}function Cx(n){let e;return{c(){e=g("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function xx(n){let e,t,i;function o(){return n[9](n[14])}return{c(){e=g("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(r,l){w(r,e,l),t||(i=[Xe(St.call(null,e,"Lock and set to Admins only")),X(e,"click",o)],t=!0)},p(r,l){n=r},d(r){r&&k(e),t=!1,rt(i)}}}function Mx(n){let e,t,i;function o(){return n[8](n[14])}return{c(){e=g("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(r,l){w(r,e,l),t||(i=[Xe(St.call(null,e,"Unlock and set custom rule")),X(e,"click",o)],t=!0)},p(r,l){n=r},d(r){r&&k(e),t=!1,rt(i)}}}function $x(n){let e;return{c(){e=j("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ax(n){let e;return{c(){e=j("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Dx(n){let e,t=n[15]+"",i,o,r=Ii(n[0][n[14]])?"Admins only":"Custom rule",l,s,a,f,c=n[14],u,d,h,b,v,_,y;function S(){return n[10](n[14])}const C=()=>n[11](f,c),x=()=>n[11](null,c);function M(I){n[12](I,n[14])}var A=n[4];function O(I){let R={baseCollection:I[0],disabled:Ii(I[0][I[14]])};return I[0][I[14]]!==void 0&&(R.value=I[0][I[14]]),{props:R}}A&&(f=new A(O(n)),C(),he.push(()=>Fe(f,"value",M)));function D(I,R){return R&1&&(b=null),b==null&&(b=!!Ii(I[0][I[14]])),b?Ax:$x}let E=D(n,-1),P=E(n);return{c(){e=g("label"),i=j(t),o=j(" - "),l=j(r),a=$(),f&&V(f.$$.fragment),d=$(),h=g("div"),P.c(),p(e,"for",s=n[18]),p(h,"class","help-block")},m(I,R){w(I,e,R),m(e,i),m(e,o),m(e,l),w(I,a,R),f&&H(f,I,R),w(I,d,R),w(I,h,R),P.m(h,null),v=!0,_||(y=X(e,"click",S),_=!0)},p(I,R){n=I,(!v||R&1)&&r!==(r=Ii(n[0][n[14]])?"Admins only":"Custom rule")&&ge(l,r),(!v||R&262144&&s!==(s=n[18]))&&p(e,"for",s),c!==n[14]&&(x(),c=n[14],C());const G={};if(R&1&&(G.baseCollection=n[0]),R&1&&(G.disabled=Ii(n[0][n[14]])),!u&&R&65&&(u=!0,G.value=n[0][n[14]],Re(()=>u=!1)),A!==(A=n[4])){if(f){Ae();const U=f;F(U.$$.fragment,1,0,()=>{q(U,1)}),De()}A?(f=new A(O(n)),C(),he.push(()=>Fe(f,"value",M)),V(f.$$.fragment),T(f.$$.fragment,1),H(f,d.parentNode,d)):f=null}else A&&f.$set(G);E!==(E=D(n,R))&&(P.d(1),P=E(n),P&&(P.c(),P.m(h,null)))},i(I){v||(f&&T(f.$$.fragment,I),v=!0)},o(I){f&&F(f.$$.fragment,I),v=!1},d(I){I&&k(e),I&&k(a),x(),f&&q(f,I),I&&k(d),I&&k(h),P.d(),_=!1,y()}}}function Yp(n,e){let t,i,o,r,l,s,a,f;function c(h,b){return b&1&&(r=null),r==null&&(r=!!Ii(h[0][h[14]])),r?Mx:xx}let u=c(e,-1),d=u(e);return s=new je({props:{class:"form-field rule-field m-0 "+(Ii(e[0][e[14]])?"disabled":""),name:e[14],$$slots:{default:[Dx,({uniqueId:h})=>({18:h}),({uniqueId:h})=>h?262144:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=g("hr"),i=$(),o=g("div"),d.c(),l=$(),V(s.$$.fragment),a=$(),p(t,"class","m-t-sm m-b-sm"),p(o,"class","rule-block svelte-fjxz7k"),this.first=t},m(h,b){w(h,t,b),w(h,i,b),w(h,o,b),d.m(o,null),m(o,l),H(s,o,null),m(o,a),f=!0},p(h,b){e=h,u===(u=c(e,b))&&d?d.p(e,b):(d.d(1),d=u(e),d&&(d.c(),d.m(o,l)));const v={};b&1&&(v.class="form-field rule-field m-0 "+(Ii(e[0][e[14]])?"disabled":"")),b&4456473&&(v.$$scope={dirty:b,ctx:e}),s.$set(v)},i(h){f||(T(s.$$.fragment,h),f=!0)},o(h){F(s.$$.fragment,h),f=!1},d(h){h&&k(t),h&&k(i),h&&k(o),d.d(),q(s)}}}function Ox(n){let e,t,i,o,r,l=n[2]?"Hide available fields":"Show available fields",s,a,f,c,u,d,h,b,v,_=n[2]&&Up(n);const y=[Cx,Sx],S=[];function C(x,M){return x[5]?0:1}return c=C(n),u=S[c]=y[c](n),{c(){e=g("div"),t=g("div"),i=g("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>.`,o=$(),r=g("span"),s=j(l),a=$(),_&&_.c(),f=$(),u.c(),d=lt(),p(r,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex"),p(e,"class","block m-b-base")},m(x,M){w(x,e,M),m(e,t),m(t,i),m(t,o),m(t,r),m(r,s),m(e,a),_&&_.m(e,null),w(x,f,M),S[c].m(x,M),w(x,d,M),h=!0,b||(v=X(r,"click",n[7]),b=!0)},p(x,[M]){(!h||M&4)&&l!==(l=x[2]?"Hide available fields":"Show available fields")&&ge(s,l),x[2]?_?(_.p(x,M),M&4&&T(_,1)):(_=Up(x),_.c(),T(_,1),_.m(e,null)):_&&(Ae(),F(_,1,1,()=>{_=null}),De());let A=c;c=C(x),c===A?S[c].p(x,M):(Ae(),F(S[A],1,1,()=>{S[A]=null}),De(),u=S[c],u?u.p(x,M):(u=S[c]=y[c](x),u.c()),T(u,1),u.m(d.parentNode,d))},i(x){h||(T(_),T(u),h=!0)},o(x){F(_),F(u),h=!1},d(x){x&&k(e),_&&_.d(),x&&k(f),S[c].d(x),x&&k(d),b=!1,v()}}}function Ii(n){return n===null}function Tx(n,e,t){let{collection:i=new En}=e,o={},r=!1,l={},s,a=!1;const f={listRule:"List Action",viewRule:"View Action",createRule:"Create Action",updateRule:"Update Action",deleteRule:"Delete Action"};async function c(){t(5,a=!0);try{t(4,s=(await _i(()=>import("./FilterAutocompleteInput.3cd8dab2.js"),[])).default)}catch(y){console.warn(y),t(4,s=null)}t(5,a=!1)}di(()=>{c()});const u=()=>t(2,r=!r),d=async y=>{var S;t(0,i[y]=o[y]||"",i),await Bi(),(S=l[y])==null||S.focus()},h=y=>{t(1,o[y]=i[y],o),t(0,i[y]=null,i)},b=y=>{var S;return(S=l[y])==null?void 0:S.focus()};function v(y,S){he[y?"unshift":"push"](()=>{l[S]=y,t(3,l)})}function _(y,S){n.$$.not_equal(i[S],y)&&(i[S]=y,t(0,i))}return n.$$set=y=>{"collection"in y&&t(0,i=y.collection)},[i,o,r,l,s,a,f,u,d,h,b,v,_]}class Ex extends Ie{constructor(e){super(),Le(this,e,Tx,Ox,Ee,{collection:0})}}function Gp(n,e,t){const i=n.slice();return i[14]=e[t],i}function Kp(n,e,t){const i=n.slice();return i[14]=e[t],i}function Jp(n){let e;return{c(){e=g("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 Zp(n){let e,t,i,o,r=n[1].originalName+"",l,s,a,f,c,u=n[1].name+"",d;return{c(){e=g("li"),t=g("div"),i=j(`Renamed collection
`),o=g("strong"),l=j(r),s=$(),a=g("i"),f=$(),c=g("strong"),d=j(u),p(o,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(c,"class","txt"),p(t,"class","inline-flex")},m(h,b){w(h,e,b),m(e,t),m(t,i),m(t,o),m(o,l),m(t,s),m(t,a),m(t,f),m(t,c),m(c,d)},p(h,b){b&2&&r!==(r=h[1].originalName+"")&&ge(l,r),b&2&&u!==(u=h[1].name+"")&&ge(d,u)},d(h){h&&k(e)}}}function Xp(n){let e,t,i,o,r=n[14].originalName+"",l,s,a,f,c,u=n[14].name+"",d;return{c(){e=g("li"),t=g("div"),i=j(`Renamed field
`),o=g("strong"),l=j(r),s=$(),a=g("i"),f=$(),c=g("strong"),d=j(u),p(o,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(c,"class","txt"),p(t,"class","inline-flex")},m(h,b){w(h,e,b),m(e,t),m(t,i),m(t,o),m(o,l),m(t,s),m(t,a),m(t,f),m(t,c),m(c,d)},p(h,b){b&16&&r!==(r=h[14].originalName+"")&&ge(l,r),b&16&&u!==(u=h[14].name+"")&&ge(d,u)},d(h){h&&k(e)}}}function Qp(n){let e,t,i,o=n[14].name+"",r,l;return{c(){e=g("li"),t=j("Removed field "),i=g("span"),r=j(o),l=$(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(s,a){w(s,e,a),m(e,t),m(e,i),m(i,r),m(e,l)},p(s,a){a&8&&o!==(o=s[14].name+"")&&ge(r,o)},d(s){s&&k(e)}}}function Px(n){let e,t,i,o,r,l,s,a,f,c,u,d,h=n[3].length&&Jp(),b=n[5]&&Zp(n),v=n[4],_=[];for(let C=0;C<v.length;C+=1)_[C]=Xp(Kp(n,v,C));let y=n[3],S=[];for(let C=0;C<y.length;C+=1)S[C]=Qp(Gp(n,y,C));return{c(){e=g("div"),t=g("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=$(),o=g("div"),r=g("p"),r.textContent=`If any of the following changes is part of another collection rule or filter, you'll have to
update it manually!`,l=$(),h&&h.c(),s=$(),a=g("h6"),a.textContent="Changes:",f=$(),c=g("ul"),b&&b.c(),u=$();for(let C=0;C<_.length;C+=1)_[C].c();d=$();for(let C=0;C<S.length;C+=1)S[C].c();p(t,"class","icon"),p(o,"class","content txt-bold"),p(e,"class","alert alert-warning"),p(c,"class","changes-list svelte-1ghly2p")},m(C,x){w(C,e,x),m(e,t),m(e,i),m(e,o),m(o,r),m(o,l),h&&h.m(o,null),w(C,s,x),w(C,a,x),w(C,f,x),w(C,c,x),b&&b.m(c,null),m(c,u);for(let M=0;M<_.length;M+=1)_[M].m(c,null);m(c,d);for(let M=0;M<S.length;M+=1)S[M].m(c,null)},p(C,x){if(C[3].length?h||(h=Jp(),h.c(),h.m(o,null)):h&&(h.d(1),h=null),C[5]?b?b.p(C,x):(b=Zp(C),b.c(),b.m(c,u)):b&&(b.d(1),b=null),x&16){v=C[4];let M;for(M=0;M<v.length;M+=1){const A=Kp(C,v,M);_[M]?_[M].p(A,x):(_[M]=Xp(A),_[M].c(),_[M].m(c,d))}for(;M<_.length;M+=1)_[M].d(1);_.length=v.length}if(x&8){y=C[3];let M;for(M=0;M<y.length;M+=1){const A=Gp(C,y,M);S[M]?S[M].p(A,x):(S[M]=Qp(A),S[M].c(),S[M].m(c,null))}for(;M<S.length;M+=1)S[M].d(1);S.length=y.length}},d(C){C&&k(e),h&&h.d(),C&&k(s),C&&k(a),C&&k(f),C&&k(c),b&&b.d(),qn(_,C),qn(S,C)}}}function Fx(n){let e;return{c(){e=g("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Lx(n){let e,t,i,o,r;return{c(){e=g("button"),e.innerHTML='<span class="txt">Cancel</span>',t=$(),i=g("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(l,s){w(l,e,s),w(l,t,s),w(l,i,s),e.focus(),o||(r=[X(e,"click",n[8]),X(i,"click",n[9])],o=!0)},p:le,d(l){l&&k(e),l&&k(t),l&&k(i),o=!1,rt(r)}}}function Ix(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[Lx],header:[Fx],default:[Px]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,[r]){const l={};r&524346&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[10](null),q(e,o)}}}function Rx(n,e,t){let i,o,r;const l=yn();let s,a;async function f(y){t(1,a=y),await Bi(),!i&&!o.length&&!r.length?u():s==null||s.show()}function c(){s==null||s.hide()}function u(){c(),l("confirm")}const d=()=>c(),h=()=>u();function b(y){he[y?"unshift":"push"](()=>{s=y,t(2,s)})}function v(y){ft.call(this,n,y)}function _(y){ft.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,o=(a==null?void 0:a.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(3,r=(a==null?void 0:a.schema.filter(y=>y.id&&y.toDelete))||[])},[c,a,s,r,o,i,u,f,d,h,b,v,_]}class Nx extends Ie{constructor(e){super(),Le(this,e,Rx,Ix,Ee,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function eh(n){let e,t,i,o;function r(s){n[26](s)}let l={};return n[2]!==void 0&&(l.collection=n[2]),t=new Ex({props:l}),he.push(()=>Fe(t,"collection",r)),{c(){e=g("div"),V(t.$$.fragment),p(e,"class","tab-item active")},m(s,a){w(s,e,a),H(t,e,null),o=!0},p(s,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=s[2],Re(()=>i=!1)),t.$set(f)},i(s){o||(T(t.$$.fragment,s),o=!0)},o(s){F(t.$$.fragment,s),o=!1},d(s){s&&k(e),q(t)}}}function jx(n){let e,t,i,o,r,l;function s(c){n[25](c)}let a={};n[2]!==void 0&&(a.collection=n[2]),i=new yx({props:a}),he.push(()=>Fe(i,"collection",s));let f=n[9]===qr&&eh(n);return{c(){e=g("div"),t=g("div"),V(i.$$.fragment),r=$(),f&&f.c(),p(t,"class","tab-item"),ne(t,"active",n[9]===ho),p(e,"class","tabs-content svelte-b10vi")},m(c,u){w(c,e,u),m(e,t),H(i,t,null),m(e,r),f&&f.m(e,null),l=!0},p(c,u){const d={};!o&&u[0]&4&&(o=!0,d.collection=c[2],Re(()=>o=!1)),i.$set(d),u[0]&512&&ne(t,"active",c[9]===ho),c[9]===qr?f?(f.p(c,u),u[0]&512&&T(f,1)):(f=eh(c),f.c(),T(f,1),f.m(e,null)):f&&(Ae(),F(f,1,1,()=>{f=null}),De())},i(c){l||(T(i.$$.fragment,c),T(f),l=!0)},o(c){F(i.$$.fragment,c),F(f),l=!1},d(c){c&&k(e),q(i),f&&f.d()}}}function th(n){let e,t,i,o,r,l,s;return l=new vo({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[zx]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=$(),i=g("button"),o=g("i"),r=$(),V(l.$$.fragment),p(e,"class","flex-fill"),p(o,"class","ri-more-line"),p(i,"type","button"),p(i,"class","btn btn-sm btn-circle btn-secondary flex-gap-0")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),m(i,o),m(i,r),H(l,i,null),s=!0},p(a,f){const c={};f[1]&256&&(c.$$scope={dirty:f,ctx:a}),l.$set(c)},i(a){s||(T(l.$$.fragment,a),s=!0)},o(a){F(l.$$.fragment,a),s=!1},d(a){a&&k(e),a&&k(t),a&&k(i),q(l)}}}function zx(n){let e,t,i;return{c(){e=g("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(o,r){w(o,e,r),t||(i=X(e,"click",n[20]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function nh(n){let e;return{c(){e=g("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Hx(n){let e,t,i,o,r,l,s,a,f,c,u,d,h=n[2].system&&nh();return{c(){e=g("label"),t=j("Name"),o=$(),r=g("input"),f=$(),h&&h.c(),c=lt(),p(e,"for",i=n[38]),p(r,"type","text"),p(r,"id",l=n[38]),r.required=!0,r.disabled=n[11],p(r,"spellcheck","false"),r.autofocus=s=n[2].isNew,p(r,"placeholder",'eg. "posts"'),r.value=a=n[2].name},m(b,v){w(b,e,v),m(e,t),w(b,o,v),w(b,r,v),w(b,f,v),h&&h.m(b,v),w(b,c,v),n[2].isNew&&r.focus(),u||(d=X(r,"input",n[21]),u=!0)},p(b,v){v[1]&128&&i!==(i=b[38])&&p(e,"for",i),v[1]&128&&l!==(l=b[38])&&p(r,"id",l),v[0]&2048&&(r.disabled=b[11]),v[0]&4&&s!==(s=b[2].isNew)&&(r.autofocus=s),v[0]&4&&a!==(a=b[2].name)&&r.value!==a&&(r.value=a),b[2].system?h||(h=nh(),h.c(),h.m(c.parentNode,c)):h&&(h.d(1),h=null)},d(b){b&&k(e),b&&k(o),b&&k(r),b&&k(f),h&&h.d(b),b&&k(c),u=!1,d()}}}function ih(n){let e,t,i,o,r,l;return{c(){e=g("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(s,a){w(s,e,a),o=!0,r||(l=Xe(t=St.call(null,e,n[12])),r=!0)},p(s,a){t&&Yn(t.update)&&a[0]&4096&&t.update.call(null,s[12])},i(s){o||(s&&Dt(()=>{i||(i=ct(e,Bn,{duration:150,start:.7},!0)),i.run(1)}),o=!0)},o(s){s&&(i||(i=ct(e,Bn,{duration:150,start:.7},!1)),i.run(0)),o=!1},d(s){s&&k(e),s&&i&&i.end(),r=!1,l()}}}function oh(n){let e,t,i,o,r;return{c(){e=g("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(l,s){w(l,e,s),i=!0,o||(r=Xe(St.call(null,e,"Has errors")),o=!0)},i(l){i||(l&&Dt(()=>{t||(t=ct(e,Bn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(l){l&&(t||(t=ct(e,Bn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(l){l&&k(e),l&&t&&t.end(),o=!1,r()}}}function qx(n){var I,R,G,U,z,K;let e,t=n[2].isNew?"New collection":"Edit collection",i,o,r,l,s,a,f,c,u,d,h,b,v=!B.isEmpty((I=n[4])==null?void 0:I.schema),_,y,S,C,x=!B.isEmpty((R=n[4])==null?void 0:R.listRule)||!B.isEmpty((G=n[4])==null?void 0:G.viewRule)||!B.isEmpty((U=n[4])==null?void 0:U.createRule)||!B.isEmpty((z=n[4])==null?void 0:z.updateRule)||!B.isEmpty((K=n[4])==null?void 0:K.deleteRule),M,A,O,D=!n[2].isNew&&!n[2].system&&th(n);s=new je({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[Hx,({uniqueId:Y})=>({38:Y}),({uniqueId:Y})=>[0,Y?128:0]]},$$scope:{ctx:n}}});let E=v&&ih(n),P=x&&oh();return{c(){e=g("h4"),i=j(t),o=$(),D&&D.c(),r=$(),l=g("form"),V(s.$$.fragment),a=$(),f=g("input"),c=$(),u=g("div"),d=g("button"),h=g("span"),h.textContent="Fields",b=$(),E&&E.c(),_=$(),y=g("button"),S=g("span"),S.textContent="API Rules",C=$(),P&&P.c(),p(f,"type","submit"),p(f,"class","hidden"),p(f,"tabindex","-1"),p(l,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ne(d,"active",n[9]===ho),p(S,"class","txt"),p(y,"type","button"),p(y,"class","tab-item"),ne(y,"active",n[9]===qr),p(u,"class","tabs-header stretched")},m(Y,W){w(Y,e,W),m(e,i),w(Y,o,W),D&&D.m(Y,W),w(Y,r,W),w(Y,l,W),H(s,l,null),m(l,a),m(l,f),w(Y,c,W),w(Y,u,W),m(u,d),m(d,h),m(d,b),E&&E.m(d,null),m(u,_),m(u,y),m(y,S),m(y,C),P&&P.m(y,null),M=!0,A||(O=[X(l,"submit",Gt(n[22])),X(d,"click",n[23]),X(y,"click",n[24])],A=!0)},p(Y,W){var ce,ve,oe,J,$e,ee;(!M||W[0]&4)&&t!==(t=Y[2].isNew?"New collection":"Edit collection")&&ge(i,t),!Y[2].isNew&&!Y[2].system?D?(D.p(Y,W),W[0]&4&&T(D,1)):(D=th(Y),D.c(),T(D,1),D.m(r.parentNode,r)):D&&(Ae(),F(D,1,1,()=>{D=null}),De());const te={};W[0]&2048&&(te.class="form-field required m-b-0 "+(Y[11]?"disabled":"")),W[0]&2052|W[1]&384&&(te.$$scope={dirty:W,ctx:Y}),s.$set(te),W[0]&16&&(v=!B.isEmpty((ce=Y[4])==null?void 0:ce.schema)),v?E?(E.p(Y,W),W[0]&16&&T(E,1)):(E=ih(Y),E.c(),T(E,1),E.m(d,null)):E&&(Ae(),F(E,1,1,()=>{E=null}),De()),W[0]&512&&ne(d,"active",Y[9]===ho),W[0]&16&&(x=!B.isEmpty((ve=Y[4])==null?void 0:ve.listRule)||!B.isEmpty((oe=Y[4])==null?void 0:oe.viewRule)||!B.isEmpty((J=Y[4])==null?void 0:J.createRule)||!B.isEmpty(($e=Y[4])==null?void 0:$e.updateRule)||!B.isEmpty((ee=Y[4])==null?void 0:ee.deleteRule)),x?P?W[0]&16&&T(P,1):(P=oh(),P.c(),T(P,1),P.m(y,null)):P&&(Ae(),F(P,1,1,()=>{P=null}),De()),W[0]&512&&ne(y,"active",Y[9]===qr)},i(Y){M||(T(D),T(s.$$.fragment,Y),T(E),T(P),M=!0)},o(Y){F(D),F(s.$$.fragment,Y),F(E),F(P),M=!1},d(Y){Y&&k(e),Y&&k(o),D&&D.d(Y),Y&&k(r),Y&&k(l),q(s),Y&&k(c),Y&&k(u),E&&E.d(),P&&P.d(),A=!1,rt(O)}}}function Vx(n){let e,t,i,o,r,l=n[2].isNew?"Create":"Save changes",s,a,f,c;return{c(){e=g("button"),t=g("span"),t.textContent="Cancel",i=$(),o=g("button"),r=g("span"),s=j(l),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=a=!n[10]||n[7],ne(o,"btn-loading",n[7])},m(u,d){w(u,e,d),m(e,t),w(u,i,d),w(u,o,d),m(o,r),m(r,s),f||(c=[X(e,"click",n[18]),X(o,"click",n[19])],f=!0)},p(u,d){d[0]&128&&(e.disabled=u[7]),d[0]&4&&l!==(l=u[2].isNew?"Create":"Save changes")&&ge(s,l),d[0]&1152&&a!==(a=!u[10]||u[7])&&(o.disabled=a),d[0]&128&&ne(o,"btn-loading",u[7])},d(u){u&&k(e),u&&k(i),u&&k(o),f=!1,rt(c)}}}function Bx(n){let e,t,i,o,r={class:"overlay-panel-lg colored-header collection-panel",beforeHide:n[27],$$slots:{footer:[Vx],header:[qx],default:[jx]},$$scope:{ctx:n}};e=new Ai({props:r}),n[28](e),e.$on("hide",n[29]),e.$on("show",n[30]);let l={};return i=new Nx({props:l}),n[31](i),i.$on("confirm",n[32]),{c(){V(e.$$.fragment),t=$(),V(i.$$.fragment)},m(s,a){H(e,s,a),w(s,t,a),H(i,s,a),o=!0},p(s,a){const f={};a[0]&264&&(f.beforeHide=s[27]),a[0]&7828|a[1]&256&&(f.$$scope={dirty:a,ctx:s}),e.$set(f);const c={};i.$set(c)},i(s){o||(T(e.$$.fragment,s),T(i.$$.fragment,s),o=!0)},o(s){F(e.$$.fragment,s),F(i.$$.fragment,s),o=!1},d(s){n[28](null),q(e,s),s&&k(t),n[31](null),q(i,s)}}}const ho="fields",qr="api_rules";function Aa(n){return JSON.stringify(n)}function Ux(n,e,t){let i,o,r,l,s,a;pn(n,fi,ee=>t(34,s=ee)),pn(n,go,ee=>t(4,a=ee));const f=yn();let c,u,d=null,h=new En,b=!1,v=!1,_=ho,y=Aa(h);function S(ee){t(9,_=ee)}function C(ee){return M(ee),t(8,v=!0),S(ho),c==null?void 0:c.show()}function x(){return c==null?void 0:c.hide()}async function M(ee){Ui({}),typeof ee!="undefined"?(d=ee,t(2,h=ee==null?void 0:ee.clone())):(d=null,t(2,h=new En)),t(2,h.schema=h.schema||[],h),t(2,h.originalName=h.name||"",h),await Bi(),t(17,y=Aa(h))}function A(){if(h.isNew)return O();u==null||u.show(h)}function O(){if(b)return;t(7,b=!0);const ee=D();let _e;h.isNew?_e=Se.Collections.create(ee):_e=Se.Collections.update(h.id,ee),_e.then(fe=>{t(8,v=!1),x(),hn(h.isNew?"Successfully created collection.":"Successfully updated collection."),bC(fe),h.isNew&&jb(fi,s=fe,s),f("save",fe)}).catch(fe=>{Se.errorResponseHandler(fe)}).finally(()=>{t(7,b=!1)})}function D(){const ee=h.export();ee.schema=ee.schema.slice(0);for(let _e=ee.schema.length-1;_e>=0;_e--)ee.schema[_e].toDelete&&ee.schema.splice(_e,1);return ee}function E(){!(d!=null&&d.id)||xi(`Do you really want to delete collection "${d==null?void 0:d.name}" and all its records?`,()=>Se.Collections.delete(d==null?void 0:d.id).then(()=>{x(),hn(`Successfully deleted collection "${d==null?void 0:d.name}".`),f("delete",d),gC(d)}).catch(ee=>{Se.errorResponseHandler(ee)}))}const P=()=>x(),I=()=>A(),R=()=>E(),G=ee=>{t(2,h.name=B.slugify(ee.target.value),h),ee.target.value=h.name},U=()=>{l&&A()},z=()=>S(ho),K=()=>S(qr);function Y(ee){h=ee,t(2,h)}function W(ee){h=ee,t(2,h)}const te=()=>r&&v?(xi("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,v=!1),x()}),!1):!0;function ce(ee){he[ee?"unshift":"push"](()=>{c=ee,t(5,c)})}function ve(ee){ft.call(this,n,ee)}function oe(ee){ft.call(this,n,ee)}function J(ee){he[ee?"unshift":"push"](()=>{u=ee,t(6,u)})}const $e=()=>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,o=!h.isNew&&h.system),n.$$.dirty[0]&131076&&t(3,r=y!=Aa(h)),n.$$.dirty[0]&12&&t(10,l=h.isNew||r)},[S,x,h,r,a,c,u,b,v,_,l,o,i,A,O,E,C,y,P,I,R,G,U,z,K,Y,W,te,ce,ve,oe,J,$e]}class hc extends Ie{constructor(e){super(),Le(this,e,Ux,Bx,Ee,{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 rh(n,e,t){const i=n.slice();return i[13]=e[t],i}function lh(n){let e,t=n[1].length&&sh();return{c(){t&&t.c(),e=lt()},m(i,o){t&&t.m(i,o),w(i,e,o)},p(i,o){i[1].length?t||(t=sh(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function sh(n){let e;return{c(){e=g("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 Wx(n){let e;return{c(){e=g("i"),p(e,"class","ri-folder-2-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Yx(n){let e;return{c(){e=g("i"),p(e,"class","ri-folder-open-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ah(n,e){let t,i,o,r=e[13].name+"",l,s,a,f;function c(b,v){var _;return((_=b[5])==null?void 0:_.id)===b[13].id?Yx:Wx}let u=c(e),d=u(e);function h(){return e[10](e[13])}return{key:n,first:null,c(){var b;t=g("div"),d.c(),i=$(),o=g("span"),l=j(r),s=$(),p(o,"class","txt"),p(t,"tabindex","0"),p(t,"class","sidebar-list-item"),ne(t,"active",((b=e[5])==null?void 0:b.id)===e[13].id),this.first=t},m(b,v){w(b,t,v),d.m(t,null),m(t,i),m(t,o),m(o,l),m(t,s),a||(f=X(t,"click",h),a=!0)},p(b,v){var _;e=b,u!==(u=c(e))&&(d.d(1),d=u(e),d&&(d.c(),d.m(t,i))),v&8&&r!==(r=e[13].name+"")&&ge(l,r),v&40&&ne(t,"active",((_=e[5])==null?void 0:_.id)===e[13].id)},d(b){b&&k(t),d.d(),a=!1,f()}}}function Gx(n){let e,t,i,o,r,l,s,a,f,c,u,d=[],h=new Map,b,v,_,y,S,C,x,M,A=n[3];const O=P=>P[13].id;for(let P=0;P<A.length;P+=1){let I=rh(n,A,P),R=O(I);h.set(R,d[P]=ah(R,I))}let D=null;A.length||(D=lh(n));let E={};return S=new hc({props:E}),n[12](S),{c(){e=g("aside"),t=g("header"),i=g("div"),o=g("div"),r=g("button"),r.innerHTML='<i class="ri-close-line"></i>',l=$(),s=g("input"),a=$(),f=g("hr"),c=$(),u=g("div");for(let P=0;P<d.length;P+=1)d[P].c();D&&D.c(),b=$(),v=g("footer"),_=g("button"),_.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New collection</span>`,y=$(),V(S.$$.fragment),p(r,"type","button"),p(r,"class","btn btn-xs btn-secondary btn-circle btn-clear"),ne(r,"hidden",!n[4]),p(o,"class","form-field-addon"),p(s,"type","text"),p(s,"placeholder","Search collections..."),p(i,"class","form-field search"),ne(i,"active",n[4]),p(t,"class","sidebar-header"),p(f,"class","m-t-5 m-b-xs"),p(u,"class","sidebar-content"),p(_,"type","button"),p(_,"class","btn btn-block btn-outline"),p(v,"class","sidebar-footer"),p(e,"class","page-sidebar collection-sidebar")},m(P,I){w(P,e,I),m(e,t),m(t,i),m(i,o),m(o,r),m(i,l),m(i,s),Me(s,n[0]),m(e,a),m(e,f),m(e,c),m(e,u);for(let R=0;R<d.length;R+=1)d[R].m(u,null);D&&D.m(u,null),m(e,b),m(e,v),m(v,_),w(P,y,I),H(S,P,I),C=!0,x||(M=[X(r,"click",n[8]),X(s,"input",n[9]),X(_,"click",n[11])],x=!0)},p(P,[I]){I&16&&ne(r,"hidden",!P[4]),I&1&&s.value!==P[0]&&Me(s,P[0]),I&16&&ne(i,"active",P[4]),I&106&&(A=P[3],d=st(d,I,O,1,P,A,h,u,an,ah,null,rh),!A.length&&D?D.p(P,I):A.length?D&&(D.d(1),D=null):(D=lh(P),D.c(),D.m(u,null)));const R={};S.$set(R)},i(P){C||(T(S.$$.fragment,P),C=!0)},o(P){F(S.$$.fragment,P),C=!1},d(P){P&&k(e);for(let I=0;I<d.length;I+=1)d[I].d();D&&D.d(),P&&k(y),n[12](null),q(S,P),x=!1,rt(M)}}}function Kx(n,e,t){let i,o,r,l,s;pn(n,fi,_=>t(5,l=_)),pn(n,Go,_=>t(7,s=_));let a,f="";function c(_){jb(fi,l=_,l)}const u=()=>t(0,f="");function d(){f=this.value,t(0,f)}const h=_=>c(_),b=()=>a==null?void 0:a.show();function v(_){he[_?"unshift":"push"](()=>{a=_,t(2,a)})}return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=f.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,o=f!==""),n.$$.dirty&131&&t(3,r=s.filter(_=>_.name!="profiles"&&(_.id==f||_.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[f,i,a,r,o,l,c,s,u,d,h,b,v]}class Jx extends Ie{constructor(e){super(),Le(this,e,Kx,Gx,Ee,{})}}function Zx(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C,x,M,A,O,D,E,P,I,R,G,U,z,K,Y,W,te,ce,ve,oe,J,$e,ee,_e,fe,ie,ye,Ne,Pe,ze,se,re,ke,He;return{c(){e=g("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=$(),i=g("ul"),o=g("li"),o.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single or double
quoted), number, null, true, false`,r=$(),l=g("li"),s=g("code"),s.textContent="OPERATOR",a=j(` - is one of:
`),f=g("br"),c=$(),u=g("ul"),d=g("li"),h=g("code"),h.textContent="=",b=$(),v=g("span"),v.textContent="Equal",_=$(),y=g("li"),S=g("code"),S.textContent="!=",C=$(),x=g("span"),x.textContent="NOT equal",M=$(),A=g("li"),O=g("code"),O.textContent=">",D=$(),E=g("span"),E.textContent="Greater than",P=$(),I=g("li"),R=g("code"),R.textContent=">=",G=$(),U=g("span"),U.textContent="Greater than or equal",z=$(),K=g("li"),Y=g("code"),Y.textContent="<",W=$(),te=g("span"),te.textContent="Less than or equal",ce=$(),ve=g("li"),oe=g("code"),oe.textContent="<=",J=$(),$e=g("span"),$e.textContent="Less than or equal",ee=$(),_e=g("li"),fe=g("code"),fe.textContent="~",ie=$(),ye=g("span"),ye.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
match)`,Ne=$(),Pe=g("li"),ze=g("code"),ze.textContent="!~",se=$(),re=g("span"),re.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,ke=$(),He=g("p"),He.innerHTML=`To group and combine several expressions you could use brackets
<code>(...)</code>, <code>&amp;&amp;</code> (AND) and <code>||</code> (OR) tokens.`,p(s,"class","txt-danger"),p(h,"class","filter-op svelte-1w7s5nw"),p(v,"class","txt-hint"),p(S,"class","filter-op svelte-1w7s5nw"),p(x,"class","txt-hint"),p(O,"class","filter-op svelte-1w7s5nw"),p(E,"class","txt-hint"),p(R,"class","filter-op svelte-1w7s5nw"),p(U,"class","txt-hint"),p(Y,"class","filter-op svelte-1w7s5nw"),p(te,"class","txt-hint"),p(oe,"class","filter-op svelte-1w7s5nw"),p($e,"class","txt-hint"),p(fe,"class","filter-op svelte-1w7s5nw"),p(ye,"class","txt-hint"),p(ze,"class","filter-op svelte-1w7s5nw"),p(re,"class","txt-hint")},m(qe,Je){w(qe,e,Je),w(qe,t,Je),w(qe,i,Je),m(i,o),m(i,r),m(i,l),m(l,s),m(l,a),m(l,f),m(l,c),m(l,u),m(u,d),m(d,h),m(d,b),m(d,v),m(u,_),m(u,y),m(y,S),m(y,C),m(y,x),m(u,M),m(u,A),m(A,O),m(A,D),m(A,E),m(u,P),m(u,I),m(I,R),m(I,G),m(I,U),m(u,z),m(u,K),m(K,Y),m(K,W),m(K,te),m(u,ce),m(u,ve),m(ve,oe),m(ve,J),m(ve,$e),m(u,ee),m(u,_e),m(_e,fe),m(_e,ie),m(_e,ye),m(u,Ne),m(u,Pe),m(Pe,ze),m(Pe,se),m(Pe,re),w(qe,ke,Je),w(qe,He,Je)},p:le,i:le,o:le,d(qe){qe&&k(e),qe&&k(t),qe&&k(i),qe&&k(ke),qe&&k(He)}}}class Xx extends Ie{constructor(e){super(),Le(this,e,null,Zx,Ee,{})}}function fh(n,e,t){const i=n.slice();return i[8]=e[t],i}function ch(n,e,t){const i=n.slice();return i[8]=e[t],i}function uh(n,e,t){const i=n.slice();return i[13]=e[t],i}function dh(n,e,t){const i=n.slice();return i[13]=e[t],i}function ph(n){let e;return{c(){e=g("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 hh(n,e){let t,i=e[13].lang+"",o,r,l,s;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&16&&i!==(i=e[13].lang+"")&&ge(o,i),c&24&&ne(t,"active",e[3]===e[13].lang)},d(f){f&&k(t),l=!1,s()}}}function mh(n,e){let t,i,o,r;return i=new tn({props:{content:e[13].code}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&16&&(a.content=e[13].code),i.$set(a),s&24&&ne(t,"active",e[3]===e[13].lang)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function bh(n,e){let t,i=e[8].code+"",o,r,l,s;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=g("div"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&36&&ne(t,"active",e[2]===e[8].code)},d(f){f&&k(t),l=!1,s()}}}function gh(n,e){let t,i,o,r;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l,s&36&&ne(t,"active",e[2]===e[8].code)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function Qx(n){let e,t,i,o,r,l,s,a=n[0].name+"",f,c,u,d,h,b,v,_,y=n[0].name+"",S,C,x,M,A,O,D,E=[],P=new Map,I,R,G=[],U=new Map,z,K,Y,W,te,ce,ve,oe,J,$e,ee,_e,fe,ie,ye,Ne,Pe,ze,se,re,ke,He,qe,Je,be,Oe,Z,ae,Ve,yt,it,bt,at,vt,qt,Mt,$t,me,Ce,Ye,ot,cn,ue,we,Ze,Kt,zt,ni,pe,L,N,Q,de,Te,Ue,tt,Ge,nt=[],Ke=new Map,et,gt,Ft=[],nn=new Map,Fn,Vt=n[1]&&ph(),wo=n[4];const So=xe=>xe[13].lang;for(let xe=0;xe<wo.length;xe+=1){let We=dh(n,wo,xe),Ot=So(We);P.set(Ot,E[xe]=hh(Ot,We))}let Gi=n[4];const nl=xe=>xe[13].lang;for(let xe=0;xe<Gi.length;xe+=1){let We=uh(n,Gi,xe),Ot=nl(We);U.set(Ot,G[xe]=mh(Ot,We))}be=new tn({props:{content:`
// DESC by created and ASC by id
?sort=-created,id
`}}),vt=new tn({props:{content:`
?filter=(id='abc' && created>'2022-01-01')
`}}),Mt=new Xx({}),Ze=new tn({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let Co=n[5];const il=xe=>xe[8].code;for(let xe=0;xe<Co.length;xe+=1){let We=ch(n,Co,xe),Ot=il(We);Ke.set(Ot,nt[xe]=bh(Ot,We))}let Ki=n[5];const ol=xe=>xe[8].code;for(let xe=0;xe<Ki.length;xe+=1){let We=fh(n,Ki,xe),Ot=ol(We);nn.set(Ot,Ft[xe]=gh(Ot,We))}return{c(){e=g("div"),t=g("strong"),t.textContent="GET",i=$(),o=g("div"),r=g("p"),l=j("/api/collections/"),s=g("strong"),f=j(a),c=j("/records"),u=$(),Vt&&Vt.c(),d=$(),h=g("div"),b=g("p"),v=j("Fetch a paginated "),_=g("strong"),S=j(y),C=j(" records list."),x=$(),M=g("div"),M.textContent="Client SDKs example",A=$(),O=g("div"),D=g("div");for(let xe=0;xe<E.length;xe+=1)E[xe].c();I=$(),R=g("div");for(let xe=0;xe<G.length;xe+=1)G[xe].c();z=$(),K=g("div"),K.textContent="Query parameters",Y=$(),W=g("table"),te=g("thead"),te.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,ce=$(),ve=g("tbody"),oe=g("tr"),oe.innerHTML=`<td>page</td>
<td><span class="label">Number</span></td>
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,J=$(),$e=g("tr"),$e.innerHTML=`<td>perPage</td>
<td><span class="label">Number</span></td>
<td>Specify the max returned records per page (default to 30).</td>`,ee=$(),_e=g("tr"),fe=g("td"),fe.textContent="sort",ie=$(),ye=g("td"),ye.innerHTML='<span class="label">String</span>',Ne=$(),Pe=g("td"),ze=j("Specify the records order attribute(s). "),se=g("br"),re=j(`
Add `),ke=g("code"),ke.textContent="-",He=j(" / "),qe=g("code"),qe.textContent="+",Je=j(` (default) in front of the attribute for DESC / ASC order.
Ex.:
`),V(be.$$.fragment),Oe=$(),Z=g("tr"),ae=g("td"),ae.textContent="filter",Ve=$(),yt=g("td"),yt.innerHTML='<span class="label">String</span>',it=$(),bt=g("td"),at=j(`Filter the returned records. Ex.:
`),V(vt.$$.fragment),qt=$(),V(Mt.$$.fragment),$t=$(),me=g("tr"),Ce=g("td"),Ce.textContent="expand",Ye=$(),ot=g("td"),ot.innerHTML='<span class="label">String</span>',cn=$(),ue=g("td"),we=j(`Auto expand nested record relations. Ex.:
`),V(Ze.$$.fragment),Kt=j(`
Supports up to 6-levels depth nested relations expansion. `),zt=g("br"),ni=j(`
The expanded relations will be appended to each individual record under the
`),pe=g("code"),pe.textContent="@expand",L=j(" property (eg. "),N=g("code"),N.textContent='"@expand": {"rel1": {...}, ...}',Q=j(")."),de=$(),Te=g("div"),Te.textContent="Responses",Ue=$(),tt=g("div"),Ge=g("div");for(let xe=0;xe<nt.length;xe+=1)nt[xe].c();et=$(),gt=g("div");for(let xe=0;xe<Ft.length;xe+=1)Ft[xe].c();p(t,"class","label label-primary"),p(o,"class","content"),p(e,"class","alert alert-info"),p(h,"class","content m-b-base"),p(M,"class","section-title"),p(D,"class","tabs-header compact left"),p(R,"class","tabs-content"),p(O,"class","tabs m-b-lg"),p(K,"class","section-title"),p(W,"class","table-compact table-border m-b-lg"),p(Te,"class","section-title"),p(Ge,"class","tabs-header compact left"),p(gt,"class","tabs-content"),p(tt,"class","tabs")},m(xe,We){w(xe,e,We),m(e,t),m(e,i),m(e,o),m(o,r),m(r,l),m(r,s),m(s,f),m(r,c),m(e,u),Vt&&Vt.m(e,null),w(xe,d,We),w(xe,h,We),m(h,b),m(b,v),m(b,_),m(_,S),m(b,C),w(xe,x,We),w(xe,M,We),w(xe,A,We),w(xe,O,We),m(O,D);for(let Ot=0;Ot<E.length;Ot+=1)E[Ot].m(D,null);m(O,I),m(O,R);for(let Ot=0;Ot<G.length;Ot+=1)G[Ot].m(R,null);w(xe,z,We),w(xe,K,We),w(xe,Y,We),w(xe,W,We),m(W,te),m(W,ce),m(W,ve),m(ve,oe),m(ve,J),m(ve,$e),m(ve,ee),m(ve,_e),m(_e,fe),m(_e,ie),m(_e,ye),m(_e,Ne),m(_e,Pe),m(Pe,ze),m(Pe,se),m(Pe,re),m(Pe,ke),m(Pe,He),m(Pe,qe),m(Pe,Je),H(be,Pe,null),m(ve,Oe),m(ve,Z),m(Z,ae),m(Z,Ve),m(Z,yt),m(Z,it),m(Z,bt),m(bt,at),H(vt,bt,null),m(bt,qt),H(Mt,bt,null),m(ve,$t),m(ve,me),m(me,Ce),m(me,Ye),m(me,ot),m(me,cn),m(me,ue),m(ue,we),H(Ze,ue,null),m(ue,Kt),m(ue,zt),m(ue,ni),m(ue,pe),m(ue,L),m(ue,N),m(ue,Q),w(xe,de,We),w(xe,Te,We),w(xe,Ue,We),w(xe,tt,We),m(tt,Ge);for(let Ot=0;Ot<nt.length;Ot+=1)nt[Ot].m(Ge,null);m(tt,et),m(tt,gt);for(let Ot=0;Ot<Ft.length;Ot+=1)Ft[Ot].m(gt,null);Fn=!0},p(xe,[We]){(!Fn||We&1)&&a!==(a=xe[0].name+"")&&ge(f,a),xe[1]?Vt||(Vt=ph(),Vt.c(),Vt.m(e,null)):Vt&&(Vt.d(1),Vt=null),(!Fn||We&1)&&y!==(y=xe[0].name+"")&&ge(S,y),We&24&&(wo=xe[4],E=st(E,We,So,1,xe,wo,P,D,an,hh,null,dh)),We&24&&(Gi=xe[4],Ae(),G=st(G,We,nl,1,xe,Gi,U,R,Pt,mh,null,uh),De()),We&36&&(Co=xe[5],nt=st(nt,We,il,1,xe,Co,Ke,Ge,an,bh,null,ch)),We&36&&(Ki=xe[5],Ae(),Ft=st(Ft,We,ol,1,xe,Ki,nn,gt,Pt,gh,null,fh),De())},i(xe){if(!Fn){for(let We=0;We<Gi.length;We+=1)T(G[We]);T(be.$$.fragment,xe),T(vt.$$.fragment,xe),T(Mt.$$.fragment,xe),T(Ze.$$.fragment,xe);for(let We=0;We<Ki.length;We+=1)T(Ft[We]);Fn=!0}},o(xe){for(let We=0;We<G.length;We+=1)F(G[We]);F(be.$$.fragment,xe),F(vt.$$.fragment,xe),F(Mt.$$.fragment,xe),F(Ze.$$.fragment,xe);for(let We=0;We<Ft.length;We+=1)F(Ft[We]);Fn=!1},d(xe){xe&&k(e),Vt&&Vt.d(),xe&&k(d),xe&&k(h),xe&&k(x),xe&&k(M),xe&&k(A),xe&&k(O);for(let We=0;We<E.length;We+=1)E[We].d();for(let We=0;We<G.length;We+=1)G[We].d();xe&&k(z),xe&&k(K),xe&&k(Y),xe&&k(W),q(be),q(vt),q(Mt),q(Ze),xe&&k(de),xe&&k(Te),xe&&k(Ue),xe&&k(tt);for(let We=0;We<nt.length;We+=1)nt[We].d();for(let We=0;We<Ft.length;We+=1)Ft[We].d()}}}function e6(n,e,t){let i,{collection:o=new En}=e,r=200,l="JavaScript",s=[],a=[];const f=u=>t(3,l=u.lang),c=u=>t(2,r=u.code);return n.$$set=u=>{"collection"in u&&t(0,o=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(o==null?void 0:o.listRule)===null),n.$$.dirty&3&&o!=null&&o.id&&(s.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[B.dummyCollectionRecord(o),B.dummyCollectionRecord(o)]},null,2)}),s.push({code:400,body:`
{
"code": 400,
"message": "Something went wrong while processing your request. Invalid filter.",
"data": {}
}
`}),i&&s.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),s.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${Se.baseUrl}");
client.Records.getList("${o==null?void 0:o.name}", { page: 2 })
.then(function (list) {
// success...
}).catch(function (error) {
// error...
});
// alternatively you can also fetch all records at once via getFullList:
client.Records.getFullList("${o==null?void 0:o.name}", 200 /* batch size */);
.then(function (records) {
// success...
}).catch(function (error) {
// error...
});
`}])},[o,i,r,l,a,s,f,c]}class t6 extends Ie{constructor(e){super(),Le(this,e,e6,Qx,Ee,{collection:0})}}function _h(n,e,t){const i=n.slice();return i[8]=e[t],i}function vh(n,e,t){const i=n.slice();return i[8]=e[t],i}function yh(n,e,t){const i=n.slice();return i[13]=e[t],i}function kh(n,e,t){const i=n.slice();return i[13]=e[t],i}function wh(n){let e;return{c(){e=g("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 Sh(n,e){let t,i=e[13].lang+"",o,r,l,s;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&16&&i!==(i=e[13].lang+"")&&ge(o,i),c&24&&ne(t,"active",e[3]===e[13].lang)},d(f){f&&k(t),l=!1,s()}}}function Ch(n,e){let t,i,o,r;return i=new tn({props:{content:e[13].code}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&16&&(a.content=e[13].code),i.$set(a),s&24&&ne(t,"active",e[3]===e[13].lang)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function xh(n,e){let t,i=e[8].code+"",o,r,l,s;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&36&&ne(t,"active",e[2]===e[8].code)},d(f){f&&k(t),l=!1,s()}}}function Mh(n,e){let t,i,o,r;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l,s&36&&ne(t,"active",e[2]===e[8].code)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function n6(n){let e,t,i,o,r,l,s,a=n[0].name+"",f,c,u,d,h,b,v,_,y,S=n[0].name+"",C,x,M,A,O,D,E,P=[],I=new Map,R,G,U=[],z=new Map,K,Y,W,te,ce,ve,oe,J,$e,ee,_e,fe,ie,ye,Ne,Pe,ze,se,re,ke,He,qe,Je,be,Oe,Z,ae,Ve,yt,it,bt,at=[],vt=new Map,qt,Mt,$t=[],me=new Map,Ce,Ye=n[1]&&wh(),ot=n[4];const cn=pe=>pe[13].lang;for(let pe=0;pe<ot.length;pe+=1){let L=kh(n,ot,pe),N=cn(L);I.set(N,P[pe]=Sh(N,L))}let ue=n[4];const we=pe=>pe[13].lang;for(let pe=0;pe<ue.length;pe+=1){let L=yh(n,ue,pe),N=we(L);z.set(N,U[pe]=Ch(N,L))}re=new tn({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let Ze=n[5];const Kt=pe=>pe[8].code;for(let pe=0;pe<Ze.length;pe+=1){let L=vh(n,Ze,pe),N=Kt(L);vt.set(N,at[pe]=xh(N,L))}let zt=n[5];const ni=pe=>pe[8].code;for(let pe=0;pe<zt.length;pe+=1){let L=_h(n,zt,pe),N=ni(L);me.set(N,$t[pe]=Mh(N,L))}return{c(){e=g("div"),t=g("strong"),t.textContent="GET",i=$(),o=g("div"),r=g("p"),l=j("/api/collections/"),s=g("strong"),f=j(a),c=j("/records/"),u=g("strong"),u.textContent=":id",d=$(),Ye&&Ye.c(),h=$(),b=g("div"),v=g("p"),_=j("Fetch a single "),y=g("strong"),C=j(S),x=j(" record."),M=$(),A=g("div"),A.textContent="Client SDKs example",O=$(),D=g("div"),E=g("div");for(let pe=0;pe<P.length;pe+=1)P[pe].c();R=$(),G=g("div");for(let pe=0;pe<U.length;pe+=1)U[pe].c();K=$(),Y=g("div"),Y.textContent="Path Parameters",W=$(),te=g("table"),te.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>`,ce=$(),ve=g("div"),ve.textContent="Query parameters",oe=$(),J=g("table"),$e=g("thead"),$e.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,ee=$(),_e=g("tbody"),fe=g("tr"),ie=g("td"),ie.textContent="expand",ye=$(),Ne=g("td"),Ne.innerHTML='<span class="label">String</span>',Pe=$(),ze=g("td"),se=j(`Auto expand nested record relations. Ex.:
`),V(re.$$.fragment),ke=j(`
Supports up to 6-levels depth nested relations expansion. `),He=g("br"),qe=j(`
The expanded relations will be appended to the record under the
`),Je=g("code"),Je.textContent="@expand",be=j(" property (eg. "),Oe=g("code"),Oe.textContent='"@expand": {"rel1": {...}, ...}',Z=j(")."),ae=$(),Ve=g("div"),Ve.textContent="Responses",yt=$(),it=g("div"),bt=g("div");for(let pe=0;pe<at.length;pe+=1)at[pe].c();qt=$(),Mt=g("div");for(let pe=0;pe<$t.length;pe+=1)$t[pe].c();p(t,"class","label label-primary"),p(o,"class","content"),p(e,"class","alert alert-info"),p(b,"class","content m-b-base"),p(A,"class","section-title"),p(E,"class","tabs-header compact left"),p(G,"class","tabs-content"),p(D,"class","tabs m-b-lg"),p(Y,"class","section-title"),p(te,"class","table-compact table-border m-b-lg"),p(ve,"class","section-title"),p(J,"class","table-compact table-border m-b-lg"),p(Ve,"class","section-title"),p(bt,"class","tabs-header compact left"),p(Mt,"class","tabs-content"),p(it,"class","tabs")},m(pe,L){w(pe,e,L),m(e,t),m(e,i),m(e,o),m(o,r),m(r,l),m(r,s),m(s,f),m(r,c),m(r,u),m(e,d),Ye&&Ye.m(e,null),w(pe,h,L),w(pe,b,L),m(b,v),m(v,_),m(v,y),m(y,C),m(v,x),w(pe,M,L),w(pe,A,L),w(pe,O,L),w(pe,D,L),m(D,E);for(let N=0;N<P.length;N+=1)P[N].m(E,null);m(D,R),m(D,G);for(let N=0;N<U.length;N+=1)U[N].m(G,null);w(pe,K,L),w(pe,Y,L),w(pe,W,L),w(pe,te,L),w(pe,ce,L),w(pe,ve,L),w(pe,oe,L),w(pe,J,L),m(J,$e),m(J,ee),m(J,_e),m(_e,fe),m(fe,ie),m(fe,ye),m(fe,Ne),m(fe,Pe),m(fe,ze),m(ze,se),H(re,ze,null),m(ze,ke),m(ze,He),m(ze,qe),m(ze,Je),m(ze,be),m(ze,Oe),m(ze,Z),w(pe,ae,L),w(pe,Ve,L),w(pe,yt,L),w(pe,it,L),m(it,bt);for(let N=0;N<at.length;N+=1)at[N].m(bt,null);m(it,qt),m(it,Mt);for(let N=0;N<$t.length;N+=1)$t[N].m(Mt,null);Ce=!0},p(pe,[L]){(!Ce||L&1)&&a!==(a=pe[0].name+"")&&ge(f,a),pe[1]?Ye||(Ye=wh(),Ye.c(),Ye.m(e,null)):Ye&&(Ye.d(1),Ye=null),(!Ce||L&1)&&S!==(S=pe[0].name+"")&&ge(C,S),L&24&&(ot=pe[4],P=st(P,L,cn,1,pe,ot,I,E,an,Sh,null,kh)),L&24&&(ue=pe[4],Ae(),U=st(U,L,we,1,pe,ue,z,G,Pt,Ch,null,yh),De()),L&36&&(Ze=pe[5],at=st(at,L,Kt,1,pe,Ze,vt,bt,an,xh,null,vh)),L&36&&(zt=pe[5],Ae(),$t=st($t,L,ni,1,pe,zt,me,Mt,Pt,Mh,null,_h),De())},i(pe){if(!Ce){for(let L=0;L<ue.length;L+=1)T(U[L]);T(re.$$.fragment,pe);for(let L=0;L<zt.length;L+=1)T($t[L]);Ce=!0}},o(pe){for(let L=0;L<U.length;L+=1)F(U[L]);F(re.$$.fragment,pe);for(let L=0;L<$t.length;L+=1)F($t[L]);Ce=!1},d(pe){pe&&k(e),Ye&&Ye.d(),pe&&k(h),pe&&k(b),pe&&k(M),pe&&k(A),pe&&k(O),pe&&k(D);for(let L=0;L<P.length;L+=1)P[L].d();for(let L=0;L<U.length;L+=1)U[L].d();pe&&k(K),pe&&k(Y),pe&&k(W),pe&&k(te),pe&&k(ce),pe&&k(ve),pe&&k(oe),pe&&k(J),q(re),pe&&k(ae),pe&&k(Ve),pe&&k(yt),pe&&k(it);for(let L=0;L<at.length;L+=1)at[L].d();for(let L=0;L<$t.length;L+=1)$t[L].d()}}}function i6(n,e,t){let i,{collection:o=new En}=e,r=200,l="JavaScript",s=[],a=[];const f=u=>t(3,l=u.lang),c=u=>t(2,r=u.code);return n.$$set=u=>{"collection"in u&&t(0,o=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(o==null?void 0:o.viewRule)===null),n.$$.dirty&3&&o!=null&&o.id&&(s.push({code:200,body:JSON.stringify(B.dummyCollectionRecord(o),null,2)}),i&&s.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),s.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${Se.baseUrl}");
client.Records.getOne("${o==null?void 0:o.name}", "RECORD_ID")
.then(function (record) {
// success...
}).catch(function (error) {
// error...
});
`}])},[o,i,r,l,a,s,f,c]}class o6 extends Ie{constructor(e){super(),Le(this,e,i6,n6,Ee,{collection:0})}}function $h(n,e,t){const i=n.slice();return i[8]=e[t],i}function Ah(n,e,t){const i=n.slice();return i[8]=e[t],i}function Dh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Oh(n,e,t){const i=n.slice();return i[16]=e[t],i}function Th(n,e,t){const i=n.slice();return i[16]=e[t],i}function Eh(n){let e;return{c(){e=g("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 Ph(n,e){let t,i=e[16].lang+"",o,r,l,s;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[16].lang),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&16&&i!==(i=e[16].lang+"")&&ge(o,i),c&20&&ne(t,"active",e[2]===e[16].lang)},d(f){f&&k(t),l=!1,s()}}}function Fh(n,e){let t,i,o,r;return i=new tn({props:{content:e[16].code}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[16].lang),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&16&&(a.content=e[16].code),i.$set(a),s&20&&ne(t,"active",e[2]===e[16].lang)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function r6(n){let e;return{c(){e=g("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function l6(n){let e;return{c(){e=g("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function s6(n){var r;let e,t=((r=n[13].options)==null?void 0:r.maxSelect)>1?"ids":"id",i,o;return{c(){e=j("User "),i=j(t),o=j(".")},m(l,s){w(l,e,s),w(l,i,s),w(l,o,s)},p(l,s){var a;s&1&&t!==(t=((a=l[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ge(i,t)},d(l){l&&k(e),l&&k(i),l&&k(o)}}}function a6(n){var r;let e,t=((r=n[13].options)==null?void 0:r.maxSelect)>1?"ids":"id",i,o;return{c(){e=j("Relation record "),i=j(t),o=j(".")},m(l,s){w(l,e,s),w(l,i,s),w(l,o,s)},p(l,s){var a;s&1&&t!==(t=((a=l[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ge(i,t)},d(l){l&&k(e),l&&k(i),l&&k(o)}}}function f6(n){let e,t,i,o,r;return{c(){e=j("FormData object."),t=g("br"),i=j(`
Set to `),o=g("code"),o.textContent="null",r=j(" to delete already uploaded file(s).")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s),w(l,o,s),w(l,r,s)},p:le,d(l){l&&k(e),l&&k(t),l&&k(i),l&&k(o),l&&k(r)}}}function c6(n){let e;return{c(){e=j("URL address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function u6(n){let e;return{c(){e=j("Email address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function d6(n){let e;return{c(){e=j("JSON array or object.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function p6(n){let e;return{c(){e=j("Number value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function h6(n){let e;return{c(){e=j("Plain text value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Lh(n,e){let t,i,o,r,l,s=e[13].name+"",a,f,c,u,d=B.getFieldValueType(e[13])+"",h,b,v,_;function y(O,D){return O[13].required?l6:r6}let S=y(e),C=S(e);function x(O,D){if(O[13].type==="text")return h6;if(O[13].type==="number")return p6;if(O[13].type==="json")return d6;if(O[13].type==="email")return u6;if(O[13].type==="url")return c6;if(O[13].type==="file")return f6;if(O[13].type==="relation")return a6;if(O[13].type==="user")return s6}let M=x(e),A=M&&M(e);return{key:n,first:null,c(){t=g("tr"),i=g("td"),o=g("div"),C.c(),r=$(),l=g("span"),a=j(s),f=$(),c=g("td"),u=g("span"),h=j(d),b=$(),v=g("td"),A&&A.c(),_=$(),p(o,"class","inline-flex"),p(u,"class","label"),this.first=t},m(O,D){w(O,t,D),m(t,i),m(i,o),C.m(o,null),m(o,r),m(o,l),m(l,a),m(t,f),m(t,c),m(c,u),m(u,h),m(t,b),m(t,v),A&&A.m(v,null),m(t,_)},p(O,D){e=O,S!==(S=y(e))&&(C.d(1),C=S(e),C&&(C.c(),C.m(o,r))),D&1&&s!==(s=e[13].name+"")&&ge(a,s),D&1&&d!==(d=B.getFieldValueType(e[13])+"")&&ge(h,d),M===(M=x(e))&&A?A.p(e,D):(A&&A.d(1),A=M&&M(e),A&&(A.c(),A.m(v,null)))},d(O){O&&k(t),C.d(),A&&A.d()}}}function Ih(n,e){let t,i=e[8].code+"",o,r,l,s;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[8].code),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&8&&i!==(i=e[8].code+"")&&ge(o,i),c&10&&ne(t,"active",e[1]===e[8].code)},d(f){f&&k(t),l=!1,s()}}}function Rh(n,e){let t,i,o,r;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[8].code),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&8&&(a.content=e[8].body),i.$set(a),s&10&&ne(t,"active",e[1]===e[8].code)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function m6(n){var $t;let e,t,i,o,r,l,s,a=n[0].name+"",f,c,u,d,h,b,v,_,y=n[0].name+"",S,C,x,M,A,O,D,E,P,I,R,G=[],U=new Map,z,K,Y=[],W=new Map,te,ce,ve,oe,J,$e,ee,_e=[],fe=new Map,ie,ye,Ne,Pe,ze,se=[],re=new Map,ke,He,qe=[],Je=new Map,be,Oe=n[5]&&Eh(),Z=n[4];const ae=me=>me[16].lang;for(let me=0;me<Z.length;me+=1){let Ce=Th(n,Z,me),Ye=ae(Ce);U.set(Ye,G[me]=Ph(Ye,Ce))}let Ve=n[4];const yt=me=>me[16].lang;for(let me=0;me<Ve.length;me+=1){let Ce=Oh(n,Ve,me),Ye=yt(Ce);W.set(Ye,Y[me]=Fh(Ye,Ce))}let it=($t=n[0])==null?void 0:$t.schema;const bt=me=>me[13].name;for(let me=0;me<it.length;me+=1){let Ce=Dh(n,it,me),Ye=bt(Ce);fe.set(Ye,_e[me]=Lh(Ye,Ce))}let at=n[3];const vt=me=>me[8].code;for(let me=0;me<at.length;me+=1){let Ce=Ah(n,at,me),Ye=vt(Ce);re.set(Ye,se[me]=Ih(Ye,Ce))}let qt=n[3];const Mt=me=>me[8].code;for(let me=0;me<qt.length;me+=1){let Ce=$h(n,qt,me),Ye=Mt(Ce);Je.set(Ye,qe[me]=Rh(Ye,Ce))}return{c(){e=g("div"),t=g("strong"),t.textContent="POST",i=$(),o=g("div"),r=g("p"),l=j("/api/collections/"),s=g("strong"),f=j(a),c=j("/records"),u=$(),Oe&&Oe.c(),d=$(),h=g("div"),b=g("p"),v=j("Create a new "),_=g("strong"),S=j(y),C=j(" record."),x=$(),M=g("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,A=$(),O=g("p"),O.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",D=$(),E=g("div"),E.textContent="Client SDKs example",P=$(),I=g("div"),R=g("div");for(let me=0;me<G.length;me+=1)G[me].c();z=$(),K=g("div");for(let me=0;me<Y.length;me+=1)Y[me].c();te=$(),ce=g("div"),ce.textContent="Body Parameters",ve=$(),oe=g("table"),J=g("thead"),J.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,$e=$(),ee=g("tbody");for(let me=0;me<_e.length;me+=1)_e[me].c();ie=$(),ye=g("div"),ye.textContent="Responses",Ne=$(),Pe=g("div"),ze=g("div");for(let me=0;me<se.length;me+=1)se[me].c();ke=$(),He=g("div");for(let me=0;me<qe.length;me+=1)qe[me].c();p(t,"class","label label-primary"),p(o,"class","content"),p(e,"class","alert alert-success"),p(h,"class","content m-b-base"),p(E,"class","section-title"),p(R,"class","tabs-header compact left"),p(K,"class","tabs-content"),p(I,"class","tabs m-b-lg"),p(ce,"class","section-title"),p(oe,"class","table-compact table-border m-b-lg"),p(ye,"class","section-title"),p(ze,"class","tabs-header compact left"),p(He,"class","tabs-content"),p(Pe,"class","tabs")},m(me,Ce){w(me,e,Ce),m(e,t),m(e,i),m(e,o),m(o,r),m(r,l),m(r,s),m(s,f),m(r,c),m(e,u),Oe&&Oe.m(e,null),w(me,d,Ce),w(me,h,Ce),m(h,b),m(b,v),m(b,_),m(_,S),m(b,C),m(h,x),m(h,M),m(h,A),m(h,O),w(me,D,Ce),w(me,E,Ce),w(me,P,Ce),w(me,I,Ce),m(I,R);for(let Ye=0;Ye<G.length;Ye+=1)G[Ye].m(R,null);m(I,z),m(I,K);for(let Ye=0;Ye<Y.length;Ye+=1)Y[Ye].m(K,null);w(me,te,Ce),w(me,ce,Ce),w(me,ve,Ce),w(me,oe,Ce),m(oe,J),m(oe,$e),m(oe,ee);for(let Ye=0;Ye<_e.length;Ye+=1)_e[Ye].m(ee,null);w(me,ie,Ce),w(me,ye,Ce),w(me,Ne,Ce),w(me,Pe,Ce),m(Pe,ze);for(let Ye=0;Ye<se.length;Ye+=1)se[Ye].m(ze,null);m(Pe,ke),m(Pe,He);for(let Ye=0;Ye<qe.length;Ye+=1)qe[Ye].m(He,null);be=!0},p(me,[Ce]){var Ye;(!be||Ce&1)&&a!==(a=me[0].name+"")&&ge(f,a),me[5]?Oe||(Oe=Eh(),Oe.c(),Oe.m(e,null)):Oe&&(Oe.d(1),Oe=null),(!be||Ce&1)&&y!==(y=me[0].name+"")&&ge(S,y),Ce&20&&(Z=me[4],G=st(G,Ce,ae,1,me,Z,U,R,an,Ph,null,Th)),Ce&20&&(Ve=me[4],Ae(),Y=st(Y,Ce,yt,1,me,Ve,W,K,Pt,Fh,null,Oh),De()),Ce&1&&(it=(Ye=me[0])==null?void 0:Ye.schema,_e=st(_e,Ce,bt,1,me,it,fe,ee,an,Lh,null,Dh)),Ce&10&&(at=me[3],se=st(se,Ce,vt,1,me,at,re,ze,an,Ih,null,Ah)),Ce&10&&(qt=me[3],Ae(),qe=st(qe,Ce,Mt,1,me,qt,Je,He,Pt,Rh,null,$h),De())},i(me){if(!be){for(let Ce=0;Ce<Ve.length;Ce+=1)T(Y[Ce]);for(let Ce=0;Ce<qt.length;Ce+=1)T(qe[Ce]);be=!0}},o(me){for(let Ce=0;Ce<Y.length;Ce+=1)F(Y[Ce]);for(let Ce=0;Ce<qe.length;Ce+=1)F(qe[Ce]);be=!1},d(me){me&&k(e),Oe&&Oe.d(),me&&k(d),me&&k(h),me&&k(D),me&&k(E),me&&k(P),me&&k(I);for(let Ce=0;Ce<G.length;Ce+=1)G[Ce].d();for(let Ce=0;Ce<Y.length;Ce+=1)Y[Ce].d();me&&k(te),me&&k(ce),me&&k(ve),me&&k(oe);for(let Ce=0;Ce<_e.length;Ce+=1)_e[Ce].d();me&&k(ie),me&&k(ye),me&&k(Ne),me&&k(Pe);for(let Ce=0;Ce<se.length;Ce+=1)se[Ce].d();for(let Ce=0;Ce<qe.length;Ce+=1)qe[Ce].d()}}}function b6(n,e,t){let i,{collection:o=new En}=e,r=200,l="JavaScript",s=[],a=[];const f=u=>t(2,l=u.lang),c=u=>t(1,r=u.code);return n.$$set=u=>{"collection"in u&&t(0,o=u.collection)},n.$$.update=()=>{var u,d;n.$$.dirty&1&&t(5,i=(o==null?void 0:o.createRule)===null),n.$$.dirty&1&&t(3,s=[{code:200,body:JSON.stringify(B.dummyCollectionRecord(o),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to create record.",
"data": {
"${(d=(u=o==null?void 0:o.schema)==null?void 0:u[0])==null?void 0:d.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${Se.baseUrl}");
const data = { ... };
client.Records.create("${o==null?void 0:o.name}", data)
.then(function (record) {
// success...
}).catch(function (error) {
// error...
});
`}])},[o,r,l,s,a,i,f,c]}class g6 extends Ie{constructor(e){super(),Le(this,e,b6,m6,Ee,{collection:0})}}function Nh(n,e,t){const i=n.slice();return i[8]=e[t],i}function jh(n,e,t){const i=n.slice();return i[8]=e[t],i}function zh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Hh(n,e,t){const i=n.slice();return i[16]=e[t],i}function qh(n,e,t){const i=n.slice();return i[16]=e[t],i}function Vh(n){let e;return{c(){e=g("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 Bh(n,e){let t,i=e[16].lang+"",o,r,l,s;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[16].lang),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&16&&i!==(i=e[16].lang+"")&&ge(o,i),c&20&&ne(t,"active",e[2]===e[16].lang)},d(f){f&&k(t),l=!1,s()}}}function Uh(n,e){let t,i,o,r;return i=new tn({props:{content:e[16].code}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[16].lang),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&16&&(a.content=e[16].code),i.$set(a),s&20&&ne(t,"active",e[2]===e[16].lang)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function _6(n){let e;return{c(){e=g("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function v6(n){let e;return{c(){e=g("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function y6(n){var r;let e,t=((r=n[13].options)==null?void 0:r.maxSelect)>1?"ids":"id",i,o;return{c(){e=j("User "),i=j(t),o=j(".")},m(l,s){w(l,e,s),w(l,i,s),w(l,o,s)},p(l,s){var a;s&1&&t!==(t=((a=l[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ge(i,t)},d(l){l&&k(e),l&&k(i),l&&k(o)}}}function k6(n){var r;let e,t=((r=n[13].options)==null?void 0:r.maxSelect)>1?"ids":"id",i,o;return{c(){e=j("Relation record "),i=j(t),o=j(".")},m(l,s){w(l,e,s),w(l,i,s),w(l,o,s)},p(l,s){var a;s&1&&t!==(t=((a=l[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ge(i,t)},d(l){l&&k(e),l&&k(i),l&&k(o)}}}function w6(n){let e,t,i,o,r;return{c(){e=j("FormData object."),t=g("br"),i=j(`
Set to `),o=g("code"),o.textContent="null",r=j(" to delete already uploaded file(s).")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s),w(l,o,s),w(l,r,s)},p:le,d(l){l&&k(e),l&&k(t),l&&k(i),l&&k(o),l&&k(r)}}}function S6(n){let e;return{c(){e=j("URL address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function C6(n){let e;return{c(){e=j("Email address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function x6(n){let e;return{c(){e=j("JSON array or object.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function M6(n){let e;return{c(){e=j("Number value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function $6(n){let e;return{c(){e=j("Plain text value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Wh(n,e){let t,i,o,r,l,s=e[13].name+"",a,f,c,u,d=B.getFieldValueType(e[13])+"",h,b,v,_;function y(O,D){return O[13].required?v6:_6}let S=y(e),C=S(e);function x(O,D){if(O[13].type==="text")return $6;if(O[13].type==="number")return M6;if(O[13].type==="json")return x6;if(O[13].type==="email")return C6;if(O[13].type==="url")return S6;if(O[13].type==="file")return w6;if(O[13].type==="relation")return k6;if(O[13].type==="user")return y6}let M=x(e),A=M&&M(e);return{key:n,first:null,c(){t=g("tr"),i=g("td"),o=g("div"),C.c(),r=$(),l=g("span"),a=j(s),f=$(),c=g("td"),u=g("span"),h=j(d),b=$(),v=g("td"),A&&A.c(),_=$(),p(o,"class","inline-flex"),p(u,"class","label"),this.first=t},m(O,D){w(O,t,D),m(t,i),m(i,o),C.m(o,null),m(o,r),m(o,l),m(l,a),m(t,f),m(t,c),m(c,u),m(u,h),m(t,b),m(t,v),A&&A.m(v,null),m(t,_)},p(O,D){e=O,S!==(S=y(e))&&(C.d(1),C=S(e),C&&(C.c(),C.m(o,r))),D&1&&s!==(s=e[13].name+"")&&ge(a,s),D&1&&d!==(d=B.getFieldValueType(e[13])+"")&&ge(h,d),M===(M=x(e))&&A?A.p(e,D):(A&&A.d(1),A=M&&M(e),A&&(A.c(),A.m(v,null)))},d(O){O&&k(t),C.d(),A&&A.d()}}}function Yh(n,e){let t,i=e[8].code+"",o,r,l,s;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[8].code),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&8&&i!==(i=e[8].code+"")&&ge(o,i),c&10&&ne(t,"active",e[1]===e[8].code)},d(f){f&&k(t),l=!1,s()}}}function Gh(n,e){let t,i,o,r;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[8].code),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&8&&(a.content=e[8].body),i.$set(a),s&10&&ne(t,"active",e[1]===e[8].code)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function A6(n){var cn;let e,t,i,o,r,l,s,a=n[0].name+"",f,c,u,d,h,b,v,_,y,S=n[0].name+"",C,x,M,A,O,D,E,P,I,R,G,U=[],z=new Map,K,Y,W=[],te=new Map,ce,ve,oe,J,$e,ee,_e,fe,ie,ye,Ne,Pe=[],ze=new Map,se,re,ke,He,qe,Je=[],be=new Map,Oe,Z,ae=[],Ve=new Map,yt,it=n[5]&&Vh(),bt=n[4];const at=ue=>ue[16].lang;for(let ue=0;ue<bt.length;ue+=1){let we=qh(n,bt,ue),Ze=at(we);z.set(Ze,U[ue]=Bh(Ze,we))}let vt=n[4];const qt=ue=>ue[16].lang;for(let ue=0;ue<vt.length;ue+=1){let we=Hh(n,vt,ue),Ze=qt(we);te.set(Ze,W[ue]=Uh(Ze,we))}let Mt=(cn=n[0])==null?void 0:cn.schema;const $t=ue=>ue[13].name;for(let ue=0;ue<Mt.length;ue+=1){let we=zh(n,Mt,ue),Ze=$t(we);ze.set(Ze,Pe[ue]=Wh(Ze,we))}let me=n[3];const Ce=ue=>ue[8].code;for(let ue=0;ue<me.length;ue+=1){let we=jh(n,me,ue),Ze=Ce(we);be.set(Ze,Je[ue]=Yh(Ze,we))}let Ye=n[3];const ot=ue=>ue[8].code;for(let ue=0;ue<Ye.length;ue+=1){let we=Nh(n,Ye,ue),Ze=ot(we);Ve.set(Ze,ae[ue]=Gh(Ze,we))}return{c(){e=g("div"),t=g("strong"),t.textContent="PATCH",i=$(),o=g("div"),r=g("p"),l=j("/api/collections/"),s=g("strong"),f=j(a),c=j("/records/"),u=g("strong"),u.textContent=":id",d=$(),it&&it.c(),h=$(),b=g("div"),v=g("p"),_=j("Update a single "),y=g("strong"),C=j(S),x=j(" record."),M=$(),A=g("p"),A.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,O=$(),D=g("p"),D.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",E=$(),P=g("div"),P.textContent="Client SDKs example",I=$(),R=g("div"),G=g("div");for(let ue=0;ue<U.length;ue+=1)U[ue].c();K=$(),Y=g("div");for(let ue=0;ue<W.length;ue+=1)W[ue].c();ce=$(),ve=g("div"),ve.textContent="Path parameters",oe=$(),J=g("table"),J.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>`,$e=$(),ee=g("div"),ee.textContent="Body Parameters",_e=$(),fe=g("table"),ie=g("thead"),ie.innerHTML=`<tr><th>Param</th>
<th width="60%">Type</th>
<th width="50%">Description</th></tr>`,ye=$(),Ne=g("tbody");for(let ue=0;ue<Pe.length;ue+=1)Pe[ue].c();se=$(),re=g("div"),re.textContent="Responses",ke=$(),He=g("div"),qe=g("div");for(let ue=0;ue<Je.length;ue+=1)Je[ue].c();Oe=$(),Z=g("div");for(let ue=0;ue<ae.length;ue+=1)ae[ue].c();p(t,"class","label label-primary"),p(o,"class","content"),p(e,"class","alert alert-warning"),p(b,"class","content m-b-base"),p(P,"class","section-title"),p(G,"class","tabs-header compact left"),p(Y,"class","tabs-content"),p(R,"class","tabs m-b-lg"),p(ve,"class","section-title"),p(J,"class","table-compact table-border m-b-lg"),p(ee,"class","section-title"),p(fe,"class","table-compact table-border m-b-lg"),p(re,"class","section-title"),p(qe,"class","tabs-header compact left"),p(Z,"class","tabs-content"),p(He,"class","tabs")},m(ue,we){w(ue,e,we),m(e,t),m(e,i),m(e,o),m(o,r),m(r,l),m(r,s),m(s,f),m(r,c),m(r,u),m(e,d),it&&it.m(e,null),w(ue,h,we),w(ue,b,we),m(b,v),m(v,_),m(v,y),m(y,C),m(v,x),m(b,M),m(b,A),m(b,O),m(b,D),w(ue,E,we),w(ue,P,we),w(ue,I,we),w(ue,R,we),m(R,G);for(let Ze=0;Ze<U.length;Ze+=1)U[Ze].m(G,null);m(R,K),m(R,Y);for(let Ze=0;Ze<W.length;Ze+=1)W[Ze].m(Y,null);w(ue,ce,we),w(ue,ve,we),w(ue,oe,we),w(ue,J,we),w(ue,$e,we),w(ue,ee,we),w(ue,_e,we),w(ue,fe,we),m(fe,ie),m(fe,ye),m(fe,Ne);for(let Ze=0;Ze<Pe.length;Ze+=1)Pe[Ze].m(Ne,null);w(ue,se,we),w(ue,re,we),w(ue,ke,we),w(ue,He,we),m(He,qe);for(let Ze=0;Ze<Je.length;Ze+=1)Je[Ze].m(qe,null);m(He,Oe),m(He,Z);for(let Ze=0;Ze<ae.length;Ze+=1)ae[Ze].m(Z,null);yt=!0},p(ue,[we]){var Ze;(!yt||we&1)&&a!==(a=ue[0].name+"")&&ge(f,a),ue[5]?it||(it=Vh(),it.c(),it.m(e,null)):it&&(it.d(1),it=null),(!yt||we&1)&&S!==(S=ue[0].name+"")&&ge(C,S),we&20&&(bt=ue[4],U=st(U,we,at,1,ue,bt,z,G,an,Bh,null,qh)),we&20&&(vt=ue[4],Ae(),W=st(W,we,qt,1,ue,vt,te,Y,Pt,Uh,null,Hh),De()),we&1&&(Mt=(Ze=ue[0])==null?void 0:Ze.schema,Pe=st(Pe,we,$t,1,ue,Mt,ze,Ne,an,Wh,null,zh)),we&10&&(me=ue[3],Je=st(Je,we,Ce,1,ue,me,be,qe,an,Yh,null,jh)),we&10&&(Ye=ue[3],Ae(),ae=st(ae,we,ot,1,ue,Ye,Ve,Z,Pt,Gh,null,Nh),De())},i(ue){if(!yt){for(let we=0;we<vt.length;we+=1)T(W[we]);for(let we=0;we<Ye.length;we+=1)T(ae[we]);yt=!0}},o(ue){for(let we=0;we<W.length;we+=1)F(W[we]);for(let we=0;we<ae.length;we+=1)F(ae[we]);yt=!1},d(ue){ue&&k(e),it&&it.d(),ue&&k(h),ue&&k(b),ue&&k(E),ue&&k(P),ue&&k(I),ue&&k(R);for(let we=0;we<U.length;we+=1)U[we].d();for(let we=0;we<W.length;we+=1)W[we].d();ue&&k(ce),ue&&k(ve),ue&&k(oe),ue&&k(J),ue&&k($e),ue&&k(ee),ue&&k(_e),ue&&k(fe);for(let we=0;we<Pe.length;we+=1)Pe[we].d();ue&&k(se),ue&&k(re),ue&&k(ke),ue&&k(He);for(let we=0;we<Je.length;we+=1)Je[we].d();for(let we=0;we<ae.length;we+=1)ae[we].d()}}}function D6(n,e,t){let i,{collection:o=new En}=e,r=200,l="JavaScript",s=[],a=[];const f=u=>t(2,l=u.lang),c=u=>t(1,r=u.code);return n.$$set=u=>{"collection"in u&&t(0,o=u.collection)},n.$$.update=()=>{var u,d;n.$$.dirty&1&&t(5,i=(o==null?void 0:o.updateRule)===null),n.$$.dirty&1&&t(3,s=[{code:200,body:JSON.stringify(B.dummyCollectionRecord(o),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to update record.",
"data": {
"${(d=(u=o==null?void 0:o.schema)==null?void 0:u[0])==null?void 0:d.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": {}
}
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${Se.baseUrl}");
const data = { ... };
client.Records.update("${o==null?void 0:o.name}", "RECORD_ID", data)
.then(function (record) {
// success...
}).catch(function (error) {
// error...
});
`}])},[o,r,l,s,a,i,f,c]}class O6 extends Ie{constructor(e){super(),Le(this,e,D6,A6,Ee,{collection:0})}}function Kh(n,e,t){const i=n.slice();return i[8]=e[t],i}function Jh(n,e,t){const i=n.slice();return i[8]=e[t],i}function Zh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Xh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Qh(n){let e;return{c(){e=g("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 em(n,e){let t,i=e[13].lang+"",o,r,l,s;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&16&&i!==(i=e[13].lang+"")&&ge(o,i),c&24&&ne(t,"active",e[3]===e[13].lang)},d(f){f&&k(t),l=!1,s()}}}function tm(n,e){let t,i,o,r;return i=new tn({props:{content:e[13].code}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&16&&(a.content=e[13].code),i.$set(a),s&24&&ne(t,"active",e[3]===e[13].lang)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function nm(n,e){let t,i=e[8].code+"",o,r,l,s;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&36&&ne(t,"active",e[2]===e[8].code)},d(f){f&&k(t),l=!1,s()}}}function im(n,e){let t,i,o,r;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l,s&36&&ne(t,"active",e[2]===e[8].code)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function T6(n){let e,t,i,o,r,l,s,a=n[0].name+"",f,c,u,d,h,b,v,_,y,S=n[0].name+"",C,x,M,A,O,D,E,P=[],I=new Map,R,G,U=[],z=new Map,K,Y,W,te,ce,ve,oe,J,$e,ee=[],_e=new Map,fe,ie,ye=[],Ne=new Map,Pe,ze=n[1]&&Qh(),se=n[4];const re=Z=>Z[13].lang;for(let Z=0;Z<se.length;Z+=1){let ae=Xh(n,se,Z),Ve=re(ae);I.set(Ve,P[Z]=em(Ve,ae))}let ke=n[4];const He=Z=>Z[13].lang;for(let Z=0;Z<ke.length;Z+=1){let ae=Zh(n,ke,Z),Ve=He(ae);z.set(Ve,U[Z]=tm(Ve,ae))}let qe=n[5];const Je=Z=>Z[8].code;for(let Z=0;Z<qe.length;Z+=1){let ae=Jh(n,qe,Z),Ve=Je(ae);_e.set(Ve,ee[Z]=nm(Ve,ae))}let be=n[5];const Oe=Z=>Z[8].code;for(let Z=0;Z<be.length;Z+=1){let ae=Kh(n,be,Z),Ve=Oe(ae);Ne.set(Ve,ye[Z]=im(Ve,ae))}return{c(){e=g("div"),t=g("strong"),t.textContent="DELETE",i=$(),o=g("div"),r=g("p"),l=j("/api/collections/"),s=g("strong"),f=j(a),c=j("/records/"),u=g("strong"),u.textContent=":id",d=$(),ze&&ze.c(),h=$(),b=g("div"),v=g("p"),_=j("Delete a single "),y=g("strong"),C=j(S),x=j(" record."),M=$(),A=g("div"),A.textContent="Client SDKs example",O=$(),D=g("div"),E=g("div");for(let Z=0;Z<P.length;Z+=1)P[Z].c();R=$(),G=g("div");for(let Z=0;Z<U.length;Z+=1)U[Z].c();K=$(),Y=g("div"),Y.textContent="Path parameters",W=$(),te=g("table"),te.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>`,ce=$(),ve=g("div"),ve.textContent="Responses",oe=$(),J=g("div"),$e=g("div");for(let Z=0;Z<ee.length;Z+=1)ee[Z].c();fe=$(),ie=g("div");for(let Z=0;Z<ye.length;Z+=1)ye[Z].c();p(t,"class","label label-primary"),p(o,"class","content"),p(e,"class","alert alert-danger"),p(b,"class","content m-b-base"),p(A,"class","section-title"),p(E,"class","tabs-header compact left"),p(G,"class","tabs-content"),p(D,"class","tabs m-b-lg"),p(Y,"class","section-title"),p(te,"class","table-compact table-border m-b-lg"),p(ve,"class","section-title"),p($e,"class","tabs-header compact left"),p(ie,"class","tabs-content"),p(J,"class","tabs")},m(Z,ae){w(Z,e,ae),m(e,t),m(e,i),m(e,o),m(o,r),m(r,l),m(r,s),m(s,f),m(r,c),m(r,u),m(e,d),ze&&ze.m(e,null),w(Z,h,ae),w(Z,b,ae),m(b,v),m(v,_),m(v,y),m(y,C),m(v,x),w(Z,M,ae),w(Z,A,ae),w(Z,O,ae),w(Z,D,ae),m(D,E);for(let Ve=0;Ve<P.length;Ve+=1)P[Ve].m(E,null);m(D,R),m(D,G);for(let Ve=0;Ve<U.length;Ve+=1)U[Ve].m(G,null);w(Z,K,ae),w(Z,Y,ae),w(Z,W,ae),w(Z,te,ae),w(Z,ce,ae),w(Z,ve,ae),w(Z,oe,ae),w(Z,J,ae),m(J,$e);for(let Ve=0;Ve<ee.length;Ve+=1)ee[Ve].m($e,null);m(J,fe),m(J,ie);for(let Ve=0;Ve<ye.length;Ve+=1)ye[Ve].m(ie,null);Pe=!0},p(Z,[ae]){(!Pe||ae&1)&&a!==(a=Z[0].name+"")&&ge(f,a),Z[1]?ze||(ze=Qh(),ze.c(),ze.m(e,null)):ze&&(ze.d(1),ze=null),(!Pe||ae&1)&&S!==(S=Z[0].name+"")&&ge(C,S),ae&24&&(se=Z[4],P=st(P,ae,re,1,Z,se,I,E,an,em,null,Xh)),ae&24&&(ke=Z[4],Ae(),U=st(U,ae,He,1,Z,ke,z,G,Pt,tm,null,Zh),De()),ae&36&&(qe=Z[5],ee=st(ee,ae,Je,1,Z,qe,_e,$e,an,nm,null,Jh)),ae&36&&(be=Z[5],Ae(),ye=st(ye,ae,Oe,1,Z,be,Ne,ie,Pt,im,null,Kh),De())},i(Z){if(!Pe){for(let ae=0;ae<ke.length;ae+=1)T(U[ae]);for(let ae=0;ae<be.length;ae+=1)T(ye[ae]);Pe=!0}},o(Z){for(let ae=0;ae<U.length;ae+=1)F(U[ae]);for(let ae=0;ae<ye.length;ae+=1)F(ye[ae]);Pe=!1},d(Z){Z&&k(e),ze&&ze.d(),Z&&k(h),Z&&k(b),Z&&k(M),Z&&k(A),Z&&k(O),Z&&k(D);for(let ae=0;ae<P.length;ae+=1)P[ae].d();for(let ae=0;ae<U.length;ae+=1)U[ae].d();Z&&k(K),Z&&k(Y),Z&&k(W),Z&&k(te),Z&&k(ce),Z&&k(ve),Z&&k(oe),Z&&k(J);for(let ae=0;ae<ee.length;ae+=1)ee[ae].d();for(let ae=0;ae<ye.length;ae+=1)ye[ae].d()}}}function E6(n,e,t){let i,{collection:o=new En}=e,r=204,l="JavaScript",s=[],a=[];const f=u=>t(3,l=u.lang),c=u=>t(2,r=u.code);return n.$$set=u=>{"collection"in u&&t(0,o=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(o==null?void 0:o.deleteRule)===null),n.$$.dirty&3&&o!=null&&o.id&&(s.push({code:204,body:`
null
`}),s.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&&s.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),s.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${Se.baseUrl}");
client.Records.delete("${o==null?void 0:o.name}", "RECORD_ID")
.then(function () {
// success...
}).catch(function (error) {
// error...
});
`}])},[o,i,r,l,a,s,f,c]}class P6 extends Ie{constructor(e){super(),Le(this,e,E6,T6,Ee,{collection:0})}}function om(n,e,t){const i=n.slice();return i[4]=e[t],i}function rm(n,e,t){const i=n.slice();return i[4]=e[t],i}function lm(n,e){let t,i=e[4].lang+"",o,r,l,s;function a(){return e[3](e[4])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[4].lang),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&4&&i!==(i=e[4].lang+"")&&ge(o,i),c&6&&ne(t,"active",e[1]===e[4].lang)},d(f){f&&k(t),l=!1,s()}}}function sm(n,e){let t,i,o,r;return i=new tn({props:{content:e[4].code}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[4].lang),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&4&&(a.content=e[4].code),i.$set(a),s&6&&ne(t,"active",e[1]===e[4].lang)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function F6(n){let e,t,i,o,r,l,s,a,f=[],c=new Map,u,d,h=[],b=new Map,v,_,y,S,C,x=n[2];const M=D=>D[4].lang;for(let D=0;D<x.length;D+=1){let E=rm(n,x,D),P=M(E);c.set(P,f[D]=lm(P,E))}let A=n[2];const O=D=>D[4].lang;for(let D=0;D<A.length;D+=1){let E=om(n,A,D),P=O(E);b.set(P,h[D]=sm(P,E))}return S=new tn({props:{content:JSON.stringify({action:"create",record:B.dummyCollectionRecord(n[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')}}),{c(){e=g("div"),e.innerHTML=`<strong class="label label-primary">SSE</strong>
<div class="content"><p>/api/realtime</p></div>`,t=$(),i=g("div"),i.innerHTML=`<p>Subscribe to realtime changes via Server-Sent Events (SSE).</p>
<p>Events are send 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>`,o=$(),r=g("div"),r.textContent="Client SDKs example",l=$(),s=g("div"),a=g("div");for(let D=0;D<f.length;D+=1)f[D].c();u=$(),d=g("div");for(let D=0;D<h.length;D+=1)h[D].c();v=$(),_=g("div"),_.textContent="Event data format",y=$(),V(S.$$.fragment),p(e,"class","alert"),p(i,"class","content m-b-base"),p(r,"class","section-title"),p(a,"class","tabs-header compact left"),p(d,"class","tabs-content"),p(s,"class","tabs m-b-base"),p(_,"class","section-title")},m(D,E){w(D,e,E),w(D,t,E),w(D,i,E),w(D,o,E),w(D,r,E),w(D,l,E),w(D,s,E),m(s,a);for(let P=0;P<f.length;P+=1)f[P].m(a,null);m(s,u),m(s,d);for(let P=0;P<h.length;P+=1)h[P].m(d,null);w(D,v,E),w(D,_,E),w(D,y,E),H(S,D,E),C=!0},p(D,[E]){E&6&&(x=D[2],f=st(f,E,M,1,D,x,c,a,an,lm,null,rm)),E&6&&(A=D[2],Ae(),h=st(h,E,O,1,D,A,b,d,Pt,sm,null,om),De());const P={};E&1&&(P.content=JSON.stringify({action:"create",record:B.dummyCollectionRecord(D[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),S.$set(P)},i(D){if(!C){for(let E=0;E<A.length;E+=1)T(h[E]);T(S.$$.fragment,D),C=!0}},o(D){for(let E=0;E<h.length;E+=1)F(h[E]);F(S.$$.fragment,D),C=!1},d(D){D&&k(e),D&&k(t),D&&k(i),D&&k(o),D&&k(r),D&&k(l),D&&k(s);for(let E=0;E<f.length;E+=1)f[E].d();for(let E=0;E<h.length;E+=1)h[E].d();D&&k(v),D&&k(_),D&&k(y),q(S,D)}}}function L6(n,e,t){let{collection:i=new En}=e,o="JavaScript",r=[];const l=s=>t(1,o=s.lang);return n.$$set=s=>{"collection"in s&&t(0,i=s.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,r=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${Se.baseUrl}");
// (Optionally) authenticate
client.Users.authViaEmail("test@example.com", "123456");
// Subscribe to changes in any record from the collection
client.Realtime.subscribe("${i==null?void 0:i.name}", function (e) {
console.log(e.data);
});
// Subscribe to changes in a single record
client.Realtime.subscribe("${i==null?void 0:i.name}/RECORD_ID", function (e) {
console.log(e.data);
});
// Unsubscribe
client.Realtime.unsubscribe() // remove all subscriptions
client.Realtime.unsubscribe("${i==null?void 0:i.name}") // remove the collection subscription
client.Realtime.unsubscribe("${i==null?void 0:i.name}/RECORD_ID") // remove the record subscription
`}])},[i,o,r,l]}class I6 extends Ie{constructor(e){super(),Le(this,e,L6,F6,Ee,{collection:0})}}function am(n,e,t){const i=n.slice();return i[14]=e[t],i}function fm(n,e,t){const i=n.slice();return i[14]=e[t],i}function cm(n){let e,t,i,o;var r=n[14].component;function l(s){return{props:{collection:s[3]}}}return r&&(t=new r(l(n))),{c(){e=g("div"),t&&V(t.$$.fragment),i=$(),p(e,"class","tab-item active")},m(s,a){w(s,e,a),t&&H(t,e,null),m(e,i),o=!0},p(s,a){const f={};if(a&8&&(f.collection=s[3]),r!==(r=s[14].component)){if(t){Ae();const c=t;F(c.$$.fragment,1,0,()=>{q(c,1)}),De()}r?(t=new r(l(s)),V(t.$$.fragment),T(t.$$.fragment,1),H(t,e,i)):t=null}else r&&t.$set(f)},i(s){o||(t&&T(t.$$.fragment,s),o=!0)},o(s){t&&F(t.$$.fragment,s),o=!1},d(s){s&&k(e),t&&q(t)}}}function um(n,e){let t,i,o,r=e[4]===e[14].id&&cm(e);return{key:n,first:null,c(){t=lt(),r&&r.c(),i=lt(),this.first=t},m(l,s){w(l,t,s),r&&r.m(l,s),w(l,i,s),o=!0},p(l,s){e=l,e[4]===e[14].id?r?(r.p(e,s),s&16&&T(r,1)):(r=cm(e),r.c(),T(r,1),r.m(i.parentNode,i)):r&&(Ae(),F(r,1,1,()=>{r=null}),De())},i(l){o||(T(r),o=!0)},o(l){F(r),o=!1},d(l){l&&k(t),r&&r.d(l),l&&k(i)}}}function R6(n){let e,t=[],i=new Map,o,r=n[5];const l=s=>s[14].id;for(let s=0;s<r.length;s+=1){let a=am(n,r,s),f=l(a);i.set(f,t[s]=um(f,a))}return{c(){e=g("div");for(let s=0;s<t.length;s+=1)t[s].c();p(e,"class","tabs-content")},m(s,a){w(s,e,a);for(let f=0;f<t.length;f+=1)t[f].m(e,null);o=!0},p(s,a){a&56&&(r=s[5],Ae(),t=st(t,a,l,1,s,r,i,e,Pt,um,null,am),De())},i(s){if(!o){for(let a=0;a<r.length;a+=1)T(t[a]);o=!0}},o(s){for(let a=0;a<t.length;a+=1)F(t[a]);o=!1},d(s){s&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function dm(n,e){let t,i,o=e[14].label+"",r,l,s,a;function f(){return e[9](e[14])}function c(...u){return e[10](e[14],...u)}return{key:n,first:null,c(){t=g("button"),i=g("span"),r=j(o),l=$(),p(i,"class","txt"),p(t,"tabindex","0"),p(t,"class","tab-item"),ne(t,"active",e[4]===e[14].id),this.first=t},m(u,d){w(u,t,d),m(t,i),m(i,r),m(t,l),s||(a=[X(t,"click",f),X(t,"keydown",Vb(c))],s=!0)},p(u,d){e=u,d&48&&ne(t,"active",e[4]===e[14].id)},d(u){u&&k(t),s=!1,rt(a)}}}function N6(n){let e,t,i=n[3].name+"",o,r,l,s,a=[],f=new Map,c=n[5];const u=d=>d[14].id;for(let d=0;d<c.length;d+=1){let h=fm(n,c,d),b=u(h);f.set(b,a[d]=dm(b,h))}return{c(){e=g("h4"),t=g("strong"),o=j(i),r=j(" records API"),l=$(),s=g("div");for(let d=0;d<a.length;d+=1)a[d].c();p(s,"class","tabs-header stretched")},m(d,h){w(d,e,h),m(e,t),m(t,o),m(e,r),w(d,l,h),w(d,s,h);for(let b=0;b<a.length;b+=1)a[b].m(s,null)},p(d,h){h&8&&i!==(i=d[3].name+"")&&ge(o,i),h&114&&(c=d[5],a=st(a,h,u,1,d,c,f,s,an,dm,null,fm))},d(d){d&&k(e),d&&k(l),d&&k(s);for(let h=0;h<a.length;h+=1)a[h].d()}}}function j6(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[8]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function z6(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[j6],header:[N6],default:[R6]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,[r]){const l={};r&524312&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[11](null),q(e,o)}}}function H6(n,e,t){const i=[{id:"list",label:"List",component:t6},{id:"view",label:"View",component:o6},{id:"create",label:"Create",component:g6},{id:"update",label:"Update",component:O6},{id:"delete",label:"Delete",component:P6},{id:"realtime",label:"Realtime",component:I6}];let o,r=new En,l=i[0].id;function s(y){return t(3,r=y),f(i[0].id),o==null?void 0:o.show()}function a(){return o==null?void 0:o.hide()}function f(y){t(4,l=y)}function c(y,S){(y.code==="Enter"||y.code==="Space")&&(y.preventDefault(),f(S))}const u=()=>a(),d=y=>f(y.id),h=(y,S)=>c(S,y.id);function b(y){he[y?"unshift":"push"](()=>{o=y,t(2,o)})}function v(y){ft.call(this,n,y)}function _(y){ft.call(this,n,y)}return[a,f,o,r,l,i,c,s,u,d,h,b,v,_]}class q6 extends Ie{constructor(e){super(),Le(this,e,H6,z6,Ee,{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 V6(n){let e,t,i,o=[n[3]],r={};for(let l=0;l<o.length;l+=1)r=ut(r,o[l]);return{c(){e=g("textarea"),ci(e,r),ne(e,"svelte-1x1pbts",!0)},m(l,s){w(l,e,s),e.autofocus&&e.focus(),n[5](e),Me(e,n[0]),t||(i=[X(e,"input",n[6]),X(e,"keydown",n[2])],t=!0)},p(l,[s]){ci(e,r=bn(o,[s&8&&l[3]])),s&1&&Me(e,l[0]),ne(e,"svelte-1x1pbts",!0)},i:le,o:le,d(l){l&&k(e),n[5](null),t=!1,rt(i)}}}function B6(n,e,t){const i=["value","maxHeight"];let o=Wt(e,i),{value:r=""}=e,{maxHeight:l=200}=e,s,a;function f(){clearTimeout(a),a=setTimeout(()=>{s&&(t(1,s.style.height="",s),t(1,s.style.height=Math.min(s.scrollHeight+2,l)+"px",s))},0)}function c(h){if((h==null?void 0:h.code)==="Enter"&&!(h!=null&&h.shiftKey)){h.preventDefault();const b=s.closest("form");b!=null&&b.requestSubmit&&b.requestSubmit()}}function u(h){he[h?"unshift":"push"](()=>{s=h,t(1,s)})}function d(){r=this.value,t(0,r)}return n.$$set=h=>{e=ut(ut({},e),ui(h)),t(3,o=Wt(e,i)),"value"in h&&t(0,r=h.value),"maxHeight"in h&&t(4,l=h.maxHeight)},n.$$.update=()=>{n.$$.dirty&3&&s&&typeof r!==void 0&&f()},[r,s,c,o,l,u,d]}class U6 extends Ie{constructor(e){super(),Le(this,e,B6,V6,Ee,{value:0,maxHeight:4})}}function W6(n){let e,t,i,o,r,l=n[1].name+"",s,a,f,c,u,d;function h(v){n[2](v)}let b={id:n[3],required:n[1].required};return n[0]!==void 0&&(b.value=n[0]),c=new U6({props:b}),he.push(()=>Fe(c,"value",h)),{c(){e=g("label"),t=g("i"),o=$(),r=g("span"),s=j(l),f=$(),V(c.$$.fragment),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(r,"class","txt"),p(e,"for",a=n[3])},m(v,_){w(v,e,_),m(e,t),m(e,o),m(e,r),m(r,s),w(v,f,_),H(c,v,_),d=!0},p(v,_){(!d||_&2&&i!==(i=B.getFieldTypeIcon(v[1].type)))&&p(t,"class",i),(!d||_&2)&&l!==(l=v[1].name+"")&&ge(s,l),(!d||_&8&&a!==(a=v[3]))&&p(e,"for",a);const y={};_&8&&(y.id=v[3]),_&2&&(y.required=v[1].required),!u&&_&1&&(u=!0,y.value=v[0],Re(()=>u=!1)),c.$set(y)},i(v){d||(T(c.$$.fragment,v),d=!0)},o(v){F(c.$$.fragment,v),d=!1},d(v){v&&k(e),v&&k(f),q(c,v)}}}function Y6(n){let e,t;return e=new je({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[W6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,[o]){const r={};o&2&&(r.class="form-field "+(i[1].required?"required":"")),o&2&&(r.name=i[1].name),o&27&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function G6(n,e,t){let{field:i=new kn}=e,{value:o=void 0}=e;function r(l){o=l,t(0,o)}return n.$$set=l=>{"field"in l&&t(1,i=l.field),"value"in l&&t(0,o=l.value)},[o,i,r]}class K6 extends Ie{constructor(e){super(),Le(this,e,G6,Y6,Ee,{field:1,value:0})}}function J6(n){let e,t,i,o,r,l=n[1].name+"",s,a,f,c,u,d,h,b,v,_;return{c(){var y,S;e=g("label"),t=g("i"),o=$(),r=g("span"),s=j(l),f=$(),c=g("input"),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(r,"class","txt"),p(e,"for",a=n[3]),p(c,"type","number"),p(c,"id",u=n[3]),c.required=d=n[1].required,p(c,"min",h=(y=n[1].options)==null?void 0:y.min),p(c,"max",b=(S=n[1].options)==null?void 0:S.max)},m(y,S){w(y,e,S),m(e,t),m(e,o),m(e,r),m(r,s),w(y,f,S),w(y,c,S),Me(c,n[0]),v||(_=X(c,"input",n[2]),v=!0)},p(y,S){var C,x;S&2&&i!==(i=B.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&l!==(l=y[1].name+"")&&ge(s,l),S&8&&a!==(a=y[3])&&p(e,"for",a),S&8&&u!==(u=y[3])&&p(c,"id",u),S&2&&d!==(d=y[1].required)&&(c.required=d),S&2&&h!==(h=(C=y[1].options)==null?void 0:C.min)&&p(c,"min",h),S&2&&b!==(b=(x=y[1].options)==null?void 0:x.max)&&p(c,"max",b),S&1&&At(c.value)!==y[0]&&Me(c,y[0])},d(y){y&&k(e),y&&k(f),y&&k(c),v=!1,_()}}}function Z6(n){let e,t;return e=new je({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[J6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,[o]){const r={};o&2&&(r.class="form-field "+(i[1].required?"required":"")),o&2&&(r.name=i[1].name),o&27&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function X6(n,e,t){let{field:i=new kn}=e,{value:o=void 0}=e;function r(){o=At(this.value),t(0,o)}return n.$$set=l=>{"field"in l&&t(1,i=l.field),"value"in l&&t(0,o=l.value)},[o,i,r]}class Q6 extends Ie{constructor(e){super(),Le(this,e,X6,Z6,Ee,{field:1,value:0})}}function eM(n){let e,t,i,o,r=n[1].name+"",l,s,a,f;return{c(){e=g("input"),i=$(),o=g("label"),l=j(r),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(o,"for",s=n[3])},m(c,u){w(c,e,u),e.checked=n[0],w(c,i,u),w(c,o,u),m(o,l),a||(f=X(e,"change",n[2]),a=!0)},p(c,u){u&8&&t!==(t=c[3])&&p(e,"id",t),u&1&&(e.checked=c[0]),u&2&&r!==(r=c[1].name+"")&&ge(l,r),u&8&&s!==(s=c[3])&&p(o,"for",s)},d(c){c&&k(e),c&&k(i),c&&k(o),a=!1,f()}}}function tM(n){let e,t;return e=new je({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[eM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,[o]){const r={};o&2&&(r.class="form-field form-field-toggle "+(i[1].required?"required":"")),o&2&&(r.name=i[1].name),o&27&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function nM(n,e,t){let{field:i=new kn}=e,{value:o=!1}=e;function r(){o=this.checked,t(0,o)}return n.$$set=l=>{"field"in l&&t(1,i=l.field),"value"in l&&t(0,o=l.value)},[o,i,r]}class iM extends Ie{constructor(e){super(),Le(this,e,nM,tM,Ee,{field:1,value:0})}}function oM(n){let e,t,i,o,r,l=n[1].name+"",s,a,f,c,u,d,h,b;return{c(){e=g("label"),t=g("i"),o=$(),r=g("span"),s=j(l),f=$(),c=g("input"),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(r,"class","txt"),p(e,"for",a=n[3]),p(c,"type","email"),p(c,"id",u=n[3]),c.required=d=n[1].required},m(v,_){w(v,e,_),m(e,t),m(e,o),m(e,r),m(r,s),w(v,f,_),w(v,c,_),Me(c,n[0]),h||(b=X(c,"input",n[2]),h=!0)},p(v,_){_&2&&i!==(i=B.getFieldTypeIcon(v[1].type))&&p(t,"class",i),_&2&&l!==(l=v[1].name+"")&&ge(s,l),_&8&&a!==(a=v[3])&&p(e,"for",a),_&8&&u!==(u=v[3])&&p(c,"id",u),_&2&&d!==(d=v[1].required)&&(c.required=d),_&1&&c.value!==v[0]&&Me(c,v[0])},d(v){v&&k(e),v&&k(f),v&&k(c),h=!1,b()}}}function rM(n){let e,t;return e=new je({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[oM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,[o]){const r={};o&2&&(r.class="form-field "+(i[1].required?"required":"")),o&2&&(r.name=i[1].name),o&27&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function lM(n,e,t){let{field:i=new kn}=e,{value:o=void 0}=e;function r(){o=this.value,t(0,o)}return n.$$set=l=>{"field"in l&&t(1,i=l.field),"value"in l&&t(0,o=l.value)},[o,i,r]}class sM extends Ie{constructor(e){super(),Le(this,e,lM,rM,Ee,{field:1,value:0})}}function aM(n){let e,t,i,o,r,l=n[1].name+"",s,a,f,c,u,d,h,b;return{c(){e=g("label"),t=g("i"),o=$(),r=g("span"),s=j(l),f=$(),c=g("input"),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(r,"class","txt"),p(e,"for",a=n[3]),p(c,"type","url"),p(c,"id",u=n[3]),c.required=d=n[1].required},m(v,_){w(v,e,_),m(e,t),m(e,o),m(e,r),m(r,s),w(v,f,_),w(v,c,_),Me(c,n[0]),h||(b=X(c,"input",n[2]),h=!0)},p(v,_){_&2&&i!==(i=B.getFieldTypeIcon(v[1].type))&&p(t,"class",i),_&2&&l!==(l=v[1].name+"")&&ge(s,l),_&8&&a!==(a=v[3])&&p(e,"for",a),_&8&&u!==(u=v[3])&&p(c,"id",u),_&2&&d!==(d=v[1].required)&&(c.required=d),_&1&&Me(c,v[0])},d(v){v&&k(e),v&&k(f),v&&k(c),h=!1,b()}}}function fM(n){let e,t;return e=new je({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[aM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,[o]){const r={};o&2&&(r.class="form-field "+(i[1].required?"required":"")),o&2&&(r.name=i[1].name),o&27&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function cM(n,e,t){let{field:i=new kn}=e,{value:o=void 0}=e;function r(){o=this.value,t(0,o)}return n.$$set=l=>{"field"in l&&t(1,i=l.field),"value"in l&&t(0,o=l.value)},[o,i,r]}class uM extends Ie{constructor(e){super(),Le(this,e,cM,fM,Ee,{field:1,value:0})}}function dM(n){let e,t,i,o,r,l=n[1].name+"",s,a,f,c,u,d,h;function b(_){n[2](_)}let v={id:n[3],options:B.defaultFlatpickrOptions(),value:n[0]};return n[0]!==void 0&&(v.formattedValue=n[0]),u=new pc({props:v}),he.push(()=>Fe(u,"formattedValue",b)),{c(){e=g("label"),t=g("i"),o=$(),r=g("span"),s=j(l),a=j(" (UTC)"),c=$(),V(u.$$.fragment),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(r,"class","txt"),p(e,"for",f=n[3])},m(_,y){w(_,e,y),m(e,t),m(e,o),m(e,r),m(r,s),m(r,a),w(_,c,y),H(u,_,y),h=!0},p(_,y){(!h||y&2&&i!==(i=B.getFieldTypeIcon(_[1].type)))&&p(t,"class",i),(!h||y&2)&&l!==(l=_[1].name+"")&&ge(s,l),(!h||y&8&&f!==(f=_[3]))&&p(e,"for",f);const S={};y&8&&(S.id=_[3]),y&1&&(S.value=_[0]),!d&&y&1&&(d=!0,S.formattedValue=_[0],Re(()=>d=!1)),u.$set(S)},i(_){h||(T(u.$$.fragment,_),h=!0)},o(_){F(u.$$.fragment,_),h=!1},d(_){_&&k(e),_&&k(c),q(u,_)}}}function pM(n){let e,t;return e=new je({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[dM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,[o]){const r={};o&2&&(r.class="form-field "+(i[1].required?"required":"")),o&2&&(r.name=i[1].name),o&27&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function hM(n,e,t){let{field:i=new kn}=e,{value:o=void 0}=e;function r(l){o=l,t(0,o)}return n.$$set=l=>{"field"in l&&t(1,i=l.field),"value"in l&&t(0,o=l.value)},[o,i,r]}class mM extends Ie{constructor(e){super(),Le(this,e,hM,pM,Ee,{field:1,value:0})}}function pm(n){let e,t,i=n[1].options.maxSelect+"",o,r;return{c(){e=g("div"),t=j("Select up to "),o=j(i),r=j(" items."),p(e,"class","help-block")},m(l,s){w(l,e,s),m(e,t),m(e,o),m(e,r)},p(l,s){s&2&&i!==(i=l[1].options.maxSelect+"")&&ge(o,i)},d(l){l&&k(e)}}}function bM(n){var S,C,x;let e,t,i,o,r,l=n[1].name+"",s,a,f,c,u,d,h,b;function v(M){n[3](M)}let _={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],items:(S=n[1].options)==null?void 0:S.values,searchable:((C=n[1].options)==null?void 0:C.values)>5};n[0]!==void 0&&(_.selected=n[0]),c=new D1({props:_}),he.push(()=>Fe(c,"selected",v));let y=((x=n[1].options)==null?void 0:x.maxSelect)>1&&pm(n);return{c(){e=g("label"),t=g("i"),o=$(),r=g("span"),s=j(l),f=$(),V(c.$$.fragment),d=$(),y&&y.c(),h=lt(),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(r,"class","txt"),p(e,"for",a=n[4])},m(M,A){w(M,e,A),m(e,t),m(e,o),m(e,r),m(r,s),w(M,f,A),H(c,M,A),w(M,d,A),y&&y.m(M,A),w(M,h,A),b=!0},p(M,A){var D,E,P;(!b||A&2&&i!==(i=B.getFieldTypeIcon(M[1].type)))&&p(t,"class",i),(!b||A&2)&&l!==(l=M[1].name+"")&&ge(s,l),(!b||A&16&&a!==(a=M[4]))&&p(e,"for",a);const O={};A&16&&(O.id=M[4]),A&6&&(O.toggle=!M[1].required||M[2]),A&4&&(O.multiple=M[2]),A&2&&(O.items=(D=M[1].options)==null?void 0:D.values),A&2&&(O.searchable=((E=M[1].options)==null?void 0:E.values)>5),!u&&A&1&&(u=!0,O.selected=M[0],Re(()=>u=!1)),c.$set(O),((P=M[1].options)==null?void 0:P.maxSelect)>1?y?y.p(M,A):(y=pm(M),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i(M){b||(T(c.$$.fragment,M),b=!0)},o(M){F(c.$$.fragment,M),b=!1},d(M){M&&k(e),M&&k(f),q(c,M),M&&k(d),y&&y.d(M),M&&k(h)}}}function gM(n){let e,t;return e=new je({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[bM,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,[o]){const r={};o&2&&(r.class="form-field "+(i[1].required?"required":"")),o&2&&(r.name=i[1].name),o&55&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function _M(n,e,t){let i,{field:o=new kn}=e,{value:r=void 0}=e;function l(s){r=s,t(0,r),t(2,i),t(1,o)}return n.$$set=s=>{"field"in s&&t(1,o=s.field),"value"in s&&t(0,r=s.value)},n.$$.update=()=>{var s;n.$$.dirty&2&&t(2,i=((s=o.options)==null?void 0:s.maxSelect)>1),n.$$.dirty&5&&typeof r=="undefined"&&t(0,r=i?[]:null),n.$$.dirty&7&&i&&Array.isArray(r)&&r.length>o.options.maxSelect&&t(0,r=r.slice(r.length-o.options.maxSelect))},[r,o,i,l]}class vM extends Ie{constructor(e){super(),Le(this,e,_M,gM,Ee,{field:1,value:0})}}function yM(n){let e,t,i,o,r,l=n[1].name+"",s,a,f,c,u,d,h,b;return{c(){e=g("label"),t=g("i"),o=$(),r=g("span"),s=j(l),f=$(),c=g("textarea"),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(r,"class","txt"),p(e,"for",a=n[3]),p(c,"id",u=n[3]),c.required=d=n[1].required,p(c,"class","txt-mono txt-sm")},m(v,_){w(v,e,_),m(e,t),m(e,o),m(e,r),m(r,s),w(v,f,_),w(v,c,_),Me(c,n[0]),h||(b=X(c,"input",n[2]),h=!0)},p(v,_){_&2&&i!==(i=B.getFieldTypeIcon(v[1].type))&&p(t,"class",i),_&2&&l!==(l=v[1].name+"")&&ge(s,l),_&8&&a!==(a=v[3])&&p(e,"for",a),_&8&&u!==(u=v[3])&&p(c,"id",u),_&2&&d!==(d=v[1].required)&&(c.required=d),_&1&&Me(c,v[0])},d(v){v&&k(e),v&&k(f),v&&k(c),h=!1,b()}}}function kM(n){let e,t;return e=new je({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[yM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,[o]){const r={};o&2&&(r.class="form-field "+(i[1].required?"required":"")),o&2&&(r.name=i[1].name),o&27&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function wM(n,e,t){let{field:i=new kn}=e,{value:o=void 0}=e;function r(){o=this.value,t(0,o)}return n.$$set=l=>{"field"in l&&t(1,i=l.field),"value"in l&&t(0,o=l.value)},n.$$.update=()=>{n.$$.dirty&1&&typeof o!="undefined"&&typeof o!="string"&&o!==null&&t(0,o=JSON.stringify(o,null,2))},[o,i,r]}class SM extends Ie{constructor(e){super(),Le(this,e,wM,kM,Ee,{field:1,value:0})}}function CM(n){let e,t;return{c(){e=g("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,o){w(i,e,o)},p(i,o){o&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&k(e)}}}function xM(n){let e,t,i;return{c(){e=g("img"),Qn(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(o,r){w(o,e,r)},p(o,r){r&4&&!Qn(e.src,t=o[2])&&p(e,"src",t),r&2&&p(e,"width",o[1]),r&2&&p(e,"height",o[1]),r&1&&i!==(i=o[0].name)&&p(e,"alt",i)},d(o){o&&k(e)}}}function MM(n){let e;function t(r,l){return r[2]?xM:CM}let i=t(n),o=i(n);return{c(){o.c(),e=lt()},m(r,l){o.m(r,l),w(r,e,l)},p(r,[l]){i===(i=t(r))&&o?o.p(r,l):(o.d(1),o=i(r),o&&(o.c(),o.m(e.parentNode,e)))},i:le,o:le,d(r){o.d(r),r&&k(e)}}}function $M(n,e,t){let i,{file:o}=e,{size:r=50}=e;function l(){t(2,i=""),B.hasImageExtension(o==null?void 0:o.name)&&B.generateThumb(o,r,r).then(s=>{t(2,i=s)}).catch(s=>{console.warn("Unable to generate thumb: ",s)})}return n.$$set=s=>{"file"in s&&t(0,o=s.file),"size"in s&&t(1,r=s.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof o!="undefined"&&l()},t(2,i=""),[o,r,i]}class AM extends Ie{constructor(e){super(),Le(this,e,$M,MM,Ee,{file:0,size:1})}}function DM(n){let e,t;return{c(){e=g("img"),Qn(e.src,t=n[2])||p(e,"src",t),p(e,"alt","Preview")},m(i,o){w(i,e,o)},p(i,o){o&4&&!Qn(e.src,t=i[2])&&p(e,"src",t)},d(i){i&&k(e)}}}function OM(n){let e,t,i=n[2].substring(n[2].lastIndexOf("/")+1)+"",o,r,l,s,a,f,c;return{c(){e=g("a"),t=j("/../"),o=j(i),r=$(),l=g("div"),s=$(),a=g("button"),a.textContent="Close",p(e,"href",n[2]),p(e,"class","link-hint txt-ellipsis"),p(l,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-secondary")},m(u,d){w(u,e,d),m(e,t),m(e,o),w(u,r,d),w(u,l,d),w(u,s,d),w(u,a,d),f||(c=X(a,"click",n[0]),f=!0)},p(u,d){d&4&&i!==(i=u[2].substring(u[2].lastIndexOf("/")+1)+"")&&ge(o,i),d&4&&p(e,"href",u[2])},d(u){u&&k(e),u&&k(r),u&&k(l),u&&k(s),u&&k(a),f=!1,c()}}}function TM(n){let e,t,i={class:"image-preview",popup:!0,$$slots:{footer:[OM],default:[DM]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[4](e),e.$on("show",n[5]),e.$on("hide",n[6]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,[r]){const l={};r&132&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[4](null),q(e,o)}}}function EM(n,e,t){let i,o="";function r(c){c!==""&&B.checkImageUrl(c).then(()=>{t(2,o=c),i==null||i.show()}).catch(()=>{console.warn("Invalid image preview url: ",c),l()})}function l(){return i==null?void 0:i.hide()}function s(c){he[c?"unshift":"push"](()=>{i=c,t(1,i)})}function a(c){ft.call(this,n,c)}function f(c){ft.call(this,n,c)}return[l,i,o,r,s,a,f]}class PM extends Ie{constructor(e){super(),Le(this,e,EM,TM,Ee,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function FM(n){let e;return{c(){e=g("i"),p(e,"class","ri-file-line")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function LM(n){let e,t,i,o;return{c(){e=g("img"),Qn(e.src,t=n[1])||p(e,"src",t),p(e,"alt",n[0])},m(r,l){w(r,e,l),i||(o=X(e,"error",n[2]),i=!0)},p(r,l){l&2&&!Qn(e.src,t=r[1])&&p(e,"src",t),l&1&&p(e,"alt",r[0])},d(r){r&&k(e),i=!1,o()}}}function IM(n){let e;function t(r,l){return r[1]?LM:FM}let i=t(n),o=i(n);return{c(){o.c(),e=lt()},m(r,l){o.m(r,l),w(r,e,l)},p(r,[l]){i===(i=t(r))&&o?o.p(r,l):(o.d(1),o=i(r),o&&(o.c(),o.m(e.parentNode,e)))},i:le,o:le,d(r){o.d(r),r&&k(e)}}}function RM(n,e,t){let{record:i}=e,{filename:o}=e,r="";function l(){t(1,r="")}return n.$$set=s=>{"record"in s&&t(3,i=s.record),"filename"in s&&t(0,o=s.filename)},n.$$.update=()=>{n.$$.dirty&9&&B.hasImageExtension(o)&&t(1,r=Se.Records.getFileUrl(i,`${o}?thumb=100x100`))},[o,r,l,i]}class P1 extends Ie{constructor(e){super(),Le(this,e,RM,IM,Ee,{record:3,filename:0})}}function hm(n,e,t){const i=n.slice();return i[25]=e[t],i[27]=t,i}function mm(n,e,t){const i=n.slice();return i[28]=e[t],i[27]=t,i}function NM(n){let e,t,i;function o(){return n[16](n[27])}return{c(){e=g("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(r,l){w(r,e,l),t||(i=[Xe(St.call(null,e,"Remove file")),X(e,"click",o)],t=!0)},p(r,l){n=r},d(r){r&&k(e),t=!1,rt(i)}}}function jM(n){let e,t,i;function o(){return n[15](n[27])}return{c(){e=g("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-secondary")},m(r,l){w(r,e,l),t||(i=X(e,"click",o),t=!0)},p(r,l){n=r},d(r){r&&k(e),t=!1,i()}}}function bm(n,e){let t,i,o,r,l,s,a,f=e[28]+"",c,u,d,h,b,v,_,y;o=new P1({props:{record:e[2],filename:e[28]}});function S(){return e[14](e[28])}function C(A,O){return O&18&&(b=null),b==null&&(b=!!A[1].includes(A[27])),b?jM:NM}let x=C(e,-1),M=x(e);return{key:n,first:null,c(){t=g("div"),i=g("figute"),V(o.$$.fragment),l=$(),s=g("a"),a=j("/.../"),c=j(f),h=$(),M.c(),p(i,"class","thumb"),p(i,"title",r=B.hasImageExtension(e[28])?"Preview":""),ne(i,"fade",e[1].includes(e[27])),ne(i,"link-fade",B.hasImageExtension(e[28])),p(s,"href",u=Se.Records.getFileUrl(e[2],e[28])),p(s,"class","filename"),p(s,"title",d="Download "+e[28]),p(s,"target","_blank"),p(s,"rel","noopener"),p(s,"download",""),ne(s,"txt-strikethrough",e[1].includes(e[27])),p(t,"class","list-item"),this.first=t},m(A,O){w(A,t,O),m(t,i),H(o,i,null),m(t,l),m(t,s),m(s,a),m(s,c),m(t,h),M.m(t,null),v=!0,_||(y=X(i,"click",S),_=!0)},p(A,O){e=A;const D={};O&4&&(D.record=e[2]),O&16&&(D.filename=e[28]),o.$set(D),(!v||O&16&&r!==(r=B.hasImageExtension(e[28])?"Preview":""))&&p(i,"title",r),O&18&&ne(i,"fade",e[1].includes(e[27])),O&16&&ne(i,"link-fade",B.hasImageExtension(e[28])),(!v||O&16)&&f!==(f=e[28]+"")&&ge(c,f),(!v||O&20&&u!==(u=Se.Records.getFileUrl(e[2],e[28])))&&p(s,"href",u),(!v||O&16&&d!==(d="Download "+e[28]))&&p(s,"title",d),O&18&&ne(s,"txt-strikethrough",e[1].includes(e[27])),x===(x=C(e,O))&&M?M.p(e,O):(M.d(1),M=x(e),M&&(M.c(),M.m(t,null)))},i(A){v||(T(o.$$.fragment,A),v=!0)},o(A){F(o.$$.fragment,A),v=!1},d(A){A&&k(t),q(o),M.d(),_=!1,y()}}}function gm(n){let e,t,i,o,r,l,s,a,f=n[25].name+"",c,u,d,h,b,v,_,y;i=new AM({props:{file:n[25]}});function S(){return n[17](n[27])}return{c(){e=g("div"),t=g("figute"),V(i.$$.fragment),o=$(),r=g("div"),l=g("small"),l.textContent="New",s=$(),a=g("span"),c=j(f),d=$(),h=g("button"),h.innerHTML='<i class="ri-close-line"></i>',p(t,"class","thumb"),p(l,"class","label label-success m-r-5"),p(a,"class","txt"),p(r,"class","filename"),p(r,"title",u=n[25].name),p(h,"type","button"),p(h,"class","btn btn-secondary btn-sm btn-circle btn-remove"),p(e,"class","list-item")},m(C,x){w(C,e,x),m(e,t),H(i,t,null),m(e,o),m(e,r),m(r,l),m(r,s),m(r,a),m(a,c),m(e,d),m(e,h),v=!0,_||(y=[Xe(b=St.call(null,h,"Remove file")),X(h,"click",S)],_=!0)},p(C,x){n=C;const M={};x&1&&(M.file=n[25]),i.$set(M),(!v||x&1)&&f!==(f=n[25].name+"")&&ge(c,f),(!v||x&1&&u!==(u=n[25].name))&&p(r,"title",u)},i(C){v||(T(i.$$.fragment,C),v=!0)},o(C){F(i.$$.fragment,C),v=!1},d(C){C&&k(e),q(i),_=!1,rt(y)}}}function _m(n){let e,t,i,o,r,l;return{c(){e=g("div"),t=g("input"),i=$(),o=g("button"),o.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(o,"type","button"),p(o,"class","btn btn-secondary btn-sm btn-block"),p(e,"class","list-item btn-list-item")},m(s,a){w(s,e,a),m(e,t),n[18](t),m(e,i),m(e,o),r||(l=[X(t,"change",n[19]),X(o,"click",n[20])],r=!0)},p(s,a){a&32&&(t.multiple=s[5])},d(s){s&&k(e),n[18](null),r=!1,rt(l)}}}function zM(n){let e,t,i,o,r,l=n[3].name+"",s,a,f,c,u=[],d=new Map,h,b,v,_=n[4];const y=A=>A[28];for(let A=0;A<_.length;A+=1){let O=mm(n,_,A),D=y(O);d.set(D,u[A]=bm(D,O))}let S=n[0],C=[];for(let A=0;A<S.length;A+=1)C[A]=gm(hm(n,S,A));const x=A=>F(C[A],1,1,()=>{C[A]=null});let M=!n[9]&&_m(n);return{c(){e=g("label"),t=g("i"),o=$(),r=g("span"),s=j(l),f=$(),c=g("div");for(let A=0;A<u.length;A+=1)u[A].c();h=$();for(let A=0;A<C.length;A+=1)C[A].c();b=$(),M&&M.c(),p(t,"class",i=B.getFieldTypeIcon(n[3].type)),p(r,"class","txt"),p(e,"for",a=n[24]),p(c,"class","files-list")},m(A,O){w(A,e,O),m(e,t),m(e,o),m(e,r),m(r,s),w(A,f,O),w(A,c,O);for(let D=0;D<u.length;D+=1)u[D].m(c,null);m(c,h);for(let D=0;D<C.length;D+=1)C[D].m(c,null);m(c,b),M&&M.m(c,null),n[21](c),v=!0},p(A,O){if((!v||O&8&&i!==(i=B.getFieldTypeIcon(A[3].type)))&&p(t,"class",i),(!v||O&8)&&l!==(l=A[3].name+"")&&ge(s,l),(!v||O&16777216&&a!==(a=A[24]))&&p(e,"for",a),O&3222&&(_=A[4],Ae(),u=st(u,O,y,1,A,_,d,c,Pt,bm,h,mm),De()),O&4097){S=A[0];let D;for(D=0;D<S.length;D+=1){const E=hm(A,S,D);C[D]?(C[D].p(E,O),T(C[D],1)):(C[D]=gm(E),C[D].c(),T(C[D],1),C[D].m(c,b))}for(Ae(),D=S.length;D<C.length;D+=1)x(D);De()}A[9]?M&&(M.d(1),M=null):M?M.p(A,O):(M=_m(A),M.c(),M.m(c,null))},i(A){if(!v){for(let O=0;O<_.length;O+=1)T(u[O]);for(let O=0;O<S.length;O+=1)T(C[O]);v=!0}},o(A){for(let O=0;O<u.length;O+=1)F(u[O]);C=C.filter(Boolean);for(let O=0;O<C.length;O+=1)F(C[O]);v=!1},d(A){A&&k(e),A&&k(f),A&&k(c);for(let O=0;O<u.length;O+=1)u[O].d();qn(C,A),M&&M.d(),n[21](null)}}}function HM(n){let e,t,i,o;e=new je({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[zM,({uniqueId:l})=>({24:l}),({uniqueId:l})=>l?16777216:0]},$$scope:{ctx:n}}});let r={};return i=new PM({props:r}),n[22](i),{c(){V(e.$$.fragment),t=$(),V(i.$$.fragment)},m(l,s){H(e,l,s),w(l,t,s),H(i,l,s),o=!0},p(l,[s]){const a={};s&8&&(a.class="form-field form-field-file "+(l[3].required?"required":"")),s&8&&(a.name=l[3].name),s&1090520063&&(a.$$scope={dirty:s,ctx:l}),e.$set(a);const f={};i.$set(f)},i(l){o||(T(e.$$.fragment,l),T(i.$$.fragment,l),o=!0)},o(l){F(e.$$.fragment,l),F(i.$$.fragment,l),o=!1},d(l){q(e,l),l&&k(t),n[22](null),q(i,l)}}}function qM(n,e,t){let i,o,r,{record:l}=e,{value:s=null}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:f=[]}=e,{field:c=new kn}=e,u,d,h;function b(I){B.removeByValue(f,I),t(1,f)}function v(I){B.pushUnique(f,I),t(1,f)}function _(I){B.isEmpty(a[I])||a.splice(I,1),t(0,a)}function y(){h==null||h.dispatchEvent(new CustomEvent("change",{detail:{value:s,uploadedFiles:a,deletedFileIndexes:f},bubbles:!0}))}const S=I=>B.hasImageExtension(I)?d==null?void 0:d.show(Se.Records.getFileUrl(l,I)):!1,C=I=>b(I),x=I=>v(I),M=I=>_(I);function A(I){he[I?"unshift":"push"](()=>{u=I,t(6,u)})}const O=()=>{for(let I of u.files)a.push(I);t(0,a),t(6,u.value=null,u)},D=()=>u==null?void 0:u.click();function E(I){he[I?"unshift":"push"](()=>{h=I,t(8,h)})}function P(I){he[I?"unshift":"push"](()=>{d=I,t(7,d)})}return n.$$set=I=>{"record"in I&&t(2,l=I.record),"value"in I&&t(13,s=I.value),"uploadedFiles"in I&&t(0,a=I.uploadedFiles),"deletedFileIndexes"in I&&t(1,f=I.deletedFileIndexes),"field"in I&&t(3,c=I.field)},n.$$.update=()=>{var I,R;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=B.toArray(a))),n.$$.dirty&2&&(Array.isArray(f)||t(1,f=B.toArray(f))),n.$$.dirty&8&&t(5,i=((I=c.options)==null?void 0:I.maxSelect)>1),n.$$.dirty&8224&&(typeof s=="undefined"||s===null)&&t(13,s=i?[]:null),n.$$.dirty&8192&&t(4,o=B.toArray(s)),n.$$.dirty&27&&t(9,r=(o.length||a.length)&&((R=c.options)==null?void 0:R.maxSelect)<=o.length+a.length-f.length),n.$$.dirty&3&&(a!==-1||f!==-1)&&y()},[a,f,l,c,o,i,u,d,h,r,b,v,_,s,S,C,x,M,A,O,D,E,P]}class VM extends Ie{constructor(e){super(),Le(this,e,qM,HM,Ee,{record:2,value:13,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function vm(n){let e,t;return{c(){e=g("small"),t=j(n[1]),p(e,"class","block txt-hint txt-ellipsis")},m(i,o){w(i,e,o),m(e,t)},p(i,o){o&2&&ge(t,i[1])},d(i){i&&k(e)}}}function BM(n){let e,t,i,o,r,l=n[0].id+"",s,a,f,c,u=n[1]!==""&&n[1]!==n[0].id&&vm(n);return{c(){e=g("i"),i=$(),o=g("div"),r=g("div"),s=j(l),a=$(),u&&u.c(),p(e,"class","ri-information-line link-hint"),p(r,"class","block txt-ellipsis"),p(o,"class","content svelte-1gjwqyd")},m(d,h){w(d,e,h),w(d,i,h),w(d,o,h),m(o,r),m(r,s),m(o,a),u&&u.m(o,null),f||(c=Xe(t=St.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),f=!0)},p(d,[h]){t&&Yn(t.update)&&h&1&&t.update.call(null,{text:JSON.stringify(d[0],null,2),position:"left",class:"code"}),h&1&&l!==(l=d[0].id+"")&&ge(s,l),d[1]!==""&&d[1]!==d[0].id?u?u.p(d,h):(u=vm(d),u.c(),u.m(o,null)):u&&(u.d(1),u=null)},i:le,o:le,d(d){d&&k(e),d&&k(i),d&&k(o),u&&u.d(),f=!1,c()}}}function UM(n,e,t){let i;const o=["id","created","updated","@collectionId","@collectionName"];let{item:r={}}=e;function l(s){s=s||{};const a=["name","title","label","key","email","heading","content",...Object.keys(s)];for(const f of a)if(typeof s[f]=="string"&&!B.isEmpty(s[f])&&!o.includes(f))return f+": "+s[f];return""}return n.$$set=s=>{"item"in s&&t(0,r=s.item)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=l(r))},[r,i]}class WM extends Ie{constructor(e){super(),Le(this,e,UM,BM,Ee,{item:0})}}function ym(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<span class="txt">Load more</span>',p(e,"type","button"),p(e,"class","btn btn-block btn-sm"),ne(e,"btn-loading",n[6]),ne(e,"btn-disabled",n[6])},m(o,r){w(o,e,r),t||(i=X(e,"click",Vn(n[14])),t=!0)},p(o,r){r&64&&ne(e,"btn-loading",o[6]),r&64&&ne(e,"btn-disabled",o[6])},d(o){o&&k(e),t=!1,i()}}}function YM(n){let e,t=n[7]&&ym(n);return{c(){t&&t.c(),e=lt()},m(i,o){t&&t.m(i,o),w(i,e,o)},p(i,o){i[7]?t?t.p(i,o):(t=ym(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function GM(n){let e,t,i,o;const r=[{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 l(f){n[15](f)}function s(f){n[16](f)}let a={$$slots:{afterOptions:[YM]},$$scope:{ctx:n}};for(let f=0;f<r.length;f+=1)a=ut(a,r[f]);return n[1]!==void 0&&(a.keyOfSelected=n[1]),n[0]!==void 0&&(a.selected=n[0]),e=new yo({props:a}),he.push(()=>Fe(e,"keyOfSelected",l)),he.push(()=>Fe(e,"selected",s)),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){V(e.$$.fragment)},m(f,c){H(e,f,c),o=!0},p(f,[c]){const u=c&1340?bn(r,[c&264&&{selectPlaceholder:f[8]?"Loading...":f[3]},c&32&&{items:f[5]},c&32&&{searchable:f[5].length>5},r[3],c&16&&{labelComponent:f[4]},c&16&&{optionComponent:f[4]},c&4&&{multiple:f[2]},r[7],c&1024&&pi(f[10])]):{};c&4194496&&(u.$$scope={dirty:c,ctx:f}),!t&&c&2&&(t=!0,u.keyOfSelected=f[1],Re(()=>t=!1)),!i&&c&1&&(i=!0,u.selected=f[0],Re(()=>i=!1)),e.$set(u)},i(f){o||(T(e.$$.fragment,f),o=!0)},o(f){F(e.$$.fragment,f),o=!1},d(f){q(e,f)}}}function KM(n,e,t){let i,o;const r=["multiple","selected","keyOfSelected","selectPlaceholder","optionComponent","collectionId"];let l=Wt(e,r);const s="select_"+B.randomString(5);let{multiple:a=!1}=e,{selected:f=a?[]:void 0}=e,{keyOfSelected:c=a?[]:void 0}=e,{selectPlaceholder:u="- Select -"}=e,{optionComponent:d=WM}=e,{collectionId:h}=e,b=[],v=1,_=0,y=!1,S=!1;C();async function C(){const P=B.toArray(c);if(!(!h||!P.length)){t(13,S=!0);try{const I=[];for(const R of P)I.push(`id="${R}"`);t(0,f=await Se.Records.getFullList(h,200,{sort:"-created",filter:I.join("||"),$cancelKey:s+"loadSelected"})),t(5,b=B.filterDuplicatesByKey(b.concat(f)))}catch(I){Se.errorResponseHandler(I)}t(13,S=!1)}}async function x(P=!1){if(!!h){t(6,y=!0);try{const I=P?1:v+1,R=await Se.Records.getList(h,I,200,{sort:"-created",$cancelKey:s+"loadList"});P&&t(5,b=[]),t(5,b=B.filterDuplicatesByKey(b.concat(R.items))),v=R.page,t(12,_=R.totalItems)}catch(I){Se.errorResponseHandler(I)}t(6,y=!1)}}const M=()=>x();function A(P){c=P,t(1,c)}function O(P){f=P,t(0,f)}function D(P){ft.call(this,n,P)}function E(P){ft.call(this,n,P)}return n.$$set=P=>{e=ut(ut({},e),ui(P)),t(10,l=Wt(e,r)),"multiple"in P&&t(2,a=P.multiple),"selected"in P&&t(0,f=P.selected),"keyOfSelected"in P&&t(1,c=P.keyOfSelected),"selectPlaceholder"in P&&t(3,u=P.selectPlaceholder),"optionComponent"in P&&t(4,d=P.optionComponent),"collectionId"in P&&t(11,h=P.collectionId)},n.$$.update=()=>{n.$$.dirty&2048&&h&&x(),n.$$.dirty&8256&&t(8,i=y||S),n.$$.dirty&4128&&t(7,o=_>b.length)},[f,c,a,u,d,b,y,o,i,x,l,h,_,S,M,A,O,D,E]}class JM extends Ie{constructor(e){super(),Le(this,e,KM,GM,Ee,{multiple:2,selected:0,keyOfSelected:1,selectPlaceholder:3,optionComponent:4,collectionId:11})}}function km(n){let e,t,i=n[1].options.maxSelect+"",o,r;return{c(){e=g("div"),t=j("Select up to "),o=j(i),r=j(" items."),p(e,"class","help-block")},m(l,s){w(l,e,s),m(e,t),m(e,o),m(e,r)},p(l,s){s&2&&i!==(i=l[1].options.maxSelect+"")&&ge(o,i)},d(l){l&&k(e)}}}function ZM(n){var S,C;let e,t,i,o,r,l=n[1].name+"",s,a,f,c,u,d,h,b;function v(x){n[3](x)}let _={toggle:!0,id:n[4],multiple:n[2],collectionId:(S=n[1].options)==null?void 0:S.collectionId};n[0]!==void 0&&(_.keyOfSelected=n[0]),c=new JM({props:_}),he.push(()=>Fe(c,"keyOfSelected",v));let y=((C=n[1].options)==null?void 0:C.maxSelect)>1&&km(n);return{c(){e=g("label"),t=g("i"),o=$(),r=g("span"),s=j(l),f=$(),V(c.$$.fragment),d=$(),y&&y.c(),h=lt(),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(r,"class","txt"),p(e,"for",a=n[4])},m(x,M){w(x,e,M),m(e,t),m(e,o),m(e,r),m(r,s),w(x,f,M),H(c,x,M),w(x,d,M),y&&y.m(x,M),w(x,h,M),b=!0},p(x,M){var O,D;(!b||M&2&&i!==(i=B.getFieldTypeIcon(x[1].type)))&&p(t,"class",i),(!b||M&2)&&l!==(l=x[1].name+"")&&ge(s,l),(!b||M&16&&a!==(a=x[4]))&&p(e,"for",a);const A={};M&16&&(A.id=x[4]),M&4&&(A.multiple=x[2]),M&2&&(A.collectionId=(O=x[1].options)==null?void 0:O.collectionId),!u&&M&1&&(u=!0,A.keyOfSelected=x[0],Re(()=>u=!1)),c.$set(A),((D=x[1].options)==null?void 0:D.maxSelect)>1?y?y.p(x,M):(y=km(x),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i(x){b||(T(c.$$.fragment,x),b=!0)},o(x){F(c.$$.fragment,x),b=!1},d(x){x&&k(e),x&&k(f),q(c,x),x&&k(d),y&&y.d(x),x&&k(h)}}}function XM(n){let e,t;return e=new je({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[ZM,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,[o]){const r={};o&2&&(r.class="form-field "+(i[1].required?"required":"")),o&2&&(r.name=i[1].name),o&55&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function QM(n,e,t){let i,{field:o=new kn}=e,{value:r=void 0}=e;function l(s){r=s,t(0,r),t(2,i),t(1,o)}return n.$$set=s=>{"field"in s&&t(1,o=s.field),"value"in s&&t(0,r=s.value)},n.$$.update=()=>{var s;n.$$.dirty&2&&t(2,i=((s=o.options)==null?void 0:s.maxSelect)>1),n.$$.dirty&7&&i&&Array.isArray(r)&&r.length>o.options.maxSelect&&t(0,r=r.slice(o.options.maxSelect-1))},[r,o,i,l]}class e$ extends Ie{constructor(e){super(),Le(this,e,QM,XM,Ee,{field:1,value:0})}}function t$(n){let e,t,i,o,r,l=n[0].id+"",s,a,f,c=n[0].email+"",u,d,h;return{c(){e=g("i"),i=$(),o=g("div"),r=g("div"),s=j(l),a=$(),f=g("small"),u=j(c),p(e,"class","ri-information-line link-hint"),p(r,"class","block txt-ellipsis"),p(f,"class","block txt-hint txt-ellipsis"),p(o,"class","content")},m(b,v){w(b,e,v),w(b,i,v),w(b,o,v),m(o,r),m(r,s),m(o,a),m(o,f),m(f,u),d||(h=Xe(t=St.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),d=!0)},p(b,[v]){t&&Yn(t.update)&&v&1&&t.update.call(null,{text:JSON.stringify(b[0],null,2),position:"left",class:"code"}),v&1&&l!==(l=b[0].id+"")&&ge(s,l),v&1&&c!==(c=b[0].email+"")&&ge(u,c)},i:le,o:le,d(b){b&&k(e),b&&k(i),b&&k(o),d=!1,h()}}}function n$(n,e,t){let{item:i={}}=e;return n.$$set=o=>{"item"in o&&t(0,i=o.item)},[i]}class bf extends Ie{constructor(e){super(),Le(this,e,n$,t$,Ee,{item:0})}}function wm(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<span class="txt">Load more</span>',p(e,"type","button"),p(e,"class","btn btn-block btn-sm"),ne(e,"btn-loading",n[6]),ne(e,"btn-disabled",n[6])},m(o,r){w(o,e,r),t||(i=X(e,"click",Vn(n[13])),t=!0)},p(o,r){r&64&&ne(e,"btn-loading",o[6]),r&64&&ne(e,"btn-disabled",o[6])},d(o){o&&k(e),t=!1,i()}}}function i$(n){let e,t=n[7]&&wm(n);return{c(){t&&t.c(),e=lt()},m(i,o){t&&t.m(i,o),w(i,e,o)},p(i,o){i[7]?t?t.p(i,o):(t=wm(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function o$(n){let e,t,i,o;const r=[{selectPlaceholder:n[8]?"Loading...":n[3]},{items:n[5]},{searchable:n[5].length>5},{selectionKey:"id"},{labelComponent:bf},{optionComponent:n[4]},{multiple:n[2]},{class:"users-select block-options"},n[10]];function l(f){n[14](f)}function s(f){n[15](f)}let a={$$slots:{afterOptions:[i$]},$$scope:{ctx:n}};for(let f=0;f<r.length;f+=1)a=ut(a,r[f]);return n[1]!==void 0&&(a.keyOfSelected=n[1]),n[0]!==void 0&&(a.selected=n[0]),e=new yo({props:a}),he.push(()=>Fe(e,"keyOfSelected",l)),he.push(()=>Fe(e,"selected",s)),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){V(e.$$.fragment)},m(f,c){H(e,f,c),o=!0},p(f,[c]){const u=c&1340?bn(r,[c&264&&{selectPlaceholder:f[8]?"Loading...":f[3]},c&32&&{items:f[5]},c&32&&{searchable:f[5].length>5},r[3],c&0&&{labelComponent:bf},c&16&&{optionComponent:f[4]},c&4&&{multiple:f[2]},r[7],c&1024&&pi(f[10])]):{};c&2097344&&(u.$$scope={dirty:c,ctx:f}),!t&&c&2&&(t=!0,u.keyOfSelected=f[1],Re(()=>t=!1)),!i&&c&1&&(i=!0,u.selected=f[0],Re(()=>i=!1)),e.$set(u)},i(f){o||(T(e.$$.fragment,f),o=!0)},o(f){F(e.$$.fragment,f),o=!1},d(f){q(e,f)}}}function r$(n,e,t){let i,o;const r=["multiple","selected","keyOfSelected","selectPlaceholder","optionComponent"];let l=Wt(e,r);const s="select_"+B.randomString(5);let{multiple:a=!1}=e,{selected:f=a?[]:void 0}=e,{keyOfSelected:c=a?[]:void 0}=e,{selectPlaceholder:u="- Select -"}=e,{optionComponent:d=bf}=e,h=[],b=1,v=0,_=!1,y=!1;C(),S();async function S(){const E=B.toArray(c);if(!!E.length){t(12,y=!0);try{const P=[];for(const I of E)P.push(`id="${I}"`);t(0,f=await Se.Users.getFullList(100,{sort:"-created",filter:P.join("||"),$cancelKey:s+"loadSelected"})),t(5,h=B.filterDuplicatesByKey(h.concat(f)))}catch(P){Se.errorResponseHandler(P)}t(12,y=!1)}}async function C(E=!1){t(6,_=!0);try{const P=E?1:b+1,I=await Se.Users.getList(P,200,{sort:"-created",$cancelKey:s+"loadList"});E&&t(5,h=[]),t(5,h=B.filterDuplicatesByKey(h.concat(I.items))),b=I.page,t(11,v=I.totalItems)}catch(P){Se.errorResponseHandler(P)}t(6,_=!1)}const x=()=>C();function M(E){c=E,t(1,c)}function A(E){f=E,t(0,f)}function O(E){ft.call(this,n,E)}function D(E){ft.call(this,n,E)}return n.$$set=E=>{e=ut(ut({},e),ui(E)),t(10,l=Wt(e,r)),"multiple"in E&&t(2,a=E.multiple),"selected"in E&&t(0,f=E.selected),"keyOfSelected"in E&&t(1,c=E.keyOfSelected),"selectPlaceholder"in E&&t(3,u=E.selectPlaceholder),"optionComponent"in E&&t(4,d=E.optionComponent)},n.$$.update=()=>{n.$$.dirty&4160&&t(8,i=_||y),n.$$.dirty&2080&&t(7,o=v>h.length)},[f,c,a,u,d,h,_,o,i,C,l,v,y,x,M,A,O,D]}class l$ extends Ie{constructor(e){super(),Le(this,e,r$,o$,Ee,{multiple:2,selected:0,keyOfSelected:1,selectPlaceholder:3,optionComponent:4})}}function Sm(n){let e,t,i=n[1].options.maxSelect+"",o,r;return{c(){e=g("div"),t=j("Select up to "),o=j(i),r=j(" users."),p(e,"class","help-block")},m(l,s){w(l,e,s),m(e,t),m(e,o),m(e,r)},p(l,s){s&2&&i!==(i=l[1].options.maxSelect+"")&&ge(o,i)},d(l){l&&k(e)}}}function s$(n){var S;let e,t,i,o,r,l=n[1].name+"",s,a,f,c,u,d,h,b;function v(C){n[4](C)}let _={toggle:!0,id:n[5],multiple:n[2],disabled:n[3]};n[0]!==void 0&&(_.keyOfSelected=n[0]),c=new l$({props:_}),he.push(()=>Fe(c,"keyOfSelected",v));let y=((S=n[1].options)==null?void 0:S.maxSelect)>1&&Sm(n);return{c(){e=g("label"),t=g("i"),o=$(),r=g("span"),s=j(l),f=$(),V(c.$$.fragment),d=$(),y&&y.c(),h=lt(),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(r,"class","txt"),p(e,"for",a=n[5])},m(C,x){w(C,e,x),m(e,t),m(e,o),m(e,r),m(r,s),w(C,f,x),H(c,C,x),w(C,d,x),y&&y.m(C,x),w(C,h,x),b=!0},p(C,x){var A;(!b||x&2&&i!==(i=B.getFieldTypeIcon(C[1].type)))&&p(t,"class",i),(!b||x&2)&&l!==(l=C[1].name+"")&&ge(s,l),(!b||x&32&&a!==(a=C[5]))&&p(e,"for",a);const M={};x&32&&(M.id=C[5]),x&4&&(M.multiple=C[2]),x&8&&(M.disabled=C[3]),!u&&x&1&&(u=!0,M.keyOfSelected=C[0],Re(()=>u=!1)),c.$set(M),((A=C[1].options)==null?void 0:A.maxSelect)>1?y?y.p(C,x):(y=Sm(C),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i(C){b||(T(c.$$.fragment,C),b=!0)},o(C){F(c.$$.fragment,C),b=!1},d(C){C&&k(e),C&&k(f),q(c,C),C&&k(d),y&&y.d(C),C&&k(h)}}}function a$(n){let e,t;return e=new je({props:{class:"form-field "+(n[1].required?"required":"")+" "+(n[3]?"disabled":""),name:n[1].name,$$slots:{default:[s$,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,[o]){const r={};o&10&&(r.class="form-field "+(i[1].required?"required":"")+" "+(i[3]?"disabled":"")),o&2&&(r.name=i[1].name),o&111&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function f$(n,e,t){let i,o,{field:r=new kn}=e,{value:l=void 0}=e;function s(a){l=a,t(0,l),t(2,o),t(1,r)}return n.$$set=a=>{"field"in a&&t(1,r=a.field),"value"in a&&t(0,l=a.value)},n.$$.update=()=>{var a;n.$$.dirty&2&&t(2,o=((a=r.options)==null?void 0:a.maxSelect)>1),n.$$.dirty&7&&o&&Array.isArray(l)&&l.length>r.options.maxSelect&&t(0,l=l.slice(r.options.maxSelect-1)),n.$$.dirty&3&&t(3,i=!B.isEmpty(l)&&r.system)},[l,r,o,i,s]}class c$ extends Ie{constructor(e){super(),Le(this,e,f$,a$,Ee,{field:1,value:0})}}function Cm(n,e,t){const i=n.slice();return i[40]=e[t],i[41]=e,i[42]=t,i}function xm(n){let e,t;return e=new je({props:{class:"form-field disabled",name:"id",$$slots:{default:[u$,({uniqueId:i})=>({43:i}),({uniqueId:i})=>[0,i?4096:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,o){const r={};o[0]&4|o[1]&12288&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function u$(n){let e,t,i,o,r,l,s,a,f,c,u;return{c(){e=g("label"),t=g("i"),i=$(),o=g("span"),o.textContent="id",r=$(),l=g("span"),a=$(),f=g("input"),p(t,"class",B.getFieldTypeIcon("primary")),p(o,"class","txt"),p(l,"class","flex-fill"),p(e,"for",s=n[43]),p(f,"type","text"),p(f,"id",c=n[43]),f.value=u=n[2].id,f.disabled=!0},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,o),m(e,r),m(e,l),w(d,a,h),w(d,f,h)},p(d,h){h[1]&4096&&s!==(s=d[43])&&p(e,"for",s),h[1]&4096&&c!==(c=d[43])&&p(f,"id",c),h[0]&4&&u!==(u=d[2].id)&&f.value!==u&&(f.value=u)},d(d){d&&k(e),d&&k(a),d&&k(f)}}}function Mm(n){let e;return{c(){e=g("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:le,d(t){t&&k(e)}}}function d$(n){let e,t,i;function o(l){n[31](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new c$({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function p$(n){let e,t,i;function o(l){n[30](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new e$({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function h$(n){let e,t,i,o,r;function l(c){n[27](c,n[40])}function s(c){n[28](c,n[40])}function a(c){n[29](c,n[40])}let f={field:n[40],record:n[2]};return n[2][n[40].name]!==void 0&&(f.value=n[2][n[40].name]),n[3][n[40].name]!==void 0&&(f.uploadedFiles=n[3][n[40].name]),n[4][n[40].name]!==void 0&&(f.deletedFileIndexes=n[4][n[40].name]),e=new VM({props:f}),he.push(()=>Fe(e,"value",l)),he.push(()=>Fe(e,"uploadedFiles",s)),he.push(()=>Fe(e,"deletedFileIndexes",a)),{c(){V(e.$$.fragment)},m(c,u){H(e,c,u),r=!0},p(c,u){n=c;const d={};u[0]&1&&(d.field=n[40]),u[0]&4&&(d.record=n[2]),!t&&u[0]&5&&(t=!0,d.value=n[2][n[40].name],Re(()=>t=!1)),!i&&u[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],Re(()=>i=!1)),!o&&u[0]&17&&(o=!0,d.deletedFileIndexes=n[4][n[40].name],Re(()=>o=!1)),e.$set(d)},i(c){r||(T(e.$$.fragment,c),r=!0)},o(c){F(e.$$.fragment,c),r=!1},d(c){q(e,c)}}}function m$(n){let e,t,i;function o(l){n[26](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new SM({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function b$(n){let e,t,i;function o(l){n[25](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new vM({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function g$(n){let e,t,i;function o(l){n[24](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new mM({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function _$(n){let e,t,i;function o(l){n[23](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new uM({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function v$(n){let e,t,i;function o(l){n[22](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new sM({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function y$(n){let e,t,i;function o(l){n[21](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new iM({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function k$(n){let e,t,i;function o(l){n[20](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new Q6({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function w$(n){let e,t,i;function o(l){n[19](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new K6({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function $m(n,e){let t,i,o,r,l;const s=[w$,k$,y$,v$,_$,g$,b$,m$,h$,p$,d$],a=[];function f(c,u){return c[40].type==="text"?0:c[40].type==="number"?1:c[40].type==="bool"?2:c[40].type==="email"?3:c[40].type==="url"?4:c[40].type==="date"?5:c[40].type==="select"?6:c[40].type==="json"?7:c[40].type==="file"?8:c[40].type==="relation"?9:c[40].type==="user"?10:-1}return~(i=f(e))&&(o=a[i]=s[i](e)),{key:n,first:null,c(){t=lt(),o&&o.c(),r=lt(),this.first=t},m(c,u){w(c,t,u),~i&&a[i].m(c,u),w(c,r,u),l=!0},p(c,u){e=c;let d=i;i=f(e),i===d?~i&&a[i].p(e,u):(o&&(Ae(),F(a[d],1,1,()=>{a[d]=null}),De()),~i?(o=a[i],o?o.p(e,u):(o=a[i]=s[i](e),o.c()),T(o,1),o.m(r.parentNode,r)):o=null)},i(c){l||(T(o),l=!0)},o(c){F(o),l=!1},d(c){c&&k(t),~i&&a[i].d(c),c&&k(r)}}}function S$(n){var d;let e,t,i=[],o=new Map,r,l,s,a=!n[2].isNew&&xm(n),f=((d=n[0])==null?void 0:d.schema)||[];const c=h=>h[40].name;for(let h=0;h<f.length;h+=1){let b=Cm(n,f,h),v=c(b);o.set(v,i[h]=$m(v,b))}let u=null;return f.length||(u=Mm()),{c(){e=g("form"),a&&a.c(),t=$();for(let h=0;h<i.length;h+=1)i[h].c();u&&u.c(),p(e,"id",n[11]),p(e,"class","block")},m(h,b){w(h,e,b),a&&a.m(e,null),m(e,t);for(let v=0;v<i.length;v+=1)i[v].m(e,null);u&&u.m(e,null),r=!0,l||(s=X(e,"submit",Gt(n[12])),l=!0)},p(h,b){var v;h[2].isNew?a&&(Ae(),F(a,1,1,()=>{a=null}),De()):a?(a.p(h,b),b[0]&4&&T(a,1)):(a=xm(h),a.c(),T(a,1),a.m(e,t)),b[0]&29&&(f=((v=h[0])==null?void 0:v.schema)||[],Ae(),i=st(i,b,c,1,h,f,o,e,Pt,$m,null,Cm),De(),!f.length&&u?u.p(h,b):f.length?u&&(u.d(1),u=null):(u=Mm(),u.c(),u.m(e,null)))},i(h){if(!r){T(a);for(let b=0;b<f.length;b+=1)T(i[b]);r=!0}},o(h){F(a);for(let b=0;b<i.length;b+=1)F(i[b]);r=!1},d(h){h&&k(e),a&&a.d();for(let b=0;b<i.length;b+=1)i[b].d();u&&u.d(),l=!1,s()}}}function Am(n){let e,t,i,o,r,l,s,a;return s=new vo({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[C$]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=$(),i=g("button"),o=g("div"),r=g("i"),l=$(),V(s.$$.fragment),p(e,"class","flex-fill"),p(r,"class","ri-more-line"),p(o,"class","content"),p(i,"type","button"),p(i,"class","btn btn-sm btn-circle btn-secondary")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),m(i,o),m(o,r),m(o,l),H(s,o,null),a=!0},p(f,c){const u={};c[1]&8192&&(u.$$scope={dirty:c,ctx:f}),s.$set(u)},i(f){a||(T(s.$$.fragment,f),a=!0)},o(f){F(s.$$.fragment,f),a=!1},d(f){f&&k(e),f&&k(t),f&&k(i),q(s)}}}function C$(n){let e,t,i;return{c(){e=g("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(o,r){w(o,e,r),t||(i=X(e,"click",n[18]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function x$(n){let e,t=n[2].isNew?"New":"Edit",i,o,r=n[0].name+"",l,s,a,f,c,u=!n[2].isNew&&n[9]&&Am(n);return{c(){e=g("h4"),i=j(t),o=$(),l=j(r),s=j(" record"),a=$(),u&&u.c(),f=lt()},m(d,h){w(d,e,h),m(e,i),m(e,o),m(e,l),m(e,s),w(d,a,h),u&&u.m(d,h),w(d,f,h),c=!0},p(d,h){(!c||h[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&ge(i,t),(!c||h[0]&1)&&r!==(r=d[0].name+"")&&ge(l,r),!d[2].isNew&&d[9]?u?(u.p(d,h),h[0]&516&&T(u,1)):(u=Am(d),u.c(),T(u,1),u.m(f.parentNode,f)):u&&(Ae(),F(u,1,1,()=>{u=null}),De())},i(d){c||(T(u),c=!0)},o(d){F(u),c=!1},d(d){d&&k(e),d&&k(a),u&&u.d(d),d&&k(f)}}}function M$(n){let e,t,i,o,r,l=n[2].isNew?"Create":"Save changes",s,a,f,c;return{c(){e=g("button"),t=g("span"),t.textContent="Cancel",i=$(),o=g("button"),r=g("span"),s=j(l),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(r,"class","txt"),p(o,"type","submit"),p(o,"form",n[11]),p(o,"class","btn btn-expanded"),o.disabled=a=!n[10]||n[7],ne(o,"btn-loading",n[7])},m(u,d){w(u,e,d),m(e,t),w(u,i,d),w(u,o,d),m(o,r),m(r,s),f||(c=X(e,"click",n[17]),f=!0)},p(u,d){d[0]&128&&(e.disabled=u[7]),d[0]&4&&l!==(l=u[2].isNew?"Create":"Save changes")&&ge(s,l),d[0]&1152&&a!==(a=!u[10]||u[7])&&(o.disabled=a),d[0]&128&&ne(o,"btn-loading",u[7])},d(u){u&&k(e),u&&k(i),u&&k(o),f=!1,c()}}}function $$(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[M$],header:[x$],default:[S$]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,r){const l={};r[0]&288&&(l.beforeHide=o[32]),r[0]&1693|r[1]&8192&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[33](null),q(e,o)}}}function Dm(n){return JSON.stringify(n)}function A$(n,e,t){let i,o,r,l;const s=yn(),a="record_"+B.randomString(5);let{collection:f}=e,c,u=null,d=new Ql,h=!1,b=!1,v={},_={},y="";function S(fe){return x(fe),t(8,b=!0),c==null?void 0:c.show()}function C(){return c==null?void 0:c.hide()}function x(fe){Ui({}),u=fe||{},t(2,d=fe!=null&&fe.clone?fe.clone():new Ql),t(3,v={}),t(4,_={}),t(15,y=Dm(d))}function M(){if(h||!o)return;t(7,h=!0);const fe=O();let ie;d.isNew?ie=Se.Records.create(f==null?void 0:f.id,fe):ie=Se.Records.update(f==null?void 0:f.id,d.id,fe),ie.then(async ye=>{hn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,b=!1),C(),s("save",ye)}).catch(ye=>{Se.errorResponseHandler(ye)}).finally(()=>{t(7,h=!1)})}function A(){!(u!=null&&u.id)||xi("Do you really want to delete the selected record?",()=>Se.Records.delete(u["@collectionId"],u.id).then(()=>{C(),hn("Successfully deleted record."),s("delete",u)}).catch(fe=>{Se.errorResponseHandler(fe)}))}function O(){const fe=(d==null?void 0:d.export())||{},ie=new FormData,ye={};for(const Ne of(f==null?void 0:f.schema)||[])ye[Ne.name]=Ne;for(const Ne in fe)!ye[Ne]||(typeof fe[Ne]=="undefined"&&(fe[Ne]=null),B.addValueToFormData(ie,Ne,fe[Ne]));for(const Ne in v){const Pe=B.toArray(v[Ne]);for(const ze of Pe)ie.append(Ne,ze)}for(const Ne in _){const Pe=B.toArray(_[Ne]);for(const ze of Pe)ie.append(Ne+"."+ze,"")}return ie}const D=()=>C(),E=()=>A();function P(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function I(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function R(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function G(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function U(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function z(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function K(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function Y(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function W(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function te(fe,ie){n.$$.not_equal(v[ie.name],fe)&&(v[ie.name]=fe,t(3,v))}function ce(fe,ie){n.$$.not_equal(_[ie.name],fe)&&(_[ie.name]=fe,t(4,_))}function ve(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function oe(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}const J=()=>o&&b?(xi("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,b=!1),C()}),!1):!0;function $e(fe){he[fe?"unshift":"push"](()=>{c=fe,t(6,c)})}function ee(fe){ft.call(this,n,fe)}function _e(fe){ft.call(this,n,fe)}return n.$$set=fe=>{"collection"in fe&&t(0,f=fe.collection)},n.$$.update=()=>{n.$$.dirty[0]&24&&t(16,i=B.hasNonEmptyProps(v)||B.hasNonEmptyProps(_)),n.$$.dirty[0]&98308&&t(5,o=i||y!=Dm(d)),n.$$.dirty[0]&36&&t(10,r=d.isNew||o),n.$$.dirty[0]&1&&t(9,l=(f==null?void 0:f.name)!=="profiles")},[f,C,d,v,_,o,c,h,b,l,r,a,M,A,S,y,i,D,E,P,I,R,G,U,z,K,Y,W,te,ce,ve,oe,J,$e,ee,_e]}class F1 extends Ie{constructor(e){super(),Le(this,e,A$,$$,Ee,{collection:0,show:14,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[1]}}function D$(n){let e;return{c(){e=g("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function O$(n){let e,t;return{c(){e=g("span"),t=j(n[1]),p(e,"class","label txt-base txt-mono"),p(e,"title",n[0])},m(i,o){w(i,e,o),m(e,t)},p(i,o){o&2&&ge(t,i[1]),o&1&&p(e,"title",i[0])},d(i){i&&k(e)}}}function T$(n){let e;function t(r,l){return r[0]?O$:D$}let i=t(n),o=i(n);return{c(){o.c(),e=lt()},m(r,l){o.m(r,l),w(r,e,l)},p(r,[l]){i===(i=t(r))&&o?o.p(r,l):(o.d(1),o=i(r),o&&(o.c(),o.m(e.parentNode,e)))},i:le,o:le,d(r){o.d(r),r&&k(e)}}}function E$(n,e,t){let{id:i=""}=e,o=i;return n.$$set=r=>{"id"in r&&t(0,i=r.id)},n.$$.update=()=>{n.$$.dirty&1&&typeof i=="string"&&i.length>27&&t(1,o=i.substring(0,5)+"..."+i.substring(i.length-10))},[i,o]}class Ls extends Ie{constructor(e){super(),Le(this,e,E$,T$,Ee,{id:0})}}function Om(n,e,t){const i=n.slice();return i[8]=e[t],i}function Tm(n,e,t){const i=n.slice();return i[3]=e[t],i}function Em(n,e,t){const i=n.slice();return i[3]=e[t],i}function P$(n){let e,t=n[0][n[1].name]+"",i,o;return{c(){e=g("span"),i=j(t),p(e,"class","txt txt-ellipsis"),p(e,"title",o=n[0][n[1].name])},m(r,l){w(r,e,l),m(e,i)},p(r,l){l&3&&t!==(t=r[0][r[1].name]+"")&&ge(i,t),l&3&&o!==(o=r[0][r[1].name])&&p(e,"title",o)},i:le,o:le,d(r){r&&k(e)}}}function F$(n){let e,t,i=B.toArray(n[0][n[1].name]),o=[];for(let l=0;l<i.length;l+=1)o[l]=Pm(Om(n,i,l));const r=l=>F(o[l],1,1,()=>{o[l]=null});return{c(){e=g("div");for(let l=0;l<o.length;l+=1)o[l].c();p(e,"class","inline-flex")},m(l,s){w(l,e,s);for(let a=0;a<o.length;a+=1)o[a].m(e,null);t=!0},p(l,s){if(s&3){i=B.toArray(l[0][l[1].name]);let a;for(a=0;a<i.length;a+=1){const f=Om(l,i,a);o[a]?(o[a].p(f,s),T(o[a],1)):(o[a]=Pm(f),o[a].c(),T(o[a],1),o[a].m(e,null))}for(Ae(),a=i.length;a<o.length;a+=1)r(a);De()}},i(l){if(!t){for(let s=0;s<i.length;s+=1)T(o[s]);t=!0}},o(l){o=o.filter(Boolean);for(let s=0;s<o.length;s+=1)F(o[s]);t=!1},d(l){l&&k(e),qn(o,l)}}}function L$(n){let e,t,i=B.toArray(n[0][n[1].name]),o=[];for(let l=0;l<i.length;l+=1)o[l]=Fm(Tm(n,i,l));const r=l=>F(o[l],1,1,()=>{o[l]=null});return{c(){e=g("div");for(let l=0;l<o.length;l+=1)o[l].c();p(e,"class","inline-flex")},m(l,s){w(l,e,s);for(let a=0;a<o.length;a+=1)o[a].m(e,null);t=!0},p(l,s){if(s&3){i=B.toArray(l[0][l[1].name]);let a;for(a=0;a<i.length;a+=1){const f=Tm(l,i,a);o[a]?(o[a].p(f,s),T(o[a],1)):(o[a]=Fm(f),o[a].c(),T(o[a],1),o[a].m(e,null))}for(Ae(),a=i.length;a<o.length;a+=1)r(a);De()}},i(l){if(!t){for(let s=0;s<i.length;s+=1)T(o[s]);t=!0}},o(l){o=o.filter(Boolean);for(let s=0;s<o.length;s+=1)F(o[s]);t=!1},d(l){l&&k(e),qn(o,l)}}}function I$(n){let e,t=B.toArray(n[0][n[1].name]),i=[];for(let o=0;o<t.length;o+=1)i[o]=Lm(Em(n,t,o));return{c(){e=g("div");for(let o=0;o<i.length;o+=1)i[o].c();p(e,"class","inline-flex")},m(o,r){w(o,e,r);for(let l=0;l<i.length;l+=1)i[l].m(e,null)},p(o,r){if(r&3){t=B.toArray(o[0][o[1].name]);let l;for(l=0;l<t.length;l+=1){const s=Em(o,t,l);i[l]?i[l].p(s,r):(i[l]=Lm(s),i[l].c(),i[l].m(e,null))}for(;l<i.length;l+=1)i[l].d(1);i.length=t.length}},i:le,o:le,d(o){o&&k(e),qn(i,o)}}}function R$(n){let e,t=JSON.stringify(n[0][n[1].name])+"",i;return{c(){e=g("span"),i=j(t),p(e,"class","txt txt-ellipsis")},m(o,r){w(o,e,r),m(e,i)},p(o,r){r&3&&t!==(t=JSON.stringify(o[0][o[1].name])+"")&&ge(i,t)},i:le,o:le,d(o){o&&k(e)}}}function N$(n){let e,t;return e=new Ci({props:{date:n[0][n[1].name]}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,o){const r={};o&3&&(r.date=i[0][i[1].name]),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function j$(n){let e,t=n[0][n[1].name]+"",i,o,r,l;return{c(){e=g("a"),i=j(t),p(e,"class","txt-ellipsis"),p(e,"href",o=n[0][n[1].name]),p(e,"target","_blank"),p(e,"rel","noopener")},m(s,a){w(s,e,a),m(e,i),r||(l=[Xe(St.call(null,e,"Open in new tab")),X(e,"click",Vn(n[2]))],r=!0)},p(s,a){a&3&&t!==(t=s[0][s[1].name]+"")&&ge(i,t),a&3&&o!==(o=s[0][s[1].name])&&p(e,"href",o)},i:le,o:le,d(s){s&&k(e),r=!1,rt(l)}}}function z$(n){let e,t=n[0][n[1].name]?"True":"False",i;return{c(){e=g("span"),i=j(t),p(e,"class","txt")},m(o,r){w(o,e,r),m(e,i)},p(o,r){r&3&&t!==(t=o[0][o[1].name]?"True":"False")&&ge(i,t)},i:le,o:le,d(o){o&&k(e)}}}function H$(n){let e;return{c(){e=g("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function Pm(n){let e,t,i,o,r,l,s;return t=new P1({props:{record:n[0],filename:n[8]}}),{c(){e=g("figure"),V(t.$$.fragment),i=$(),p(e,"class","thumb thumb-sm")},m(a,f){w(a,e,f),H(t,e,null),m(e,i),r=!0,l||(s=Xe(o=St.call(null,e,n[8])),l=!0)},p(a,f){n=a;const c={};f&1&&(c.record=n[0]),f&3&&(c.filename=n[8]),t.$set(c),o&&Yn(o.update)&&f&3&&o.update.call(null,n[8])},i(a){r||(T(t.$$.fragment,a),r=!0)},o(a){F(t.$$.fragment,a),r=!1},d(a){a&&k(e),q(t),l=!1,s()}}}function Fm(n){let e,t;return e=new Ls({props:{id:n[3]}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,o){const r={};o&3&&(r.id=i[3]),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function Lm(n){let e,t=n[3]+"",i;return{c(){e=g("span"),i=j(t),p(e,"class","label")},m(o,r){w(o,e,r),m(e,i)},p(o,r){r&3&&t!==(t=o[3]+"")&&ge(i,t)},d(o){o&&k(e)}}}function q$(n){let e,t,i,o,r,l;const s=[H$,z$,j$,N$,R$,I$,L$,F$,P$],a=[];function f(c,u){return u&3&&(t=null),t==null&&(t=!!B.isEmpty(c[0][c[1].name])),t?0:c[1].type==="bool"?1:c[1].type==="url"?2:c[1].type==="date"?3:c[1].type==="json"?4:c[1].type==="select"?5:c[1].type==="relation"||c[1].type==="user"?6:c[1].type==="file"?7:8}return i=f(n,-1),o=a[i]=s[i](n),{c(){e=g("td"),o.c(),p(e,"class",r="col-type-"+n[1].type+" col-field-"+n[1].name)},m(c,u){w(c,e,u),a[i].m(e,null),l=!0},p(c,[u]){let d=i;i=f(c,u),i===d?a[i].p(c,u):(Ae(),F(a[d],1,1,()=>{a[d]=null}),De(),o=a[i],o?o.p(c,u):(o=a[i]=s[i](c),o.c()),T(o,1),o.m(e,null)),(!l||u&2&&r!==(r="col-type-"+c[1].type+" col-field-"+c[1].name))&&p(e,"class",r)},i(c){l||(T(o),l=!0)},o(c){F(o),l=!1},d(c){c&&k(e),a[i].d()}}}function V$(n,e,t){let{record:i}=e,{field:o}=e;function r(l){ft.call(this,n,l)}return n.$$set=l=>{"record"in l&&t(0,i=l.record),"field"in l&&t(1,o=l.field)},[i,o,r]}class L1 extends Ie{constructor(e){super(),Le(this,e,V$,q$,Ee,{record:0,field:1})}}function Im(n,e,t){const i=n.slice();return i[35]=e[t],i}function Rm(n,e,t){const i=n.slice();return i[38]=e[t],i}function Nm(n,e,t){const i=n.slice();return i[38]=e[t],i}function B$(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function U$(n){let e,t,i,o,r,l=n[38].name+"",s;return{c(){e=g("div"),t=g("i"),o=$(),r=g("span"),s=j(l),p(t,"class",i=B.getFieldTypeIcon(n[38].type)),p(r,"class","txt"),p(e,"class","col-header-content")},m(a,f){w(a,e,f),m(e,t),m(e,o),m(e,r),m(r,s)},p(a,f){f[0]&2048&&i!==(i=B.getFieldTypeIcon(a[38].type))&&p(t,"class",i),f[0]&2048&&l!==(l=a[38].name+"")&&ge(s,l)},d(a){a&&k(e)}}}function jm(n,e){let t,i,o,r;function l(a){e[22](a)}let s={class:"col-type-"+e[38].type+" col-field-"+e[38].name,name:e[38].name,$$slots:{default:[U$]},$$scope:{ctx:e}};return e[0]!==void 0&&(s.sort=e[0]),i=new en({props:s}),he.push(()=>Fe(i,"sort",l)),{key:n,first:null,c(){t=lt(),V(i.$$.fragment),this.first=t},m(a,f){w(a,t,f),H(i,a,f),r=!0},p(a,f){e=a;const c={};f[0]&2048&&(c.class="col-type-"+e[38].type+" col-field-"+e[38].name),f[0]&2048&&(c.name=e[38].name),f[0]&2048|f[1]&4096&&(c.$$scope={dirty:f,ctx:e}),!o&&f[0]&1&&(o=!0,c.sort=e[0],Re(()=>o=!1)),i.$set(c)},i(a){r||(T(i.$$.fragment,a),r=!0)},o(a){F(i.$$.fragment,a),r=!1},d(a){a&&k(t),q(i,a)}}}function W$(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function Y$(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="updated",p(t,"class",B.getFieldTypeIcon("date")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function zm(n){let e;function t(r,l){return r[8]?K$:G$}let i=t(n),o=i(n);return{c(){o.c(),e=lt()},m(r,l){o.m(r,l),w(r,e,l)},p(r,l){i===(i=t(r))&&o?o.p(r,l):(o.d(1),o=i(r),o&&(o.c(),o.m(e.parentNode,e)))},d(r){o.d(r),r&&k(e)}}}function G$(n){var s;let e,t,i,o,r,l=((s=n[1])==null?void 0:s.length)&&Hm(n);return{c(){e=g("tr"),t=g("td"),i=g("h6"),i.textContent="No records found.",o=$(),l&&l.c(),r=$(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),m(e,t),m(t,i),m(t,o),l&&l.m(t,null),m(e,r)},p(a,f){var c;(c=a[1])!=null&&c.length?l?l.p(a,f):(l=Hm(a),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},d(a){a&&k(e),l&&l.d()}}}function K$(n){let e;return{c(){e=g("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Hm(n){let e,t,i;return{c(){e=g("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(o,r){w(o,e,r),t||(i=X(e,"click",n[28]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function qm(n,e){let t,i,o;return i=new L1({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=lt(),V(i.$$.fragment),this.first=t},m(r,l){w(r,t,l),H(i,r,l),o=!0},p(r,l){e=r;const s={};l[0]&8&&(s.record=e[35]),l[0]&2048&&(s.field=e[38]),i.$set(s)},i(r){o||(T(i.$$.fragment,r),o=!0)},o(r){F(i.$$.fragment,r),o=!1},d(r){r&&k(t),q(i,r)}}}function Vm(n,e){let t,i,o,r,l,s,a,f,c,u,d,h,b,v=[],_=new Map,y,S,C,x,M,A,O,D,E,P,I,R;function G(){return e[25](e[35])}h=new Ls({props:{id:e[35].id}});let U=e[11];const z=W=>W[38].name;for(let W=0;W<U.length;W+=1){let te=Rm(e,U,W),ce=z(te);_.set(ce,v[W]=qm(ce,te))}C=new Ci({props:{date:e[35].created}}),A=new Ci({props:{date:e[35].updated}});function K(){return e[26](e[35])}function Y(...W){return e[27](e[35],...W)}return{key:n,first:null,c(){t=g("tr"),i=g("td"),o=g("div"),r=g("input"),a=$(),f=g("label"),u=$(),d=g("td"),V(h.$$.fragment),b=$();for(let W=0;W<v.length;W+=1)v[W].c();y=$(),S=g("td"),V(C.$$.fragment),x=$(),M=g("td"),V(A.$$.fragment),O=$(),D=g("td"),D.innerHTML='<i class="ri-arrow-right-line"></i>',E=$(),p(r,"type","checkbox"),p(r,"id",l="checkbox_"+e[35].id),r.checked=s=e[5][e[35].id],p(f,"for",c="checkbox_"+e[35].id),p(o,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-id"),p(S,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(D,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(W,te){w(W,t,te),m(t,i),m(i,o),m(o,r),m(o,a),m(o,f),m(t,u),m(t,d),H(h,d,null),m(t,b);for(let ce=0;ce<v.length;ce+=1)v[ce].m(t,null);m(t,y),m(t,S),H(C,S,null),m(t,x),m(t,M),H(A,M,null),m(t,O),m(t,D),m(t,E),P=!0,I||(R=[X(r,"change",G),X(o,"click",Vn(e[19])),X(t,"click",K),X(t,"keydown",Y)],I=!0)},p(W,te){e=W,(!P||te[0]&8&&l!==(l="checkbox_"+e[35].id))&&p(r,"id",l),(!P||te[0]&40&&s!==(s=e[5][e[35].id]))&&(r.checked=s),(!P||te[0]&8&&c!==(c="checkbox_"+e[35].id))&&p(f,"for",c);const ce={};te[0]&8&&(ce.id=e[35].id),h.$set(ce),te[0]&2056&&(U=e[11],Ae(),v=st(v,te,z,1,e,U,_,t,Pt,qm,y,Rm),De());const ve={};te[0]&8&&(ve.date=e[35].created),C.$set(ve);const oe={};te[0]&8&&(oe.date=e[35].updated),A.$set(oe)},i(W){if(!P){T(h.$$.fragment,W);for(let te=0;te<U.length;te+=1)T(v[te]);T(C.$$.fragment,W),T(A.$$.fragment,W),P=!0}},o(W){F(h.$$.fragment,W);for(let te=0;te<v.length;te+=1)F(v[te]);F(C.$$.fragment,W),F(A.$$.fragment,W),P=!1},d(W){W&&k(t),q(h);for(let te=0;te<v.length;te+=1)v[te].d();q(C),q(A),I=!1,rt(R)}}}function Bm(n){let e,t,i=n[3].length+"",o,r,l;return{c(){e=g("small"),t=j("Showing "),o=j(i),r=j(" of "),l=j(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(s,a){w(s,e,a),m(e,t),m(e,o),m(e,r),m(e,l)},p(s,a){a[0]&8&&i!==(i=s[3].length+"")&&ge(o,i),a[0]&16&&ge(l,s[4])},d(s){s&&k(e)}}}function Um(n){let e,t,i,o,r=n[4]-n[3].length+"",l,s,a,f;return{c(){e=g("div"),t=g("button"),i=g("span"),o=j("Load more ("),l=j(r),s=j(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ne(t,"btn-loading",n[8]),ne(t,"btn-disabled",n[8]),p(e,"class","block txt-center m-t-xs")},m(c,u){w(c,e,u),m(e,t),m(t,i),m(i,o),m(i,l),m(i,s),a||(f=X(t,"click",n[29]),a=!0)},p(c,u){u[0]&24&&r!==(r=c[4]-c[3].length+"")&&ge(l,r),u[0]&256&&ne(t,"btn-loading",c[8]),u[0]&256&&ne(t,"btn-disabled",c[8])},d(c){c&&k(e),a=!1,f()}}}function Wm(n){let e,t,i,o,r,l,s=n[6]===1?"record":"records",a,f,c,u,d,h,b,v,_,y,S;return{c(){e=g("div"),t=g("div"),i=j("Selected "),o=g("strong"),r=j(n[6]),l=$(),a=j(s),f=$(),c=g("button"),c.innerHTML='<span class="txt">Reset</span>',u=$(),d=g("div"),h=$(),b=g("button"),b.innerHTML='<span class="txt">Delete selected</span>',p(t,"class","txt"),p(c,"type","button"),p(c,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),ne(c,"btn-disabled",n[9]),p(d,"class","flex-fill"),p(b,"type","button"),p(b,"class","btn btn-sm btn-secondary btn-danger"),ne(b,"btn-loading",n[9]),ne(b,"btn-disabled",n[9]),p(e,"class","bulkbar")},m(C,x){w(C,e,x),m(e,t),m(t,i),m(t,o),m(o,r),m(t,l),m(t,a),m(e,f),m(e,c),m(e,u),m(e,d),m(e,h),m(e,b),_=!0,y||(S=[X(c,"click",n[30]),X(b,"click",n[31])],y=!0)},p(C,x){(!_||x[0]&64)&&ge(r,C[6]),(!_||x[0]&64)&&s!==(s=C[6]===1?"record":"records")&&ge(a,s),x[0]&512&&ne(c,"btn-disabled",C[9]),x[0]&512&&ne(b,"btn-loading",C[9]),x[0]&512&&ne(b,"btn-disabled",C[9])},i(C){_||(C&&Dt(()=>{v||(v=ct(e,ti,{duration:150,y:5},!0)),v.run(1)}),_=!0)},o(C){C&&(v||(v=ct(e,ti,{duration:150,y:5},!1)),v.run(0)),_=!1},d(C){C&&k(e),C&&v&&v.end(),y=!1,rt(S)}}}function J$(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v=[],_=new Map,y,S,C,x,M,A,O,D,E,P,I=[],R=new Map,G,U,z,K,Y,W,te;function ce(re){n[21](re)}let ve={class:"col-type-text col-field-id",name:"id",$$slots:{default:[B$]},$$scope:{ctx:n}};n[0]!==void 0&&(ve.sort=n[0]),d=new en({props:ve}),he.push(()=>Fe(d,"sort",ce));let oe=n[11];const J=re=>re[38].name;for(let re=0;re<oe.length;re+=1){let ke=Nm(n,oe,re),He=J(ke);_.set(He,v[re]=jm(He,ke))}function $e(re){n[23](re)}let ee={class:"col-type-date col-field-created",name:"created",$$slots:{default:[W$]},$$scope:{ctx:n}};n[0]!==void 0&&(ee.sort=n[0]),S=new en({props:ee}),he.push(()=>Fe(S,"sort",$e));function _e(re){n[24](re)}let fe={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[Y$]},$$scope:{ctx:n}};n[0]!==void 0&&(fe.sort=n[0]),M=new en({props:fe}),he.push(()=>Fe(M,"sort",_e));let ie=n[3];const ye=re=>re[35].id;for(let re=0;re<ie.length;re+=1){let ke=Im(n,ie,re),He=ye(ke);R.set(He,I[re]=Vm(He,ke))}let Ne=null;ie.length||(Ne=zm(n));let Pe=n[3].length&&Bm(n),ze=n[3].length&&n[12]&&Um(n),se=n[6]&&Wm(n);return{c(){e=g("div"),t=g("table"),i=g("thead"),o=g("tr"),r=g("th"),l=g("div"),s=g("input"),f=$(),c=g("label"),u=$(),V(d.$$.fragment),b=$();for(let re=0;re<v.length;re+=1)v[re].c();y=$(),V(S.$$.fragment),x=$(),V(M.$$.fragment),O=$(),D=g("th"),E=$(),P=g("tbody");for(let re=0;re<I.length;re+=1)I[re].c();Ne&&Ne.c(),G=$(),Pe&&Pe.c(),U=$(),ze&&ze.c(),z=$(),se&&se.c(),K=lt(),p(s,"type","checkbox"),p(s,"id","checkbox_0"),s.disabled=a=!n[3].length,s.checked=n[10],p(c,"for","checkbox_0"),p(l,"class","form-field"),p(r,"class","bulk-select-col min-width"),p(D,"class","col-type-action min-width"),p(t,"class","table"),ne(t,"table-loading",n[8]),p(e,"class","table-wrapper")},m(re,ke){w(re,e,ke),m(e,t),m(t,i),m(i,o),m(o,r),m(r,l),m(l,s),m(l,f),m(l,c),m(o,u),H(d,o,null),m(o,b);for(let He=0;He<v.length;He+=1)v[He].m(o,null);m(o,y),H(S,o,null),m(o,x),H(M,o,null),m(o,O),m(o,D),m(t,E),m(t,P);for(let He=0;He<I.length;He+=1)I[He].m(P,null);Ne&&Ne.m(P,null),w(re,G,ke),Pe&&Pe.m(re,ke),w(re,U,ke),ze&&ze.m(re,ke),w(re,z,ke),se&&se.m(re,ke),w(re,K,ke),Y=!0,W||(te=X(s,"change",n[20]),W=!0)},p(re,ke){(!Y||ke[0]&8&&a!==(a=!re[3].length))&&(s.disabled=a),(!Y||ke[0]&1024)&&(s.checked=re[10]);const He={};ke[1]&4096&&(He.$$scope={dirty:ke,ctx:re}),!h&&ke[0]&1&&(h=!0,He.sort=re[0],Re(()=>h=!1)),d.$set(He),ke[0]&2049&&(oe=re[11],Ae(),v=st(v,ke,J,1,re,oe,_,o,Pt,jm,y,Nm),De());const qe={};ke[1]&4096&&(qe.$$scope={dirty:ke,ctx:re}),!C&&ke[0]&1&&(C=!0,qe.sort=re[0],Re(()=>C=!1)),S.$set(qe);const Je={};ke[1]&4096&&(Je.$$scope={dirty:ke,ctx:re}),!A&&ke[0]&1&&(A=!0,Je.sort=re[0],Re(()=>A=!1)),M.$set(Je),ke[0]&76074&&(ie=re[3],Ae(),I=st(I,ke,ye,1,re,ie,R,P,Pt,Vm,null,Im),De(),!ie.length&&Ne?Ne.p(re,ke):ie.length?Ne&&(Ne.d(1),Ne=null):(Ne=zm(re),Ne.c(),Ne.m(P,null))),ke[0]&256&&ne(t,"table-loading",re[8]),re[3].length?Pe?Pe.p(re,ke):(Pe=Bm(re),Pe.c(),Pe.m(U.parentNode,U)):Pe&&(Pe.d(1),Pe=null),re[3].length&&re[12]?ze?ze.p(re,ke):(ze=Um(re),ze.c(),ze.m(z.parentNode,z)):ze&&(ze.d(1),ze=null),re[6]?se?(se.p(re,ke),ke[0]&64&&T(se,1)):(se=Wm(re),se.c(),T(se,1),se.m(K.parentNode,K)):se&&(Ae(),F(se,1,1,()=>{se=null}),De())},i(re){if(!Y){T(d.$$.fragment,re);for(let ke=0;ke<oe.length;ke+=1)T(v[ke]);T(S.$$.fragment,re),T(M.$$.fragment,re);for(let ke=0;ke<ie.length;ke+=1)T(I[ke]);T(se),Y=!0}},o(re){F(d.$$.fragment,re);for(let ke=0;ke<v.length;ke+=1)F(v[ke]);F(S.$$.fragment,re),F(M.$$.fragment,re);for(let ke=0;ke<I.length;ke+=1)F(I[ke]);F(se),Y=!1},d(re){re&&k(e),q(d);for(let ke=0;ke<v.length;ke+=1)v[ke].d();q(S),q(M);for(let ke=0;ke<I.length;ke+=1)I[ke].d();Ne&&Ne.d(),re&&k(G),Pe&&Pe.d(re),re&&k(U),ze&&ze.d(re),re&&k(z),se&&se.d(re),re&&k(K),W=!1,te()}}}function Z$(n,e,t){let i,o,r,l;const s=yn();let{collection:a}=e,{sort:f=""}=e,{filter:c=""}=e,u=[],d=1,h=0,b={},v=!0,_=!1;async function y(oe=1){if(!!(a!=null&&a.id))return t(8,v=!0),Se.Records.getList(a.id,oe,50,{sort:f,filter:c}).then(J=>{oe<=1&&S(),t(8,v=!1),t(3,u=u.concat(J.items)),t(7,d=J.page),t(4,h=J.totalItems),s("load",u)}).catch(J=>{J!==null&&(t(8,v=!1),console.warn(J),S(),Se.errorResponseHandler(J,!1))})}function S(){t(3,u=[]),t(7,d=1),t(4,h=0),t(5,b={})}function C(){l?x():M()}function x(){t(5,b={})}function M(){for(const oe of u)t(5,b[oe.id]=oe,b);t(5,b)}function A(oe){b[oe.id]?delete b[oe.id]:t(5,b[oe.id]=oe,b),t(5,b)}function O(){xi(`Do you really want to delete the selected ${r===1?"record":"records"}?`,D)}async function D(){if(_||!r)return;let oe=[];for(const J of Object.keys(b))oe.push(Se.Records.delete(a==null?void 0:a.id,J));return t(9,_=!0),Promise.all(oe).then(()=>{hn(`Successfully deleted the selected ${r===1?"record":"records"}.`),x()}).catch(J=>{Se.errorResponseHandler(J)}).finally(()=>(t(9,_=!1),y()))}function E(oe){ft.call(this,n,oe)}const P=()=>C();function I(oe){f=oe,t(0,f)}function R(oe){f=oe,t(0,f)}function G(oe){f=oe,t(0,f)}function U(oe){f=oe,t(0,f)}const z=oe=>A(oe),K=oe=>s("select",oe),Y=(oe,J)=>{J.code==="Enter"&&(J.preventDefault(),s("select",oe))},W=()=>t(1,c=""),te=()=>y(d+1),ce=()=>x(),ve=()=>O();return n.$$set=oe=>{"collection"in oe&&t(18,a=oe.collection),"sort"in oe&&t(0,f=oe.sort),"filter"in oe&&t(1,c=oe.filter)},n.$$.update=()=>{n.$$.dirty[0]&262147&&a&&a.id&&f!==-1&&c!==-1&&(S(),y(1)),n.$$.dirty[0]&24&&t(12,i=h>u.length),n.$$.dirty[0]&262144&&t(11,o=(a==null?void 0:a.schema)||[]),n.$$.dirty[0]&32&&t(6,r=Object.keys(b).length),n.$$.dirty[0]&72&&t(10,l=u.length&&r===u.length)},[f,c,y,u,h,b,r,d,v,_,l,o,i,s,C,x,A,O,a,E,P,I,R,G,U,z,K,Y,W,te,ce,ve]}class X$ extends Ie{constructor(e){super(),Le(this,e,Z$,J$,Ee,{collection:18,sort:0,filter:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}function Q$(n){let e,t,i,o,r,l,s,a,f=n[2].name+"",c,u,d,h,b,v,_,y,S,C,x,M,A,O,D,E,P;e=new Jx({}),C=new Ds({props:{value:n[0],autocompleteCollection:n[2]}}),C.$on("submit",n[15]);function I(U){n[17](U)}function R(U){n[18](U)}let G={collection:n[2]};return n[0]!==void 0&&(G.filter=n[0]),n[1]!==void 0&&(G.sort=n[1]),M=new X$({props:G}),n[16](M),he.push(()=>Fe(M,"filter",I)),he.push(()=>Fe(M,"sort",R)),M.$on("select",n[19]),{c(){V(e.$$.fragment),t=$(),i=g("main"),o=g("header"),r=g("nav"),l=g("div"),l.textContent="Collections",s=$(),a=g("div"),c=j(f),u=$(),d=g("button"),d.innerHTML='<i class="ri-settings-4-line"></i>',h=$(),b=g("div"),v=g("button"),v.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,_=$(),y=g("button"),y.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,S=$(),V(C.$$.fragment),x=$(),V(M.$$.fragment),p(l,"class","breadcrumb-item"),p(a,"class","breadcrumb-item"),p(r,"class","breadcrumbs"),p(d,"type","button"),p(d,"class","btn btn-secondary btn-circle"),p(v,"type","button"),p(v,"class","btn btn-outline"),p(y,"type","button"),p(y,"class","btn btn-expanded"),p(b,"class","btns-group"),p(o,"class","page-header"),p(i,"class","page-wrapper")},m(U,z){H(e,U,z),w(U,t,z),w(U,i,z),m(i,o),m(o,r),m(r,l),m(r,s),m(r,a),m(a,c),m(o,u),m(o,d),m(o,h),m(o,b),m(b,v),m(b,_),m(b,y),m(i,S),H(C,i,null),m(i,x),H(M,i,null),D=!0,E||(P=[Xe(St.call(null,d,{text:"Edit collection",position:"right"})),X(d,"click",n[12]),X(v,"click",n[13]),X(y,"click",n[14])],E=!0)},p(U,z){(!D||z&4)&&f!==(f=U[2].name+"")&&ge(c,f);const K={};z&1&&(K.value=U[0]),z&4&&(K.autocompleteCollection=U[2]),C.$set(K);const Y={};z&4&&(Y.collection=U[2]),!A&&z&1&&(A=!0,Y.filter=U[0],Re(()=>A=!1)),!O&&z&2&&(O=!0,Y.sort=U[1],Re(()=>O=!1)),M.$set(Y)},i(U){D||(T(e.$$.fragment,U),T(C.$$.fragment,U),T(M.$$.fragment,U),D=!0)},o(U){F(e.$$.fragment,U),F(C.$$.fragment,U),F(M.$$.fragment,U),D=!1},d(U){q(e,U),U&&k(t),U&&k(i),q(C),n[16](null),q(M),E=!1,rt(P)}}}function eA(n){let e,t,i,o,r,l,s,a;return{c(){e=g("div"),t=g("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=$(),o=g("h1"),o.textContent="Create your first collection to add records!",r=$(),l=g("button"),l.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,p(t,"class","icon"),p(o,"class","m-b-10"),p(l,"type","button"),p(l,"class","btn btn-expanded-lg btn-lg"),p(e,"class","placeholder-section m-b-base")},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,o),m(e,r),m(e,l),s||(a=X(l,"click",n[11]),s=!0)},p:le,i:le,o:le,d(f){f&&k(e),s=!1,a()}}}function tA(n){let e;return{c(){e=g("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:le,i:le,o:le,d(t){t&&k(e)}}}function nA(n){let e,t,i,o,r,l,s,a,f;const c=[tA,eA,Q$],u=[];function d(_,y){return _[8]?0:_[7].length?2:1}e=d(n),t=u[e]=c[e](n);let h={};o=new hc({props:h}),n[20](o);let b={};l=new q6({props:b}),n[21](l);let v={collection:n[2]};return a=new F1({props:v}),n[22](a),a.$on("save",n[23]),a.$on("delete",n[24]),{c(){t.c(),i=$(),V(o.$$.fragment),r=$(),V(l.$$.fragment),s=$(),V(a.$$.fragment)},m(_,y){u[e].m(_,y),w(_,i,y),H(o,_,y),w(_,r,y),H(l,_,y),w(_,s,y),H(a,_,y),f=!0},p(_,[y]){let S=e;e=d(_),e===S?u[e].p(_,y):(Ae(),F(u[S],1,1,()=>{u[S]=null}),De(),t=u[e],t?t.p(_,y):(t=u[e]=c[e](_),t.c()),T(t,1),t.m(i.parentNode,i));const C={};o.$set(C);const x={};l.$set(x);const M={};y&4&&(M.collection=_[2]),a.$set(M)},i(_){f||(T(t),T(o.$$.fragment,_),T(l.$$.fragment,_),T(a.$$.fragment,_),f=!0)},o(_){F(t),F(o.$$.fragment,_),F(l.$$.fragment,_),F(a.$$.fragment,_),f=!1},d(_){u[e].d(_),_&&k(i),n[20](null),q(o,_),_&&k(r),n[21](null),q(l,_),_&&k(s),n[22](null),q(a,_)}}}function iA(n,e,t){var G;let i,o,r,l;pn(n,fi,U=>t(2,o=U)),pn(n,Go,U=>t(10,r=U)),pn(n,pf,U=>t(8,l=U));const s=B.getQueryParams((G=window.location)==null?void 0:G.href);let a,f,c,u,d=s.filter||"",h=s.sort||"-created",b=s.collectionId;B.setDocumentTitle("Collections"),_C(b);const v=()=>a==null?void 0:a.show(),_=()=>a==null?void 0:a.show(o),y=()=>f==null?void 0:f.show(o),S=()=>c==null?void 0:c.show(),C=U=>t(0,d=U.detail);function x(U){he[U?"unshift":"push"](()=>{u=U,t(6,u)})}function M(U){d=U,t(0,d),t(2,o),t(9,b)}function A(U){h=U,t(1,h),t(2,o),t(9,b)}const O=U=>c==null?void 0:c.show(U==null?void 0:U.detail);function D(U){he[U?"unshift":"push"](()=>{a=U,t(3,a)})}function E(U){he[U?"unshift":"push"](()=>{f=U,t(4,f)})}function P(U){he[U?"unshift":"push"](()=>{c=U,t(5,c)})}const I=()=>u==null?void 0:u.load(),R=()=>u==null?void 0:u.load();return n.$$.update=()=>{n.$$.dirty&1024&&t(7,i=r.filter(U=>U.name!="profiles")),n.$$.dirty&516&&(o==null?void 0:o.id)&&b!=o.id&&(t(9,b=o.id),t(1,h="-created"),t(0,d="")),n.$$.dirty&7&&(h||d||(o==null?void 0:o.id))&&B.replaceClientQueryParams({collectionId:o==null?void 0:o.id,filter:d,sort:h})},[d,h,o,a,f,c,u,i,l,b,r,v,_,y,S,C,x,M,A,O,D,E,P,I,R]}class oA extends Ie{constructor(e){super(),Le(this,e,iA,nA,Ee,{})}}function Ym(n){let e,t;return e=new je({props:{class:"form-field disabled",name:"id",$$slots:{default:[rA,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,o){const r={};o[0]&2|o[1]&3&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function rA(n){let e,t,i,o,r,l,s,a,f;return{c(){e=g("label"),t=g("i"),i=$(),o=g("span"),o.textContent="ID",l=$(),s=g("input"),p(t,"class",B.getFieldTypeIcon("primary")),p(o,"class","txt"),p(e,"for",r=n[31]),p(s,"type","text"),p(s,"id",a=n[31]),s.value=f=n[1].id,s.disabled=!0},m(c,u){w(c,e,u),m(e,t),m(e,i),m(e,o),w(c,l,u),w(c,s,u)},p(c,u){u[1]&1&&r!==(r=c[31])&&p(e,"for",r),u[1]&1&&a!==(a=c[31])&&p(s,"id",a),u[0]&2&&f!==(f=c[1].id)&&s.value!==f&&(s.value=f)},d(c){c&&k(e),c&&k(l),c&&k(s)}}}function Gm(n){let e,t,i,o;return{c(){e=g("div"),e.innerHTML='<i class="ri-shield-check-line"></i>',p(e,"class","form-field-addon txt-success")},m(r,l){w(r,e,l),i||(o=Xe(t=St.call(null,e,"Verified")),i=!0)},d(r){r&&k(e),i=!1,o()}}}function lA(n){let e,t,i,o,r,l,s,a,f,c,u,d=n[1].verified&&Gm();return{c(){e=g("label"),t=g("i"),i=$(),o=g("span"),o.textContent="Email",l=$(),d&&d.c(),s=$(),a=g("input"),p(t,"class",B.getFieldTypeIcon("email")),p(o,"class","txt"),p(e,"for",r=n[31]),p(a,"type","email"),p(a,"autocomplete","off"),p(a,"id",f=n[31]),a.required=!0},m(h,b){w(h,e,b),m(e,t),m(e,i),m(e,o),w(h,l,b),d&&d.m(h,b),w(h,s,b),w(h,a,b),Me(a,n[2]),c||(u=X(a,"input",n[19]),c=!0)},p(h,b){b[1]&1&&r!==(r=h[31])&&p(e,"for",r),h[1].verified?d||(d=Gm(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),b[1]&1&&f!==(f=h[31])&&p(a,"id",f),b[0]&4&&a.value!==h[2]&&Me(a,h[2])},d(h){h&&k(e),h&&k(l),d&&d.d(h),h&&k(s),h&&k(a),c=!1,u()}}}function Km(n){let e,t;return e=new je({props:{class:"form-field form-field-toggle",$$slots:{default:[sA,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,o){const r={};o[0]&8|o[1]&3&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function sA(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(o,"for",l=n[31])},m(f,c){w(f,e,c),e.checked=n[3],w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[20]),s=!0)},p(f,c){c[1]&1&&t!==(t=f[31])&&p(e,"id",t),c[0]&8&&(e.checked=f[3]),c[1]&1&&l!==(l=f[31])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function Jm(n){let e,t,i,o,r,l,s,a,f;return o=new je({props:{class:"form-field required",name:"password",$$slots:{default:[aA,({uniqueId:c})=>({31:c}),({uniqueId:c})=>[0,c?1:0]]},$$scope:{ctx:n}}}),s=new je({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[fA,({uniqueId:c})=>({31:c}),({uniqueId:c})=>[0,c?1:0]]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),i=g("div"),V(o.$$.fragment),r=$(),l=g("div"),V(s.$$.fragment),p(i,"class","col-sm-6"),p(l,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(c,u){w(c,e,u),m(e,t),m(t,i),H(o,i,null),m(t,r),m(t,l),H(s,l,null),f=!0},p(c,u){const d={};u[0]&128|u[1]&3&&(d.$$scope={dirty:u,ctx:c}),o.$set(d);const h={};u[0]&256|u[1]&3&&(h.$$scope={dirty:u,ctx:c}),s.$set(h)},i(c){f||(T(o.$$.fragment,c),T(s.$$.fragment,c),Dt(()=>{a||(a=ct(t,fn,{duration:150},!0)),a.run(1)}),f=!0)},o(c){F(o.$$.fragment,c),F(s.$$.fragment,c),a||(a=ct(t,fn,{duration:150},!1)),a.run(0),f=!1},d(c){c&&k(e),q(o),q(s),c&&a&&a.end()}}}function aA(n){let e,t,i,o,r,l,s,a,f,c;return{c(){e=g("label"),t=g("i"),i=$(),o=g("span"),o.textContent="Password",l=$(),s=g("input"),p(t,"class","ri-lock-line"),p(o,"class","txt"),p(e,"for",r=n[31]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"id",a=n[31]),s.required=!0},m(u,d){w(u,e,d),m(e,t),m(e,i),m(e,o),w(u,l,d),w(u,s,d),Me(s,n[7]),f||(c=X(s,"input",n[21]),f=!0)},p(u,d){d[1]&1&&r!==(r=u[31])&&p(e,"for",r),d[1]&1&&a!==(a=u[31])&&p(s,"id",a),d[0]&128&&s.value!==u[7]&&Me(s,u[7])},d(u){u&&k(e),u&&k(l),u&&k(s),f=!1,c()}}}function fA(n){let e,t,i,o,r,l,s,a,f,c;return{c(){e=g("label"),t=g("i"),i=$(),o=g("span"),o.textContent="Password confirm",l=$(),s=g("input"),p(t,"class","ri-lock-line"),p(o,"class","txt"),p(e,"for",r=n[31]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"id",a=n[31]),s.required=!0},m(u,d){w(u,e,d),m(e,t),m(e,i),m(e,o),w(u,l,d),w(u,s,d),Me(s,n[8]),f||(c=X(s,"input",n[22]),f=!0)},p(u,d){d[1]&1&&r!==(r=u[31])&&p(e,"for",r),d[1]&1&&a!==(a=u[31])&&p(s,"id",a),d[0]&256&&s.value!==u[8]&&Me(s,u[8])},d(u){u&&k(e),u&&k(l),u&&k(s),f=!1,c()}}}function Zm(n){let e,t;return e=new je({props:{class:"form-field form-field-toggle",$$slots:{default:[cA,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,o){const r={};o[0]&512|o[1]&3&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function cA(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Send verification email"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(o,"for",l=n[31])},m(f,c){w(f,e,c),e.checked=n[9],w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[23]),s=!0)},p(f,c){c[1]&1&&t!==(t=f[31])&&p(e,"id",t),c[0]&512&&(e.checked=f[9]),c[1]&1&&l!==(l=f[31])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function uA(n){let e,t,i,o,r,l,s,a,f,c=!n[1].isNew&&Ym(n);i=new je({props:{class:"form-field required",name:"email",$$slots:{default:[lA,({uniqueId:b})=>({31:b}),({uniqueId:b})=>[0,b?1:0]]},$$scope:{ctx:n}}});let u=!n[1].isNew&&Km(n),d=(n[1].isNew||n[3])&&Jm(n),h=n[1].isNew&&Zm(n);return{c(){e=g("form"),c&&c.c(),t=$(),V(i.$$.fragment),o=$(),u&&u.c(),r=$(),d&&d.c(),l=$(),h&&h.c(),p(e,"id",n[11]),p(e,"class","grid"),p(e,"autocomplete","off")},m(b,v){w(b,e,v),c&&c.m(e,null),m(e,t),H(i,e,null),m(e,o),u&&u.m(e,null),m(e,r),d&&d.m(e,null),m(e,l),h&&h.m(e,null),s=!0,a||(f=X(e,"submit",Gt(n[12])),a=!0)},p(b,v){b[1].isNew?c&&(Ae(),F(c,1,1,()=>{c=null}),De()):c?(c.p(b,v),v[0]&2&&T(c,1)):(c=Ym(b),c.c(),T(c,1),c.m(e,t));const _={};v[0]&6|v[1]&3&&(_.$$scope={dirty:v,ctx:b}),i.$set(_),b[1].isNew?u&&(Ae(),F(u,1,1,()=>{u=null}),De()):u?(u.p(b,v),v[0]&2&&T(u,1)):(u=Km(b),u.c(),T(u,1),u.m(e,r)),b[1].isNew||b[3]?d?(d.p(b,v),v[0]&10&&T(d,1)):(d=Jm(b),d.c(),T(d,1),d.m(e,l)):d&&(Ae(),F(d,1,1,()=>{d=null}),De()),b[1].isNew?h?(h.p(b,v),v[0]&2&&T(h,1)):(h=Zm(b),h.c(),T(h,1),h.m(e,null)):h&&(Ae(),F(h,1,1,()=>{h=null}),De())},i(b){s||(T(c),T(i.$$.fragment,b),T(u),T(d),T(h),s=!0)},o(b){F(c),F(i.$$.fragment,b),F(u),F(d),F(h),s=!1},d(b){b&&k(e),c&&c.d(),q(i),u&&u.d(),d&&d.d(),h&&h.d(),a=!1,f()}}}function dA(n){let e,t=n[1].isNew?"New user":"Edit user",i;return{c(){e=g("h4"),i=j(t)},m(o,r){w(o,e,r),m(e,i)},p(o,r){r[0]&2&&t!==(t=o[1].isNew?"New user":"Edit user")&&ge(i,t)},d(o){o&&k(e)}}}function Xm(n){let e,t,i,o,r,l,s,a,f;return l=new vo({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[pA]},$$scope:{ctx:n}}}),{c(){e=g("button"),t=g("span"),i=$(),o=g("i"),r=$(),V(l.$$.fragment),s=$(),a=g("div"),p(o,"class","ri-more-line"),p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-secondary"),p(a,"class","flex-fill")},m(c,u){w(c,e,u),m(e,t),m(e,i),m(e,o),m(e,r),H(l,e,null),w(c,s,u),w(c,a,u),f=!0},p(c,u){const d={};u[0]&2|u[1]&2&&(d.$$scope={dirty:u,ctx:c}),l.$set(d)},i(c){f||(T(l.$$.fragment,c),f=!0)},o(c){F(l.$$.fragment,c),f=!1},d(c){c&&k(e),q(l),c&&k(s),c&&k(a)}}}function Qm(n){let e,t,i;return{c(){e=g("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(o,r){w(o,e,r),t||(i=X(e,"click",n[16]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function pA(n){let e,t,i,o,r=!n[1].verified&&Qm(n);return{c(){r&&r.c(),e=$(),t=g("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(l,s){r&&r.m(l,s),w(l,e,s),w(l,t,s),i||(o=X(t,"click",n[17]),i=!0)},p(l,s){l[1].verified?r&&(r.d(1),r=null):r?r.p(l,s):(r=Qm(l),r.c(),r.m(e.parentNode,e))},d(l){r&&r.d(l),l&&k(e),l&&k(t),i=!1,o()}}}function hA(n){let e,t,i,o,r,l,s=n[1].isNew?"Create":"Save changes",a,f,c,u,d,h=!n[1].isNew&&Xm(n);return{c(){h&&h.c(),e=$(),t=g("button"),i=g("span"),i.textContent="Cancel",o=$(),r=g("button"),l=g("span"),a=j(s),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[5],p(l,"class","txt"),p(r,"type","submit"),p(r,"form",n[11]),p(r,"class","btn btn-expanded"),r.disabled=f=!n[10]||n[5],ne(r,"btn-loading",n[5])},m(b,v){h&&h.m(b,v),w(b,e,v),w(b,t,v),m(t,i),w(b,o,v),w(b,r,v),m(r,l),m(l,a),c=!0,u||(d=X(t,"click",n[18]),u=!0)},p(b,v){b[1].isNew?h&&(Ae(),F(h,1,1,()=>{h=null}),De()):h?(h.p(b,v),v[0]&2&&T(h,1)):(h=Xm(b),h.c(),T(h,1),h.m(e.parentNode,e)),(!c||v[0]&32)&&(t.disabled=b[5]),(!c||v[0]&2)&&s!==(s=b[1].isNew?"Create":"Save changes")&&ge(a,s),(!c||v[0]&1056&&f!==(f=!b[10]||b[5]))&&(r.disabled=f),v[0]&32&&ne(r,"btn-loading",b[5])},i(b){c||(T(h),c=!0)},o(b){F(h),c=!1},d(b){h&&h.d(b),b&&k(e),b&&k(t),b&&k(o),b&&k(r),u=!1,d()}}}function mA(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[hA],header:[dA],default:[uA]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,r){const l={};r[0]&1088&&(l.beforeHide=o[24]),r[0]&1966|r[1]&2&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[25](null),q(e,o)}}}function bA(n,e,t){let i;const o=yn(),r="user_"+B.randomString(5);let l,s=new es,a=!1,f=!1,c="",u="",d="",h=!1,b=!0;function v(W){return y(W),t(6,f=!0),l==null?void 0:l.show()}function _(){return l==null?void 0:l.hide()}function y(W){Ui({}),t(1,s=W!=null&&W.clone?W.clone():new es),S()}function S(){t(3,h=!1),t(9,b=!0),t(2,c=(s==null?void 0:s.email)||""),t(7,u=""),t(8,d="")}function C(){if(a||!i)return;t(5,a=!0);const W={email:c};(s.isNew||h)&&(W.password=u,W.passwordConfirm=d);let te;s.isNew?te=Se.Users.create(W):te=Se.Users.update(s.id,W),te.then(async ce=>{b&&M(!1),t(6,f=!1),_(),hn(s.isNew?"Successfully created user.":"Successfully updated user."),o("save",ce)}).catch(ce=>{Se.errorResponseHandler(ce)}).finally(()=>{t(5,a=!1)})}function x(){!(s!=null&&s.id)||xi("Do you really want to delete the selected user?",()=>Se.Users.delete(s.id).then(()=>{t(6,f=!1),_(),hn("Successfully deleted user."),o("delete",s)}).catch(W=>{Se.errorResponseHandler(W)}))}function M(W=!0){return Se.Users.requestVerification(s.isNew?c:s.email).then(()=>{t(6,f=!1),_(),W&&hn(`Successfully sent verification email to ${s.email}.`)}).catch(te=>{Se.errorResponseHandler(te)})}const A=()=>M(),O=()=>x(),D=()=>_();function E(){c=this.value,t(2,c)}function P(){h=this.checked,t(3,h)}function I(){u=this.value,t(7,u)}function R(){d=this.value,t(8,d)}function G(){b=this.checked,t(9,b)}const U=()=>i&&f?(xi("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,f=!1),_()}),!1):!0;function z(W){he[W?"unshift":"push"](()=>{l=W,t(4,l)})}function K(W){ft.call(this,n,W)}function Y(W){ft.call(this,n,W)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(10,i=s.isNew&&c!=""||h||c!==s.email)},[_,s,c,h,l,a,f,u,d,b,i,r,C,x,M,v,A,O,D,E,P,I,R,G,U,z,K,Y]}class gA extends Ie{constructor(e){super(),Le(this,e,bA,mA,Ee,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function eb(n,e,t){const i=n.slice();return i[37]=e[t],i}function tb(n,e,t){const i=n.slice();return i[40]=e[t],i}function nb(n,e,t){const i=n.slice();return i[40]=e[t],i}function _A(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C,x,M,A,O=[],D=new Map,E,P,I,R,G,U,z,K,Y,W,te=[],ce=new Map,ve,oe,J,$e,ee;u=new Ds({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}}),u.$on("submit",n[17]);function _e(Z){n[18](Z)}let fe={class:"col-type-text col-field-id",name:"id",$$slots:{default:[yA]},$$scope:{ctx:n}};n[4]!==void 0&&(fe.sort=n[4]),y=new en({props:fe}),he.push(()=>Fe(y,"sort",_e));function ie(Z){n[19](Z)}let ye={class:"col-type-email col-field-email",name:"email",$$slots:{default:[kA]},$$scope:{ctx:n}};n[4]!==void 0&&(ye.sort=n[4]),x=new en({props:ye}),he.push(()=>Fe(x,"sort",ie));let Ne=n[12];const Pe=Z=>Z[40].name;for(let Z=0;Z<Ne.length;Z+=1){let ae=nb(n,Ne,Z),Ve=Pe(ae);D.set(Ve,O[Z]=ib(Ve,ae))}function ze(Z){n[20](Z)}let se={class:"col-type-date col-field-created",name:"created",$$slots:{default:[wA]},$$scope:{ctx:n}};n[4]!==void 0&&(se.sort=n[4]),P=new en({props:se}),he.push(()=>Fe(P,"sort",ze));function re(Z){n[21](Z)}let ke={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[SA]},$$scope:{ctx:n}};n[4]!==void 0&&(ke.sort=n[4]),G=new en({props:ke}),he.push(()=>Fe(G,"sort",re));let He=n[1];const qe=Z=>Z[37].id;for(let Z=0;Z<He.length;Z+=1){let ae=eb(n,He,Z),Ve=qe(ae);ce.set(Ve,te[Z]=sb(Ve,ae))}let Je=null;He.length||(Je=ob(n));let be=n[1].length&&ab(n),Oe=n[1].length&&n[13]&&fb(n);return{c(){e=g("main"),t=g("header"),i=g("nav"),i.innerHTML='<div class="breadcrumb-item">Users</div>',o=$(),r=g("button"),r.innerHTML='<i class="ri-settings-4-line"></i>',l=$(),s=g("div"),a=$(),f=g("button"),f.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New user</span>`,c=$(),V(u.$$.fragment),d=$(),h=g("div"),b=g("table"),v=g("thead"),_=g("tr"),V(y.$$.fragment),C=$(),V(x.$$.fragment),A=$();for(let Z=0;Z<O.length;Z+=1)O[Z].c();E=$(),V(P.$$.fragment),R=$(),V(G.$$.fragment),z=$(),K=g("th"),Y=$(),W=g("tbody");for(let Z=0;Z<te.length;Z+=1)te[Z].c();Je&&Je.c(),ve=$(),be&&be.c(),oe=$(),Oe&&Oe.c(),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"class","btn btn-secondary btn-circle"),p(s,"class","flex-fill"),p(f,"type","button"),p(f,"class","btn btn-expanded"),p(t,"class","page-header"),p(K,"class","col-type-action min-width"),p(b,"class","table"),ne(b,"table-loading",n[10]),p(h,"class","table-wrapper"),p(e,"class","page-wrapper")},m(Z,ae){w(Z,e,ae),m(e,t),m(t,i),m(t,o),m(t,r),m(t,l),m(t,s),m(t,a),m(t,f),m(e,c),H(u,e,null),m(e,d),m(e,h),m(h,b),m(b,v),m(v,_),H(y,_,null),m(_,C),H(x,_,null),m(_,A);for(let Ve=0;Ve<O.length;Ve+=1)O[Ve].m(_,null);m(_,E),H(P,_,null),m(_,R),H(G,_,null),m(_,z),m(_,K),m(b,Y),m(b,W);for(let Ve=0;Ve<te.length;Ve+=1)te[Ve].m(W,null);Je&&Je.m(W,null),m(e,ve),be&&be.m(e,null),m(e,oe),Oe&&Oe.m(e,null),J=!0,$e||(ee=[Xe(St.call(null,r,{text:"Edit profile collection",position:"right"})),X(r,"click",n[15]),X(f,"click",n[16])],$e=!0)},p(Z,ae){const Ve={};ae[0]&8&&(Ve.value=Z[3]),u.$set(Ve);const yt={};ae[1]&16384&&(yt.$$scope={dirty:ae,ctx:Z}),!S&&ae[0]&16&&(S=!0,yt.sort=Z[4],Re(()=>S=!1)),y.$set(yt);const it={};ae[1]&16384&&(it.$$scope={dirty:ae,ctx:Z}),!M&&ae[0]&16&&(M=!0,it.sort=Z[4],Re(()=>M=!1)),x.$set(it),ae[0]&4096&&(Ne=Z[12],O=st(O,ae,Pe,1,Z,Ne,D,_,an,ib,E,nb));const bt={};ae[1]&16384&&(bt.$$scope={dirty:ae,ctx:Z}),!I&&ae[0]&16&&(I=!0,bt.sort=Z[4],Re(()=>I=!1)),P.$set(bt);const at={};ae[1]&16384&&(at.$$scope={dirty:ae,ctx:Z}),!U&&ae[0]&16&&(U=!0,at.sort=Z[4],Re(()=>U=!1)),G.$set(at),ae[0]&5450&&(He=Z[1],Ae(),te=st(te,ae,qe,1,Z,He,ce,W,Pt,sb,null,eb),De(),!He.length&&Je?Je.p(Z,ae):He.length?Je&&(Je.d(1),Je=null):(Je=ob(Z),Je.c(),Je.m(W,null))),ae[0]&1024&&ne(b,"table-loading",Z[10]),Z[1].length?be?be.p(Z,ae):(be=ab(Z),be.c(),be.m(e,oe)):be&&(be.d(1),be=null),Z[1].length&&Z[13]?Oe?Oe.p(Z,ae):(Oe=fb(Z),Oe.c(),Oe.m(e,null)):Oe&&(Oe.d(1),Oe=null)},i(Z){if(!J){T(u.$$.fragment,Z),T(y.$$.fragment,Z),T(x.$$.fragment,Z),T(P.$$.fragment,Z),T(G.$$.fragment,Z);for(let ae=0;ae<He.length;ae+=1)T(te[ae]);J=!0}},o(Z){F(u.$$.fragment,Z),F(y.$$.fragment,Z),F(x.$$.fragment,Z),F(P.$$.fragment,Z),F(G.$$.fragment,Z);for(let ae=0;ae<te.length;ae+=1)F(te[ae]);J=!1},d(Z){Z&&k(e),q(u),q(y),q(x);for(let ae=0;ae<O.length;ae+=1)O[ae].d();q(P),q(G);for(let ae=0;ae<te.length;ae+=1)te[ae].d();Je&&Je.d(),be&&be.d(),Oe&&Oe.d(),$e=!1,rt(ee)}}}function vA(n){let e;return{c(){e=g("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:le,i:le,o:le,d(t){t&&k(e)}}}function yA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function kA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="email",p(t,"class",B.getFieldTypeIcon("email")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function ib(n,e){let t,i,o,r,l,s,a,f=e[40].name+"",c,u,d;return{key:n,first:null,c(){t=g("th"),i=g("div"),o=g("i"),l=$(),s=g("span"),a=j("profile."),c=j(f),p(o,"class",r=B.getFieldTypeIcon(e[40].type)),p(s,"class","txt"),p(i,"class","col-header-content"),p(t,"class",u="col-type-"+e[40].type+" col-field-"+e[40].name),p(t,"name",d=e[40].name),this.first=t},m(h,b){w(h,t,b),m(t,i),m(i,o),m(i,l),m(i,s),m(s,a),m(s,c)},p(h,b){e=h,b[0]&4096&&r!==(r=B.getFieldTypeIcon(e[40].type))&&p(o,"class",r),b[0]&4096&&f!==(f=e[40].name+"")&&ge(c,f),b[0]&4096&&u!==(u="col-type-"+e[40].type+" col-field-"+e[40].name)&&p(t,"class",u),b[0]&4096&&d!==(d=e[40].name)&&p(t,"name",d)},d(h){h&&k(t)}}}function wA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function SA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="updated",p(t,"class",B.getFieldTypeIcon("date")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function ob(n){let e;function t(r,l){return r[10]?xA:CA}let i=t(n),o=i(n);return{c(){o.c(),e=lt()},m(r,l){o.m(r,l),w(r,e,l)},p(r,l){i===(i=t(r))&&o?o.p(r,l):(o.d(1),o=i(r),o&&(o.c(),o.m(e.parentNode,e)))},d(r){o.d(r),r&&k(e)}}}function CA(n){var s;let e,t,i,o,r,l=((s=n[3])==null?void 0:s.length)&&rb(n);return{c(){e=g("tr"),t=g("td"),i=g("h6"),i.textContent="No users found.",o=$(),l&&l.c(),r=$(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),m(e,t),m(t,i),m(t,o),l&&l.m(t,null),m(e,r)},p(a,f){var c;(c=a[3])!=null&&c.length?l?l.p(a,f):(l=rb(a),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},d(a){a&&k(e),l&&l.d()}}}function xA(n){let e;return{c(){e=g("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function rb(n){let e,t,i;return{c(){e=g("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(o,r){w(o,e,r),t||(i=X(e,"click",n[24]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function lb(n,e){let t,i,o;return i=new L1({props:{field:e[40],record:e[37].profile||{}}}),{key:n,first:null,c(){t=lt(),V(i.$$.fragment),this.first=t},m(r,l){w(r,t,l),H(i,r,l),o=!0},p(r,l){e=r;const s={};l[0]&4096&&(s.field=e[40]),l[0]&2&&(s.record=e[37].profile||{}),i.$set(s)},i(r){o||(T(i.$$.fragment,r),o=!0)},o(r){F(i.$$.fragment,r),o=!1},d(r){r&&k(t),q(i,r)}}}function sb(n,e){let t,i,o,r,l,s,a,f=e[37].email+"",c,u,d,h,b=e[37].verified?"Verified":"Unverified",v,_,y=[],S=new Map,C,x,M,A,O,D,E,P,I,R,G,U,z,K,Y;o=new Ls({props:{id:e[37].id}});let W=e[12];const te=oe=>oe[40].name;for(let oe=0;oe<W.length;oe+=1){let J=tb(e,W,oe),$e=te(J);S.set($e,y[oe]=lb($e,J))}M=new Ci({props:{date:e[37].created}}),D=new Ci({props:{date:e[37].updated}});function ce(){return e[22](e[37])}function ve(){return e[23](e[37])}return{key:n,first:null,c(){t=g("tr"),i=g("td"),V(o.$$.fragment),r=$(),l=g("td"),s=g("div"),a=g("span"),c=j(f),d=$(),h=g("span"),v=j(b),_=$();for(let oe=0;oe<y.length;oe+=1)y[oe].c();C=$(),x=g("td"),V(M.$$.fragment),A=$(),O=g("td"),V(D.$$.fragment),E=$(),P=g("td"),I=g("button"),I.innerHTML=`<i class="ri-user-settings-line"></i>
<span class="txt">Edit user</span>`,R=$(),G=g("button"),G.innerHTML=`<i class="ri-profile-line"></i>
<span class="txt">Edit profile</span>`,U=$(),p(i,"class","col-type-text col-field-id"),p(a,"class","txt"),p(a,"title",u=e[37].email),p(h,"class","label"),ne(h,"label-success",e[37].verified),ne(h,"label-warning",!e[37].verified),p(s,"class","inline-flex"),p(l,"class","col-type-email col-field-email"),p(x,"class","col-type-date col-field-created"),p(O,"class","col-type-date col-field-updated"),p(I,"type","button"),p(I,"class","btn btn-sm btn-outline"),p(G,"type","button"),p(G,"class","btn btn-sm m-l-10"),p(P,"class","col-type-action min-width"),this.first=t},m(oe,J){w(oe,t,J),m(t,i),H(o,i,null),m(t,r),m(t,l),m(l,s),m(s,a),m(a,c),m(s,d),m(s,h),m(h,v),m(t,_);for(let $e=0;$e<y.length;$e+=1)y[$e].m(t,null);m(t,C),m(t,x),H(M,x,null),m(t,A),m(t,O),H(D,O,null),m(t,E),m(t,P),m(P,I),m(P,R),m(P,G),m(t,U),z=!0,K||(Y=[X(I,"click",Vn(ce)),X(G,"click",Vn(ve))],K=!0)},p(oe,J){e=oe;const $e={};J[0]&2&&($e.id=e[37].id),o.$set($e),(!z||J[0]&2)&&f!==(f=e[37].email+"")&&ge(c,f),(!z||J[0]&2&&u!==(u=e[37].email))&&p(a,"title",u),(!z||J[0]&2)&&b!==(b=e[37].verified?"Verified":"Unverified")&&ge(v,b),J[0]&2&&ne(h,"label-success",e[37].verified),J[0]&2&&ne(h,"label-warning",!e[37].verified),J[0]&4098&&(W=e[12],Ae(),y=st(y,J,te,1,e,W,S,t,Pt,lb,C,tb),De());const ee={};J[0]&2&&(ee.date=e[37].created),M.$set(ee);const _e={};J[0]&2&&(_e.date=e[37].updated),D.$set(_e)},i(oe){if(!z){T(o.$$.fragment,oe);for(let J=0;J<W.length;J+=1)T(y[J]);T(M.$$.fragment,oe),T(D.$$.fragment,oe),z=!0}},o(oe){F(o.$$.fragment,oe);for(let J=0;J<y.length;J+=1)F(y[J]);F(M.$$.fragment,oe),F(D.$$.fragment,oe),z=!1},d(oe){oe&&k(t),q(o);for(let J=0;J<y.length;J+=1)y[J].d();q(M),q(D),K=!1,rt(Y)}}}function ab(n){let e,t,i=n[1].length+"",o,r,l;return{c(){e=g("small"),t=j("Showing "),o=j(i),r=j(" of "),l=j(n[2]),p(e,"class","block txt-hint txt-right m-t-sm")},m(s,a){w(s,e,a),m(e,t),m(e,o),m(e,r),m(e,l)},p(s,a){a[0]&2&&i!==(i=s[1].length+"")&&ge(o,i),a[0]&4&&ge(l,s[2])},d(s){s&&k(e)}}}function fb(n){let e,t,i,o,r=n[2]-n[1].length+"",l,s,a,f;return{c(){e=g("div"),t=g("button"),i=g("span"),o=j("Load more ("),l=j(r),s=j(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ne(t,"btn-loading",n[10]),ne(t,"btn-disabled",n[10]),p(e,"class","block txt-center m-t-xs")},m(c,u){w(c,e,u),m(e,t),m(t,i),m(i,o),m(i,l),m(i,s),a||(f=X(t,"click",n[25]),a=!0)},p(c,u){u[0]&6&&r!==(r=c[2]-c[1].length+"")&&ge(l,r),u[0]&1024&&ne(t,"btn-loading",c[10]),u[0]&1024&&ne(t,"btn-disabled",c[10])},d(c){c&&k(e),a=!1,f()}}}function MA(n){let e,t,i,o,r,l,s,a,f;const c=[vA,_A],u=[];function d(_,y){return _[11]?0:1}e=d(n),t=u[e]=c[e](n);let h={};o=new gA({props:h}),n[26](o),o.$on("save",n[27]),o.$on("delete",n[28]);let b={};l=new hc({props:b}),n[29](l),l.$on("save",n[30]);let v={collection:n[5]};return a=new F1({props:v}),n[31](a),a.$on("save",n[32]),{c(){t.c(),i=$(),V(o.$$.fragment),r=$(),V(l.$$.fragment),s=$(),V(a.$$.fragment)},m(_,y){u[e].m(_,y),w(_,i,y),H(o,_,y),w(_,r,y),H(l,_,y),w(_,s,y),H(a,_,y),f=!0},p(_,y){let S=e;e=d(_),e===S?u[e].p(_,y):(Ae(),F(u[S],1,1,()=>{u[S]=null}),De(),t=u[e],t?t.p(_,y):(t=u[e]=c[e](_),t.c()),T(t,1),t.m(i.parentNode,i));const C={};o.$set(C);const x={};l.$set(x);const M={};y[0]&32&&(M.collection=_[5]),a.$set(M)},i(_){f||(T(t),T(o.$$.fragment,_),T(l.$$.fragment,_),T(a.$$.fragment,_),f=!0)},o(_){F(t),F(o.$$.fragment,_),F(l.$$.fragment,_),F(a.$$.fragment,_),f=!1},d(_){u[e].d(_),_&&k(i),n[26](null),q(o,_),_&&k(r),n[29](null),q(l,_),_&&k(s),n[31](null),q(a,_)}}}function $A(n,e,t){var $e;let i,o;const r=B.getQueryParams(($e=window.location)==null?void 0:$e.href),l=["id","userId","created","updated"];let s,a,f,c=[],u=1,d=0,h=!1,b=r.filter||"",v=r.sort||"-created",_=new En,y=!1;B.setDocumentTitle("Users"),M();async function S(ee=1){return t(10,h=!0),Se.Users.getList(ee,50,{sort:v||"-created",filter:b}).then(_e=>{ee<=1&&C(),t(10,h=!1),t(1,c=c.concat(_e.items)),t(9,u=_e.page),t(2,d=_e.totalItems)}).catch(_e=>{_e!==null&&(t(10,h=!1),console.warn(_e),C(),Se.errorResponseHandler(_e,!1))})}function C(){t(1,c=[]),t(9,u=1),t(2,d=0)}function x(ee){const _e=c.find(fe=>fe.id===(ee==null?void 0:ee.userId));_e&&(_e.profile=ee),t(1,c)}async function M(){t(11,y=!0);try{t(5,_=await Se.Collections.getOne("profiles"))}catch(ee){Se.errorResponseHandler(ee)}t(11,y=!1)}const A=()=>a==null?void 0:a.show(_),O=()=>s==null?void 0:s.show(),D=ee=>t(3,b=ee.detail);function E(ee){v=ee,t(4,v)}function P(ee){v=ee,t(4,v)}function I(ee){v=ee,t(4,v)}function R(ee){v=ee,t(4,v)}const G=ee=>s==null?void 0:s.show(ee),U=ee=>f==null?void 0:f.show(ee.profile),z=()=>t(3,b=""),K=()=>S(u+1);function Y(ee){he[ee?"unshift":"push"](()=>{s=ee,t(6,s)})}const W=()=>S(),te=()=>S();function ce(ee){he[ee?"unshift":"push"](()=>{a=ee,t(7,a)})}const ve=ee=>t(5,_=ee.detail);function oe(ee){he[ee?"unshift":"push"](()=>{f=ee,t(8,f)})}const J=ee=>x(ee.detail);return n.$$.update=()=>{var ee;n.$$.dirty[0]&24&&v!==-1&&b!==-1&&(B.replaceClientQueryParams({filter:b,sort:v}),S()),n.$$.dirty[0]&6&&t(13,i=d>c.length),n.$$.dirty[0]&32&&t(12,o=(ee=_==null?void 0:_.schema)==null?void 0:ee.filter(_e=>!l.includes(_e.name)))},[S,c,d,b,v,_,s,a,f,u,h,y,o,i,x,A,O,D,E,P,I,R,G,U,z,K,Y,W,te,ce,ve,oe,J]}class AA extends Ie{constructor(e){super(),Le(this,e,$A,MA,Ee,{loadUsers:0},null,[-1,-1])}get loadUsers(){return this.$$.ctx[0]}}function DA(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C;return{c(){e=g("aside"),t=g("div"),i=g("div"),i.textContent="System",o=$(),r=g("a"),r.innerHTML=`<i class="ri-home-gear-line"></i>
<span class="txt">Application</span>`,l=$(),s=g("a"),s.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=$(),f=g("a"),f.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,c=$(),u=g("div"),u.textContent="Authentication",d=$(),h=g("a"),h.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,b=$(),v=g("a"),v.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,_=$(),y=g("a"),y.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,p(i,"class","sidebar-title"),p(r,"href","/settings"),p(r,"class","sidebar-list-item"),p(s,"href","/settings/mail"),p(s,"class","sidebar-list-item"),p(f,"href","/settings/storage"),p(f,"class","sidebar-list-item"),p(u,"class","sidebar-title"),p(h,"href","/settings/auth-providers"),p(h,"class","sidebar-list-item"),p(v,"href","/settings/tokens"),p(v,"class","sidebar-list-item"),p(y,"href","/settings/admins"),p(y,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(x,M){w(x,e,M),m(e,t),m(t,i),m(t,o),m(t,r),m(t,l),m(t,s),m(t,a),m(t,f),m(t,c),m(t,u),m(t,d),m(t,h),m(t,b),m(t,v),m(t,_),m(t,y),S||(C=[Xe(li.call(null,r,{path:"/settings"})),Xe(xn.call(null,r)),Xe(li.call(null,s,{path:"/settings/mail/?.*"})),Xe(xn.call(null,s)),Xe(li.call(null,f,{path:"/settings/storage/?.*"})),Xe(xn.call(null,f)),Xe(li.call(null,h,{path:"/settings/auth-providers/?.*"})),Xe(xn.call(null,h)),Xe(li.call(null,v,{path:"/settings/tokens/?.*"})),Xe(xn.call(null,v)),Xe(li.call(null,y,{path:"/settings/admins/?.*"})),Xe(xn.call(null,y))],S=!0)},p:le,i:le,o:le,d(x){x&&k(e),S=!1,rt(C)}}}class er extends Ie{constructor(e){super(),Le(this,e,null,DA,Ee,{})}}function cb(n,e,t){const i=n.slice();return i[31]=e[t],i}function ub(n){let e,t;return e=new je({props:{class:"form-field disabled",name:"id",$$slots:{default:[OA,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,o){const r={};o[0]&1073741826|o[1]&8&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function OA(n){let e,t,i,o,r,l,s,a,f;return{c(){e=g("label"),t=g("i"),i=$(),o=g("span"),o.textContent="ID",l=$(),s=g("input"),p(t,"class",B.getFieldTypeIcon("primary")),p(o,"class","txt"),p(e,"for",r=n[30]),p(s,"type","text"),p(s,"id",a=n[30]),s.value=f=n[1].id,s.disabled=!0},m(c,u){w(c,e,u),m(e,t),m(e,i),m(e,o),w(c,l,u),w(c,s,u)},p(c,u){u[0]&1073741824&&r!==(r=c[30])&&p(e,"for",r),u[0]&1073741824&&a!==(a=c[30])&&p(s,"id",a),u[0]&2&&f!==(f=c[1].id)&&s.value!==f&&(s.value=f)},d(c){c&&k(e),c&&k(l),c&&k(s)}}}function db(n){let e,t,i,o,r,l,s,a;function f(){return n[17](n[31])}function c(...u){return n[18](n[31],...u)}return{c(){e=g("figure"),t=g("img"),r=$(),Qn(t.src,i="/_/images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt",o="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(u,d){w(u,e,d),m(e,t),m(e,r),s||(a=[X(e,"click",f),X(e,"keydown",c)],s=!0)},p(u,d){n=u,d[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(u){u&&k(e),s=!1,rt(a)}}}function TA(n){let e,t,i,o,r,l,s,a,f,c;return{c(){e=g("label"),t=g("i"),i=$(),o=g("span"),o.textContent="Email",l=$(),s=g("input"),p(t,"class",B.getFieldTypeIcon("email")),p(o,"class","txt"),p(e,"for",r=n[30]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",a=n[30]),s.required=!0},m(u,d){w(u,e,d),m(e,t),m(e,i),m(e,o),w(u,l,d),w(u,s,d),Me(s,n[3]),f||(c=X(s,"input",n[19]),f=!0)},p(u,d){d[0]&1073741824&&r!==(r=u[30])&&p(e,"for",r),d[0]&1073741824&&a!==(a=u[30])&&p(s,"id",a),d[0]&8&&s.value!==u[3]&&Me(s,u[3])},d(u){u&&k(e),u&&k(l),u&&k(s),f=!1,c()}}}function pb(n){let e,t;return e=new je({props:{class:"form-field form-field-toggle",$$slots:{default:[EA,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,o){const r={};o[0]&1073741840|o[1]&8&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function EA(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(o,"for",l=n[30])},m(f,c){w(f,e,c),e.checked=n[4],w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[20]),s=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&16&&(e.checked=f[4]),c[0]&1073741824&&l!==(l=f[30])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function hb(n){let e,t,i,o,r,l,s,a,f;return o=new je({props:{class:"form-field required",name:"password",$$slots:{default:[PA,({uniqueId:c})=>({30:c}),({uniqueId:c})=>[c?1073741824:0]]},$$scope:{ctx:n}}}),s=new je({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[FA,({uniqueId:c})=>({30:c}),({uniqueId:c})=>[c?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),i=g("div"),V(o.$$.fragment),r=$(),l=g("div"),V(s.$$.fragment),p(i,"class","col-sm-6"),p(l,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(c,u){w(c,e,u),m(e,t),m(t,i),H(o,i,null),m(t,r),m(t,l),H(s,l,null),f=!0},p(c,u){const d={};u[0]&1073742080|u[1]&8&&(d.$$scope={dirty:u,ctx:c}),o.$set(d);const h={};u[0]&1073742336|u[1]&8&&(h.$$scope={dirty:u,ctx:c}),s.$set(h)},i(c){f||(T(o.$$.fragment,c),T(s.$$.fragment,c),Dt(()=>{a||(a=ct(t,fn,{duration:150},!0)),a.run(1)}),f=!0)},o(c){F(o.$$.fragment,c),F(s.$$.fragment,c),a||(a=ct(t,fn,{duration:150},!1)),a.run(0),f=!1},d(c){c&&k(e),q(o),q(s),c&&a&&a.end()}}}function PA(n){let e,t,i,o,r,l,s,a,f,c;return{c(){e=g("label"),t=g("i"),i=$(),o=g("span"),o.textContent="Password",l=$(),s=g("input"),p(t,"class","ri-lock-line"),p(o,"class","txt"),p(e,"for",r=n[30]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"id",a=n[30]),s.required=!0},m(u,d){w(u,e,d),m(e,t),m(e,i),m(e,o),w(u,l,d),w(u,s,d),Me(s,n[8]),f||(c=X(s,"input",n[21]),f=!0)},p(u,d){d[0]&1073741824&&r!==(r=u[30])&&p(e,"for",r),d[0]&1073741824&&a!==(a=u[30])&&p(s,"id",a),d[0]&256&&s.value!==u[8]&&Me(s,u[8])},d(u){u&&k(e),u&&k(l),u&&k(s),f=!1,c()}}}function FA(n){let e,t,i,o,r,l,s,a,f,c;return{c(){e=g("label"),t=g("i"),i=$(),o=g("span"),o.textContent="Password confirm",l=$(),s=g("input"),p(t,"class","ri-lock-line"),p(o,"class","txt"),p(e,"for",r=n[30]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"id",a=n[30]),s.required=!0},m(u,d){w(u,e,d),m(e,t),m(e,i),m(e,o),w(u,l,d),w(u,s,d),Me(s,n[9]),f||(c=X(s,"input",n[22]),f=!0)},p(u,d){d[0]&1073741824&&r!==(r=u[30])&&p(e,"for",r),d[0]&1073741824&&a!==(a=u[30])&&p(s,"id",a),d[0]&512&&s.value!==u[9]&&Me(s,u[9])},d(u){u&&k(e),u&&k(l),u&&k(s),f=!1,c()}}}function LA(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b=!n[1].isNew&&ub(n),v=[0,1,2,3,4,5,6,7,8,9],_=[];for(let C=0;C<10;C+=1)_[C]=db(cb(n,v,C));a=new je({props:{class:"form-field required",name:"email",$$slots:{default:[TA,({uniqueId:C})=>({30:C}),({uniqueId:C})=>[C?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[1].isNew&&pb(n),S=(n[1].isNew||n[4])&&hb(n);return{c(){e=g("form"),b&&b.c(),t=$(),i=g("div"),o=g("p"),o.textContent="Avatar",r=$(),l=g("div");for(let C=0;C<10;C+=1)_[C].c();s=$(),V(a.$$.fragment),f=$(),y&&y.c(),c=$(),S&&S.c(),p(o,"class","section-title"),p(l,"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,x){w(C,e,x),b&&b.m(e,null),m(e,t),m(e,i),m(i,o),m(i,r),m(i,l);for(let M=0;M<10;M+=1)_[M].m(l,null);m(e,s),H(a,e,null),m(e,f),y&&y.m(e,null),m(e,c),S&&S.m(e,null),u=!0,d||(h=X(e,"submit",Gt(n[12])),d=!0)},p(C,x){if(C[1].isNew?b&&(Ae(),F(b,1,1,()=>{b=null}),De()):b?(b.p(C,x),x[0]&2&&T(b,1)):(b=ub(C),b.c(),T(b,1),b.m(e,t)),x[0]&4){v=[0,1,2,3,4,5,6,7,8,9];let A;for(A=0;A<10;A+=1){const O=cb(C,v,A);_[A]?_[A].p(O,x):(_[A]=db(O),_[A].c(),_[A].m(l,null))}for(;A<10;A+=1)_[A].d(1)}const M={};x[0]&1073741832|x[1]&8&&(M.$$scope={dirty:x,ctx:C}),a.$set(M),C[1].isNew?y&&(Ae(),F(y,1,1,()=>{y=null}),De()):y?(y.p(C,x),x[0]&2&&T(y,1)):(y=pb(C),y.c(),T(y,1),y.m(e,c)),C[1].isNew||C[4]?S?(S.p(C,x),x[0]&18&&T(S,1)):(S=hb(C),S.c(),T(S,1),S.m(e,null)):S&&(Ae(),F(S,1,1,()=>{S=null}),De())},i(C){u||(T(b),T(a.$$.fragment,C),T(y),T(S),u=!0)},o(C){F(b),F(a.$$.fragment,C),F(y),F(S),u=!1},d(C){C&&k(e),b&&b.d(),qn(_,C),q(a),y&&y.d(),S&&S.d(),d=!1,h()}}}function IA(n){let e,t=n[1].isNew?"New admin":"Edit admin",i;return{c(){e=g("h4"),i=j(t)},m(o,r){w(o,e,r),m(e,i)},p(o,r){r[0]&2&&t!==(t=o[1].isNew?"New admin":"Edit admin")&&ge(i,t)},d(o){o&&k(e)}}}function mb(n){let e,t,i,o,r,l,s,a,f;return l=new vo({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[RA]},$$scope:{ctx:n}}}),{c(){e=g("button"),t=g("span"),i=$(),o=g("i"),r=$(),V(l.$$.fragment),s=$(),a=g("div"),p(o,"class","ri-more-line"),p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-secondary"),p(a,"class","flex-fill")},m(c,u){w(c,e,u),m(e,t),m(e,i),m(e,o),m(e,r),H(l,e,null),w(c,s,u),w(c,a,u),f=!0},p(c,u){const d={};u[1]&8&&(d.$$scope={dirty:u,ctx:c}),l.$set(d)},i(c){f||(T(l.$$.fragment,c),f=!0)},o(c){F(l.$$.fragment,c),f=!1},d(c){c&&k(e),q(l),c&&k(s),c&&k(a)}}}function RA(n){let e,t,i;return{c(){e=g("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(o,r){w(o,e,r),t||(i=X(e,"click",n[15]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function NA(n){let e,t,i,o,r,l,s=n[1].isNew?"Create":"Save changes",a,f,c,u,d,h=!n[1].isNew&&mb(n);return{c(){h&&h.c(),e=$(),t=g("button"),i=g("span"),i.textContent="Cancel",o=$(),r=g("button"),l=g("span"),a=j(s),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[6],p(l,"class","txt"),p(r,"type","submit"),p(r,"form",n[11]),p(r,"class","btn btn-expanded"),r.disabled=f=!n[10]||n[6],ne(r,"btn-loading",n[6])},m(b,v){h&&h.m(b,v),w(b,e,v),w(b,t,v),m(t,i),w(b,o,v),w(b,r,v),m(r,l),m(l,a),c=!0,u||(d=X(t,"click",n[16]),u=!0)},p(b,v){b[1].isNew?h&&(Ae(),F(h,1,1,()=>{h=null}),De()):h?(h.p(b,v),v[0]&2&&T(h,1)):(h=mb(b),h.c(),T(h,1),h.m(e.parentNode,e)),(!c||v[0]&64)&&(t.disabled=b[6]),(!c||v[0]&2)&&s!==(s=b[1].isNew?"Create":"Save changes")&&ge(a,s),(!c||v[0]&1088&&f!==(f=!b[10]||b[6]))&&(r.disabled=f),v[0]&64&&ne(r,"btn-loading",b[6])},i(b){c||(T(h),c=!0)},o(b){F(h),c=!1},d(b){h&&h.d(b),b&&k(e),b&&k(t),b&&k(o),b&&k(r),u=!1,d()}}}function jA(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[NA],header:[IA],default:[LA]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,r){const l={};r[0]&1152&&(l.beforeHide=o[23]),r[0]&1886|r[1]&8&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[24](null),q(e,o)}}}function zA(n,e,t){let i;const o=yn(),r="admin_"+B.randomString(5);let l,s=new Bo,a=!1,f=!1,c=0,u="",d="",h="",b=!1;function v(Y){return y(Y),t(7,f=!0),l==null?void 0:l.show()}function _(){return l==null?void 0:l.hide()}function y(Y){Ui({}),t(1,s=Y!=null&&Y.clone?Y.clone():new Bo),S()}function S(){t(4,b=!1),t(3,u=(s==null?void 0:s.email)||""),t(2,c=(s==null?void 0:s.avatar)||0),t(8,d=""),t(9,h="")}function C(){if(a||!i)return;t(6,a=!0);const Y={email:u,avatar:c};(s.isNew||b)&&(Y.password=d,Y.passwordConfirm=h);let W;s.isNew?W=Se.Admins.create(Y):W=Se.Admins.update(s.id,Y),W.then(async te=>{var ce;t(7,f=!1),_(),hn(s.isNew?"Successfully created admin.":"Successfully updated admin."),o("save",te),((ce=Se.AuthStore.model)==null?void 0:ce.id)===te.id&&Se.AuthStore.save(Se.AuthStore.token,te)}).catch(te=>{Se.errorResponseHandler(te)}).finally(()=>{t(6,a=!1)})}function x(){!(s!=null&&s.id)||xi("Do you really want to delete the selected admin?",()=>Se.Admins.delete(s.id).then(()=>{t(7,f=!1),_(),hn("Successfully deleted admin."),o("delete",s)}).catch(Y=>{Se.errorResponseHandler(Y)}))}const M=()=>x(),A=()=>_(),O=Y=>t(2,c=Y),D=(Y,W)=>{(W.code==="Enter"||W.code==="Space")&&(W.preventDefault(),t(2,c=Y))};function E(){u=this.value,t(3,u)}function P(){b=this.checked,t(4,b)}function I(){d=this.value,t(8,d)}function R(){h=this.value,t(9,h)}const G=()=>i&&f?(xi("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,f=!1),_()}),!1):!0;function U(Y){he[Y?"unshift":"push"](()=>{l=Y,t(5,l)})}function z(Y){ft.call(this,n,Y)}function K(Y){ft.call(this,n,Y)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=s.isNew&&u!=""||b||u!==s.email||c!==s.avatar)},[_,s,c,u,b,l,a,f,d,h,i,r,C,x,v,M,A,O,D,E,P,I,R,G,U,z,K]}class HA extends Ie{constructor(e){super(),Le(this,e,zA,jA,Ee,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function bb(n,e,t){const i=n.slice();return i[21]=e[t],i}function qA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function VA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="email",p(t,"class",B.getFieldTypeIcon("email")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function BA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function UA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="updated",p(t,"class",B.getFieldTypeIcon("date")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function gb(n){let e;function t(r,l){return r[5]?YA:WA}let i=t(n),o=i(n);return{c(){o.c(),e=lt()},m(r,l){o.m(r,l),w(r,e,l)},p(r,l){i===(i=t(r))&&o?o.p(r,l):(o.d(1),o=i(r),o&&(o.c(),o.m(e.parentNode,e)))},d(r){o.d(r),r&&k(e)}}}function WA(n){var s;let e,t,i,o,r,l=((s=n[1])==null?void 0:s.length)&&_b(n);return{c(){e=g("tr"),t=g("td"),i=g("h6"),i.textContent="No admins found.",o=$(),l&&l.c(),r=$(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),m(e,t),m(t,i),m(t,o),l&&l.m(t,null),m(e,r)},p(a,f){var c;(c=a[1])!=null&&c.length?l?l.p(a,f):(l=_b(a),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},d(a){a&&k(e),l&&l.d()}}}function YA(n){let e;return{c(){e=g("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function _b(n){let e,t,i;return{c(){e=g("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(o,r){w(o,e,r),t||(i=X(e,"click",n[15]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function vb(n){let e;return{c(){e=g("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 yb(n,e){let t,i,o,r,l,s,a,f,c,u,d,h,b=e[21].email+"",v,_,y,S,C,x,M,A,O,D,E,P,I,R;f=new Ls({props:{id:e[21].id}});let G=e[21].id===e[6].id&&vb();C=new Ci({props:{date:e[21].created}}),A=new Ci({props:{date:e[21].updated}});function U(){return e[13](e[21])}function z(...K){return e[14](e[21],...K)}return{key:n,first:null,c(){t=g("tr"),i=g("td"),o=g("figure"),r=g("img"),s=$(),a=g("td"),V(f.$$.fragment),c=$(),G&&G.c(),u=$(),d=g("td"),h=g("span"),v=j(b),y=$(),S=g("td"),V(C.$$.fragment),x=$(),M=g("td"),V(A.$$.fragment),O=$(),D=g("td"),D.innerHTML='<i class="ri-arrow-right-line"></i>',E=$(),Qn(r.src,l="/_/images/avatars/avatar"+(e[21].avatar||0)+".svg")||p(r,"src",l),p(r,"alt","Admin avatar"),p(o,"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",_=e[21].email),p(d,"class","col-type-email col-field-email"),p(S,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(D,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(K,Y){w(K,t,Y),m(t,i),m(i,o),m(o,r),m(t,s),m(t,a),H(f,a,null),m(a,c),G&&G.m(a,null),m(t,u),m(t,d),m(d,h),m(h,v),m(t,y),m(t,S),H(C,S,null),m(t,x),m(t,M),H(A,M,null),m(t,O),m(t,D),m(t,E),P=!0,I||(R=[X(t,"click",U),X(t,"keydown",z)],I=!0)},p(K,Y){e=K,(!P||Y&16&&!Qn(r.src,l="/_/images/avatars/avatar"+(e[21].avatar||0)+".svg"))&&p(r,"src",l);const W={};Y&16&&(W.id=e[21].id),f.$set(W),e[21].id===e[6].id?G||(G=vb(),G.c(),G.m(a,null)):G&&(G.d(1),G=null),(!P||Y&16)&&b!==(b=e[21].email+"")&&ge(v,b),(!P||Y&16&&_!==(_=e[21].email))&&p(h,"title",_);const te={};Y&16&&(te.date=e[21].created),C.$set(te);const ce={};Y&16&&(ce.date=e[21].updated),A.$set(ce)},i(K){P||(T(f.$$.fragment,K),T(C.$$.fragment,K),T(A.$$.fragment,K),P=!0)},o(K){F(f.$$.fragment,K),F(C.$$.fragment,K),F(A.$$.fragment,K),P=!1},d(K){K&&k(t),q(f),G&&G.d(),q(C),q(A),I=!1,rt(R)}}}function kb(n){let e,t,i=n[4].length+"",o,r,l=n[4].length+"",s;return{c(){e=g("small"),t=j("Showing "),o=j(i),r=j(" of "),s=j(l),p(e,"class","block txt-hint txt-right m-t-sm")},m(a,f){w(a,e,f),m(e,t),m(e,o),m(e,r),m(e,s)},p(a,f){f&16&&i!==(i=a[4].length+"")&&ge(o,i),f&16&&l!==(l=a[4].length+"")&&ge(s,l)},d(a){a&&k(e)}}}function GA(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C,x,M,A,O,D,E,P,I,R,G,U,z,K,Y,W=[],te=new Map,ce,ve,oe,J,$e,ee;e=new er({}),u=new Ds({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),u.$on("submit",n[8]);function _e(be){n[9](be)}let fe={class:"col-type-text",name:"id",$$slots:{default:[qA]},$$scope:{ctx:n}};n[2]!==void 0&&(fe.sort=n[2]),C=new en({props:fe}),he.push(()=>Fe(C,"sort",_e));function ie(be){n[10](be)}let ye={class:"col-type-email col-field-email",name:"email",$$slots:{default:[VA]},$$scope:{ctx:n}};n[2]!==void 0&&(ye.sort=n[2]),A=new en({props:ye}),he.push(()=>Fe(A,"sort",ie));function Ne(be){n[11](be)}let Pe={class:"col-type-date col-field-created",name:"created",$$slots:{default:[BA]},$$scope:{ctx:n}};n[2]!==void 0&&(Pe.sort=n[2]),E=new en({props:Pe}),he.push(()=>Fe(E,"sort",Ne));function ze(be){n[12](be)}let se={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[UA]},$$scope:{ctx:n}};n[2]!==void 0&&(se.sort=n[2]),R=new en({props:se}),he.push(()=>Fe(R,"sort",ze));let re=n[4];const ke=be=>be[21].id;for(let be=0;be<re.length;be+=1){let Oe=bb(n,re,be),Z=ke(Oe);te.set(Z,W[be]=yb(Z,Oe))}let He=null;re.length||(He=gb(n));let qe=n[4].length&&kb(n),Je={};return oe=new HA({props:Je}),n[16](oe),oe.$on("save",n[17]),oe.$on("delete",n[18]),{c(){V(e.$$.fragment),t=$(),i=g("main"),o=g("header"),r=g("nav"),r.innerHTML=`<div class="breadcrumb-item">Settings</div>
<div class="breadcrumb-item">Admins</div>`,l=$(),s=g("div"),a=$(),f=g("button"),f.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New admin</span>`,c=$(),V(u.$$.fragment),d=$(),h=g("div"),b=g("table"),v=g("thead"),_=g("tr"),y=g("th"),S=$(),V(C.$$.fragment),M=$(),V(A.$$.fragment),D=$(),V(E.$$.fragment),I=$(),V(R.$$.fragment),U=$(),z=g("th"),K=$(),Y=g("tbody");for(let be=0;be<W.length;be+=1)W[be].c();He&&He.c(),ce=$(),qe&&qe.c(),ve=$(),V(oe.$$.fragment),p(r,"class","breadcrumbs"),p(s,"class","flex-fill"),p(f,"type","button"),p(f,"class","btn btn-expanded"),p(o,"class","page-header"),p(y,"class","min-width"),p(z,"class","col-type-action min-width"),p(b,"class","table"),ne(b,"table-loading",n[5]),p(h,"class","table-wrapper"),p(i,"class","page-wrapper")},m(be,Oe){H(e,be,Oe),w(be,t,Oe),w(be,i,Oe),m(i,o),m(o,r),m(o,l),m(o,s),m(o,a),m(o,f),m(i,c),H(u,i,null),m(i,d),m(i,h),m(h,b),m(b,v),m(v,_),m(_,y),m(_,S),H(C,_,null),m(_,M),H(A,_,null),m(_,D),H(E,_,null),m(_,I),H(R,_,null),m(_,U),m(_,z),m(b,K),m(b,Y);for(let Z=0;Z<W.length;Z+=1)W[Z].m(Y,null);He&&He.m(Y,null),m(i,ce),qe&&qe.m(i,null),w(be,ve,Oe),H(oe,be,Oe),J=!0,$e||(ee=X(f,"click",n[7]),$e=!0)},p(be,[Oe]){const Z={};Oe&2&&(Z.value=be[1]),u.$set(Z);const ae={};Oe&16777216&&(ae.$$scope={dirty:Oe,ctx:be}),!x&&Oe&4&&(x=!0,ae.sort=be[2],Re(()=>x=!1)),C.$set(ae);const Ve={};Oe&16777216&&(Ve.$$scope={dirty:Oe,ctx:be}),!O&&Oe&4&&(O=!0,Ve.sort=be[2],Re(()=>O=!1)),A.$set(Ve);const yt={};Oe&16777216&&(yt.$$scope={dirty:Oe,ctx:be}),!P&&Oe&4&&(P=!0,yt.sort=be[2],Re(()=>P=!1)),E.$set(yt);const it={};Oe&16777216&&(it.$$scope={dirty:Oe,ctx:be}),!G&&Oe&4&&(G=!0,it.sort=be[2],Re(()=>G=!1)),R.$set(it),Oe&122&&(re=be[4],Ae(),W=st(W,Oe,ke,1,be,re,te,Y,Pt,yb,null,bb),De(),!re.length&&He?He.p(be,Oe):re.length?He&&(He.d(1),He=null):(He=gb(be),He.c(),He.m(Y,null))),Oe&32&&ne(b,"table-loading",be[5]),be[4].length?qe?qe.p(be,Oe):(qe=kb(be),qe.c(),qe.m(i,null)):qe&&(qe.d(1),qe=null);const bt={};oe.$set(bt)},i(be){if(!J){T(e.$$.fragment,be),T(u.$$.fragment,be),T(C.$$.fragment,be),T(A.$$.fragment,be),T(E.$$.fragment,be),T(R.$$.fragment,be);for(let Oe=0;Oe<re.length;Oe+=1)T(W[Oe]);T(oe.$$.fragment,be),J=!0}},o(be){F(e.$$.fragment,be),F(u.$$.fragment,be),F(C.$$.fragment,be),F(A.$$.fragment,be),F(E.$$.fragment,be),F(R.$$.fragment,be);for(let Oe=0;Oe<W.length;Oe+=1)F(W[Oe]);F(oe.$$.fragment,be),J=!1},d(be){q(e,be),be&&k(t),be&&k(i),q(u),q(C),q(A),q(E),q(R);for(let Oe=0;Oe<W.length;Oe+=1)W[Oe].d();He&&He.d(),qe&&qe.d(),be&&k(ve),n[16](null),q(oe,be),$e=!1,ee()}}}function KA(n,e,t){var D;let i;pn(n,qf,E=>t(6,i=E));const o=B.getQueryParams((D=window.location)==null?void 0:D.href);let r,l=[],s=!1,a=o.filter||"",f=o.sort||"-created";B.setDocumentTitle("Admins");function c(){return t(5,s=!0),t(4,l=[]),Se.Admins.getFullList(100,{sort:f||"-created",filter:a}).then(E=>{t(4,l=E),t(5,s=!1)}).catch(E=>{E!==null&&(t(5,s=!1),console.warn(E),u(),Se.errorResponseHandler(E,!1))})}function u(){t(4,l=[])}const d=()=>r==null?void 0:r.show(),h=E=>t(1,a=E.detail);function b(E){f=E,t(2,f)}function v(E){f=E,t(2,f)}function _(E){f=E,t(2,f)}function y(E){f=E,t(2,f)}const S=E=>r==null?void 0:r.show(E),C=(E,P)=>{(P.code==="Enter"||P.code==="Space")&&(P.preventDefault(),r==null||r.show(E))},x=()=>t(1,a="");function M(E){he[E?"unshift":"push"](()=>{r=E,t(3,r)})}const A=()=>c(),O=()=>c();return n.$$.update=()=>{n.$$.dirty&6&&f!==-1&&a!==-1&&(B.replaceClientQueryParams({filter:a,sort:f}),c())},[c,a,f,r,l,s,i,d,h,b,v,_,y,S,C,x,M,A,O]}class JA extends Ie{constructor(e){super(),Le(this,e,KA,GA,Ee,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function wb(n){let e,t,i;return{c(){e=g("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=$(),i=g("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r)},d(o){o&&k(e),o&&k(t),o&&k(i)}}}function ZA(n){let e,t,i,o,r,l,s,a,f=!n[0]&&wb();const c=n[2].default,u=$n(c,n,n[1],null);return{c(){e=g("div"),t=g("div"),i=$(),o=g("div"),f&&f.c(),r=$(),u&&u.c(),l=$(),s=g("div"),p(t,"class","flex-fill"),p(o,"class","wrapper wrapper-sm m-b-xl svelte-1wbawr2"),p(s,"class","flex-fill"),p(e,"class","page-wrapper full-page-panel svelte-1wbawr2")},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,o),f&&f.m(o,null),m(o,r),u&&u.m(o,null),m(e,l),m(e,s),a=!0},p(d,[h]){d[0]?f&&(f.d(1),f=null):f||(f=wb(),f.c(),f.m(o,r)),u&&u.p&&(!a||h&2)&&Dn(u,c,d,d[1],a?An(c,d[1],h,null):On(d[1]),null)},i(d){a||(T(u,d),a=!0)},o(d){F(u,d),a=!1},d(d){d&&k(e),f&&f.d(),u&&u.d(d)}}}function XA(n,e,t){let{$$slots:i={},$$scope:o}=e,{nobranding:r=!1}=e;return n.$$set=l=>{"nobranding"in l&&t(0,r=l.nobranding),"$$scope"in l&&t(1,o=l.$$scope)},[r,o,i]}class QA extends Ie{constructor(e){super(),Le(this,e,XA,ZA,Ee,{nobranding:0})}}function eD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Email"),o=$(),r=g("input"),p(e,"for",i=n[7]),p(r,"type","email"),p(r,"id",l=n[7]),r.required=!0,r.autofocus=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0]),r.focus(),s||(a=X(r,"input",n[4]),s=!0)},p(f,c){c&128&&i!==(i=f[7])&&p(e,"for",i),c&128&&l!==(l=f[7])&&p(r,"id",l),c&1&&r.value!==f[0]&&Me(r,f[0])},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function tD(n){let e,t,i,o,r,l,s,a,f,c,u;return{c(){e=g("label"),t=j("Password"),o=$(),r=g("input"),s=$(),a=g("div"),f=g("a"),f.textContent="Forgotten password?",p(e,"for",i=n[7]),p(r,"type","password"),p(r,"id",l=n[7]),r.required=!0,p(f,"href","/request-password-reset"),p(f,"class","link-hint"),p(a,"class","help-block")},m(d,h){w(d,e,h),m(e,t),w(d,o,h),w(d,r,h),Me(r,n[1]),w(d,s,h),w(d,a,h),m(a,f),c||(u=[X(r,"input",n[5]),Xe(xn.call(null,f))],c=!0)},p(d,h){h&128&&i!==(i=d[7])&&p(e,"for",i),h&128&&l!==(l=d[7])&&p(r,"id",l),h&2&&r.value!==d[1]&&Me(r,d[1])},d(d){d&&k(e),d&&k(o),d&&k(r),d&&k(s),d&&k(a),c=!1,rt(u)}}}function nD(n){let e,t,i,o,r,l,s,a,f,c,u;return o=new je({props:{class:"form-field required",name:"email",$$slots:{default:[eD,({uniqueId:d})=>({7:d}),({uniqueId:d})=>d?128:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"password",$$slots:{default:[tD,({uniqueId:d})=>({7:d}),({uniqueId:d})=>d?128:0]},$$scope:{ctx:n}}}),{c(){e=g("form"),t=g("div"),t.innerHTML="<h4>Admin sign in</h4>",i=$(),V(o.$$.fragment),r=$(),V(l.$$.fragment),s=$(),a=g("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"),ne(a,"btn-disabled",n[2]),ne(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){w(d,e,h),m(e,t),m(e,i),H(o,e,null),m(e,r),H(l,e,null),m(e,s),m(e,a),f=!0,c||(u=X(e,"submit",Gt(n[3])),c=!0)},p(d,h){const b={};h&385&&(b.$$scope={dirty:h,ctx:d}),o.$set(b);const v={};h&386&&(v.$$scope={dirty:h,ctx:d}),l.$set(v),h&4&&ne(a,"btn-disabled",d[2]),h&4&&ne(a,"btn-loading",d[2])},i(d){f||(T(o.$$.fragment,d),T(l.$$.fragment,d),f=!0)},o(d){F(o.$$.fragment,d),F(l.$$.fragment,d),f=!1},d(d){d&&k(e),q(o),q(l),c=!1,u()}}}function iD(n){let e,t;return e=new QA({props:{$$slots:{default:[nD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,[o]){const r={};o&263&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function oD(n,e,t){var c;const i=B.getQueryParams((c=window.location)==null?void 0:c.href);let o=i.demoEmail||"",r=i.demoPassword||"",l=!1;function s(){if(!l)return t(2,l=!0),Se.Admins.authViaEmail(o,r).then(()=>{Ss("/")}).catch(()=>{M0("Invalid login credentials.")}).finally(()=>{t(2,l=!1)})}function a(){o=this.value,t(0,o)}function f(){r=this.value,t(1,r)}return[o,r,l,s,a,f]}class rD extends Ie{constructor(e){super(),Le(this,e,oD,iD,Ee,{})}}function lD(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S;return i=new je({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[aD,({uniqueId:C})=>({12:C}),({uniqueId:C})=>C?4096:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[fD,({uniqueId:C})=>({12:C}),({uniqueId:C})=>C?4096:0]},$$scope:{ctx:n}}}),a=new je({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[cD,({uniqueId:C})=>({12:C}),({uniqueId:C})=>C?4096:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),s=$(),V(a.$$.fragment),f=$(),c=g("div"),u=g("div"),d=$(),h=g("button"),b=g("span"),b.textContent="Save changes",p(t,"class","col-lg-6"),p(r,"class","col-lg-6"),p(u,"class","flex-fill"),p(b,"class","txt"),p(h,"type","submit"),p(h,"class","btn btn-expanded"),h.disabled=v=!n[3]||n[2],ne(h,"btn-loading",n[2]),p(c,"class","col-lg-12 flex"),p(e,"class","grid")},m(C,x){w(C,e,x),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),m(e,s),H(a,e,null),m(e,f),m(e,c),m(c,u),m(c,d),m(c,h),m(h,b),_=!0,y||(S=X(h,"click",n[9]),y=!0)},p(C,x){const M={};x&12289&&(M.$$scope={dirty:x,ctx:C}),i.$set(M);const A={};x&12289&&(A.$$scope={dirty:x,ctx:C}),l.$set(A);const O={};x&12289&&(O.$$scope={dirty:x,ctx:C}),a.$set(O),(!_||x&12&&v!==(v=!C[3]||C[2]))&&(h.disabled=v),x&4&&ne(h,"btn-loading",C[2])},i(C){_||(T(i.$$.fragment,C),T(l.$$.fragment,C),T(a.$$.fragment,C),_=!0)},o(C){F(i.$$.fragment,C),F(l.$$.fragment,C),F(a.$$.fragment,C),_=!1},d(C){C&&k(e),q(i),q(l),q(a),y=!1,S()}}}function sD(n){let e;return{c(){e=g("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function aD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Application name"),o=$(),r=g("input"),p(e,"for",i=n[12]),p(r,"type","text"),p(r,"id",l=n[12]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].meta.appName),s||(a=X(r,"input",n[6]),s=!0)},p(f,c){c&4096&&i!==(i=f[12])&&p(e,"for",i),c&4096&&l!==(l=f[12])&&p(r,"id",l),c&1&&r.value!==f[0].meta.appName&&Me(r,f[0].meta.appName)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function fD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Application url"),o=$(),r=g("input"),p(e,"for",i=n[12]),p(r,"type","text"),p(r,"id",l=n[12]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].meta.appUrl),s||(a=X(r,"input",n[7]),s=!0)},p(f,c){c&4096&&i!==(i=f[12])&&p(e,"for",i),c&4096&&l!==(l=f[12])&&p(r,"id",l),c&1&&r.value!==f[0].meta.appUrl&&Me(r,f[0].meta.appUrl)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function cD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Logs max days retention"),o=$(),r=g("input"),p(e,"for",i=n[12]),p(r,"type","number"),p(r,"id",l=n[12]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].logs.maxDays),s||(a=X(r,"input",n[8]),s=!0)},p(f,c){c&4096&&i!==(i=f[12])&&p(e,"for",i),c&4096&&l!==(l=f[12])&&p(r,"id",l),c&1&&At(r.value)!==f[0].logs.maxDays&&Me(r,f[0].logs.maxDays)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function uD(n){let e,t,i,o,r,l,s,a,f,c,u,d;e=new er({});const h=[sD,lD],b=[];function v(_,y){return _[1]?0:1}return a=v(n),f=b[a]=h[a](n),{c(){V(e.$$.fragment),t=$(),i=g("main"),o=g("header"),o.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
<div class="breadcrumb-item">Application</div></nav>`,r=$(),l=g("div"),s=g("form"),f.c(),p(o,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(l,"class","wrapper"),p(i,"class","page-wrapper")},m(_,y){H(e,_,y),w(_,t,y),w(_,i,y),m(i,o),m(i,r),m(i,l),m(l,s),b[a].m(s,null),c=!0,u||(d=X(s,"submit",Gt(n[4])),u=!0)},p(_,[y]){let S=a;a=v(_),a===S?b[a].p(_,y):(Ae(),F(b[S],1,1,()=>{b[S]=null}),De(),f=b[a],f?f.p(_,y):(f=b[a]=h[a](_),f.c()),T(f,1),f.m(s,null))},i(_){c||(T(e.$$.fragment,_),T(f),c=!0)},o(_){F(e.$$.fragment,_),F(f),c=!1},d(_){q(e,_),_&&k(t),_&&k(i),b[a].d(),u=!1,d()}}}function dD(n,e,t){let i,o={},r=!1,l=!1,s="";B.setDocumentTitle("Application settings"),a();async function a(){t(1,r=!0);try{const v=await Se.Settings.getAll()||{};c(v)}catch(v){Se.errorResponseHandler(v)}t(1,r=!1)}async function f(){if(!(l||!i)){t(2,l=!0);try{const v=await Se.Settings.update(B.filterRedactedProps(o));c(v),hn("Successfully saved application settings.")}catch(v){Se.errorResponseHandler(v)}t(2,l=!1)}}function c(v={}){t(0,o={meta:(v==null?void 0:v.meta)||{},logs:(v==null?void 0:v.logs)||{}}),t(5,s=JSON.stringify(o))}function u(){o.meta.appName=this.value,t(0,o)}function d(){o.meta.appUrl=this.value,t(0,o)}function h(){o.logs.maxDays=At(this.value),t(0,o)}const b=()=>f();return n.$$.update=()=>{n.$$.dirty&33&&t(3,i=s!=JSON.stringify(o))},[o,r,l,i,f,s,u,d,h,b]}class pD extends Ie{constructor(e){super(),Le(this,e,dD,uD,Ee,{})}}function hD(n){let e,t,i,o=[{type:"password"},{autocomplete:"new-password"},n[5]],r={};for(let l=0;l<o.length;l+=1)r=ut(r,o[l]);return{c(){e=g("input"),ci(e,r)},m(l,s){w(l,e,s),e.autofocus&&e.focus(),n[7](e),Me(e,n[0]),t||(i=X(e,"input",n[8]),t=!0)},p(l,s){ci(e,r=bn(o,[{type:"password"},{autocomplete:"new-password"},s&32&&l[5]])),s&1&&e.value!==l[0]&&Me(e,l[0])},d(l){l&&k(e),n[7](null),t=!1,i()}}}function mD(n){let e,t,i,o,r,l,s=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let f=0;f<s.length;f+=1)a=ut(a,s[f]);return{c(){e=g("div"),t=g("button"),t.innerHTML='<i class="ri-key-line"></i>',i=$(),o=g("input"),p(t,"type","button"),p(t,"class","btn btn-secondary btn-circle"),p(e,"class","form-field-addon"),ci(o,a)},m(f,c){w(f,e,c),m(e,t),w(f,i,c),w(f,o,c),o.autofocus&&o.focus(),r||(l=[Xe(St.call(null,t,{position:"left",text:"Set new value"})),X(t,"click",n[6])],r=!0)},p(f,c){ci(o,a=bn(s,[{readOnly:!0},{type:"text"},c&2&&{placeholder:f[1]},c&32&&f[5]]))},d(f){f&&k(e),f&&k(i),f&&k(o),r=!1,rt(l)}}}function bD(n){let e;function t(r,l){return r[3]?mD:hD}let i=t(n),o=i(n);return{c(){o.c(),e=lt()},m(r,l){o.m(r,l),w(r,e,l)},p(r,[l]){i===(i=t(r))&&o?o.p(r,l):(o.d(1),o=i(r),o&&(o.c(),o.m(e.parentNode,e)))},i:le,o:le,d(r){o.d(r),r&&k(e)}}}function gD(n,e,t){const i=["value","mask"];let o=Wt(e,i),{value:r=""}=e,{mask:l="******"}=e,s,a=!1;async function f(){t(0,r=""),t(3,a=!1),await Bi(),s==null||s.focus()}const c=()=>f();function u(h){he[h?"unshift":"push"](()=>{s=h,t(2,s)})}function d(){r=this.value,t(0,r)}return n.$$set=h=>{e=ut(ut({},e),ui(h)),t(5,o=Wt(e,i)),"value"in h&&t(0,r=h.value),"mask"in h&&t(1,l=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&r===l&&t(3,a=!0)},[r,l,s,a,f,o,c,u,d]}class mc extends Ie{constructor(e){super(),Le(this,e,gD,bD,Ee,{value:0,mask:1})}}function _D(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C,x,M,A,O,D,E,P,I,R,G;i=new je({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[yD,({uniqueId:z})=>({22:z}),({uniqueId:z})=>z?4194304:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[kD,({uniqueId:z})=>({22:z}),({uniqueId:z})=>z?4194304:0]},$$scope:{ctx:n}}}),a=new je({props:{class:"form-field required",name:"meta.userVerificationUrl",$$slots:{default:[wD,({uniqueId:z})=>({22:z}),({uniqueId:z})=>z?4194304:0]},$$scope:{ctx:n}}}),c=new je({props:{class:"form-field required",name:"meta.userResetPasswordUrl",$$slots:{default:[SD,({uniqueId:z})=>({22:z}),({uniqueId:z})=>z?4194304:0]},$$scope:{ctx:n}}}),d=new je({props:{class:"form-field required",name:"meta.userConfirmEmailChangeUrl",$$slots:{default:[CD,({uniqueId:z})=>({22:z}),({uniqueId:z})=>z?4194304:0]},$$scope:{ctx:n}}}),S=new je({props:{class:"form-field form-field-toggle",$$slots:{default:[xD,({uniqueId:z})=>({22:z}),({uniqueId:z})=>z?4194304:0]},$$scope:{ctx:n}}});let U=n[0].smtp.enabled&&Sb(n);return{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),s=$(),V(a.$$.fragment),f=$(),V(c.$$.fragment),u=$(),V(d.$$.fragment),h=$(),b=g("hr"),v=$(),_=g("div"),_.innerHTML=`<p>By default PocketBase uses the OS <code>sendmail</code> command for sending emails.
<br/>
<strong class="txt-bold">For better emails deliverability it is recommended to enable the SMTP settings
below.</strong></p>`,y=$(),V(S.$$.fragment),C=$(),U&&U.c(),x=$(),M=g("div"),A=g("div"),O=$(),D=g("button"),E=g("span"),E.textContent="Save changes",p(t,"class","col-lg-6"),p(r,"class","col-lg-6"),p(e,"class","grid"),p(_,"class","content m-b-sm"),p(A,"class","flex-fill"),p(E,"class","txt"),p(D,"type","submit"),p(D,"class","btn btn-expanded"),D.disabled=P=!n[3]||n[2],ne(D,"btn-loading",n[2]),p(M,"class","flex")},m(z,K){w(z,e,K),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),m(e,s),H(a,e,null),m(e,f),H(c,e,null),m(e,u),H(d,e,null),w(z,h,K),w(z,b,K),w(z,v,K),w(z,_,K),w(z,y,K),H(S,z,K),w(z,C,K),U&&U.m(z,K),w(z,x,K),w(z,M,K),m(M,A),m(M,O),m(M,D),m(D,E),I=!0,R||(G=X(D,"click",n[18]),R=!0)},p(z,K){const Y={};K&12582913&&(Y.$$scope={dirty:K,ctx:z}),i.$set(Y);const W={};K&12582913&&(W.$$scope={dirty:K,ctx:z}),l.$set(W);const te={};K&12582913&&(te.$$scope={dirty:K,ctx:z}),a.$set(te);const ce={};K&12582913&&(ce.$$scope={dirty:K,ctx:z}),c.$set(ce);const ve={};K&12582913&&(ve.$$scope={dirty:K,ctx:z}),d.$set(ve);const oe={};K&12582913&&(oe.$$scope={dirty:K,ctx:z}),S.$set(oe),z[0].smtp.enabled?U?(U.p(z,K),K&1&&T(U,1)):(U=Sb(z),U.c(),T(U,1),U.m(x.parentNode,x)):U&&(Ae(),F(U,1,1,()=>{U=null}),De()),(!I||K&12&&P!==(P=!z[3]||z[2]))&&(D.disabled=P),K&4&&ne(D,"btn-loading",z[2])},i(z){I||(T(i.$$.fragment,z),T(l.$$.fragment,z),T(a.$$.fragment,z),T(c.$$.fragment,z),T(d.$$.fragment,z),T(S.$$.fragment,z),T(U),I=!0)},o(z){F(i.$$.fragment,z),F(l.$$.fragment,z),F(a.$$.fragment,z),F(c.$$.fragment,z),F(d.$$.fragment,z),F(S.$$.fragment,z),F(U),I=!1},d(z){z&&k(e),q(i),q(l),q(a),q(c),q(d),z&&k(h),z&&k(b),z&&k(v),z&&k(_),z&&k(y),q(S,z),z&&k(C),U&&U.d(z),z&&k(x),z&&k(M),R=!1,G()}}}function vD(n){let e;return{c(){e=g("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function yD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Sender name"),o=$(),r=g("input"),p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].meta.senderName),s||(a=X(r,"input",n[7]),s=!0)},p(f,c){c&4194304&&i!==(i=f[22])&&p(e,"for",i),c&4194304&&l!==(l=f[22])&&p(r,"id",l),c&1&&r.value!==f[0].meta.senderName&&Me(r,f[0].meta.senderName)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function kD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Sender address"),o=$(),r=g("input"),p(e,"for",i=n[22]),p(r,"type","email"),p(r,"id",l=n[22]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].meta.senderAddress),s||(a=X(r,"input",n[8]),s=!0)},p(f,c){c&4194304&&i!==(i=f[22])&&p(e,"for",i),c&4194304&&l!==(l=f[22])&&p(r,"id",l),c&1&&r.value!==f[0].meta.senderAddress&&Me(r,f[0].meta.senderAddress)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function wD(n){let e,t,i,o,r,l,s,a,f,c;return{c(){e=g("label"),t=j("User verification page url"),o=$(),r=g("input"),s=$(),a=g("div"),a.innerHTML=`Used in the user verification email. Available placeholder parameters:
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22]),r.required=!0,p(a,"class","help-block")},m(u,d){w(u,e,d),m(e,t),w(u,o,d),w(u,r,d),Me(r,n[0].meta.userVerificationUrl),w(u,s,d),w(u,a,d),f||(c=X(r,"input",n[9]),f=!0)},p(u,d){d&4194304&&i!==(i=u[22])&&p(e,"for",i),d&4194304&&l!==(l=u[22])&&p(r,"id",l),d&1&&r.value!==u[0].meta.userVerificationUrl&&Me(r,u[0].meta.userVerificationUrl)},d(u){u&&k(e),u&&k(o),u&&k(r),u&&k(s),u&&k(a),f=!1,c()}}}function SD(n){let e,t,i,o,r,l,s,a,f,c;return{c(){e=g("label"),t=j("User reset password page url"),o=$(),r=g("input"),s=$(),a=g("div"),a.innerHTML=`Used in the user password reset email. Available placeholder parameters:
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22]),r.required=!0,p(a,"class","help-block")},m(u,d){w(u,e,d),m(e,t),w(u,o,d),w(u,r,d),Me(r,n[0].meta.userResetPasswordUrl),w(u,s,d),w(u,a,d),f||(c=X(r,"input",n[10]),f=!0)},p(u,d){d&4194304&&i!==(i=u[22])&&p(e,"for",i),d&4194304&&l!==(l=u[22])&&p(r,"id",l),d&1&&r.value!==u[0].meta.userResetPasswordUrl&&Me(r,u[0].meta.userResetPasswordUrl)},d(u){u&&k(e),u&&k(o),u&&k(r),u&&k(s),u&&k(a),f=!1,c()}}}function CD(n){let e,t,i,o,r,l,s,a,f,c;return{c(){e=g("label"),t=j("User confirm email change page url"),o=$(),r=g("input"),s=$(),a=g("div"),a.innerHTML=`Used in the user email change confirmation email. Available placeholder
parameters:
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22]),r.required=!0,p(a,"class","help-block")},m(u,d){w(u,e,d),m(e,t),w(u,o,d),w(u,r,d),Me(r,n[0].meta.userConfirmEmailChangeUrl),w(u,s,d),w(u,a,d),f||(c=X(r,"input",n[11]),f=!0)},p(u,d){d&4194304&&i!==(i=u[22])&&p(e,"for",i),d&4194304&&l!==(l=u[22])&&p(r,"id",l),d&1&&r.value!==u[0].meta.userConfirmEmailChangeUrl&&Me(r,u[0].meta.userConfirmEmailChangeUrl)},d(u){u&&k(e),u&&k(o),u&&k(r),u&&k(s),u&&k(a),f=!1,c()}}}function xD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Use SMTP mail server"),p(e,"type","checkbox"),p(e,"id",t=n[22]),e.required=!0,p(o,"for",l=n[22])},m(f,c){w(f,e,c),e.checked=n[0].smtp.enabled,w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[12]),s=!0)},p(f,c){c&4194304&&t!==(t=f[22])&&p(e,"id",t),c&1&&(e.checked=f[0].smtp.enabled),c&4194304&&l!==(l=f[22])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function Sb(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C;return i=new je({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[MD,({uniqueId:x})=>({22:x}),({uniqueId:x})=>x?4194304:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[$D,({uniqueId:x})=>({22:x}),({uniqueId:x})=>x?4194304:0]},$$scope:{ctx:n}}}),f=new je({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[AD,({uniqueId:x})=>({22:x}),({uniqueId:x})=>x?4194304:0]},$$scope:{ctx:n}}}),d=new je({props:{class:"form-field",name:"smtp.username",$$slots:{default:[DD,({uniqueId:x})=>({22:x}),({uniqueId:x})=>x?4194304:0]},$$scope:{ctx:n}}}),v=new je({props:{class:"form-field",name:"smtp.password",$$slots:{default:[OD,({uniqueId:x})=>({22:x}),({uniqueId:x})=>x?4194304:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),s=$(),a=g("div"),V(f.$$.fragment),c=$(),u=g("div"),V(d.$$.fragment),h=$(),b=g("div"),V(v.$$.fragment),_=$(),y=g("div"),p(t,"class","col-lg-6"),p(r,"class","col-lg-3"),p(a,"class","col-lg-3"),p(u,"class","col-lg-6"),p(b,"class","col-lg-6"),p(y,"class","col-lg-12"),p(e,"class","grid")},m(x,M){w(x,e,M),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),m(e,s),m(e,a),H(f,a,null),m(e,c),m(e,u),H(d,u,null),m(e,h),m(e,b),H(v,b,null),m(e,_),m(e,y),C=!0},p(x,M){const A={};M&12582913&&(A.$$scope={dirty:M,ctx:x}),i.$set(A);const O={};M&12582913&&(O.$$scope={dirty:M,ctx:x}),l.$set(O);const D={};M&12582913&&(D.$$scope={dirty:M,ctx:x}),f.$set(D);const E={};M&12582913&&(E.$$scope={dirty:M,ctx:x}),d.$set(E);const P={};M&12582913&&(P.$$scope={dirty:M,ctx:x}),v.$set(P)},i(x){C||(T(i.$$.fragment,x),T(l.$$.fragment,x),T(f.$$.fragment,x),T(d.$$.fragment,x),T(v.$$.fragment,x),x&&Dt(()=>{S||(S=ct(e,fn,{duration:150},!0)),S.run(1)}),C=!0)},o(x){F(i.$$.fragment,x),F(l.$$.fragment,x),F(f.$$.fragment,x),F(d.$$.fragment,x),F(v.$$.fragment,x),x&&(S||(S=ct(e,fn,{duration:150},!1)),S.run(0)),C=!1},d(x){x&&k(e),q(i),q(l),q(f),q(d),q(v),x&&S&&S.end()}}}function MD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("SMTP server host"),o=$(),r=g("input"),p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].smtp.host),s||(a=X(r,"input",n[13]),s=!0)},p(f,c){c&4194304&&i!==(i=f[22])&&p(e,"for",i),c&4194304&&l!==(l=f[22])&&p(r,"id",l),c&1&&r.value!==f[0].smtp.host&&Me(r,f[0].smtp.host)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function $D(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Port"),o=$(),r=g("input"),p(e,"for",i=n[22]),p(r,"type","number"),p(r,"id",l=n[22]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].smtp.port),s||(a=X(r,"input",n[14]),s=!0)},p(f,c){c&4194304&&i!==(i=f[22])&&p(e,"for",i),c&4194304&&l!==(l=f[22])&&p(r,"id",l),c&1&&At(r.value)!==f[0].smtp.port&&Me(r,f[0].smtp.port)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function AD(n){let e,t,i,o,r,l,s;function a(c){n[15](c)}let f={id:n[22],items:n[4]};return n[0].smtp.tls!==void 0&&(f.keyOfSelected=n[0].smtp.tls),r=new yo({props:f}),he.push(()=>Fe(r,"keyOfSelected",a)),{c(){e=g("label"),t=j("TLS Encryption"),o=$(),V(r.$$.fragment),p(e,"for",i=n[22])},m(c,u){w(c,e,u),m(e,t),w(c,o,u),H(r,c,u),s=!0},p(c,u){(!s||u&4194304&&i!==(i=c[22]))&&p(e,"for",i);const d={};u&4194304&&(d.id=c[22]),!l&&u&1&&(l=!0,d.keyOfSelected=c[0].smtp.tls,Re(()=>l=!1)),r.$set(d)},i(c){s||(T(r.$$.fragment,c),s=!0)},o(c){F(r.$$.fragment,c),s=!1},d(c){c&&k(e),c&&k(o),q(r,c)}}}function DD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Username"),o=$(),r=g("input"),p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22])},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].smtp.username),s||(a=X(r,"input",n[16]),s=!0)},p(f,c){c&4194304&&i!==(i=f[22])&&p(e,"for",i),c&4194304&&l!==(l=f[22])&&p(r,"id",l),c&1&&r.value!==f[0].smtp.username&&Me(r,f[0].smtp.username)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function OD(n){let e,t,i,o,r,l,s;function a(c){n[17](c)}let f={id:n[22]};return n[0].smtp.password!==void 0&&(f.value=n[0].smtp.password),r=new mc({props:f}),he.push(()=>Fe(r,"value",a)),{c(){e=g("label"),t=j("Password"),o=$(),V(r.$$.fragment),p(e,"for",i=n[22])},m(c,u){w(c,e,u),m(e,t),w(c,o,u),H(r,c,u),s=!0},p(c,u){(!s||u&4194304&&i!==(i=c[22]))&&p(e,"for",i);const d={};u&4194304&&(d.id=c[22]),!l&&u&1&&(l=!0,d.value=c[0].smtp.password,Re(()=>l=!1)),r.$set(d)},i(c){s||(T(r.$$.fragment,c),s=!0)},o(c){F(r.$$.fragment,c),s=!1},d(c){c&&k(e),c&&k(o),q(r,c)}}}function TD(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b;e=new er({});const v=[vD,_D],_=[];function y(S,C){return S[1]?0:1}return c=y(n),u=_[c]=v[c](n),{c(){V(e.$$.fragment),t=$(),i=g("main"),o=g("header"),o.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
<div class="breadcrumb-item">Mail settings</div></nav>`,r=$(),l=g("div"),s=g("form"),a=g("div"),a.innerHTML="<p>Configure common settings for sending emails.</p>",f=$(),u.c(),p(o,"class","page-header"),p(a,"class","content txt-xl m-b-base"),p(s,"class","panel"),p(s,"autocomplete","off"),p(l,"class","wrapper"),p(i,"class","page-wrapper")},m(S,C){H(e,S,C),w(S,t,C),w(S,i,C),m(i,o),m(i,r),m(i,l),m(l,s),m(s,a),m(s,f),_[c].m(s,null),d=!0,h||(b=X(s,"submit",Gt(n[19])),h=!0)},p(S,[C]){let x=c;c=y(S),c===x?_[c].p(S,C):(Ae(),F(_[x],1,1,()=>{_[x]=null}),De(),u=_[c],u?u.p(S,C):(u=_[c]=v[c](S),u.c()),T(u,1),u.m(s,null))},i(S){d||(T(e.$$.fragment,S),T(u),d=!0)},o(S){F(e.$$.fragment,S),F(u),d=!1},d(S){q(e,S),S&&k(t),S&&k(i),_[c].d(),h=!1,b()}}}function ED(n,e,t){let i;const o=[{label:"Optional (StartTLS)",value:!1},{label:"Always",value:!0}];let r={},l=!1,s=!1,a="";B.setDocumentTitle("Mail settings"),f();async function f(){t(1,l=!0);try{const E=await Se.Settings.getAll()||{};u(E)}catch(E){Se.errorResponseHandler(E)}t(1,l=!1)}async function c(){if(!(s||!i)){t(2,s=!0);try{const E=await Se.Settings.update(B.filterRedactedProps(r));u(E),hn("Successfully saved mail settings.")}catch(E){Se.errorResponseHandler(E)}t(2,s=!1)}}function u(E={}){t(0,r={meta:(E==null?void 0:E.meta)||{},smtp:(E==null?void 0:E.smtp)||{}}),t(6,a=JSON.stringify(r))}function d(){r.meta.senderName=this.value,t(0,r)}function h(){r.meta.senderAddress=this.value,t(0,r)}function b(){r.meta.userVerificationUrl=this.value,t(0,r)}function v(){r.meta.userResetPasswordUrl=this.value,t(0,r)}function _(){r.meta.userConfirmEmailChangeUrl=this.value,t(0,r)}function y(){r.smtp.enabled=this.checked,t(0,r)}function S(){r.smtp.host=this.value,t(0,r)}function C(){r.smtp.port=At(this.value),t(0,r)}function x(E){n.$$.not_equal(r.smtp.tls,E)&&(r.smtp.tls=E,t(0,r))}function M(){r.smtp.username=this.value,t(0,r)}function A(E){n.$$.not_equal(r.smtp.password,E)&&(r.smtp.password=E,t(0,r))}const O=()=>c(),D=()=>c();return n.$$.update=()=>{n.$$.dirty&65&&t(3,i=a!=JSON.stringify(r))},[r,l,s,i,o,c,a,d,h,b,v,_,y,S,C,x,M,A,O,D]}class PD extends Ie{constructor(e){super(),Le(this,e,ED,TD,Ee,{})}}function FD(n){let e,t,i,o,r,l,s,a,f,c,u,d;e=new je({props:{class:"form-field form-field-toggle",$$slots:{default:[ID,({uniqueId:b})=>({15:b}),({uniqueId:b})=>b?32768:0]},$$scope:{ctx:n}}});let h=n[0].enabled&&Cb(n);return{c(){V(e.$$.fragment),t=$(),h&&h.c(),i=$(),o=g("div"),r=g("div"),l=$(),s=g("button"),a=g("span"),a.textContent="Save changes",p(r,"class","flex-fill"),p(a,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=f=!n[3]||n[2],ne(s,"btn-loading",n[2]),p(o,"class","flex")},m(b,v){H(e,b,v),w(b,t,v),h&&h.m(b,v),w(b,i,v),w(b,o,v),m(o,r),m(o,l),m(o,s),m(s,a),c=!0,u||(d=X(s,"click",n[12]),u=!0)},p(b,v){const _={};v&98305&&(_.$$scope={dirty:v,ctx:b}),e.$set(_),b[0].enabled?h?(h.p(b,v),v&1&&T(h,1)):(h=Cb(b),h.c(),T(h,1),h.m(i.parentNode,i)):h&&(Ae(),F(h,1,1,()=>{h=null}),De()),(!c||v&12&&f!==(f=!b[3]||b[2]))&&(s.disabled=f),v&4&&ne(s,"btn-loading",b[2])},i(b){c||(T(e.$$.fragment,b),T(h),c=!0)},o(b){F(e.$$.fragment,b),F(h),c=!1},d(b){q(e,b),b&&k(t),h&&h.d(b),b&&k(i),b&&k(o),u=!1,d()}}}function LD(n){let e;return{c(){e=g("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function ID(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Use S3 storage"),p(e,"type","checkbox"),p(e,"id",t=n[15]),e.required=!0,p(o,"for",l=n[15])},m(f,c){w(f,e,c),e.checked=n[0].enabled,w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[6]),s=!0)},p(f,c){c&32768&&t!==(t=f[15])&&p(e,"id",t),c&1&&(e.checked=f[0].enabled),c&32768&&l!==(l=f[15])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function Cb(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C;return i=new je({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[RD,({uniqueId:x})=>({15:x}),({uniqueId:x})=>x?32768:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[ND,({uniqueId:x})=>({15:x}),({uniqueId:x})=>x?32768:0]},$$scope:{ctx:n}}}),f=new je({props:{class:"form-field required",name:"s3.region",$$slots:{default:[jD,({uniqueId:x})=>({15:x}),({uniqueId:x})=>x?32768:0]},$$scope:{ctx:n}}}),d=new je({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[zD,({uniqueId:x})=>({15:x}),({uniqueId:x})=>x?32768:0]},$$scope:{ctx:n}}}),v=new je({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[HD,({uniqueId:x})=>({15:x}),({uniqueId:x})=>x?32768:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),s=$(),a=g("div"),V(f.$$.fragment),c=$(),u=g("div"),V(d.$$.fragment),h=$(),b=g("div"),V(v.$$.fragment),_=$(),y=g("div"),p(t,"class","col-lg-12"),p(r,"class","col-lg-6"),p(a,"class","col-lg-6"),p(u,"class","col-lg-6"),p(b,"class","col-lg-6"),p(y,"class","col-lg-12"),p(e,"class","grid")},m(x,M){w(x,e,M),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),m(e,s),m(e,a),H(f,a,null),m(e,c),m(e,u),H(d,u,null),m(e,h),m(e,b),H(v,b,null),m(e,_),m(e,y),C=!0},p(x,M){const A={};M&98305&&(A.$$scope={dirty:M,ctx:x}),i.$set(A);const O={};M&98305&&(O.$$scope={dirty:M,ctx:x}),l.$set(O);const D={};M&98305&&(D.$$scope={dirty:M,ctx:x}),f.$set(D);const E={};M&98305&&(E.$$scope={dirty:M,ctx:x}),d.$set(E);const P={};M&98305&&(P.$$scope={dirty:M,ctx:x}),v.$set(P)},i(x){C||(T(i.$$.fragment,x),T(l.$$.fragment,x),T(f.$$.fragment,x),T(d.$$.fragment,x),T(v.$$.fragment,x),x&&Dt(()=>{S||(S=ct(e,fn,{duration:150},!0)),S.run(1)}),C=!0)},o(x){F(i.$$.fragment,x),F(l.$$.fragment,x),F(f.$$.fragment,x),F(d.$$.fragment,x),F(v.$$.fragment,x),x&&(S||(S=ct(e,fn,{duration:150},!1)),S.run(0)),C=!1},d(x){x&&k(e),q(i),q(l),q(f),q(d),q(v),x&&S&&S.end()}}}function RD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Endpoint"),o=$(),r=g("input"),p(e,"for",i=n[15]),p(r,"type","text"),p(r,"id",l=n[15]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].endpoint),s||(a=X(r,"input",n[7]),s=!0)},p(f,c){c&32768&&i!==(i=f[15])&&p(e,"for",i),c&32768&&l!==(l=f[15])&&p(r,"id",l),c&1&&r.value!==f[0].endpoint&&Me(r,f[0].endpoint)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function ND(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Bucket"),o=$(),r=g("input"),p(e,"for",i=n[15]),p(r,"type","text"),p(r,"id",l=n[15]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].bucket),s||(a=X(r,"input",n[8]),s=!0)},p(f,c){c&32768&&i!==(i=f[15])&&p(e,"for",i),c&32768&&l!==(l=f[15])&&p(r,"id",l),c&1&&r.value!==f[0].bucket&&Me(r,f[0].bucket)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function jD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Region"),o=$(),r=g("input"),p(e,"for",i=n[15]),p(r,"type","text"),p(r,"id",l=n[15]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].region),s||(a=X(r,"input",n[9]),s=!0)},p(f,c){c&32768&&i!==(i=f[15])&&p(e,"for",i),c&32768&&l!==(l=f[15])&&p(r,"id",l),c&1&&r.value!==f[0].region&&Me(r,f[0].region)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function zD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Access key"),o=$(),r=g("input"),p(e,"for",i=n[15]),p(r,"type","text"),p(r,"id",l=n[15]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].accessKey),s||(a=X(r,"input",n[10]),s=!0)},p(f,c){c&32768&&i!==(i=f[15])&&p(e,"for",i),c&32768&&l!==(l=f[15])&&p(r,"id",l),c&1&&r.value!==f[0].accessKey&&Me(r,f[0].accessKey)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function HD(n){let e,t,i,o,r,l,s;function a(c){n[11](c)}let f={id:n[15],required:!0};return n[0].secret!==void 0&&(f.value=n[0].secret),r=new mc({props:f}),he.push(()=>Fe(r,"value",a)),{c(){e=g("label"),t=j("Secret"),o=$(),V(r.$$.fragment),p(e,"for",i=n[15])},m(c,u){w(c,e,u),m(e,t),w(c,o,u),H(r,c,u),s=!0},p(c,u){(!s||u&32768&&i!==(i=c[15]))&&p(e,"for",i);const d={};u&32768&&(d.id=c[15]),!l&&u&1&&(l=!0,d.value=c[0].secret,Re(()=>l=!1)),r.$set(d)},i(c){s||(T(r.$$.fragment,c),s=!0)},o(c){F(r.$$.fragment,c),s=!1},d(c){c&&k(e),c&&k(o),q(r,c)}}}function qD(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b;e=new er({});const v=[LD,FD],_=[];function y(S,C){return S[1]?0:1}return c=y(n),u=_[c]=v[c](n),{c(){V(e.$$.fragment),t=$(),i=g("main"),o=g("header"),o.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
<div class="breadcrumb-item">Files storage</div></nav>`,r=$(),l=g("div"),s=g("form"),a=g("div"),a.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>`,f=$(),u.c(),p(o,"class","page-header"),p(a,"class","content txt-xl m-b-base"),p(s,"class","panel"),p(s,"autocomplete","off"),p(l,"class","wrapper"),p(i,"class","page-wrapper")},m(S,C){H(e,S,C),w(S,t,C),w(S,i,C),m(i,o),m(i,r),m(i,l),m(l,s),m(s,a),m(s,f),_[c].m(s,null),d=!0,h||(b=X(s,"submit",Gt(n[4])),h=!0)},p(S,[C]){let x=c;c=y(S),c===x?_[c].p(S,C):(Ae(),F(_[x],1,1,()=>{_[x]=null}),De(),u=_[c],u?u.p(S,C):(u=_[c]=v[c](S),u.c()),T(u,1),u.m(s,null))},i(S){d||(T(e.$$.fragment,S),T(u),d=!0)},o(S){F(e.$$.fragment,S),F(u),d=!1},d(S){q(e,S),S&&k(t),S&&k(i),_[c].d(),h=!1,b()}}}function VD(n,e,t){let i,o={},r=!1,l=!1,s="";B.setDocumentTitle("Files storage"),a();async function a(){t(1,r=!0);try{const S=await Se.Settings.getAll()||{};c(S)}catch(S){Se.errorResponseHandler(S)}t(1,r=!1)}async function f(){if(!(l||!i)){t(2,l=!0);try{const S=await Se.Settings.update(B.filterRedactedProps({s3:o}));c(S),Ui({}),hn("Successfully saved Files storage settings.")}catch(S){Se.errorResponseHandler(S)}t(2,l=!1)}}function c(S={}){t(0,o=(S==null?void 0:S.s3)||{}),t(5,s=JSON.stringify(o))}function u(){o.enabled=this.checked,t(0,o)}function d(){o.endpoint=this.value,t(0,o)}function h(){o.bucket=this.value,t(0,o)}function b(){o.region=this.value,t(0,o)}function v(){o.accessKey=this.value,t(0,o)}function _(S){n.$$.not_equal(o.secret,S)&&(o.secret=S,t(0,o))}const y=()=>f();return n.$$.update=()=>{n.$$.dirty&33&&t(3,i=s!=JSON.stringify(o))},[o,r,l,i,f,s,u,d,h,b,v,_,y]}class BD extends Ie{constructor(e){super(),Le(this,e,VD,qD,Ee,{})}}function UD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[16]),p(o,"for",l=n[16])},m(f,c){w(f,e,c),e.checked=n[0].enabled,w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[8]),s=!0)},p(f,c){c&65536&&t!==(t=f[16])&&p(e,"id",t),c&1&&(e.checked=f[0].enabled),c&65536&&l!==(l=f[16])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function xb(n){let e,t,i,o,r,l,s,a,f,c,u;return i=new je({props:{class:"form-field required",name:"emailPassword.minPasswordLength",$$slots:{default:[WD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field "+(B.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailPassword.exceptDomains",$$slots:{default:[YD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),f=new je({props:{class:"form-field "+(B.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailPassword.onlyDomains",$$slots:{default:[GD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),s=$(),a=g("div"),V(f.$$.fragment),p(t,"class","col-sm-12 m-t-sm"),p(r,"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,o),m(e,r),H(l,r,null),m(e,s),m(e,a),H(f,a,null),u=!0},p(d,h){const b={};h&196609&&(b.$$scope={dirty:h,ctx:d}),i.$set(b);const v={};h&1&&(v.class="form-field "+(B.isEmpty(d[0].onlyDomains)?"":"disabled")),h&196609&&(v.$$scope={dirty:h,ctx:d}),l.$set(v);const _={};h&1&&(_.class="form-field "+(B.isEmpty(d[0].exceptDomains)?"":"disabled")),h&196609&&(_.$$scope={dirty:h,ctx:d}),f.$set(_)},i(d){u||(T(i.$$.fragment,d),T(l.$$.fragment,d),T(f.$$.fragment,d),d&&Dt(()=>{c||(c=ct(e,fn,{duration:150},!0)),c.run(1)}),u=!0)},o(d){F(i.$$.fragment,d),F(l.$$.fragment,d),F(f.$$.fragment,d),d&&(c||(c=ct(e,fn,{duration:150},!1)),c.run(0)),u=!1},d(d){d&&k(e),q(i),q(l),q(f),d&&c&&c.end()}}}function WD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Minimum password length"),o=$(),r=g("input"),p(e,"for",i=n[16]),p(r,"type","number"),p(r,"id",l=n[16]),r.required=!0,p(r,"min","5"),p(r,"max","200")},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].minPasswordLength),s||(a=X(r,"input",n[9]),s=!0)},p(f,c){c&65536&&i!==(i=f[16])&&p(e,"for",i),c&65536&&l!==(l=f[16])&&p(r,"id",l),c&1&&At(r.value)!==f[0].minPasswordLength&&Me(r,f[0].minPasswordLength)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function YD(n){let e,t,i,o,r,l,s,a,f,c,u,d,h;function b(_){n[10](_)}let v={id:n[16],disabled:!B.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(v.value=n[0].exceptDomains),s=new ko({props:v}),he.push(()=>Fe(s,"value",b)),{c(){e=g("label"),t=g("span"),t.textContent="Except domains",i=$(),o=g("i"),l=$(),V(s.$$.fragment),f=$(),c=g("div"),c.textContent="Use comma as separator.",p(t,"class","txt"),p(o,"class","ri-information-line link-hint"),p(e,"for",r=n[16]),p(c,"class","help-block")},m(_,y){w(_,e,y),m(e,t),m(e,i),m(e,o),w(_,l,y),H(s,_,y),w(_,f,y),w(_,c,y),u=!0,d||(h=Xe(St.call(null,o,{text:`Email domains that are NOT allowed to sign up.
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!u||y&65536&&r!==(r=_[16]))&&p(e,"for",r);const S={};y&65536&&(S.id=_[16]),y&1&&(S.disabled=!B.isEmpty(_[0].onlyDomains)),!a&&y&1&&(a=!0,S.value=_[0].exceptDomains,Re(()=>a=!1)),s.$set(S)},i(_){u||(T(s.$$.fragment,_),u=!0)},o(_){F(s.$$.fragment,_),u=!1},d(_){_&&k(e),_&&k(l),q(s,_),_&&k(f),_&&k(c),d=!1,h()}}}function GD(n){let e,t,i,o,r,l,s,a,f,c,u,d,h;function b(_){n[11](_)}let v={id:n[16]+".config.onlyDomains",disabled:!B.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),s=new ko({props:v}),he.push(()=>Fe(s,"value",b)),{c(){e=g("label"),t=g("span"),t.textContent="Only domains",i=$(),o=g("i"),l=$(),V(s.$$.fragment),f=$(),c=g("div"),c.textContent="Use comma as separator.",p(t,"class","txt"),p(o,"class","ri-information-line link-hint"),p(e,"for",r=n[16]+".config.onlyDomains"),p(c,"class","help-block")},m(_,y){w(_,e,y),m(e,t),m(e,i),m(e,o),w(_,l,y),H(s,_,y),w(_,f,y),w(_,c,y),u=!0,d||(h=Xe(St.call(null,o,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!u||y&65536&&r!==(r=_[16]+".config.onlyDomains"))&&p(e,"for",r);const S={};y&65536&&(S.id=_[16]+".config.onlyDomains"),y&1&&(S.disabled=!B.isEmpty(_[0].exceptDomains)),!a&&y&1&&(a=!0,S.value=_[0].onlyDomains,Re(()=>a=!1)),s.$set(S)},i(_){u||(T(s.$$.fragment,_),u=!0)},o(_){F(s.$$.fragment,_),u=!1},d(_){_&&k(e),_&&k(l),q(s,_),_&&k(f),_&&k(c),d=!1,h()}}}function KD(n){let e,t,i,o;e=new je({props:{class:"form-field form-field-toggle m-b-0",name:"emailPassword.enabled",$$slots:{default:[UD,({uniqueId:l})=>({16:l}),({uniqueId:l})=>l?65536:0]},$$scope:{ctx:n}}});let r=n[0].enabled&&xb(n);return{c(){V(e.$$.fragment),t=$(),r&&r.c(),i=lt()},m(l,s){H(e,l,s),w(l,t,s),r&&r.m(l,s),w(l,i,s),o=!0},p(l,s){const a={};s&196609&&(a.$$scope={dirty:s,ctx:l}),e.$set(a),l[0].enabled?r?(r.p(l,s),s&1&&T(r,1)):(r=xb(l),r.c(),T(r,1),r.m(i.parentNode,i)):r&&(Ae(),F(r,1,1,()=>{r=null}),De())},i(l){o||(T(e.$$.fragment,l),T(r),o=!0)},o(l){F(e.$$.fragment,l),F(r),o=!1},d(l){q(e,l),l&&k(t),r&&r.d(l),l&&k(i)}}}function JD(n){let e;return{c(){e=g("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ZD(n){let e;return{c(){e=g("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Mb(n){let e,t,i,o,r,l;return{c(){e=g("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(s,a){w(s,e,a),o=!0,r||(l=Xe(t=St.call(null,e,{text:"Has errors",position:"left"})),r=!0)},i(s){o||(Dt(()=>{i||(i=ct(e,Bn,{duration:150,start:.7},!0)),i.run(1)}),o=!0)},o(s){i||(i=ct(e,Bn,{duration:150,start:.7},!1)),i.run(0),o=!1},d(s){s&&k(e),s&&i&&i.end(),r=!1,l()}}}function XD(n){let e,t,i,o,r,l,s;function a(d,h){return d[0].enabled?ZD:JD}let f=a(n),c=f(n),u=n[2]&&Mb();return{c(){e=g("div"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Email/Password</span>`,t=$(),c.c(),i=$(),o=g("div"),r=$(),u&&u.c(),l=lt(),p(e,"class","inline-flex"),p(o,"class","flex-fill")},m(d,h){w(d,e,h),w(d,t,h),c.m(d,h),w(d,i,h),w(d,o,h),w(d,r,h),u&&u.m(d,h),w(d,l,h),s=!0},p(d,h){f!==(f=a(d))&&(c.d(1),c=f(d),c&&(c.c(),c.m(i.parentNode,i))),d[2]?u?h&4&&T(u,1):(u=Mb(),u.c(),T(u,1),u.m(l.parentNode,l)):u&&(Ae(),F(u,1,1,()=>{u=null}),De())},i(d){s||(T(u),s=!0)},o(d){F(u),s=!1},d(d){d&&k(e),d&&k(t),c.d(d),d&&k(i),d&&k(o),d&&k(r),u&&u.d(d),d&&k(l)}}}function QD(n){let e,t;const i=[n[3]];let o={$$slots:{header:[XD],default:[KD]},$$scope:{ctx:n}};for(let r=0;r<i.length;r+=1)o=ut(o,i[r]);return e=new dc({props:o}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){V(e.$$.fragment)},m(r,l){H(e,r,l),t=!0},p(r,[l]){const s=l&8?bn(i,[pi(r[3])]):{};l&131077&&(s.$$scope={dirty:l,ctx:r}),e.$set(s)},i(r){t||(T(e.$$.fragment,r),t=!0)},o(r){F(e.$$.fragment,r),t=!1},d(r){n[12](null),q(e,r)}}}function eO(n,e,t){let i;const o=["config","expand","collapse","collapseSiblings"];let r=Wt(e,o),l;pn(n,go,x=>t(7,l=x));let{config:s={}}=e,a;function f(){a==null||a.expand()}function c(){a==null||a.collapse()}function u(){a==null||a.collapseSiblings()}function d(){s.enabled=this.checked,t(0,s)}function h(){s.minPasswordLength=At(this.value),t(0,s)}function b(x){n.$$.not_equal(s.exceptDomains,x)&&(s.exceptDomains=x,t(0,s))}function v(x){n.$$.not_equal(s.onlyDomains,x)&&(s.onlyDomains=x,t(0,s))}function _(x){he[x?"unshift":"push"](()=>{a=x,t(1,a)})}function y(x){ft.call(this,n,x)}function S(x){ft.call(this,n,x)}function C(x){ft.call(this,n,x)}return n.$$set=x=>{e=ut(ut({},e),ui(x)),t(3,r=Wt(e,o)),"config"in x&&t(0,s=x.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!B.isEmpty(l==null?void 0:l.emailPassword))},[s,a,i,r,f,c,u,l,d,h,b,v,_,y,S,C]}class tO extends Ie{constructor(e){super(),Le(this,e,eO,QD,Ee,{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 nO(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(o,"for",l=n[22])},m(f,c){w(f,e,c),e.checked=n[0].enabled,w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[11]),s=!0)},p(f,c){c&4194304&&t!==(t=f[22])&&p(e,"id",t),c&1&&(e.checked=f[0].enabled),c&4194304&&l!==(l=f[22])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function $b(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b;r=new je({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[iO,({uniqueId:_})=>({22:_}),({uniqueId:_})=>_?4194304:0]},$$scope:{ctx:n}}}),a=new je({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[oO,({uniqueId:_})=>({22:_}),({uniqueId:_})=>_?4194304:0]},$$scope:{ctx:n}}}),u=new je({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[rO,({uniqueId:_})=>({22:_}),({uniqueId:_})=>_?4194304:0]},$$scope:{ctx:n}}});let v=n[4]&&Ab(n);return{c(){e=g("div"),t=g("div"),i=$(),o=g("div"),V(r.$$.fragment),l=$(),s=g("div"),V(a.$$.fragment),f=$(),c=g("div"),V(u.$$.fragment),d=$(),v&&v.c(),p(t,"class","col-12 spacing"),p(o,"class","col-lg-6"),p(s,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(_,y){w(_,e,y),m(e,t),m(e,i),m(e,o),H(r,o,null),m(e,l),m(e,s),H(a,s,null),m(e,f),m(e,c),H(u,c,null),m(e,d),v&&v.m(e,null),b=!0},p(_,y){const S={};y&2&&(S.name=_[1]+".clientId"),y&12582913&&(S.$$scope={dirty:y,ctx:_}),r.$set(S);const C={};y&2&&(C.name=_[1]+".clientSecret"),y&12582913&&(C.$$scope={dirty:y,ctx:_}),a.$set(C);const x={};y&2&&(x.name=_[1]+".allowRegistrations"),y&12582913&&(x.$$scope={dirty:y,ctx:_}),u.$set(x),_[4]?v?(v.p(_,y),y&16&&T(v,1)):(v=Ab(_),v.c(),T(v,1),v.m(e,null)):v&&(Ae(),F(v,1,1,()=>{v=null}),De())},i(_){b||(T(r.$$.fragment,_),T(a.$$.fragment,_),T(u.$$.fragment,_),T(v),_&&Dt(()=>{h||(h=ct(e,fn,{duration:200},!0)),h.run(1)}),b=!0)},o(_){F(r.$$.fragment,_),F(a.$$.fragment,_),F(u.$$.fragment,_),F(v),_&&(h||(h=ct(e,fn,{duration:200},!1)),h.run(0)),b=!1},d(_){_&&k(e),q(r),q(a),q(u),v&&v.d(),_&&h&&h.end()}}}function iO(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Client ID"),o=$(),r=g("input"),p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].clientId),s||(a=X(r,"input",n[12]),s=!0)},p(f,c){c&4194304&&i!==(i=f[22])&&p(e,"for",i),c&4194304&&l!==(l=f[22])&&p(r,"id",l),c&1&&r.value!==f[0].clientId&&Me(r,f[0].clientId)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function oO(n){let e,t,i,o,r,l,s;function a(c){n[13](c)}let f={id:n[22],required:!0};return n[0].clientSecret!==void 0&&(f.value=n[0].clientSecret),r=new mc({props:f}),he.push(()=>Fe(r,"value",a)),{c(){e=g("label"),t=j("Client Secret"),o=$(),V(r.$$.fragment),p(e,"for",i=n[22])},m(c,u){w(c,e,u),m(e,t),w(c,o,u),H(r,c,u),s=!0},p(c,u){(!s||u&4194304&&i!==(i=c[22]))&&p(e,"for",i);const d={};u&4194304&&(d.id=c[22]),!l&&u&1&&(l=!0,d.value=c[0].clientSecret,Re(()=>l=!1)),r.$set(d)},i(c){s||(T(r.$$.fragment,c),s=!0)},o(c){F(r.$$.fragment,c),s=!1},d(c){c&&k(e),c&&k(o),q(r,c)}}}function rO(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Allow registration for new users"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(o,"for",l=n[22])},m(f,c){w(f,e,c),e.checked=n[0].allowRegistrations,w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[14]),s=!0)},p(f,c){c&4194304&&t!==(t=f[22])&&p(e,"id",t),c&1&&(e.checked=f[0].allowRegistrations),c&4194304&&l!==(l=f[22])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function Ab(n){let e,t,i,o,r,l,s,a,f,c,u,d,h;return l=new je({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[lO,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),f=new je({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[sO,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),d=new je({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[aO,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),t.textContent="Optional endpoints (if you self host the OAUTH2 service)",i=$(),o=g("div"),r=g("div"),V(l.$$.fragment),s=$(),a=g("div"),V(f.$$.fragment),c=$(),u=g("div"),V(d.$$.fragment),p(t,"class","section-title"),p(r,"class","col-lg-4"),p(a,"class","col-lg-4"),p(u,"class","col-lg-4"),p(o,"class","grid"),p(e,"class","col-lg-12")},m(b,v){w(b,e,v),m(e,t),m(e,i),m(e,o),m(o,r),H(l,r,null),m(o,s),m(o,a),H(f,a,null),m(o,c),m(o,u),H(d,u,null),h=!0},p(b,v){const _={};v&2&&(_.name=b[1]+".authUrl"),v&12582913&&(_.$$scope={dirty:v,ctx:b}),l.$set(_);const y={};v&2&&(y.name=b[1]+".tokenUrl"),v&12582913&&(y.$$scope={dirty:v,ctx:b}),f.$set(y);const S={};v&2&&(S.name=b[1]+".userApiUrl"),v&12582913&&(S.$$scope={dirty:v,ctx:b}),d.$set(S)},i(b){h||(T(l.$$.fragment,b),T(f.$$.fragment,b),T(d.$$.fragment,b),h=!0)},o(b){F(l.$$.fragment,b),F(f.$$.fragment,b),F(d.$$.fragment,b),h=!1},d(b){b&&k(e),q(l),q(f),q(d)}}}function lO(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Custom Auth URL"),o=$(),r=g("input"),p(e,"for",i=n[22]),p(r,"type","url"),p(r,"id",l=n[22])},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].authUrl),s||(a=X(r,"input",n[15]),s=!0)},p(f,c){c&4194304&&i!==(i=f[22])&&p(e,"for",i),c&4194304&&l!==(l=f[22])&&p(r,"id",l),c&1&&Me(r,f[0].authUrl)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function sO(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Custom Token URL"),o=$(),r=g("input"),p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22])},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].tokenUrl),s||(a=X(r,"input",n[16]),s=!0)},p(f,c){c&4194304&&i!==(i=f[22])&&p(e,"for",i),c&4194304&&l!==(l=f[22])&&p(r,"id",l),c&1&&r.value!==f[0].tokenUrl&&Me(r,f[0].tokenUrl)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function aO(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Custom User API URL"),o=$(),r=g("input"),p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22])},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].userApiUrl),s||(a=X(r,"input",n[17]),s=!0)},p(f,c){c&4194304&&i!==(i=f[22])&&p(e,"for",i),c&4194304&&l!==(l=f[22])&&p(r,"id",l),c&1&&r.value!==f[0].userApiUrl&&Me(r,f[0].userApiUrl)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function fO(n){let e,t,i,o;e=new je({props:{class:"form-field form-field-toggle m-b-0",name:n[1]+".enabled",$$slots:{default:[nO,({uniqueId:l})=>({22:l}),({uniqueId:l})=>l?4194304:0]},$$scope:{ctx:n}}});let r=n[0].enabled&&$b(n);return{c(){V(e.$$.fragment),t=$(),r&&r.c(),i=lt()},m(l,s){H(e,l,s),w(l,t,s),r&&r.m(l,s),w(l,i,s),o=!0},p(l,s){const a={};s&2&&(a.name=l[1]+".enabled"),s&12582913&&(a.$$scope={dirty:s,ctx:l}),e.$set(a),l[0].enabled?r?(r.p(l,s),s&1&&T(r,1)):(r=$b(l),r.c(),T(r,1),r.m(i.parentNode,i)):r&&(Ae(),F(r,1,1,()=>{r=null}),De())},i(l){o||(T(e.$$.fragment,l),T(r),o=!0)},o(l){F(e.$$.fragment,l),F(r),o=!1},d(l){q(e,l),l&&k(t),r&&r.d(l),l&&k(i)}}}function Db(n){let e;return{c(){e=g("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 cO(n){let e;return{c(){e=g("span"),e.textContent="Disabled",p(e,"class","label label-hint")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function uO(n){let e;return{c(){e=g("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ob(n){let e,t,i,o,r,l;return{c(){e=g("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(s,a){w(s,e,a),o=!0,r||(l=Xe(t=St.call(null,e,{text:"Has errors",position:"left"})),r=!0)},i(s){o||(Dt(()=>{i||(i=ct(e,Bn,{duration:150,start:.7},!0)),i.run(1)}),o=!0)},o(s){i||(i=ct(e,Bn,{duration:150,start:.7},!1)),i.run(0),o=!1},d(s){s&&k(e),s&&i&&i.end(),r=!1,l()}}}function dO(n){let e,t,i,o,r,l,s,a,f,c,u=n[3]&&Db(n);function d(_,y){return _[0].enabled?uO:cO}let h=d(n),b=h(n),v=n[6]&&Ob();return{c(){e=g("div"),u&&u.c(),t=$(),i=g("span"),o=j(n[2]),r=$(),b.c(),l=$(),s=g("div"),a=$(),v&&v.c(),f=lt(),p(i,"class","txt"),p(e,"class","inline-flex"),p(s,"class","flex-fill")},m(_,y){w(_,e,y),u&&u.m(e,null),m(e,t),m(e,i),m(i,o),w(_,r,y),b.m(_,y),w(_,l,y),w(_,s,y),w(_,a,y),v&&v.m(_,y),w(_,f,y),c=!0},p(_,y){_[3]?u?u.p(_,y):(u=Db(_),u.c(),u.m(e,t)):u&&(u.d(1),u=null),(!c||y&4)&&ge(o,_[2]),h!==(h=d(_))&&(b.d(1),b=h(_),b&&(b.c(),b.m(l.parentNode,l))),_[6]?v?y&64&&T(v,1):(v=Ob(),v.c(),T(v,1),v.m(f.parentNode,f)):v&&(Ae(),F(v,1,1,()=>{v=null}),De())},i(_){c||(T(v),c=!0)},o(_){F(v),c=!1},d(_){_&&k(e),u&&u.d(),_&&k(r),b.d(_),_&&k(l),_&&k(s),_&&k(a),v&&v.d(_),_&&k(f)}}}function pO(n){let e,t;const i=[n[7]];let o={$$slots:{header:[dO],default:[fO]},$$scope:{ctx:n}};for(let r=0;r<i.length;r+=1)o=ut(o,i[r]);return e=new dc({props:o}),n[18](e),e.$on("expand",n[19]),e.$on("collapse",n[20]),e.$on("toggle",n[21]),{c(){V(e.$$.fragment)},m(r,l){H(e,r,l),t=!0},p(r,[l]){const s=l&128?bn(i,[pi(r[7])]):{};l&8388703&&(s.$$scope={dirty:l,ctx:r}),e.$set(s)},i(r){t||(T(e.$$.fragment,r),t=!0)},o(r){F(e.$$.fragment,r),t=!1},d(r){n[18](null),q(e,r)}}}function hO(n,e,t){let i;const o=["key","title","icon","config","showSelfHostedFields","expand","collapse"];let r=Wt(e,o),l;pn(n,go,P=>t(10,l=P));let{key:s}=e,{title:a}=e,{icon:f=""}=e,{config:c={}}=e,{showSelfHostedFields:u=!1}=e,d;function h(){d==null||d.expand()}function b(){d==null||d.collapse()}function v(){c.enabled=this.checked,t(0,c)}function _(){c.clientId=this.value,t(0,c)}function y(P){n.$$.not_equal(c.clientSecret,P)&&(c.clientSecret=P,t(0,c))}function S(){c.allowRegistrations=this.checked,t(0,c)}function C(){c.authUrl=this.value,t(0,c)}function x(){c.tokenUrl=this.value,t(0,c)}function M(){c.userApiUrl=this.value,t(0,c)}function A(P){he[P?"unshift":"push"](()=>{d=P,t(5,d)})}function O(P){ft.call(this,n,P)}function D(P){ft.call(this,n,P)}function E(P){ft.call(this,n,P)}return n.$$set=P=>{e=ut(ut({},e),ui(P)),t(7,r=Wt(e,o)),"key"in P&&t(1,s=P.key),"title"in P&&t(2,a=P.title),"icon"in P&&t(3,f=P.icon),"config"in P&&t(0,c=P.config),"showSelfHostedFields"in P&&t(4,u=P.showSelfHostedFields)},n.$$.update=()=>{n.$$.dirty&1026&&t(6,i=!B.isEmpty(B.getNestedVal(l,s))),n.$$.dirty&3&&(c.enabled||D0(s))},[c,s,a,f,u,d,i,r,h,b,l,v,_,y,S,C,x,M,A,O,D,E]}class Il extends Ie{constructor(e){super(),Le(this,e,hO,pO,Ee,{key:1,title:2,icon:3,config:0,showSelfHostedFields:4,expand:8,collapse:9})}get expand(){return this.$$.ctx[8]}get collapse(){return this.$$.ctx[9]}}function mO(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C,x,M,A,O,D,E;function P(ce){n[8](ce)}let I={single:!0};n[0].emailAuth!==void 0&&(I.config=n[0].emailAuth),t=new tO({props:I}),n[7](t),he.push(()=>Fe(t,"config",P));function R(ce){n[9](ce)}let G={single:!0,key:"googleAuth",title:"Google",icon:"ri-google-line"};n[0].googleAuth!==void 0&&(G.config=n[0].googleAuth),r=new Il({props:G}),he.push(()=>Fe(r,"config",R));function U(ce){n[10](ce)}let z={single:!0,key:"facebookAuth",title:"Facebook",icon:"ri-facebook-line"};n[0].facebookAuth!==void 0&&(z.config=n[0].facebookAuth),a=new Il({props:z}),he.push(()=>Fe(a,"config",U));function K(ce){n[11](ce)}let Y={single:!0,key:"githubAuth",title:"GitHub",icon:"ri-github-line"};n[0].githubAuth!==void 0&&(Y.config=n[0].githubAuth),u=new Il({props:Y}),he.push(()=>Fe(u,"config",K));function W(ce){n[12](ce)}let te={single:!0,key:"gitlabAuth",title:"GitLab",icon:"ri-gitlab-line",showSelfHostedFields:!0};return n[0].gitlabAuth!==void 0&&(te.config=n[0].gitlabAuth),b=new Il({props:te}),he.push(()=>Fe(b,"config",W)),{c(){e=g("div"),V(t.$$.fragment),o=$(),V(r.$$.fragment),s=$(),V(a.$$.fragment),c=$(),V(u.$$.fragment),h=$(),V(b.$$.fragment),_=$(),y=g("div"),S=g("div"),C=$(),x=g("button"),M=g("span"),M.textContent="Save changes",p(e,"class","accordions"),p(S,"class","flex-fill"),p(M,"class","txt"),p(x,"type","submit"),p(x,"class","btn btn-expanded"),x.disabled=A=!n[4]||n[3],ne(x,"btn-loading",n[3]),p(y,"class","flex m-t-base")},m(ce,ve){w(ce,e,ve),H(t,e,null),m(e,o),H(r,e,null),m(e,s),H(a,e,null),m(e,c),H(u,e,null),m(e,h),H(b,e,null),w(ce,_,ve),w(ce,y,ve),m(y,S),m(y,C),m(y,x),m(x,M),O=!0,D||(E=X(x,"click",n[13]),D=!0)},p(ce,ve){const oe={};!i&&ve&1&&(i=!0,oe.config=ce[0].emailAuth,Re(()=>i=!1)),t.$set(oe);const J={};!l&&ve&1&&(l=!0,J.config=ce[0].googleAuth,Re(()=>l=!1)),r.$set(J);const $e={};!f&&ve&1&&(f=!0,$e.config=ce[0].facebookAuth,Re(()=>f=!1)),a.$set($e);const ee={};!d&&ve&1&&(d=!0,ee.config=ce[0].githubAuth,Re(()=>d=!1)),u.$set(ee);const _e={};!v&&ve&1&&(v=!0,_e.config=ce[0].gitlabAuth,Re(()=>v=!1)),b.$set(_e),(!O||ve&24&&A!==(A=!ce[4]||ce[3]))&&(x.disabled=A),ve&8&&ne(x,"btn-loading",ce[3])},i(ce){O||(T(t.$$.fragment,ce),T(r.$$.fragment,ce),T(a.$$.fragment,ce),T(u.$$.fragment,ce),T(b.$$.fragment,ce),O=!0)},o(ce){F(t.$$.fragment,ce),F(r.$$.fragment,ce),F(a.$$.fragment,ce),F(u.$$.fragment,ce),F(b.$$.fragment,ce),O=!1},d(ce){ce&&k(e),n[7](null),q(t),q(r),q(a),q(u),q(b),ce&&k(_),ce&&k(y),D=!1,E()}}}function bO(n){let e;return{c(){e=g("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function gO(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b;e=new er({});const v=[bO,mO],_=[];function y(S,C){return S[2]?0:1}return c=y(n),u=_[c]=v[c](n),{c(){V(e.$$.fragment),t=$(),i=g("main"),o=g("header"),o.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
<div class="breadcrumb-item">Auth providers</div></nav>`,r=$(),l=g("div"),s=g("form"),a=g("h6"),a.textContent="Manage the allowed users sign-in/sign-up methods.",f=$(),u.c(),p(o,"class","page-header"),p(a,"class","m-b-base"),p(s,"class","panel"),p(s,"autocomplete","off"),p(l,"class","wrapper"),p(i,"class","page-wrapper")},m(S,C){H(e,S,C),w(S,t,C),w(S,i,C),m(i,o),m(i,r),m(i,l),m(l,s),m(s,a),m(s,f),_[c].m(s,null),d=!0,h||(b=X(s,"submit",Gt(n[5])),h=!0)},p(S,[C]){let x=c;c=y(S),c===x?_[c].p(S,C):(Ae(),F(_[x],1,1,()=>{_[x]=null}),De(),u=_[c],u?u.p(S,C):(u=_[c]=v[c](S),u.c()),T(u,1),u.m(s,null))},i(S){d||(T(e.$$.fragment,S),T(u),d=!0)},o(S){F(e.$$.fragment,S),F(u),d=!1},d(S){q(e,S),S&&k(t),S&&k(i),_[c].d(),h=!1,b()}}}function _O(n,e,t){let i,o,r={},l=!1,s=!1,a="";B.setDocumentTitle("Auth providers"),f();async function f(){t(2,l=!0);try{const C=await Se.Settings.getAll()||{};u(C)}catch(C){Se.errorResponseHandler(C)}t(2,l=!1)}async function c(){if(!(s||!i)){t(3,s=!0);try{const C=await Se.Settings.update(B.filterRedactedProps(r));u(C),Ui({}),o==null||o.collapseSiblings(),hn("Successfully updated auth providers.")}catch(C){Se.errorResponseHandler(C)}t(3,s=!1)}}function u(C){C=C||{},t(0,r={}),t(0,r.emailAuth=Object.assign({enabled:!0},C.emailAuth),r);const x=["googleAuth","facebookAuth","githubAuth","gitlabAuth"];for(const M of x)t(0,r[M]=Object.assign({enabled:!1,allowRegistrations:!0},C[M]),r);t(6,a=JSON.stringify(r))}function d(C){he[C?"unshift":"push"](()=>{o=C,t(1,o)})}function h(C){n.$$.not_equal(r.emailAuth,C)&&(r.emailAuth=C,t(0,r))}function b(C){n.$$.not_equal(r.googleAuth,C)&&(r.googleAuth=C,t(0,r))}function v(C){n.$$.not_equal(r.facebookAuth,C)&&(r.facebookAuth=C,t(0,r))}function _(C){n.$$.not_equal(r.githubAuth,C)&&(r.githubAuth=C,t(0,r))}function y(C){n.$$.not_equal(r.gitlabAuth,C)&&(r.gitlabAuth=C,t(0,r))}const S=()=>c();return n.$$.update=()=>{n.$$.dirty&65&&t(4,i=a!=JSON.stringify(r))},[r,o,l,s,i,c,a,d,h,b,v,_,y,S]}class vO extends Ie{constructor(e){super(),Le(this,e,_O,gO,Ee,{})}}function Tb(n,e,t){const i=n.slice();return i[12]=e[t],i[13]=e,i[14]=t,i}function yO(n){let e=[],t=new Map,i,o,r,l,s,a,f,c,u,d,h=n[4];const b=v=>v[12].key;for(let v=0;v<h.length;v+=1){let _=Tb(n,h,v),y=b(_);t.set(y,e[v]=Eb(y,_))}return{c(){for(let v=0;v<e.length;v+=1)e[v].c();i=$(),o=g("div"),r=g("div"),l=$(),s=g("button"),a=g("span"),a.textContent="Save changes",p(r,"class","flex-fill"),p(a,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=f=!n[3]||n[2],ne(s,"btn-loading",n[2]),p(o,"class","flex")},m(v,_){for(let y=0;y<e.length;y+=1)e[y].m(v,_);w(v,i,_),w(v,o,_),m(o,r),m(o,l),m(o,s),m(s,a),c=!0,u||(d=X(s,"click",n[9]),u=!0)},p(v,_){_&32785&&(h=v[4],Ae(),e=st(e,_,b,1,v,h,t,i.parentNode,Pt,Eb,i,Tb),De()),(!c||_&12&&f!==(f=!v[3]||v[2]))&&(s.disabled=f),_&4&&ne(s,"btn-loading",v[2])},i(v){if(!c){for(let _=0;_<h.length;_+=1)T(e[_]);c=!0}},o(v){for(let _=0;_<e.length;_+=1)F(e[_]);c=!1},d(v){for(let _=0;_<e.length;_+=1)e[_].d(v);v&&k(i),v&&k(o),u=!1,d()}}}function kO(n){let e;return{c(){e=g("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function wO(n){let e,t=n[12].label+"",i,o,r,l,s,a,f,c,u,d,h;function b(){n[7].call(s,n[12])}function v(){return n[8](n[12])}return{c(){e=g("label"),i=j(t),o=j(" duration (in seconds)"),l=$(),s=g("input"),f=$(),c=g("div"),u=g("span"),u.textContent="Invalidate all previously issued tokens",p(e,"for",r=n[15]),p(s,"type","number"),p(s,"id",a=n[15]),s.required=!0,p(u,"class","link-primary"),ne(u,"txt-success",n[0][n[12].key].secret),p(c,"class","help-block")},m(_,y){w(_,e,y),m(e,i),m(e,o),w(_,l,y),w(_,s,y),Me(s,n[0][n[12].key].duration),w(_,f,y),w(_,c,y),m(c,u),d||(h=[X(s,"input",b),X(u,"click",v)],d=!0)},p(_,y){n=_,y&32768&&r!==(r=n[15])&&p(e,"for",r),y&32768&&a!==(a=n[15])&&p(s,"id",a),y&17&&At(s.value)!==n[0][n[12].key].duration&&Me(s,n[0][n[12].key].duration),y&17&&ne(u,"txt-success",n[0][n[12].key].secret)},d(_){_&&k(e),_&&k(l),_&&k(s),_&&k(f),_&&k(c),d=!1,rt(h)}}}function Eb(n,e){let t,i,o;return i=new je({props:{class:"form-field required",name:e[12].key+".duration",$$slots:{default:[wO,({uniqueId:r})=>({15:r}),({uniqueId:r})=>r?32768:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=lt(),V(i.$$.fragment),this.first=t},m(r,l){w(r,t,l),H(i,r,l),o=!0},p(r,l){e=r;const s={};l&98305&&(s.$$scope={dirty:l,ctx:e}),i.$set(s)},i(r){o||(T(i.$$.fragment,r),o=!0)},o(r){F(i.$$.fragment,r),o=!1},d(r){r&&k(t),q(i,r)}}}function SO(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b;e=new er({});const v=[kO,yO],_=[];function y(S,C){return S[1]?0:1}return c=y(n),u=_[c]=v[c](n),{c(){V(e.$$.fragment),t=$(),i=g("main"),o=g("header"),o.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
<div class="breadcrumb-item">Token options</div></nav>`,r=$(),l=g("div"),s=g("form"),a=g("div"),a.innerHTML="<p>Adjust common token options.</p>",f=$(),u.c(),p(o,"class","page-header"),p(a,"class","content m-b-sm txt-xl"),p(s,"class","panel"),p(s,"autocomplete","off"),p(l,"class","wrapper"),p(i,"class","page-wrapper")},m(S,C){H(e,S,C),w(S,t,C),w(S,i,C),m(i,o),m(i,r),m(i,l),m(l,s),m(s,a),m(s,f),_[c].m(s,null),d=!0,h||(b=X(s,"submit",Gt(n[5])),h=!0)},p(S,[C]){let x=c;c=y(S),c===x?_[c].p(S,C):(Ae(),F(_[x],1,1,()=>{_[x]=null}),De(),u=_[c],u?u.p(S,C):(u=_[c]=v[c](S),u.c()),T(u,1),u.m(s,null))},i(S){d||(T(e.$$.fragment,S),T(u),d=!0)},o(S){F(e.$$.fragment,S),F(u),d=!1},d(S){q(e,S),S&&k(t),S&&k(i),_[c].d(),h=!1,b()}}}function CO(n,e,t){let i;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"}];let r={},l=!1,s=!1,a="";B.setDocumentTitle("Token options"),f();async function f(){t(1,l=!0);try{const v=await Se.Settings.getAll()||{};u(v)}catch(v){Se.errorResponseHandler(v)}t(1,l=!1)}async function c(){if(!(s||!i)){t(2,s=!0);try{const v=await Se.Settings.update(B.filterRedactedProps(r));u(v),hn("Successfully saved tokens options.")}catch(v){Se.errorResponseHandler(v)}t(2,s=!1)}}function u(v){var _;v=v||{},t(0,r={});for(const y of o)t(0,r[y.key]={duration:((_=v[y.key])==null?void 0:_.duration)||0},r);t(6,a=JSON.stringify(r))}function d(v){r[v.key].duration=At(this.value),t(0,r)}const h=v=>{r[v.key].secret?(delete r[v.key].secret,t(0,r)):t(0,r[v.key].secret=B.randomString(50),r)},b=()=>c();return n.$$.update=()=>{n.$$.dirty&65&&t(3,i=a!=JSON.stringify(r))},[r,l,s,i,o,c,a,d,h,b]}class xO extends Ie{constructor(e){super(),Le(this,e,CO,SO,Ee,{})}}const MO={"/_elements":Zt({asyncComponent:()=>_i(()=>import("./Elements.fba5cef6.js"),[])}),"/login":Zt({component:rD,conditions:[n=>!Se.AuthStore.isValid]}),"/request-password-reset":Zt({asyncComponent:()=>_i(()=>import("./PageAdminRequestPasswordReset.45866e03.js"),[]),conditions:[n=>!Se.AuthStore.isValid]}),"/confirm-password-reset/:token":Zt({asyncComponent:()=>_i(()=>import("./PageAdminConfirmPasswordReset.6f7f63d0.js"),[]),conditions:[n=>!Se.AuthStore.isValid]}),"/collections":Zt({component:oA,conditions:[n=>Se.AuthStore.isValid]}),"/logs":Zt({component:mC,conditions:[n=>Se.AuthStore.isValid]}),"/users":Zt({component:AA,conditions:[n=>Se.AuthStore.isValid]}),"/users/confirm-password-reset/:token":Zt({asyncComponent:()=>_i(()=>import("./PageUserConfirmPasswordReset.6d56895b.js"),[]),conditions:[()=>(Se.logout(!1),!0)]}),"/users/confirm-verification/:token":Zt({asyncComponent:()=>_i(()=>import("./PageUserConfirmVerification.8d023a32.js"),[]),conditions:[()=>(Se.logout(!1),!0)]}),"/users/confirm-email-change/:token":Zt({asyncComponent:()=>_i(()=>import("./PageUserConfirmEmailChange.a2624070.js"),[]),conditions:[()=>(Se.logout(!1),!0)]}),"/settings":Zt({component:pD,conditions:[n=>Se.AuthStore.isValid]}),"/settings/admins":Zt({component:JA,conditions:[n=>Se.AuthStore.isValid]}),"/settings/mail":Zt({component:PD,conditions:[n=>Se.AuthStore.isValid]}),"/settings/storage":Zt({component:BD,conditions:[n=>Se.AuthStore.isValid]}),"/settings/auth-providers":Zt({component:vO,conditions:[n=>Se.AuthStore.isValid]}),"/settings/tokens":Zt({component:xO,conditions:[n=>Se.AuthStore.isValid]}),"*":Zt({asyncComponent:()=>_i(()=>import("./NotFoundPage.899a1d8c.js"),[])})};function $O(n,{from:e,to:t},i={}){const o=getComputedStyle(n),r=o.transform==="none"?"":o.transform,[l,s]=o.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*l/t.width-(t.left+l),f=e.top+e.height*s/t.height-(t.top+s),{delay:c=0,duration:u=h=>Math.sqrt(h)*120,easing:d=As}=i;return{delay:c,duration:Yn(u)?u(Math.sqrt(a*a+f*f)):u,easing:d,css:(h,b)=>{const v=b*a,_=b*f,y=h+b*e.width/t.width,S=h+b*e.height/t.height;return`transform: ${r} translate(${v}px, ${_}px) scale(${y}, ${S});`}}}function Pb(n,e,t){const i=n.slice();return i[2]=e[t],i}function AO(n){let e;return{c(){e=g("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function DO(n){let e;return{c(){e=g("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function OO(n){let e;return{c(){e=g("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Fb(n,e){let t,i,o,r,l=e[2].message+"",s,a,f,c,u,d,h=le,b,v,_;function y(M,A){return M[2].type==="info"?OO:M[2].type==="success"?DO:AO}let S=y(e),C=S(e);function x(){return e[1](e[2])}return{key:n,first:null,c(){t=g("div"),i=g("div"),C.c(),o=$(),r=g("div"),s=j(l),a=$(),f=g("div"),f.innerHTML='<i class="ri-close-line"></i>',c=$(),p(i,"class","icon"),p(r,"class","content"),p(f,"class","close"),p(t,"class","alert txt-break"),ne(t,"alert-info",e[2].type=="info"),ne(t,"alert-success",e[2].type=="success"),ne(t,"alert-danger",e[2].type=="error"),ne(t,"alert-warning",e[2].type=="warning"),this.first=t},m(M,A){w(M,t,A),m(t,i),C.m(i,null),m(t,o),m(t,r),m(r,s),m(t,a),m(t,f),m(t,c),b=!0,v||(_=X(f,"click",Gt(x)),v=!0)},p(M,A){e=M,S!==(S=y(e))&&(C.d(1),C=S(e),C&&(C.c(),C.m(i,null))),(!b||A&1)&&l!==(l=e[2].message+"")&&ge(s,l),A&1&&ne(t,"alert-info",e[2].type=="info"),A&1&&ne(t,"alert-success",e[2].type=="success"),A&1&&ne(t,"alert-danger",e[2].type=="error"),A&1&&ne(t,"alert-warning",e[2].type=="warning")},r(){d=t.getBoundingClientRect()},f(){U1(t),h(),Ub(t,d)},a(){h(),h=B1(t,d,$O,{duration:150})},i(M){b||(Dt(()=>{u||(u=ct(t,rs,{duration:150},!0)),u.run(1)}),b=!0)},o(M){u||(u=ct(t,rs,{duration:150},!1)),u.run(0),b=!1},d(M){M&&k(t),C.d(),M&&u&&u.end(),v=!1,_()}}}function TO(n){let e,t=[],i=new Map,o,r=n[0];const l=s=>s[2].message;for(let s=0;s<r.length;s+=1){let a=Pb(n,r,s),f=l(a);i.set(f,t[s]=Fb(f,a))}return{c(){e=g("div");for(let s=0;s<t.length;s+=1)t[s].c();p(e,"class","toasts-wrapper")},m(s,a){w(s,e,a);for(let f=0;f<t.length;f+=1)t[f].m(e,null);o=!0},p(s,[a]){if(a&1){r=s[0],Ae();for(let f=0;f<t.length;f+=1)t[f].r();t=st(t,a,l,1,s,r,i,e,K1,Fb,null,Pb);for(let f=0;f<t.length;f+=1)t[f].a();De()}},i(s){if(!o){for(let a=0;a<r.length;a+=1)T(t[a]);o=!0}},o(s){for(let a=0;a<t.length;a+=1)F(t[a]);o=!1},d(s){s&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function EO(n,e,t){let i;return pn(n,zf,r=>t(0,i=r)),[i,r=>$0(r)]}class PO extends Ie{constructor(e){super(),Le(this,e,EO,TO,Ee,{})}}function FO(n){var o;let e,t=((o=n[1])==null?void 0:o.text)+"",i;return{c(){e=g("h4"),i=j(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(r,l){w(r,e,l),m(e,i)},p(r,l){var s;l&2&&t!==(t=((s=r[1])==null?void 0:s.text)+"")&&ge(i,t)},d(r){r&&k(e)}}}function LO(n){let e,t,i,o,r,l,s;return{c(){e=g("button"),t=g("span"),t.textContent="No",i=$(),o=g("button"),r=g("span"),r.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(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-danger btn-expanded"),o.disabled=n[2],ne(o,"btn-loading",n[2])},m(a,f){w(a,e,f),m(e,t),w(a,i,f),w(a,o,f),m(o,r),e.focus(),l||(s=[X(e,"click",n[3]),X(o,"click",n[4])],l=!0)},p(a,f){f&4&&(e.disabled=a[2]),f&4&&(o.disabled=a[2]),f&4&&ne(o,"btn-loading",a[2])},d(a){a&&k(e),a&&k(i),a&&k(o),l=!1,rt(s)}}}function IO(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:[LO],header:[FO]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[5](e),e.$on("hide",n[6]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,[r]){const l={};r&4&&(l.overlayClose=!o[2]),r&4&&(l.escClose=!o[2]),r&135&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[5](null),q(e,o)}}}function RO(n,e,t){let i;pn(n,uc,c=>t(1,i=c));let o,r=!1;const l=()=>{i!=null&&i.noCallback&&i.noCallback(),o==null||o.hide()},s=async()=>{i!=null&&i.yesCallback&&(t(2,r=!0),await Promise.resolve(i.yesCallback()),t(2,r=!1)),o==null||o.hide()};function a(c){he[c?"unshift":"push"](()=>{o=c,t(0,o)})}const f=async()=>{i!=null&&i.noCallback&&i.noCallback(),await Bi(),A1()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(o==null||o.show())},[o,i,r,l,s,a,f]}class NO extends Ie{constructor(e){super(),Le(this,e,RO,IO,Ee,{})}}function Lb(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C,x,M,A,O,D,E,P,I,R,G,U,z,K,Y;return U=new vo({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[jO]},$$scope:{ctx:n}}}),{c(){var W;e=g("aside"),t=g("a"),t.innerHTML='<img src="/_/images/logo.svg" alt="PocketBase logo" width="40" height="40"/>',o=$(),r=g("nav"),l=g("a"),l.innerHTML='<i class="ri-database-2-line"></i>',c=$(),u=g("a"),u.innerHTML='<i class="ri-group-line"></i>',v=$(),_=g("a"),_.innerHTML='<i class="ri-line-chart-line"></i>',x=$(),M=g("a"),M.innerHTML='<i class="ri-tools-line"></i>',E=$(),P=g("figure"),I=g("img"),G=$(),V(U.$$.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(u,"href","/users"),p(u,"class","menu-item"),p(u,"aria-label","Users"),p(_,"href","/logs"),p(_,"class","menu-item"),p(_,"aria-label","Logs"),p(M,"href","/settings"),p(M,"class","menu-item"),p(M,"aria-label","Settings"),p(r,"class","main-menu"),Qn(I.src,R="/_/images/avatars/avatar"+(((W=n[0])==null?void 0:W.avatar)||0)+".svg")||p(I,"src",R),p(I,"alt","Avatar"),p(P,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(W,te){w(W,e,te),m(e,t),m(e,o),m(e,r),m(r,l),m(r,c),m(r,u),m(r,v),m(r,_),m(r,x),m(r,M),m(e,E),m(e,P),m(P,I),m(P,G),H(U,P,null),z=!0,K||(Y=[Xe(i=xn.call(null,t)),Xe(s=xn.call(null,l)),Xe(a=li.call(null,l,{path:"/collections/?.*",className:"current-route"})),Xe(f=St.call(null,l,{text:"Collections",position:"right"})),Xe(d=xn.call(null,u)),Xe(h=li.call(null,u,{path:"/users/?.*",className:"current-route"})),Xe(b=St.call(null,u,{text:"Users",position:"right"})),Xe(y=xn.call(null,_)),Xe(S=li.call(null,_,{path:"/logs/?.*",className:"current-route"})),Xe(C=St.call(null,_,{text:"Logs",position:"right"})),Xe(A=xn.call(null,M)),Xe(O=li.call(null,M,{path:"/settings/?.*",className:"current-route"})),Xe(D=St.call(null,M,{text:"Settings",position:"right"}))],K=!0)},p(W,te){var ve;(!z||te&1&&!Qn(I.src,R="/_/images/avatars/avatar"+(((ve=W[0])==null?void 0:ve.avatar)||0)+".svg"))&&p(I,"src",R);const ce={};te&32&&(ce.$$scope={dirty:te,ctx:W}),U.$set(ce)},i(W){z||(T(U.$$.fragment,W),z=!0)},o(W){F(U.$$.fragment,W),z=!1},d(W){W&&k(e),q(U),K=!1,rt(Y)}}}function jO(n){let e,t,i,o,r,l,s;return{c(){e=g("a"),e.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Manage admins</span>`,t=$(),i=g("hr"),o=$(),r=g("div"),r.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(r,"tabindex","0"),p(r,"class","dropdown-item closable")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,o,f),w(a,r,f),l||(s=[Xe(xn.call(null,e)),X(r,"click",n[3])],l=!0)},p:le,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(o),a&&k(r),l=!1,rt(s)}}}function zO(n){var u;let e,t,i,o,r,l,s,a,f,c=((u=n[0])==null?void 0:u.id)&&Lb(n);return o=new n_({props:{routes:MO}}),o.$on("routeLoading",n[1]),o.$on("conditionsFailed",n[2]),l=new PO({}),a=new NO({}),{c(){e=g("div"),c&&c.c(),t=$(),i=g("div"),V(o.$$.fragment),r=$(),V(l.$$.fragment),s=$(),V(a.$$.fragment),p(i,"class","app-body"),p(e,"class","app-layout")},m(d,h){w(d,e,h),c&&c.m(e,null),m(e,t),m(e,i),H(o,i,null),w(d,r,h),H(l,d,h),w(d,s,h),H(a,d,h),f=!0},p(d,[h]){var b;(b=d[0])!=null&&b.id?c?(c.p(d,h),h&1&&T(c,1)):(c=Lb(d),c.c(),T(c,1),c.m(e,t)):c&&(Ae(),F(c,1,1,()=>{c=null}),De())},i(d){f||(T(c),T(o.$$.fragment,d),T(l.$$.fragment,d),T(a.$$.fragment,d),f=!0)},o(d){F(c),F(o.$$.fragment,d),F(l.$$.fragment,d),F(a.$$.fragment,d),f=!1},d(d){d&&k(e),c&&c.d(),q(o),d&&k(r),q(l,d),d&&k(s),q(a,d)}}}function HO(n,e,t){let i;pn(n,qf,a=>t(0,i=a));let o;function r(a){var f,c;((f=a==null?void 0:a.detail)==null?void 0:f.location)!==o&&(o=(c=a==null?void 0:a.detail)==null?void 0:c.location,B.setDocumentTitle(""),Ui({}),A1())}function l(){Se.AuthStore.isValid?Ss("/"):Se.logout()}function s(){Se.logout()}return[i,r,l,s]}class qO extends Ie{constructor(e){super(),Le(this,e,HO,zO,Ee,{})}}new qO({target:document.getElementById("app")});export{ne as A,X as B,Gt as C,j as D,ge as E,QA as F,Me as G,B as H,rt as I,hn as J,Ss as K,lt as L,pn as M,Go as N,yo as O,yn as P,En as Q,di as R,Ie as S,Ai as a,he as b,Fe as c,$ as d,g as e,V as f,p as g,w as h,Le as i,m as j,Xe as k,Re as l,H as m,T as n,F as o,k as p,q,VO as r,Ee as s,St as t,le as u,xn as v,Ae as w,De as x,Se as y,je as z};