pocketbase/ui/dist/assets/index-41f683eb.js

212 lines
929 KiB
JavaScript
Raw Normal View History

(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function Q(){}const $l=n=>n;function je(n,e){for(const t in e)n[t]=e[t];return n}function wb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function F_(n){return n()}function du(){return Object.create(null)}function De(n){n.forEach(F_)}function jt(n){return typeof n=="function"}function _e(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Rl;function dn(n,e){return Rl||(Rl=document.createElement("a")),Rl.href=e,n===Rl.href}function Sb(n){return Object.keys(n).length===0}function _a(n,...e){if(n==null)return Q;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function $b(n){let e;return _a(n,t=>e=t)(),e}function Xe(n,e,t){n.$$.on_destroy.push(_a(e,t))}function Tt(n,e,t,i){if(n){const s=R_(n,e,t,i);return n[0](s)}}function R_(n,e,t,i){return n[1]&&i?je(t.ctx.slice(),n[1](i(e))):t.ctx}function Ct(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r<o;r+=1)l[r]=e.dirty[r]|s[r];return l}return e.dirty|s}return e.dirty}function Mt(n,e,t,i,s,l){if(s){const o=R_(e,t,i,l);n.p(o,s)}}function Ot(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 Yt(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Qe(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 bi(n){return n??""}function ln(n,e,t){return n.set(t),e}function Ee(n){return n&&jt(n.destroy)?n.destroy:Q}function pu(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const q_=typeof window<"u";let Ro=q_?()=>window.performance.now():()=>Date.now(),ga=q_?n=>requestAnimationFrame(n):Q;const ks=new Set;function j_(n){ks.forEach(e=>{e.c(n)||(ks.delete(e),e.f())}),ks.size!==0&&ga(j_)}function qo(n){let e;return ks.size===0&&ga(j_),{promise:new Promise(t=>{ks.add(e={c:n,f:t})}),abort(){ks.delete(e)}}}function v(n,e){n.appendChild(e)}function V_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Tb(n){const e=y("style");return Cb(V_(n),e),e.sheet}function Cb(n,e){return v(n.head||n,e),e.sheet}function S(n,e,t){n.insertBefore(e,t||null)}function w(n){n.parentNode&&n.parentNode.removeChild(n)}function dt(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function y(n){return document.createElement(n)}function U(n){return document.createTextNode(n)}function E(){return U(" ")}function Se(){return U("")}function K(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function at(n){return function(e){return e.preventDefault(),n.call(this,e)}}function En(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function h(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function ai(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:h(n,i,e[i])}function Mb(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function gt(n){return n===""?null:+n}function Ob(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.
`;for(let b=0;b<=1;b+=a){const k=e+(t-e)*l(b);u+=b*100+`%{${o(k,1-k)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,d=`__svelte_${Db(f)}_${r}`,p=V_(n),{stylesheet:m,rules:_}=ho.get(p)||Eb(p,n);_[d]||(_[d]=!0,m.insertRule(`@keyframes ${d} ${f}`,m.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${d} ${i}ms linear ${s}ms 1 both`,_o+=1,d}function dl(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),_o-=s,_o||Ab())}function Ab(){ga(()=>{_o||(ho.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),ho.clear())})}function Ib(n,e,t,i){if(!e)return Q;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return Q;const{delay:l=0,duration:o=300,easing:r=$l,start:a=Ro()+l,end:u=a+o,tick:f=Q,css:d}=t(n,{from:e,to:s},i);let p=!0,m=!1,_;function g(){d&&(_=cl(n,0,1,o,l,r,d)),l||(m=!0)}function b(){d&&dl(n,_),p=!1}return qo(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),b()),!p)return!1;if(m){const $=k-a,C=0+1*r($/o);f(C,1-C)}return!0}),g(),f(0,1),b}function Pb(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,z_(n,s)}}function z_(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let pl;function _i(n){pl=n}function Tl(){if(!pl)throw new Error("Function called outside component initialization");return pl}function Gt(n){Tl().$$.on_mount.push(n)}function Lb(n){Tl().$$.after_update.push(n)}function B_(n){Tl().$$.on_destroy.push(n)}function wt(){const n=Tl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=H_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function me(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const ys=[],se=[];let ws=[];const jr=[],U_=Promise.resolve();let Vr=!1;function W_(){Vr||(Vr=!0,U_.then(ba))}function pn(){return W_(),U_}function nt(n){ws.push(n)}function ye(n){jr.push(n)}const ir=new Set;let ms=0;function ba(){if(ms!==0)return;const n=pl;do{try{for(;ms<ys.length;){const e=ys[ms];ms++,_i(e),Nb(e.$$)}}catch(e){throw ys.length=0,ms=0,e}for(_i(null),ys.length=0,ms=0;se.length;)se.pop()();for(let e=0;e<ws.length;e+=1){const t=ws[e];ir.has(t)||(ir.add(t),t())}ws.length=0}while(ys.length);for(;jr.length;)jr.pop()();Vr=!1,ir.clear(),_i(n)}function Nb(n){if(n.fragment!==null){n.update(),De(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(nt)}}function Fb(n){const e=[],t=[];ws.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),ws=e}let Hs;function va(){return Hs||(Hs=Promise.resolve(),Hs.then(()=>{Hs=null})),Hs}function ns(n,e,t){n.dispatchEvent(H_(`${e?"intro":"outro"}${t}`))}const oo=new Set;let li;function re(){li={r:0,c:[],p:li}}function ae(){li.r||De(li.c),li=li.p}function A(n,e){n&&n.i&&(oo.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(oo.has(n))return;oo.add(n),li.c.push(()=>{oo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ya={duration:0};function Rb(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&dl(n,o)}function f(){const{delay:p=0,duration:m=300,easing:_=$l,tick:g=Q,css:b}=s||ya;b&&(o=cl(n,0,1,m,p,_,b,a++)),g(0,1);const k=Ro()+p,$=k+m;r&&r.abort(),l=!0,nt(()=>ns(n,!0,"start")),r=qo(C=>{if(l){if(C>=$)return g(1,0),ns(n,!0,"end"),u(),l=!1;if(C>=k){const T=_((C-k)/m);g(T,1-T)}}return l})}let d=!1;return{start(){d||(d=!0,dl(n),jt(s)?(s=s(i),va().then(f)):f())},invalidate(){d=!1},end(){l&&(u(),l=!1)}}}function Y_(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=li;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:d=$l,tick:p=Q,css:m}=s||ya;m&&(o=cl(n,1,0,f,u,d,m));const _=Ro()+u,g=_+f;nt(()=>ns(n,!1,"start")),qo(b=>{if(l){if(b>=g)return p(0,1),ns(n,!1,"end"),--r.r||De(r.c),!1;if(b>=_){con
`),t+=i.map(s=>{let l="";return s.name.includes("(")||s.name.includes(" ")?l+=s.name:l+="`"+s.name+"`",s.collate&&(l+=" COLLATE "+s.collate),s.sort&&(l+=" "+c.sort.toUpperCase()),l}).join(`,
`),i.length>1&&(t+=`
`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=j.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?j.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const s of i)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}}const Uo=An([]);function e1(n,e=4e3){return Wo(n,"info",e)}function Jt(n,e=3e3){return Wo(n,"success",e)}function hl(n,e=4500){return Wo(n,"error",e)}function cy(n,e=4500){return Wo(n,"warning",e)}function Wo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{t1(i)},t)};Uo.update(s=>(Ia(s,i.message),j.pushOrReplaceByKey(s,i,"message"),s))}function t1(n){Uo.update(e=>(Ia(e,n),e))}function Aa(){Uo.update(n=>{for(let e of n)Ia(n,e);return[]})}function Ia(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const wi=An({});function mn(n){wi.set(n||{})}function Ni(n){wi.update(e=>(j.deleteByPath(e,n),e))}const Pa=An({});function Xr(n){Pa.set(n||{})}const fi=An([]),yi=An({}),yo=An(!1),n1=An({});function dy(n){fi.update(e=>{const t=j.findByKey(e,"id",n);return t?yi.set(t):e.length&&yi.set(e[0]),e})}function py(n){yi.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),fi.update(e=>(j.pushOrReplaceByKey(e,n,"id"),La(),j.sortCollections(e)))}function my(n){fi.update(e=>(j.removeByKey(e,"id",n.id),yi.update(t=>t.id===n.id?e[0]:t),La(),e))}async function hy(n=null){yo.set(!0);try{let e=await pe.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),fi.set(e);const t=n&&j.findByKey(e,"id",n);t?yi.set(t):e.length&&yi.set(e[0]),La()}catch(e){pe.errorResponseHandler(e)}yo.set(!1)}function La(){n1.update(n=>(fi.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(s=>{var l;return s.type=="file"&&((l=s.options)==null?void 0:l.protected)}));return e}),n))}const dr="pb_admin_file_token";Vo.prototype.logout=function(n=!0){this.authStore.clear(),n&&qi("/login")};Vo.prototype.errorResponseHandler=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{};if(e&&i!==404){let l=s.message||n.message||t;l&&hl(l)}if(j.isEmpty(s.data)||mn(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),qi("/")};Vo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=$b(n1);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(dr)||"";return(!t||eg(t,15))&&(t&&localStorage.removeItem(dr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(dr,t),this._adminFileTokenRequest=null),t};class _y extends tg{save(e,t){super.save(e,t),t instanceof os&&Xr(t)}clear(){super.clear(),Xr(null)}}const pe=new Vo("../",new _y("pb_admin_auth"));pe.authStore.model instanceof os&&Xr(pe.authStore.model);function gy(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=n[3].default,_=Tt(m,n,n[2],null);return{c(){e=y("div"),t=y("main"),_&&_.c(),i=E(),s=y("footer"),l=y("a"),l.innerHTML=`<i class="ri-book-open-line txt-sm"></i>
<span class="txt">Docs</span>`,o=E(),r=y("span"),r.textContent="|",a=E(),u=y("a"),f=y("span"),f.textContent="PocketBase v0.15.0-WIP",h(t,"class","page-content"),h(l,"href","https://pocketbase.io/docs/"),h(l,"target","_blank"),h(l,"rel","noopener noreferrer"),h(r,"class","delimiter"),h(f,"class","txt"),h(u,"href","https://github.com/pocketbase/pocketbase/releases"),h(u,"target","_blank"),h(u,"rel","noopener noreferrer"),h(u,"title","Releases"),h(s,"class","page-footer"),h(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(g,b){S(g,e,b),v(e,t),_&&_.m(t,null),v(e,i),v(e,s),v(s,l),v(s,o),v(s,r),v(s,a),v(s,u),v(u,f),p=!0},p(g,[b]){_&&_.p&&(!p||b&4)&&Mt(_,m,g,g[2],p?Ct(m,g[2],b,null):Ot(g[2]),null),(!p||b&2&&d!==(d="page-wrapper "+g[1]))&&h(e,"class",d),(!p||b&3)&&x(e,"center-content",g[0])},i(g){p||(A(_,g),p=!0)},o(g){P(_,g),p=!1},d(g){g&&w(e),_&&_.d(g)}}}function by(n,e,t){let{$$slots:i={},$$scope:s}=e,{center:l=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,l=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,s=r.$$scope)},[l,o,s,i]}class In extends ve{constructor(e){super(),be(this,e,by,gy,_e,{center:0,class:1})}}function Yu(n){let e,t,i;return{c(){e=y("div"),e.innerHTML=`<figure class="logo"><img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=E(),i=y("div"),h(e,"class","block txt-center m-b-lg"),h(i,"class","clearfix")},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},d(s){s&&w(e),s&&w(t),s&&w(i)}}}function vy(n){let e,t,i,s=!n[0]&&Yu();const l=n[1].default,o=Tt(l,n,n[2],null);return{c(){e=y("div"),s&&s.c(),t=E(),o&&o.c(),h(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){S(r,e,a),s&&s.m(e,null),v(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Yu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Mt(o,l,r,r[2],i?Ct(l,r[2],a,null):Ot(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&w(e),s&&s.d(),o&&o.d(r)}}}function yy(n){let e,t;return e=new In({props:{class:"full-page",center:!0,$$slots:{default:[vy]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function ky(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class i1 extends ve{constructor(e){super(),be(this,e,ky,yy,_e,{nobranding:0})}}function Yo(n){const e=n-1;return e*e*e+1}function ko(n,{delay:e=0,duration:t=400,easing:i=$l}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function ui(n,{delay:e=0,duration:t=400,easing:i=Yo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[d,p]=pu(s),[m,_]=pu(l);return{delay:e,duration:t,easing:i,css:(g,b)=>`
transform: ${u} translate(${(1-g)*d}${p}, ${(1-g)*m}${_});
opacity: ${a-f*b}`}}function kt(n,{delay:e=0,duration:t=400,easing:i=Yo,axis:s="y"}={}){const l=getComputedStyle(n),o=+l.opacity,r=s==="y"?"height":"width",a=parseFloat(l[r]),u=s==="y"?["top","bottom"]:["left","right"],f=u.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),d=parseFloat(l[`padding${f[0]}`]),p=parseFloat(l[`padding${f[1]}`]),m=parseFloat(l[`margin${f[0]}`]),_=parseFloat(l[`margin${f[1]}`]),g=parseFloat(l[`border${f[0]}Width`]),b=parseFloat(l[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*o};${r}: ${k*a}px;padding-${u[0]}: ${k*d}px;padding-${u[1]}: ${k*p}px;margin-${u[0]}: ${k*m}px;margin-${u[1]}: ${k*_}px;border-${u[0]}-width: ${k*g}px;border-${u[1]}-width: ${k*b}px;`}}function Ut(n,{delay:e=0,duration:t=400,easing:i=Yo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(d,p)=>`
transform: ${a} scale(${1-u*p});
opacity: ${r-f*p}
`}}let Qr,Ki;const xr="app-tooltip";function Ku(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ii(){return Ki=Ki||document.querySelector("."+xr),Ki||(Ki=document.createElement("div"),Ki.classList.add(xr),document.body.appendChild(Ki)),Ki}function s1(n,e){let t=Ii();if(!t.classList.contains("active")||!(e!=null&&e.text)){ea();return}t.textContent=e.text,t.className=xr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function ea(){clearTimeout(Qr),Ii().classList.remove("active"),Ii().activeNode=void 0}function wy(n,e){Ii().activeNode=n,clearTimeout(Qr),Qr=setTimeout(()=>{Ii().classList.add("active"),s1(n,e)},isNaN(e.delay)?0:e.delay)}function We(n,e){let t=Ku(e);function i(){wy(n,t)}function s(){ea()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",s),Ii(),{update(l){var o,r;t=Ku(l),(r=(o=Ii())==null?void 0:o.activeNode)!=null&&r.contains(n)&&s1(n,t)},destroy(){var l,o;(o=(l=Ii())==null?void 0:l.activeNode)!=null&&o.contains(n)&&ea(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Ju(n,e,t){const i=n.slice();return i[12]=e[t],i}const Sy=n=>({}),Zu=n=>({uniqueId:n[4]});function $y(n){let e,t,i=n[3],s=[];for(let o=0;o<i.length;o+=1)s[o]=Gu(Ju(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Se()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&8){i=o[3];let a;for(a=0;a<i.length;a+=1){const u=Ju(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Gu(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){dt(s,o),o&&w(e)}}}function Ty(n){let e,t,i,s,l,o,r;return{c(){e=y("div"),t=y("i"),h(t,"class","ri-error-warning-fill txt-danger"),h(e,"class","form-field-addon")},m(a,u){S(a,e,u),v(e,t),l=!0,o||(r=Ee(i=We.call(null,t,{position:"left",text:n[3].map(wo).join(`
`)})),o=!0)},p(a,u){i&&jt(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(wo).join(`
`)})},i(a){l||(a&&nt(()=>{l&&(s||(s=He(t,Ut,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=He(t,Ut,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&w(e),a&&s&&s.end(),o=!1,r()}}}function Gu(n){let e,t,i=wo(n[12])+"",s,l,o,r;return{c(){e=y("div"),t=y("pre"),s=U(i),l=E(),h(e,"class","help-block help-block-error")},m(a,u){S(a,e,u),v(e,t),v(t,s),v(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=wo(a[12])+"")&&le(s,i)},i(a){r||(a&&nt(()=>{r&&(o||(o=He(e,kt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=He(e,kt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&w(e),a&&o&&o.end()}}}function Cy(n){let e,t,i,s,l,o,r;const a=n[9].default,u=Tt(a,n,n[8],Zu),f=[Ty,$y],d=[];function p(m,_){return m[0]&&m[3].length?0:1}return i=p(n),s=d[i]=f[i](n),{c(){e=y("div"),u&&u.c(),t=E(),s.c(),h(e,"class",n[1]),x(e,"error",n[3].length)},m(m,_){S(m,e,_),u&&u.m(e,null),v(e,t),d[i].m(e,null),n[11](e),l=!0,o||(r=K(e,"click",n[10]),o=!0)},p(m,[_]){u&&u.p&&(!l||_&256)&&Mt(u,a,m,m[8],l?Ct(a,m[8],_,Sy):Ot(m[8]),Zu);let g=i;i=p(m),i===g?d[i].p(m,_):(re(),P(d[g],1,1,()=>{d[g]=null}),ae(),s=d[i],s?s.p(m,_):(s=d[i]=f[i](m),s.c()),A(s,1),s.m(e,null)),(!l||_&2)&&h(e,"class",m[1]),(!l||_&10)&&x(e,"error",m[3].length)},i(m){l||(A(u,m),A(s),l=!0)},o(m){P(u,m),P(s),l=!1},d(m){m&&w(e),u&&u.d(m),d[i].d(),n[11](null),o=!1,r()}}}const Xu="Invalid value";function wo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Xu:n||Xu}function My(n,e,t){let i;Xe(n,wi,g=>t(7,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,d=[];function p(){Ni(r)}Gt(()=>(f.addEventListener("input",p),f.addEventListener("change",p),()=>{f.removeEventListener("input",p),f.removeEventListener("change",p)}));function m(g){me.call(this,n,g)}function _(g){se[g?"unshift":"push"](()=>{f=g,t(2,f)})}return n.$$set=g=>{"name"in g&&t(5,r=g.name),"inlineError"in g&&t(0,a=g.inlineError),"class"in g&&t(1,u=g.class),"$$scope"in g&&t(8,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,d=j.toArray(j.getNestedVal(i,r)))},[a,u,f,d,o,r,p,i,l,s,m,_]}class de extends ve{constructor(e){super(),be(this,e,My,Cy,_e,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function Oy(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Email"),s=E(),l=y("input"),h(e,"for",i=n[9]),h(l,"type","email"),h(l,"autocomplete","off"),h(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0]),l.focus(),r||(a=K(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&1&&l.value!==u[0]&&ue(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Dy(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=U("Password"),s=E(),l=y("input"),r=E(),a=y("div"),a.textContent="Minimum 10 characters.",h(e,"for",i=n[9]),h(l,"type","password"),h(l,"autocomplete","new-password"),h(l,"minlength","10"),h(l,"id",o=n[9]),l.required=!0,h(a,"class","help-block")},m(d,p){S(d,e,p),v(e,t),S(d,s,p),S(d,l,p),ue(l,n[1]),S(d,r,p),S(d,a,p),u||(f=K(l,"input",n[6]),u=!0)},p(d,p){p&512&&i!==(i=d[9])&&h(e,"for",i),p&512&&o!==(o=d[9])&&h(l,"id",o),p&2&&l.value!==d[1]&&ue(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function Ey(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Password confirm"),s=E(),l=y("input"),h(e,"for",i=n[9]),h(l,"type","password"),h(l,"minlength","10"),h(l,"id",o=n[9]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[2]),r||(a=K(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&4&&l.value!==u[2]&&ue(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Ay(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;return s=new de({props:{class:"form-field required",name:"email",$$slots:{default:[Oy,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"password",$$slots:{default:[Dy,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),a=new de({props:{class:"form-field required",name:
<i class="ri-arrow-right-line"></i>`,h(t,"class","content txt-center m-b-base"),h(f,"type","submit"),h(f,"class","btn btn-lg btn-block btn-next"),x(f,"btn-disabled",n[3]),x(f,"btn-loading",n[3]),h(e,"class","block"),h(e,"autocomplete","off")},m(_,g){S(_,e,g),v(e,t),v(e,i),V(s,e,null),v(e,l),V(o,e,null),v(e,r),V(a,e,null),v(e,u),v(e,f),d=!0,p||(m=K(e,"submit",at(n[4])),p=!0)},p(_,[g]){const b={};g&1537&&(b.$$scope={dirty:g,ctx:_}),s.$set(b);const k={};g&1538&&(k.$$scope={dirty:g,ctx:_}),o.$set(k);const $={};g&1540&&($.$$scope={dirty:g,ctx:_}),a.$set($),(!d||g&8)&&x(f,"btn-disabled",_[3]),(!d||g&8)&&x(f,"btn-loading",_[3])},i(_){d||(A(s.$$.fragment,_),A(o.$$.fragment,_),A(a.$$.fragment,_),d=!0)},o(_){P(s.$$.fragment,_),P(o.$$.fragment,_),P(a.$$.fragment,_),d=!1},d(_){_&&w(e),H(s),H(o),H(a),p=!1,m()}}}function Iy(n,e,t){const i=wt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await pe.admins.create({email:s,password:l,passwordConfirm:o}),await pe.admins.authWithPassword(s,l),i("submit")}catch(p){pe.errorResponseHandler(p)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function d(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,d]}class Py extends ve{constructor(e){super(),be(this,e,Iy,Ay,_e,{})}}function Qu(n){let e,t;return e=new i1({props:{$$slots:{default:[Ly]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Ly(n){let e,t;return e=new Py({}),e.$on("submit",n[1]),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p:Q,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Ny(n){let e,t,i=n[0]&&Qu(n);return{c(){i&&i.c(),e=Se()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Qu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(re(),P(i,1,1,()=>{i=null}),ae())},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function Fy(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){pe.logout(!1),t(0,i=!0);return}pe.authStore.isValid?qi("/collections"):pe.logout()}return[i,async()=>{t(0,i=!1),await pn(),window.location.search=""}]}class Ry extends ve{constructor(e){super(),be(this,e,Fy,Ny,_e,{})}}const Lt=An(""),So=An(""),Ds=An(!1);function qy(n){let e,t,i,s;return{c(){e=y("input"),h(e,"type","text"),h(e,"id",n[8]),h(e,"placeholder",t=n[0]||n[1])},m(l,o){S(l,e,o),n[13](e),ue(e,n[7]),i||(s=K(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&h(e,"placeholder",t),o&128&&e.value!==l[7]&&ue(e,l[7])},i:Q,o:Q,d(l){l&&w(e),n[13](null),i=!1,s()}}}function jy(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=Pt(o,r(n)),se.push(()=>he(e,"value",l)),e.$on("submit",n[10])),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&V(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],ye(()=>t=!1)),u&16&&o!==(o=a[4])){if(e){re();const d=e;P(d.$$.fragment,1,0,()=>{H(d,1)}),ae()}o?(e=Pt(o,r(a)),se.push(()=>he(e,"value",l)),e.$on("submit",a[10]),z(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&H(e,a)}}}function xu(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Search</span>',h(e,"type","submit"),h(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&nt(()=>{i&&(t||(t=He(e,ui,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=He(e,ui,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function ef(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear</span>',h(e,"type","button"
<span class="txt">Method</span>`,h(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function t2(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="URL",h(t,"class",j.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function n2(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="Referer",h(t,"class",j.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function i2(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="User IP",h(t,"class",j.getFieldTypeIcon("number")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function s2(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="Status",h(t,"class",j.getFieldTypeIcon("number")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function l2(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="Created",h(t,"class",j.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function lf(n){let e;function t(l,o){return l[6]?r2:o2}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function o2(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&of(n);return{c(){e=y("tr"),t=y("td"),i=y("h6"),i.textContent="No logs found.",s=E(),o&&o.c(),l=E(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),v(e,t),v(t,i),v(t,s),o&&o.m(t,null),v(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=of(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function r2(n){let e;return{c(){e=y("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function of(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[19]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function rf(n){let e;return{c(){e=y("i"),h(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),h(e,"title","Error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function af(n,e){var Ce,Ze,mt;let t,i,s,l=((Ce=e[23].method)==null?void 0:Ce.toUpperCase())+"",o,r,a,u,f,d=e[23].url+"",p,m,_,g,b,k,$=(e[23].referer||"N/A")+"",C,T,O,M,D,I=(e[23].userIp||"N/A")+"",L,F,q,N,R,Y=e[23].status+"",B,Z,ee,ne,X,fe,G,ce,ge,Me,Ve=(((Ze=e[23].meta)==null?void 0:Ze.errorMessage)||((mt=e[23].meta)==null?void 0:mt.errorData))&&rf();ne=new ki({props:{date:e[23].created}});function ze(){return e[17](e[23])}function we(...Ge){return e[18](e[23],...Ge)}return{key:n,first:null,c(){t=y("tr"),i=y("td"),s=y("span"),o=U(l),a=E(),u=y("td"),f=y("span"),p=U(d),_=E(),Ve&&Ve.c(),g=E(),b=y("td"),k=y("span"),C=U($),O=E(),M=y("td"),D=y("span"),L=U(I),q=E(),N=y("td"),R=y("span"),B=U(Y),Z=E(),ee=y("td"),z(ne.$$.fragment),X=E(),fe=y("td"),fe.innerHTML='<i class="ri-arrow-right-line"></i>',G=E(),h(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),h(i,"class","col-type-text col-field-method min-width"),h(f,"class","txt txt-ellipsis"),h(f,"title",m=e[23].url),h(u,"class","col-type-text col-field-url"),h(k,"class","txt txt-ellipsis"),h(k,"title",T=e[23].referer),x(k,"txt-hint",!e[23].referer),h(b,"class","col-type-text col-field-referer"),h(D,"class","txt txt-ellipsis"),h(D,"title",F=e[23].userIp),x(D,"txt-hint",!e[23].userIp),h(M,"class","col-type-number col-field-userIp"),h(R,"class","label"),x(R,"label-danger",e[23].status>=400),h(N,"class","col-type-number col-field-status"),h(ee,"class","col-type-date col-field-created"),h(fe,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(Ge,Ye){S(Ge,t,Ye),v(t,i),v(i,s),v(s,o),v(t,a),v(t,u),v(u,f),v(f,p),v(u,_),Ve&&Ve.m(u,null),v(t,g),v(t,b),v(b,k),v(k,C),v(t,O),v(t,M),v(M,D),v(D,L),v(t,q),v(t,N),v(N,R),v(R,B),v(t,Z),v(t,ee),V(ne,ee,null),v(t,X),v(t,fe),v(t,G),ce=!0,ge||(Me=[K(t,"click",ze),K(t,"keydown",we)],ge=!0)},p(Ge,Ye){var qe,xe,Xt;e=Ge,(!ce||Ye&8)&&l!==(l=((qe=e[23].method)==null?void 0:qe.toUpperCase())+"")&&le(o,l),(!ce||Ye&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&h(s,"class",r),(!ce||Ye&8)&&d!==(d=e[23].url+"")&&le(p,d),(!ce||Ye&8&&m!==(m=e[23].url))&&h(f,"title",m),(xe=e[23].meta)!=null&&xe.errorMessage||(Xt=e[23].meta)!=null&&Xt.errorData?Ve||(Ve=rf(),Ve.c(),Ve.m(u,null)):Ve&&(Ve.d(1),Ve=null),(!ce||Ye&8)&&$!==($=(e[23].referer||"N/A")+"")&&le(C,$),(!ce||Ye&8&&T!==(T=e[23].referer))&&h(k,"title",T),(!ce||Ye&8)&&x(k,"txt-hint",!e[23].referer),(!ce||Ye&8)&&I!==(I=(e[23].userIp||"N/A")+"")&&le(L,I),(!ce||Ye&8&&F!==(F=e[23].userIp))&&h(D,"title",F),(!ce||Ye&8)&&x(D,"txt-hint",!e[23].userIp),(!ce||Ye&8)&&Y!==(Y=e[23].status+"")&&le(B,Y),(!ce||Ye&8)&&x(R,"label-danger",e[23].status>=400);const te={};Ye&8&&(te.date=e[23].created),ne.$set(te)},i(Ge){ce||(A(ne.$$.fragment,Ge),ce=!0)},o(Ge){P(ne.$$.fragment,Ge),ce=!1},d(Ge){Ge&&w(t),Ve&&Ve.d(),H(ne),ge=!1,De(Me)}}}function a2(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,C,T,O,M,D,I,L=[],F=new Map,q;function N(we){n[11](we)}let R={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[e2]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),s=new nn({props:R}),se.push(()=>he(s,"sort",N));function Y(we){n[12](we)}let B={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[t2]},$$scope:{ctx:n}};n[1]!==void 0&&(B.sort=n[1]),r=new nn({props:B}),se.push(()=>he(r,"sort",Y));function Z(we){n[13](we)}let ee={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[n2]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),f=new nn({props:ee}),se.push(()=>he(f,"sort",Z));function ne(we){n[14](we)}let X={disable:!0,class:"col-type-number col-fie
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/function di(){}const d2=function(){let n=0;return function(){return n++}}();function ct(n){return n===null||typeof n>"u"}function vt(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function et(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const qt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function qn(n,e){return qt(n)?n:e}function st(n,e){return typeof n>"u"?e:n}const p2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,l1=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function At(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function pt(n,e,t,i){let s,l,o;if(vt(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(et(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function $o(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function To(n){if(vt(n))return n.map(To);if(et(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=To(n[t[s]]);return e}return n}function o1(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function m2(n,e,t,i){if(!o1(n))return;const s=e[n],l=t[n];et(s)&&et(l)?_l(s,l,i):e[n]=To(l)}function _l(n,e,t){const i=vt(e)?e:[e],s=i.length;if(!et(n))return n;t=t||{};const l=t.merger||m2;for(let o=0;o<s;++o){if(e=i[o],!et(e))continue;const r=Object.keys(e);for(let a=0,u=r.length;a<u;++a)l(r[a],n,e,t)}return n}function ll(n,e){return _l(n,e,{merger:h2})}function h2(n,e,t){if(!o1(n))return;const i=e[n],s=t[n];et(i)&&et(s)?ll(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=To(s))}const cf={"":n=>n,x:n=>n.x,y:n=>n.y};function Fi(n,e){return(cf[e]||(cf[e]=_2(e)))(n)}function _2(n){const e=g2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function g2(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Ra(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Un=n=>typeof n<"u",Ri=n=>typeof n=="function",df=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function b2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Nt=Math.PI,_t=2*Nt,v2=_t+Nt,Co=Number.POSITIVE_INFINITY,y2=Nt/180,It=Nt/2,Ys=Nt/4,pf=Nt*2/3,zn=Math.log10,ri=Math.sign;function mf(n){const e=Math.round(n);n=ol(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 k2(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function Es(n){return!isNaN(parseFloat(n))&&isFinite(n)}function ol(n,e,t){return Math.abs(n-e)<t}function w2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function r1(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Qn(n){return n*(Nt/180)}function qa(n){return n*(180/Nt)}function hf(n){if(!qt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function a1(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*Nt&&(l+=_t),{angle:l,distance:s}}function ta(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function S2(n,e){return(n-e+v2)%_t-Nt}function Mn(n){return(n%_t+_t)%_t}function gl(n,e,t,i){const s=Mn(n),l=Mn(e),o=Mn(t),r=Mn(l-s),a=Mn(o-s),u=Mn(s-l),f=Mn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function sn(n,e,t){return Math.max(e,Math.min(t,n))}function $2(n){return sn(n,-32768,32767)}function bl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function ja(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,l;for(;i-s>1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const ts=(n,e,t,i)=>ja(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),T2=(n,e,t)=>ja(n,t,i=>n[i][e]>=t);function C2(n,e,
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function Al(n){return n+.5|0}const Di=(n,e,t)=>Math.max(Math.min(n,t),e);function tl(n){return Di(Al(n*2.55),0,255)}function Pi(n){return Di(Al(n*255),0,255)}function hi(n){return Di(Al(n/2.55)/100,0,1)}function yf(n){return Di(Al(n*100),0,100)}const Rn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},na=[..."0123456789ABCDEF"],E2=n=>na[n&15],A2=n=>na[(n&240)>>4]+na[n&15],Wl=n=>(n&240)>>4===(n&15),I2=n=>Wl(n.r)&&Wl(n.g)&&Wl(n.b)&&Wl(n.a);function P2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Rn[n[1]]*17,g:255&Rn[n[2]]*17,b:255&Rn[n[3]]*17,a:e===5?Rn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Rn[n[1]]<<4|Rn[n[2]],g:Rn[n[3]]<<4|Rn[n[4]],b:Rn[n[5]]<<4|Rn[n[6]],a:e===9?Rn[n[7]]<<4|Rn[n[8]]:255})),t}const L2=(n,e)=>n<255?e(n):"";function N2(n){var e=I2(n)?E2:A2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+L2(n.a,e):void 0}const F2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function h1(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function R2(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function q2(n,e,t){const i=h1(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function j2(n,e,t,i,s){return n===s?(e-t)/i+(e<t?6:0):e===s?(t-n)/i+2:(n-e)/i+4}function Va(n){const t=n.r/255,i=n.g/255,s=n.b/255,l=Math.max(t,i,s),o=Math.min(t,i,s),r=(l+o)/2;let a,u,f;return l!==o&&(f=l-o,u=r>.5?f/(2-l-o):f/(l+o),a=j2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Ha(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Pi)}function za(n,e,t){return Ha(h1,n,e,t)}function V2(n,e,t){return Ha(q2,n,e,t)}function H2(n,e,t){return Ha(R2,n,e,t)}function _1(n){return(n%360+360)%360}function z2(n){const e=F2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?tl(+e[5]):Pi(+e[5]));const s=_1(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=V2(s,l,o):e[1]==="hsv"?i=H2(s,l,o):i=za(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function B2(n,e){var t=Va(n);t[0]=_1(t[0]+e),t=za(t),n.r=t[0],n.g=t[1],n.b=t[2]}function U2(n){if(!n)return;const e=Va(n),t=e[0],i=yf(e[1]),s=yf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${hi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const kf={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"},wf={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:"
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class Kk{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const l=t.listeners[s],o=t.duration;l.forEach(r=>r({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=c1.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var pi=new Kk;const Lf="transparent",Jk={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=$f(n||Lf),s=i.valid&&$f(e||Lf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Zk{constructor(e,t,i,s){const l=t[i];s=Jl([e.to,s,l,e.from]);const o=Jl([e.from,l,s]);this._active=!0,this._fn=e.fn||Jk[e.type||typeof o],this._easing=rl[e.easing]||rl.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Jl([e.to,t,s,e.from]),this._from=Jl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t<i),!this._active){this._target[s]=r,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][t]()}}const Gk=["x","y","borderWidth","radius","tension"],Xk=["color","borderColor","backgroundColor"];lt.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const Qk=Object.keys(lt.animation);lt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});lt.set("animations",{colors:{type:"color",properties:Xk},numbers:{type:"number",properties:Gk}});lt.describe("animations",{_fallback:"animation"});lt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class A1{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!et(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!et(s))return;const l={};for(con
`)>-1?n.split(`
`):n}function mS(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function cc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=On(e.bodyFont),u=On(e.titleFont),f=On(e.footerFont),d=l.length,p=s.length,m=i.length,_=Wn(e.padding);let g=_.height,b=0,k=i.reduce((T,O)=>T+O.before.length+O.lines.length+O.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,d&&(g+=d*u.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=m*T+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}p&&(g+=e.footerMarginTop+p*f.lineHeight+(p-1)*e.footerSpacing);let $=0;const C=function(T){b=Math.max(b,t.measureText(T).width+$)};return t.save(),t.font=u.string,pt(n.title,C),t.font=a.string,pt(n.beforeBody.concat(n.afterBody),C),$=e.displayColors?o+2+e.boxPadding:0,pt(i,T=>{pt(T.before,C),pt(T.lines,C),pt(T.after,C)}),$=0,t.font=f.string,pt(n.footer,C),t.restore(),b+=_.width,{width:b,height:g}}function hS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function _S(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function gS(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),_S(u,n,e,t)&&(u="center"),u}function dc(n,e,t){const i=t.yAlign||e.yAlign||hS(n,t);return{xAlign:t.xAlign||e.xAlign||gS(n,e,t,i),yAlign:i}}function bS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function vS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function pc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:d,bottomLeft:p,bottomRight:m}=$s(o);let _=bS(e,r);const g=vS(e,a,u);return a==="center"?r==="left"?_+=u:r==="right"&&(_-=u):r==="left"?_-=Math.max(f,p)+s:r==="right"&&(_+=Math.max(d,m)+s),{x:sn(_,0,i.width-e.width),y:sn(g,0,i.height-e.height)}}function to(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 mc(n){return si([],mi(n))}function yS(n,e,t){return ji(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function hc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ca extends Si{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new A1(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=yS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=si(r,mi(s)),r=si(r,mi(l)),r=si(r,mi(o)),r}getBeforeBody(e,t){return mc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return pt(e,l=>{const o={before:[],lines:[],after:[]},r=hc(i,l);si(o.before,mi(r.beforeLabel.call(this,l))
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const HS={datetime:Be.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Be.TIME_WITH_SECONDS,minute:Be.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};F1._date.override({_id:"luxon",_create:function(n){return Be.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return HS},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Be.fromFormat(n,e,t):n=Be.fromISO(n,t):n instanceof Date?n=Be.fromJSDate(n,t):i==="object"&&!(n instanceof Be)&&(n=Be.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function Sc(n){let e,t,i;return{c(){e=y("div"),h(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&nt(()=>{i&&(t||(t=He(e,Ut,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=He(e,Ut,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function zS(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=U(n[1]),t=E(),s=U(i)},m(l,o){S(l,e,o),S(l,t,o),S(l,s,o)},p(l,o){o&2&&le(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&le(s,i)},d(l){l&&w(e),l&&w(t),l&&w(s)}}}function BS(n){let e;return{c(){e=U("Loading...")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function US(n){let e,t,i,s,l,o=n[2]&&Sc();function r(f,d){return f[2]?BS:zS}let a=r(n),u=a(n);return{c(){e=y("div"),o&&o.c(),t=E(),i=y("canvas"),s=E(),l=y("div"),u.c(),h(i,"class","chart-canvas svelte-vh4sl8"),qr(i,"height","250px"),qr(i,"width","100%"),h(e,"class","chart-wrapper svelte-vh4sl8"),x(e,"loading",n[2]),h(l,"class","txt-hint m-t-xs txt-right")},m(f,d){S(f,e,d),o&&o.m(e,null),v(e,t),v(e,i),n[8](i),S(f,s,d),S(f,l,d),u.m(l,null)},p(f,[d]){f[2]?o?d&4&&A(o,1):(o=Sc(),o.c(),A(o,1),o.m(e,t)):o&&(re(),P(o,1,1,()=>{o=null}),ae()),d&4&&x(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,d):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){P(o)},d(f){f&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function WS(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),pe.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(m=>{d();for(let _ of m)r.push({x:new Date(_.date),y:_.total}),t(1,a+=_.total);r.push({x:new Date,y:void 0})}).catch(m=>{m!=null&&m.isAbort||(d(),console.warn(m),pe.errorResponseHandler(m,!1))}).finally(()=>{t(2,u=!1)})}function d(){t(1,a=0),t(7,r=[])}Gt(()=>(Lo.register(Vi,Xo,Zo,su,Nl,pS,kS),t(6,o=new Lo(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:m=>m.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>m.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function p(m){se[m?"unshift":"push"](()=>{l=m,t(0,l)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,s=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function $(C){return C instanceof a?new a(C.type,$(C.content),C.alias):Array.isArray(C)?C.map($):C.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function($){return Object.prototype.toString.call($).slice(8,-1)},objId:function($){return $.__id||Object.defineProperty($,"__id",{value:++l}),$.__id},clone:function $(C,T){T=T||{};var O,M;switch(r.util.type(C)){case"Object":if(M=r.util.objId(C),T[M])return T[M];O={},T[M]=O;for(var D in C)C.hasOwnProperty(D)&&(O[D]=$(C[D],T));return O;case"Array":return M=r.util.objId(C),T[M]?T[M]:(O=[],T[M]=O,C.forEach(function(I,L){O[L]=$(I,T)}),O);default:return C}},getLanguage:function($){for(;$;){var C=s.exec($.className);if(C)return C[1].toLowerCase();$=$.parentElement}return"none"},setLanguage:function($,C){$.className=$.className.replace(RegExp(s,"gi"),""),$.classList.add("language-"+C)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(O){var $=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(O.stack)||[])[1];if($){var C=document.getElementsByTagName("script");for(var T in C)if(C[T].src==$)return C[T]}return null}},isActive:function($,C,T){for(var O="no-"+C;$;){var M=$.classList;if(M.contains(C))return!0;if(M.contains(O))return!1;$=$.parentElement}return!!T}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function($,C){var T=r.util.clone(r.languages[$]);for(var O in C)T[O]=C[O];return T},insertBefore:function($,C,T,O){O=O||r.languages;var M=O[$],D={};for(var I in M)if(M.hasOwnProperty(I)){if(I==C)for(var L in T)T.hasOwnProperty(L)&&(D[L]=T[L]);T.hasOwnProperty(I)||(D[I]=M[I])}var F=O[$];return O[$]=D,r.languages.DFS(r.languages,function(q,N){N===F&&q!=$&&(this[q]=D)}),D},DFS:function $(C,T,O,M){M=M||{};var D=r.util.objId;for(var I in C)if(C.hasOwnProperty(I)){T.call(C,I,C[I],O||I);var L=C[I],F=r.util.type(L);F==="Object"&&!M[D(L)]?(M[D(L)]=!0,$(L,T,null,M)):F==="Array"&&!M[D(L)]&&(M[D(L)]=!0,$(L,T,I,M))}}},plugins:{},highlightAll:function($,C){r.highlightAllUnder(document,$,C)},highlightAllUnder:function($,C,T){var O={callback:T,container:$,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",O),O.elements=Array.prototype.slice.apply(O.container.querySelectorAll(O.selector)),r.hooks.run("before-all-elements-highlight",O);for(var M=0,D;D=O.elements[M++];)r.highlightElement(D,C===!0,O.callback)},highlightElement:function($,C,T){var O=r.util.getLanguage($),M=r.languages[O];r.util.setLanguage($,O);var D=$.parentElement;D&&D.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(D,O);var I=$.textContent,L={element:$,language:O,grammar:M,code:I};function F(N){L.highlightedCode=N,r.hooks.run("before-insert",L),L.element.innerHTML=L.highlightedCode,r.hooks.run("after-highlight",L),r.hooks.run("complete",L),T&&T.call(L.element)}if(r.hooks.run("before-sanity-check",L),D=L.element.parentElement,D&&D.nodeName.toLowerCase()==="pre"&&!D.hasAttribute("tabindex")&&D.setAttribute("tabindex","0"),!L.code){r.hooks.run("complete",L),T&&T.call(L.element);return}if(r.hooks.run("before-highlight",L),!L.grammar){F(r.util.encode(L.code));return}if(C&&i.Worker){var q=new Worker(r.filename);q.onmessage=function(N){F(N.data)},q.postMessage(JSON.stringify({language:L.language,code:L.code,immediateClose:!0}))}else F(r.highlight(L.code,L.grammar,L.language))},highlight:function($,C,T){var O={code:$,grammar:C,language:T};if(r.hooks.run("before-tokenize",O),!O.grammar)throw new Error('The language "'+O.language+'" has no grammar.');return O.tokens=r.tokenize(O.code,O.grammar),r.hooks.run("after-tokenize",O),a.stringify(r.util.encode(O.tokens),O.language)},tokenize:function($,C){var T=C.rest;if(T){for(var O in T)C[O]=T[O];delete C.rest}var M=new d;return p(M,M.head,$),f($,M,C,M.head,0),_(M)},hooks:{all:{},add:function
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(L+1))}k.textContent=M,t.highlightElement(k)},function(M){b.setAttribute(r,f),k.textContent=M})}}),t.plugins.fileHighlight={highlight:function(b){for(var k=(b||document).querySelectorAll(d),$=0,C;C=k[$++];)t.highlightElement(C)}};var _=!1;t.fileHighlight=function(){_||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),_=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(KS);const Qs=ma;var Tc={},JS={get exports(){return Tc},set exports(n){Tc=n}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var l={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};t.prototype={setDefaults:function(o){this.defaults=e(this.defaults,o)},normalize:function(o,r){r=e(this.defaults,r);for(var a in r){var u=i(a);a!=="normalize"&&u!=="setDefaults"&&r[a]&&this[u]&&(o=this[u].call(this,o,r[a]))}return o},leftTrim:function(o){return o.replace(/^\s+/,"")},rightTrim:function(o){return o.replace(/\s+$/,"")},tabsToSpaces:function(o,r){return r=r|0||4,o.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(o,r){return r=r|0||4,o.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(o){return o.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(o){return o.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(o){var r=o.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(a,u){return a.length-u.length}),!r[0].length)?o:o.replace(RegExp("^"+r[0],"gm"),"")},indent:function(o,r){return o.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(o,r){r=r===!0?80:r|0||80;for(var a=o.split(`
`),u=0;u<a.length;++u)if(!(s(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),d=0,p=0;p<f.length;++p){var m=s(f[p]);d+=m,d>r&&(f[p]=`
`+f[p],d=m)}a[u]=f.join("")}return a.join(`
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var d=JSON.parse(a.getAttribute("data-"+u)||"true");typeof d===f&&(o.settings[u]=d)}catch{}}for(var p=a.childNodes,m="",_="",g=!1,b=0;b<p.length;++b){var k=p[b];k==o.element?g=!0:k.nodeName==="#text"&&(g?_+=k.nodeValue:m+=k.nodeValue,a.removeChild(k),--b)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=m+o.code+_,o.code=r.normalize(o.code,o.settings);else{var $=m+o.element.innerHTML+_;o.element.innerHTML=r.normalize($,o.settings),o.code=o.element.textContent}}}})})()})(JS);(function(n){var e=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],t=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,i={pattern:RegExp(t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};n.languages.dart=n.languages.extend("clike",{"class-name":[i,{pattern:RegExp(t+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:e,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function ZS(n){let e,t,i;return{c(){e=y("div"),t=y("code"),h(t,"class","svelte-10s5tkd"),h(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){S(s,e,l),v(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&h(e,"class",i)},i:Q,o:Q,d(s){s&&w(e)}}}function GS(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Qs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Qs.highlight(a,Qs.languages[l]||Qs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Qs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class nb extends ve{constructor(e){super(),be(this,e,GS,ZS,_e,{class:0,content:2,language:3})}}const XS=n=>({}),Cc=n=>({}),QS=n=>({}),Mc=n=>({});function Oc(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,C=n[4]&&!n[2]&&Dc(n);const T=n[19].header,O=Tt(T,n,n[18],Mc);let M=n[4]&&n[2]&&Ec(n);const D=n[19].default,I=Tt(D,n,n[18],null),L=n[19].footer,F=Tt(L,n,n[18],Cc);return{c(){e=y("div"),t=y("div"),s=E(),l=y("div"),o=y("div"),C&&C.c(),r=E(),O&&O.c(),a=E(),M&&M.c(),u=E(),f=y("div"),I&&I.c(),d=E(),p=y("div"),F&&F.c(),h(t,
<span class="txt">New index</span>`,f=E(),z(d.$$.fragment),h(e,"class","section-title"),h(u,"type","button"),h(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),h(r,"class","indexes-list svelte-167lbwu")},m(D,I){S(D,e,I),v(e,t),v(e,s),v(e,l),S(D,o,I),S(D,r,I);for(let L=0;L<k.length;L+=1)k[L]&&k[L].m(r,null);v(r,a),v(r,u),S(D,f,I),V(d,D,I),m=!0,_||(g=K(u,"click",n[5]),_=!0)},p(D,[I]){var F,q,N;if((!m||I&1)&&i!==(i=(((q=(F=D[0])==null?void 0:F.indexes)==null?void 0:q.length)||0)+"")&&le(s,i),I&7){b=((N=D[0])==null?void 0:N.indexes)||[];let R;for(R=0;R<b.length;R+=1){const Y=Vc(D,b,R);k[R]?k[R].p(Y,I):(k[R]=zc(Y),k[R].c(),k[R].m(r,a))}for(;R<k.length;R+=1)k[R].d(1);k.length=b.length}const L={};!p&&I&1&&(p=!0,L.collection=D[0],ye(()=>p=!1)),d.$set(L)},i(D){m||(A(d.$$.fragment,D),m=!0)},o(D){P(d.$$.fragment,D),m=!1},d(D){D&&w(e),D&&w(o),D&&w(r),dt(k,D),D&&w(f),n[6](null),H(d,D),_=!1,g()}}}const Bc=n=>n.name;function D$(n,e,t){let i;Xe(n,wi,m=>t(2,i=m));let{collection:s}=e,l;function o(m,_){for(let g=0;g<s.indexes.length;g++)if(s.indexes[g]==m){t(0,s.indexes[g]=_,s),Ni("indexes."+g);return}s.indexes.push(_),t(0,s)}const r=(m,_)=>l==null?void 0:l.show(m,_),a=()=>l==null?void 0:l.show();function u(m){se[m?"unshift":"push"](()=>{l=m,t(1,l)})}function f(m){s=m,t(0,s)}const d=m=>{for(let _=0;_<s.indexes.length;_++)if(s.indexes[_]==m.detail){s.indexes.splice(_,1),Ni("indexes."+_);break}t(0,s)},p=m=>{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},[s,l,i,o,r,a,u,f,d,p]}class E$ extends ve{constructor(e){super(),be(this,e,D$,O$,_e,{collection:0})}}function Uc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Wc(n){let e,t,i,s,l=n[6].label+"",o,r,a,u;function f(){return n[4](n[6])}function d(...p){return n[5](n[6],...p)}return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),o=U(l),r=E(),h(t,"class","icon "+n[6].icon+" svelte-1p626x7"),h(s,"class","txt"),h(e,"tabindex","0"),h(e,"class","dropdown-item closable svelte-1p626x7")},m(p,m){S(p,e,m),v(e,t),v(e,i),v(e,s),v(s,o),v(e,r),a||(u=[K(e,"click",En(f)),K(e,"keydown",En(d))],a=!0)},p(p,m){n=p},d(p){p&&w(e),a=!1,De(u)}}}function A$(n){let e,t=n[2],i=[];for(let s=0;s<t.length;s+=1)i[s]=Wc(Uc(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Se()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l&12){t=s[2];let o;for(o=0;o<t.length;o+=1){const r=Uc(s,t,o);i[o]?i[o].p(r,l):(i[o]=Wc(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){dt(i,s),s&&w(e)}}}function I$(n){let e,t,i,s,l,o,r,a,u,f;return o=new Yn({props:{class:"dropdown field-types-dropdown",$$slots:{default:[A$]},$$scope:{ctx:n}}}),{c(){e=y("button"),t=y("i"),i=E(),s=y("div"),s.textContent="New field",l=E(),z(o.$$.fragment),h(t,"class","ri-add-line"),h(s,"class","txt"),h(e,"type","button"),h(e,"class",r=bi(n[0])+" svelte-1p626x7")},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),v(e,l),V(o,e,null),a=!0,u||(f=K(e,"click",n[1]),u=!0)},p(d,[p]){const m={};p&512&&(m.$$scope={dirty:p,ctx:d}),o.$set(m),(!a||p&1&&r!==(r=bi(d[0])+" svelte-1p626x7"))&&h(e,"class",r)},i(d){a||(A(o.$$.fragment,d),a=!0)},o(d){P(o.$$.fragment,d),a=!1},d(d){d&&w(e),H(o),u=!1,f()}}}function P$(n,e,t){let{class:i=""}=e;const s=wt(),l=[{label:"Plain text",value:"text",icon:j.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:j.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:j.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:j.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:j.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:j.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:j.getFieldTypeIcon("date")},{label:"Select",value:"select",icon:j.getFieldTypeIcon("select")},{label:"File",value:"file",icon:j.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:j.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:j.getFieldTypeIcon("json")}];function o(u){s("select",u)}const r=u=>{o(u.value)},a=(u,f)=>{(f.code==="Enter"||f.code==="Space")&&o(u.value)};return n.$$
This field is disabled if "Only domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]))&&h(e,"for",l);const $={};k&4096&&($.id=b[12]),k&1&&($.disabled=!j.isEmpty(b[0].options.onlyDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.exceptDomains,ye(()=>a=!1)),r.$set($)},i(b){d||(A(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),H(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function dT(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(b){n[4](b)}let g={id:n[12]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(g.value=n[0].options.onlyDomains),r=new js({props:g}),se.push(()=>he(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Only domains",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]+".options.onlyDomains"),h(f,"class","help-block")},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),V(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(m=Ee(We.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]+".options.onlyDomains"))&&h(e,"for",l);const $={};k&4096&&($.id=b[12]+".options.onlyDomains"),k&1&&($.disabled=!j.isEmpty(b[0].options.exceptDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.onlyDomains,ye(()=>a=!1)),r.$set($)},i(b){d||(A(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),H(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function pT(n){let e,t,i,s,l,o,r;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[cT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[dT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid grid-sm")},m(a,u){S(a,e,u),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&12289&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};u&2&&(d.name="schema."+a[1]+".options.onlyDomains"),u&12289&&(d.$$scope={dirty:u,ctx:a}),o.$set(d)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),H(i),H(o)}}}function mT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[pT]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=je(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ci({props:o}),se.push(()=>he(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?St(s,[a&2&&{key:r[1]},a&4&&Kt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function hT(n,e,t){const i=["field","key"];let s=Qe(e,i),{field:l}=e,{key:o=""}=e;function r(b){n.$$.not_equal(l.options.exceptDomains,b)&&(l.options.exceptDomains=b,t(0,l))}function a(b){n.$$.not_equal(l.options.onlyDomains,b)&&(l.options.onlyDomains=b,t(0,l))}function u(b){l=b,t(0,l)}function f(b){me.call(this,n,b)}function d(b){me.call(this,n,b)}function p(b){me.call(this,n,b)}function m(b){me.call(this,n,b)}function _(b){me.call(this,n,b)}function g(b){me.call(this,n,b)}return n.$$set=b=>{e=je(je({},e),Yt(b)),t(2,s=Qe(e,i)),"field"in b&&t(0,l=b.field),"key"in b&&t(1,o=b.key)},[l,o,s,r,a,u,f,d,p,m,_,g]}class lb extends ve{constructor(e){super(),be(this,e,hT,mT,_e,{field:0,key:1})}}function _T(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r<s.length;r+=1)o=je(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new lb({props:o}),se.push(()=>he(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("drop",n[6]),e.$on("dragstart",n[7]),e.$on("dragenter",n[8]),e.$on("dragleave",n[9]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?St(s,[a&2&&{key:r[1]},a&4&&Kt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function gT(n,e,t){const i=["field","key"];let s=Qe(e,i),{field:l}=e,{key:o=""}=e;function r(_){l=_,t(0,l)}function a(_){me.call(this,n,_)}function u(_){me.call(this,n,_)}function f(_){me.call(this,n,_)}function d(_){me.call(this,n,_)}function p(_){me.call(this,n,_)}function m(_){me.call(this,n,_)}return n.$$set=_=>{e=je(je({},e),Yt(_)),t(2,s=Qe(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,s,r,a,u,f,d,p,m]}class bT extends ve{constructor(e){super(),be(this,e,gT,_T,_e,{field:0,key:1})}}function vT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r<s.length;r+=1)o=je(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ci({props:o}),se.push(()=>he(e,"field",l)),e.$on("rename",n[4]),e.$on(
<span class='flatpickr-weekday'>
`+J.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function fe(){t.calendarContainer.classList.add("hasWeeks");var W=ft("div","flatpickr-weekwrapper");W.appendChild(ft("span","flatpickr-weekday",t.l10n.weekAbbreviation));var J=ft("div","flatpickr-weeks");return W.appendChild(J),{weekWrapper:W,weekNumbers:J}}function G(W,J){J===void 0&&(J=!0);var ie=J?W:W-t.currentMonth;ie<0&&t._hidePrevMonthArrow===!0||ie>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ie,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Fe("onYearChange"),R()),N(),Fe("onMonthChange"),Bi())}function ce(W,J){if(W===void 0&&(W=!0),J===void 0&&(J=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,J===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ie=Ir(t.config),oe=ie.hours,Te=ie.minutes,Ie=ie.seconds;m(oe,Te,Ie)}t.redraw(),W&&Fe("onChange")}function ge(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Fe("onClose")}function Me(){t.config!==void 0&&Fe("onDestroy");for(var W=t._handlers.length;W--;)t._handlers[W].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var J=t.calendarContainer.parentNode;if(J.lastChild&&J.removeChild(J.lastChild),J.parentNode){for(;J.firstChild;)J.parentNode.insertBefore(J.firstChild,J);J.parentNode.removeChild(J)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ie){try{delete t[ie]}catch{}})}function Ve(W){return t.calendarContainer.contains(W)}function ze(W){if(t.isOpen&&!t.config.inline){var J=Tn(W),ie=Ve(J),oe=J===t.input||J===t.altInput||t.element.contains(J)||W.path&&W.path.indexOf&&(~W.path.indexOf(t.input)||~W.path.indexOf(t.altInput)),Te=!oe&&!ie&&!Ve(W.relatedTarget),Ie=!t.config.ignoredFocusElements.some(function(Pe){return Pe.contains(J)});Te&&Ie&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function we(W){if(!(!W||t.config.minDate&&W<t.config.minDate.getFullYear()||t.config.maxDate&&W>t.config.maxDate.getFullYear())){var J=W,ie=t.currentYear!==J;t.currentYear=J||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ie&&(t.redraw(),Fe("onYearChange"),R())}}function Ce(W,J){var ie;J===void 0&&(J=!0);var oe=t.parseDate(W,void 0,J);if(t.config.minDate&&oe&&Cn(oe,t.config.minDate,J!==void 0?J:!t.minDateHasTime)<0||t.config.maxDate&&oe&&Cn(oe,t.config.maxDate,J!==void 0?J:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)retu
`),r=y("code"),r.textContent="multipart/form-data",a=U(`
requests, the following normalization rules are applied if the `),u=y("code"),u.textContent="json",f=U(` field
is a
`),d=y("strong"),d.textContent="plain string",p=U(`:
`),m=y("ul"),_=y("li"),_.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",g=E(),b=y("li"),b.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",k=E(),$=y("li"),$.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",C=E(),T=y("li"),T.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",O=E(),M=y("li"),I=U(D),L=U(" is converted to the json "),F=y("code"),F.textContent='{"a":1,"b":2}',q=E(),N=y("li"),N.textContent="numeric strings are converted to json number",R=E(),Y=y("li"),Y.textContent="double quoted strings are left as they are (aka. without normalizations)",B=E(),Z=y("li"),Z.textContent="any other string (empty string too) is double quoted",ee=U(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your
data inside an object, eg.`),ne=y("code"),ne.textContent='{"data": anything}',h(i,"class","content"),h(t,"class","alert alert-warning m-b-0 m-t-10"),h(e,"class","block")},m(G,ce){S(G,e,ce),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(i,r),v(i,a),v(i,u),v(i,f),v(i,d),v(i,p),v(i,m),v(m,_),v(m,g),v(m,b),v(m,k),v(m,$),v(m,C),v(m,T),v(m,O),v(m,M),v(M,I),v(M,L),v(M,F),v(m,q),v(m,N),v(m,R),v(m,Y),v(m,B),v(m,Z),v(i,ee),v(i,ne),fe=!0},i(G){fe||(G&&nt(()=>{fe&&(X||(X=He(e,kt,{duration:150},!0)),X.run(1))}),fe=!0)},o(G){G&&(X||(X=He(e,kt,{duration:150},!1)),X.run(0)),fe=!1},d(G){G&&w(e),G&&X&&X.end()}}}function fC(n){let e,t,i,s,l,o,r;function a(p,m){return p[2]?uC:aC}let u=a(n),f=u(n),d=n[2]&&kd();return{c(){e=y("button"),t=y("strong"),t.textContent="String value normalizations",i=E(),f.c(),s=E(),d&&d.c(),l=Se(),h(t,"class","txt"),h(e,"type","button"),h(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(p,m){S(p,e,m),v(e,t),v(e,i),f.m(e,null),S(p,s,m),d&&d.m(p,m),S(p,l,m),o||(r=K(e,"click",n[4]),o=!0)},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(e,null))),p[2]?d?m&4&&A(d,1):(d=kd(),d.c(),A(d,1),d.m(l.parentNode,l)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},d(p){p&&w(e),f.d(),p&&w(s),d&&d.d(p),p&&w(l),o=!1,r()}}}function cC(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[fC]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=je(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ci({props:o}),se.push(()=>he(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&10?St(s,[a&2&&{key:r[1]},a&8&&Kt(r[3])]):{};a&4100&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function dC(n,e,t){const i=["field","key"];let s=Qe(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(b){l=b,t(0,l)}function f(b){me.call(this,n,b)}function d(b){me.call(this,n,b)}function p(b){me.call(this,n,b)}function m(b){me.call(this,n,b)}function _(b){me.call(this,n,b)}function g(b){me.call(this,n,b)}return n.$$set=b=>{e=je(je({},e),Yt(b)),t(3,s=Qe(e,i)),"field"in b&&t(0,l=b.field),"key"in b&&t(1,o=b.key)},[l,o,r,s,a,u,f,d,p,m,_,g]}class pC extends ve{constructor(e){super(),be(this,e,dC,cC,_e,{field:0,key:1})}}function mC(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=y("span"),i=U(t),s=E(),l=y("small"),r=U(o),h(e,"class","txt"),h(l,"class","txt-hint")},m(a,u){S(a,e,u),v(e,i),S(a,s,u),S(a,l,u),v(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&le(i,t),u&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:Q,o:Q,d(a){a&&w(e),a&&w(s),a&&w(l)}}}function hC(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class wd extends ve{constructor(e){super(),be(this,e,hC,mC,_e,{item:0})}}const _C=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oas
Leave empty for no restriction.`,position:"top"})),$=!0)},p(M,D){(!k||D&67108864&&l!==(l=M[26]))&&h(e,"for",l);const I={};D&67108864&&(I.id=M[26]),D&8&&(I.items=M[3]),!a&&D&1&&(a=!0,I.keyOfSelected=M[0].options.mimeTypes,ye(()=>a=!1)),r.$set(I);const L={};D&268435457&&(L.$$scope={dirty:D,ctx:M}),b.$set(L)},i(M){k||(A(r.$$.fragment,M),A(b.$$.fragment,M),k=!0)},o(M){P(r.$$.fragment,M),P(b.$$.fragment,M),k=!1},d(M){M&&w(e),M&&w(o),H(r,M),M&&w(u),M&&w(f),H(b),$=!1,C()}}}function kC(n){let e;return{c(){e=y("ul"),e.innerHTML=`<li><strong>WxH</strong>
(eg. 100x50) - crop to WxH viewbox (from center)</li>
<li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li>
<li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li>
<li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li>
<li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li>
<li><strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,h(e,"class","m-0")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function wC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,C,T,O;function M(I){n[13](I)}let D={id:n[26],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(D.value=n[0].options.thumbs),r=new js({props:D}),se.push(()=>he(r,"value",M)),$=new Yn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[kC]},$$scope:{ctx:n}}}),{c(){e=y("label"),t=y("span"),t.textContent="Thumb sizes",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),d=y("span"),d.textContent="Use comma as separator.",p=E(),m=y("button"),_=y("span"),_.textContent="Supported formats",g=E(),b=y("i"),k=E(),z($.$$.fragment),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[26]),h(d,"class","txt"),h(_,"class","txt link-primary"),h(b,"class","ri-arrow-drop-down-fill"),h(m,"type","button"),h(m,"class","inline-flex flex-gap-0"),h(f,"class","help-block")},m(I,L){S(I,e,L),v(e,t),v(e,i),v(e,s),S(I,o,L),V(r,I,L),S(I,u,L),S(I,f,L),v(f,d),v(f,p),v(f,m),v(m,_),v(m,g),v(m,b),v(m,k),V($,m,null),C=!0,T||(O=Ee(We.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(I,L){(!C||L&67108864&&l!==(l=I[26]))&&h(e,"for",l);const F={};L&67108864&&(F.id=I[26]),!a&&L&1&&(a=!0,F.value=I[0].options.thumbs,ye(()=>a=!1)),r.$set(F);const q={};L&268435456&&(q.$$scope={dirty:L,ctx:I}),$.$set(q)},i(I){C||(A(r.$$.fragment,I),A($.$$.fragment,I),C=!0)},o(I){P(r.$$.fragment,I),P($.$$.fragment,I),C=!1},d(I){I&&w(e),I&&w(o),H(r,I),I&&w(u),I&&w(f),H($),T=!1,O()}}}function SC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=U("Max file size"),s=E(),l=y("input"),r=E(),a=y("div"),a.textContent="Must be in bytes.",h(e,"for",i=n[26]),h(l,"type","number"),h(l,"id",o=n[26]),h(l,"step","1"),h(l,"min","0"),h(a,"class","help-block")},m(d,p){S(d,e,p),v(e,t),S(d,s,p),S(d,l,p),ue(l,n[0].options.maxSize),S(d,r,p),S(d,a,p),u||(f=K(l,"input",n[14]),u=!0)},p(d,p){p&67108864&&i!==(i=d[26])&&h(e,"for",i),p&67108864&&o!==(o=d[26])&&h(l,"id",o),p&1&&gt(l.value)!==d[0].options.maxSize&&ue(l,d[0].options.maxSize)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function Sd(n){let e,t,i;return t=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[$C,({uniqueId:s})=>({26:s}),({uniqueId:s})=>s?67108864:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","col-sm-3")},m(s,l){S(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&335544321&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function $C(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Max select"),s=E(),l=y("input"),h(e,"for",i=n[26]),h(l,"id",o=n[26]),h(l,"type","number"),h(l,"step","1"),h(l,"min","2"),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.maxSelect),r||(a=K(l,"input",n[15]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&h(e,"for",i),f&67108864&&o!==(o=u[26])&&h(l,"id",o),f&1&&gt(l.value)!==u[0].options.maxSelect&&ue(l,u[0].options.maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function TC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[yC,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[wC,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[SC,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}});let _=!n[2]&&Sd(n);return{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),a=E(),u=y("div"),z(f.$$.f
<span class="txt">New collection</span>`,h(i,"type","button"),h(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=K(i,"click",n[16]),s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function IC(n){let e,t,i;function s(o){n[17](o)}let l={id:n[32],searchable:n[3].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[3],disabled:!n[33]||n[0].id,$$slots:{afterOptions:[AC]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Hi({props:l}),se.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[1]&2&&(a.id=o[32]),r[0]&8&&(a.searchable=o[3].length>5),r[0]&8&&(a.items=o[3]),r[0]&1|r[1]&4&&(a.disabled=!o[33]||o[0].id),r[0]&16|r[1]&8&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function PC(n){let e,t,i;function s(o){n[18](o)}let l={id:n[32],items:n[7],disabled:!n[33]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Hi({props:l}),se.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[1]&2&&(a.id=o[32]),r[1]&4&&(a.disabled=!o[33]),!t&&r[0]&4&&(t=!0,a.keyOfSelected=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function LC(n){let e,t,i,s;return e=new de({props:{class:"form-field required "+(n[33]?"":"disabled"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[IC,({uniqueId:l})=>({32:l}),({uniqueId:l})=>[0,l?2:0]]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field form-field-single-multiple-select "+(n[33]?"":"disabled"),inlineError:!0,$$slots:{default:[PC,({uniqueId:l})=>({32:l}),({uniqueId:l})=>[0,l?2:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,o){const r={};o[1]&4&&(r.class="form-field required "+(l[33]?"":"disabled")),o[0]&2&&(r.name="schema."+l[1]+".options.collectionId"),o[0]&25|o[1]&14&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o[1]&4&&(a.class="form-field form-field-single-multiple-select "+(l[33]?"":"disabled")),o[0]&4|o[1]&14&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function $d(n){let e,t,i,s,l,o;return t=new de({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[NC,({uniqueId:r})=>({32:r}),({uniqueId:r})=>[0,r?2:0]]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[FC,({uniqueId:r})=>({32:r}),({uniqueId:r})=>[0,r?2:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),z(t.$$.fragment),i=E(),s=y("div"),z(l.$$.fragment),h(e,"class","col-sm-6"),h(s,"class","col-sm-6")},m(r,a){S(r,e,a),V(t,e,null),S(r,i,a),S(r,s,a),V(l,s,null),o=!0},p(r,a){const u={};a[0]&2&&(u.name="schema."+r[1]+".options.minSelect"),a[0]&1|a[1]&10&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a[0]&2&&(f.name="schema."+r[1]+".options.maxSelect"),a[0]&1|a[1]&10&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(t.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){P(t.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){r&&w(e),H(t),r&&w(i),r&&w(s),H(l)}}}function NC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Min select"),s=E(),l=y("input"),h(e,"for",i=n[32]),h(l,"type","number"),h(l,"id",o=n[32]),h(l,"step","1"),h(l,"min","1"),h(l,"placeholder","No min limit")},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.minSelect),r||(a=K(l,"input",n[12]),r=!0)},p(u,f){f[1]&2&&i!==(i=u[32])&&h(e,"for",i),f[1]&2&&o!==(o=u[32])&&h(l,"id",o),f[0]&1&&gt(l.value)!==u[0].options.minSelect&&ue(l,u[0].options.minSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function FC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=U("Max select"),s=E(),l=y("input"),h(e,"for",i=n
`),t=y("code"),t.textContent="username",i=U(` ,
`),s=y("code"),s.textContent="email",l=U(` ,
`),o=y("code"),o.textContent="emailVisibility",r=U(` ,
`),a=y("code"),a.textContent="verified",h(t,"class","txt-sm"),h(s,"class","txt-sm"),h(o,"class","txt-sm"),h(a,"class","txt-sm")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),S(u,s,f),S(u,l,f),S(u,o,f),S(u,r,f),S(u,a,f)},d(u){u&&w(e),u&&w(t),u&&w(i),u&&w(s),u&&w(l),u&&w(o),u&&w(r),u&&w(a)}}}function Md(n,e){let t,i,s,l,o;function r(m){e[7](m,e[17],e[18],e[19])}function a(){return e[8](e[19])}function u(...m){return e[10](e[19],...m)}function f(...m){return e[11](e[19],...m)}var d=e[1][e[17].type];function p(m){let _={key:m[4](m[17])};return m[17]!==void 0&&(_.field=m[17]),{props:_}}return d&&(i=Pt(d,p(e)),se.push(()=>he(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f)),{key:n,first:null,c(){t=Se(),i&&z(i.$$.fragment),l=Se(),this.first=t},m(m,_){S(m,t,_),i&&V(i,m,_),S(m,l,_),o=!0},p(m,_){e=m;const g={};if(_&1&&(g.key=e[4](e[17])),!s&&_&1&&(s=!0,g.field=e[17],ye(()=>s=!1)),_&1&&d!==(d=e[1][e[17].type])){if(i){re();const b=i;P(b.$$.fragment,1,0,()=>{H(b,1)}),ae()}d?(i=Pt(d,p(e)),se.push(()=>he(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f),z(i.$$.fragment),A(i.$$.fragment,1),V(i,l.parentNode,l)):i=null}else d&&i.$set(g)},i(m){o||(i&&A(i.$$.fragment,m),o=!0)},o(m){i&&P(i.$$.fragment,m),o=!1},d(m){m&&w(t),m&&w(l),i&&H(i,m)}}}function BC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m=[],_=new Map,g,b,k,$,C,T,O,M,D=n[0].$isAuth&&Cd(),I=n[0].schema;const L=N=>N[17];for(let N=0;N<I.length;N+=1){let R=Td(n,I,N),Y=L(R);_.set(Y,m[N]=Md(Y,R))}b=new L$({props:{class:"btn btn-block btn-outline"}}),b.$on("select",n[12]);function F(N){n[13](N)}let q={};return n[0]!==void 0&&(q.collection=n[0]),T=new E$({props:q}),se.push(()=>he(T,"collection",F)),{c(){e=y("div"),t=y("p"),i=U(`System fields:
`),s=y("code"),s.textContent="id",l=U(` ,
`),o=y("code"),o.textContent="created",r=U(` ,
`),a=y("code"),a.textContent="updated",u=E(),D&&D.c(),f=U(`
.`),d=E(),p=y("div");for(let N=0;N<m.length;N+=1)m[N].c();g=E(),z(b.$$.fragment),k=E(),$=y("hr"),C=E(),z(T.$$.fragment),h(s,"class","txt-sm"),h(o,"class","txt-sm"),h(a,"class","txt-sm"),h(t,"class","txt-sm"),h(e,"class","block m-b-25"),h(p,"class","accordions schema-fields")},m(N,R){S(N,e,R),v(e,t),v(t,i),v(t,s),v(t,l),v(t,o),v(t,r),v(t,a),v(t,u),D&&D.m(t,null),v(t,f),S(N,d,R),S(N,p,R);for(let Y=0;Y<m.length;Y+=1)m[Y]&&m[Y].m(p,null);S(N,g,R),V(b,N,R),S(N,k,R),S(N,$,R),S(N,C,R),V(T,N,R),M=!0},p(N,[R]){N[0].$isAuth?D||(D=Cd(),D.c(),D.m(t,f)):D&&(D.d(1),D=null),R&119&&(I=N[0].schema,re(),m=yt(m,R,L,1,N,I,_,p,Zt,Md,null,Td),ae());const Y={};!O&&R&1&&(O=!0,Y.collection=N[0],ye(()=>O=!1)),T.$set(Y)},i(N){if(!M){for(let R=0;R<I.length;R+=1)A(m[R]);A(b.$$.fragment,N),A(T.$$.fragment,N),M=!0}},o(N){for(let R=0;R<m.length;R+=1)P(m[R]);P(b.$$.fragment,N),P(T.$$.fragment,N),M=!1},d(N){N&&w(e),D&&D.d(),N&&w(d),N&&w(p);for(let R=0;R<m.length;R+=1)m[R].d();N&&w(g),H(b,N),N&&w(k),N&&w($),N&&w(C),H(T,N)}}}function UC(n,e){n&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.dropEffect="move",n.dataTransfer.setData("text/plain",e))}function WC(n,e,t){let i,{collection:s=new kn}=e;const l={text:x$,number:lT,bool:aT,email:lb,url:bT,editor:kT,date:RT,select:rC,json:pC,file:EC,relation:zC};function o(T){s.schema[T]&&(s.schema.splice(T,1),t(0,s))}function r(T="text"){const O=new wn({name:a(),type:T});O.onMountSelect=!0,s.schema.push(O),t(0,s)}function a(T="field"){let O="";for(;u(T+O);)++O;return T+O}function u(T){return!!s.schema.find(O=>O.name===T)}function f(T){return i.findIndex(O=>O===T)}function d(T,O){var M;!((M=s==null?void 0:s.schema)!=null&&M.length)||T===O||!O||t(0,s.indexes=s.indexes.map(D=>j.replaceIndexColumn(D,T,O)),s)}function p(T,O){if(!T)return;T.dataTransfer.dropEffect="move";const M=parseInt(T.dataTransfer.getData("text/plain")),D=s.schema;M<O?(D.splice(O+1,0,D[M]),D.splice(M,1)):(D.splice(O,0,D[M]),D.splice(M+1,1)),t(0,s.schema=D,s),mn({})}function m(T,O,M,D){M[D]=T,t(0,s)}const _=T=>o(T),g=T=>d(T.detail.oldName,T.detail.newName),b=(T,O)=>UC(O.detail,T),k=(T,O)=>p(O.detail,T),$=T=>r(T.detail);function C(T){s=T,t(0,s)}return n.$$set=T=>{"collection"in T&&t(0,s=T.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&(t(0,s=s||new kn),t(0,s.schema=[],s)),n.$$.dirty&1&&(i=s.schema.filter(T=>!T.toDelete)||[])},[s,l,o,r,f,d,p,m,_,g,b,k,$,C]}class YC extends ve{constructor(e){super(),be(this,e,WC,BC,_e,{collection:0})}}const KC=n=>({isAdminOnly:n&512}),Od=n=>({isAdminOnly:n[9]});function JC(n){let e,t;return e=new de({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[GC,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&528&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),s&8&&(l.name=i[3]),s&295655&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function ZC(n){let e;return{c(){e=y("div"),e.innerHTML='<span class="loader"></span>',h(e,"class","txt-center")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function Dd(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-lock-line"></i>
<span class="txt">Set Admins only</span>`,h(e,"type","button"),h(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[11]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function Ed(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML=`<small class="txt svelte-1akuazq">Unlock and set custom rule</small>
<div class="icon svelte-1akuazq"><i class="ri-lock-unlock-line svelte-1akuazq"></i></div>`,h(e,"type","button"),h(e,"class","unlock-overlay svelte-1akuazq"),h(e,"aria-label","Unlock and set custom rule")},m(o,r){S(o,e,r),i=!0,s||(l=K(e,"click",n[10]),s=!0)},p:Q,i(o){i||(o&&nt(()=>{i&&(t||(t=He(e,Ut,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ut,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function GC(n){let e,t,i,s,l,o=n[9]?"- Admins only":"",r,a,u,f,d,p,m,_,g,b,k=!n[9]&&Dd(n);function $(I){n[14](I)}var C=n[7];function T(I){let L={id:I[18],baseCollection:I[1],disabled:I[9],placeholder:I[9]?"":I[5]};return I[0]!==void 0&&(L.value=I[0]),{props:L}}C&&(d=Pt(C,T(n)),n[13](d),se.push(()=>he(d,"value",$)));let O=n[9]&&Ed(n);const M=n[12].default,D=Tt(M,n,n[15],Od);return{c(){e=y("div"),t=y("label"),i=y("span"),s=U(n[2]),l=E(),r=U(o),a=E(),k&&k.c(),f=E(),d&&z(d.$$.fragment),m=E(),O&&O.c(),_=E(),g=y("div"),D&&D.c(),h(i,"class","txt"),x(i,"txt-hint",n[9]),h(t,"for",u=n[18]),h(e,"class","input-wrapper svelte-1akuazq"),h(g,"class","help-block")},m(I,L){S(I,e,L),v(e,t),v(t,i),v(i,s),v(i,l),v(i,r),v(t,a),k&&k.m(t,null),v(e,f),d&&V(d,e,null),v(e,m),O&&O.m(e,null),S(I,_,L),S(I,g,L),D&&D.m(g,null),b=!0},p(I,L){(!b||L&4)&&le(s,I[2]),(!b||L&512)&&o!==(o=I[9]?"- Admins only":"")&&le(r,o),(!b||L&512)&&x(i,"txt-hint",I[9]),I[9]?k&&(k.d(1),k=null):k?k.p(I,L):(k=Dd(I),k.c(),k.m(t,null)),(!b||L&262144&&u!==(u=I[18]))&&h(t,"for",u);const F={};if(L&262144&&(F.id=I[18]),L&2&&(F.baseCollection=I[1]),L&512&&(F.disabled=I[9]),L&544&&(F.placeholder=I[9]?"":I[5]),!p&&L&1&&(p=!0,F.value=I[0],ye(()=>p=!1)),L&128&&C!==(C=I[7])){if(d){re();const q=d;P(q.$$.fragment,1,0,()=>{H(q,1)}),ae()}C?(d=Pt(C,T(I)),I[13](d),se.push(()=>he(d,"value",$)),z(d.$$.fragment),A(d.$$.fragment,1),V(d,e,m)):d=null}else C&&d.$set(F);I[9]?O?(O.p(I,L),L&512&&A(O,1)):(O=Ed(I),O.c(),A(O,1),O.m(e,null)):O&&(re(),P(O,1,1,()=>{O=null}),ae()),D&&D.p&&(!b||L&33280)&&Mt(D,M,I,I[15],b?Ct(M,I[15],L,KC):Ot(I[15]),Od)},i(I){b||(d&&A(d.$$.fragment,I),A(O),A(D,I),b=!0)},o(I){d&&P(d.$$.fragment,I),P(O),P(D,I),b=!1},d(I){I&&w(e),k&&k.d(),n[13](null),d&&H(d),O&&O.d(),I&&w(_),I&&w(g),D&&D.d(I)}}}function XC(n){let e,t,i,s;const l=[ZC,JC],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),P(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}let Ad;function QC(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,{placeholder:d="Leave empty to grant everyone access..."}=e,p=null,m=null,_=Ad,g=!1;b();async function b(){_||g||(t(8,g=!0),t(7,_=(await rt(()=>import("./FilterAutocompleteInput-5a120970.js"),["./FilterAutocompleteInput-5a120970.js","./index-c4d2d831.js"],import.meta.url)).default),Ad=_,t(8,g=!1))}async function k(){t(0,r=m||""),await pn(),p==null||p.focus()}async function $(){m=r,t(0,r=null)}function C(O){se[O?"unshift":"push"](()=>{p=O,t(6,p)})}function T(O){r=O,t(0,r)}return n.$$set=O=>{"collection"in O&&t(1,o=O.collection),"rule"in O&&t(0,r=O.rule),"label"in O&&t(2,a=O.label),"formKey"in O&&t(3,u=O.formKey),"required"in O&&t(4,f=O.required),"placeholder"in O&&t(5,d=O.placeholder),"$$scope"in O&&t(15,l=O.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,d,p,_,g,i,k,$,s,C,T,l]}class Ms extends ve{constructor(e){super(),be(this,e,QC,XC,_e,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Id(n,e,t){const i=n.slice();return i[10]=e[t],i}function Pd(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,C,T,O,M,D,I,L=n[2],F=[];for(let q=0;q<L.length;q+=1)F[q]=Ld(Id(n,L,q));return{c(){e=y("div"),t=y("div"),i=y("div"),s=y("p"),s.textContent="The following record fields are available:",l=E(),o=y("div");for(let q=0;q<F.length;q+=1)F[q].c();r=E(),a=y("hr"),u=E(),f=y("p"),f.innerH
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.auth.*</code>`,m=E(),_=y("hr"),g=E(),b=y("p"),b.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",k=E(),$=y("div"),$.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",C=E(),T=y("hr"),O=E(),M=y("p"),M.innerHTML=`Example rule:
<br/>
<code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,h(s,"class","m-b-0"),h(o,"class","inline-flex flex-gap-5"),h(a,"class","m-t-10 m-b-5"),h(f,"class","m-b-0"),h(p,"class","inline-flex flex-gap-5"),h(_,"class","m-t-10 m-b-5"),h(b,"class","m-b-0"),h($,"class","inline-flex flex-gap-5"),h(T,"class","m-t-10 m-b-5"),h(i,"class","content"),h(t,"class","alert alert-warning m-0")},m(q,N){S(q,e,N),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o);for(let R=0;R<F.length;R+=1)F[R]&&F[R].m(o,null);v(i,r),v(i,a),v(i,u),v(i,f),v(i,d),v(i,p),v(i,m),v(i,_),v(i,g),v(i,b),v(i,k),v(i,$),v(i,C),v(i,T),v(i,O),v(i,M),I=!0},p(q,N){if(N&4){L=q[2];let R;for(R=0;R<L.length;R+=1){const Y=Id(q,L,R);F[R]?F[R].p(Y,N):(F[R]=Ld(Y),F[R].c(),F[R].m(o,null))}for(;R<F.length;R+=1)F[R].d(1);F.length=L.length}},i(q){I||(q&&nt(()=>{I&&(D||(D=He(e,kt,{duration:150},!0)),D.run(1))}),I=!0)},o(q){q&&(D||(D=He(e,kt,{duration:150},!1)),D.run(0)),I=!1},d(q){q&&w(e),dt(F,q),q&&D&&D.end()}}}function Ld(n){let e,t=n[10]+"",i;return{c(){e=y("code"),i=U(t)},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&4&&t!==(t=s[10]+"")&&le(i,t)},d(s){s&&w(e)}}}function Nd(n){let e,t,i,s,l,o,r,a,u;function f(b){n[6](b)}let d={label:"Create rule",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(d.rule=n[0].createRule),e=new Ms({props:d}),se.push(()=>he(e,"rule",f));function p(b){n[7](b)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),s=new Ms({props:m}),se.push(()=>he(s,"rule",p));function _(b){n[8](b)}let g={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(g.rule=n[0].deleteRule),r=new Ms({props:g}),se.push(()=>he(r,"rule",_)),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment),o=E(),z(r.$$.fragment)},m(b,k){V(e,b,k),S(b,i,k),V(s,b,k),S(b,o,k),V(r,b,k),u=!0},p(b,k){const $={};k&1&&($.collection=b[0]),!t&&k&1&&(t=!0,$.rule=b[0].createRule,ye(()=>t=!1)),e.$set($);const C={};k&1&&(C.collection=b[0]),!l&&k&1&&(l=!0,C.rule=b[0].updateRule,ye(()=>l=!1)),s.$set(C);const T={};k&1&&(T.collection=b[0]),!a&&k&1&&(a=!0,T.rule=b[0].deleteRule,ye(()=>a=!1)),r.$set(T)},i(b){u||(A(e.$$.fragment,b),A(s.$$.fragment,b),A(r.$$.fragment,b),u=!0)},o(b){P(e.$$.fragment,b),P(s.$$.fragment,b),P(r.$$.fragment,b),u=!1},d(b){H(e,b),b&&w(i),H(s,b),b&&w(o),H(r,b)}}}function Fd(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[xC]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Ms({props:l}),se.push(()=>he(e,"rule",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&8192&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function xC(n){let e,t,i;return{c(){e=y("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg.
changing the password without requiring to enter the old one, directly updating the verified
state or email, etc.`,t=E(),i=y("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},p:Q,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function e4(n){var N,R;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,d,p,m,_,g,b,k,$,C,T,O=n[1]&&Pd(n);function M(Y){n[4](Y)}let D={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(D.rule=n[0].listRule),f=new Ms({props:D}),se.push(()=>he(f,"rule",M));function I(Y){n[5](Y)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new Ms({props:L}),se.push(()=>he(m,"rule",I));let F=!((N=n[0])!=null&&N.isView)&&Nd(n),q=((R=n[0])==null?void 0:R.isAuth)&&Fd(n);return{c(){e=y("div"),t=y("div"),i=y("p"),i.innerHTML=`All rules follow the
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
</a>.`,s=E(),l=y("button"),r=U(o),a=E(),O&&O.c(),u=E(),z(f.$$.fragment),p=E(),z(m.$$.fragment),g=E(),F&&F.c(),b=E(),q&&q.c(),k=Se(),h(l,"type","button"),h(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),h(t,"class","flex txt-sm txt-hint m-b-5"),h(e,"class","block m-b-sm handle")},m(Y,B){S(Y,e,B),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),O&&O.m(e,null),S(Y,u,B),V(f,Y,B),S(Y,p,B),V(m,Y,B),S(Y,g,B),F&&F.m(Y,B),S(Y,b,B),q&&q.m(Y,B),S(Y,k,B),$=!0,C||(T=K(l,"click",n[3]),C=!0)},p(Y,[B]){var ne,X;(!$||B&2)&&o!==(o=Y[1]?"Hide available fields":"Show available fields")&&le(r,o),Y[1]?O?(O.p(Y,B),B&2&&A(O,1)):(O=Pd(Y),O.c(),A(O,1),O.m(e,null)):O&&(re(),P(O,1,1,()=>{O=null}),ae());const Z={};B&1&&(Z.collection=Y[0]),!d&&B&1&&(d=!0,Z.rule=Y[0].listRule,ye(()=>d=!1)),f.$set(Z);const ee={};B&1&&(ee.collection=Y[0]),!_&&B&1&&(_=!0,ee.rule=Y[0].viewRule,ye(()=>_=!1)),m.$set(ee),(ne=Y[0])!=null&&ne.isView?F&&(re(),P(F,1,1,()=>{F=null}),ae()):F?(F.p(Y,B),B&1&&A(F,1)):(F=Nd(Y),F.c(),A(F,1),F.m(b.parentNode,b)),(X=Y[0])!=null&&X.isAuth?q?(q.p(Y,B),B&1&&A(q,1)):(q=Fd(Y),q.c(),A(q,1),q.m(k.parentNode,k)):q&&(re(),P(q,1,1,()=>{q=null}),ae())},i(Y){$||(A(O),A(f.$$.fragment,Y),A(m.$$.fragment,Y),A(F),A(q),$=!0)},o(Y){P(O),P(f.$$.fragment,Y),P(m.$$.fragment,Y),P(F),P(q),$=!1},d(Y){Y&&w(e),O&&O.d(),Y&&w(u),H(f,Y),Y&&w(p),H(m,Y),Y&&w(g),F&&F.d(Y),Y&&w(b),q&&q.d(Y),Y&&w(k),C=!1,T()}}}function t4(n,e,t){let i,{collection:s=new kn}=e,l=!1;const o=()=>t(1,l=!l);function r(m){n.$$.not_equal(s.listRule,m)&&(s.listRule=m,t(0,s))}function a(m){n.$$.not_equal(s.viewRule,m)&&(s.viewRule=m,t(0,s))}function u(m){n.$$.not_equal(s.createRule,m)&&(s.createRule=m,t(0,s))}function f(m){n.$$.not_equal(s.updateRule,m)&&(s.updateRule=m,t(0,s))}function d(m){n.$$.not_equal(s.deleteRule,m)&&(s.deleteRule=m,t(0,s))}function p(m){n.$$.not_equal(s.options.manageRule,m)&&(s.options.manageRule=m,t(0,s))}return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,d,p]}class n4 extends ve{constructor(e){super(),be(this,e,t4,e4,_e,{collection:0})}}function Rd(n,e,t){const i=n.slice();return i[9]=e[t],i}function i4(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Pt(o,r(n)),se.push(()=>he(e,"value",l)),e.$on("change",n[6])),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&V(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ye(()=>t=!1)),u&2&&o!==(o=a[1])){if(e){re();const d=e;P(d.$$.fragment,1,0,()=>{H(d,1)}),ae()}o?(e=Pt(o,r(a)),se.push(()=>he(e,"value",l)),e.$on("change",a[6]),z(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&H(e,a)}}}function s4(n){let e;return{c(){e=y("textarea"),e.disabled=!0,h(e,"rows","7"),h(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function qd(n){let e,t,i=n[3],s=[];for(let l=0;l<i.length;l+=1)s[l]=jd(Rd(n,i,l));return{c(){e=y("div"),t=y("div");for(let l=0;l<s.length;l+=1)s[l].c();h(t,"class","content"),h(e,"class","help-block help-block-error")},m(l,o){S(l,e,o),v(e,t);for(let r=0;r<s.length;r+=1)s[r]&&s[r].m(t,null)},p(l,o){if(o&8){i=l[3];let r;for(r=0;r<i.length;r+=1){const a=Rd(l,i,r);s[r]?s[r].p(a,o):(s[r]=jd(a),s[r].c(),s[r].m(t,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=i.length}},d(l){l&&w(e),dt(s,l)}}}function jd(n){let e,t=n[9]+"",i;return{c(){e=y("p"),i=U(t)},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&le(i,t)},d(s){s&&w(e)}}}function l4(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[s4,i4],m=[];function _(b,k){return b[2]?0:1}l=_(n),o=m[l]=p[l](n);let g=n[3].length&&qd(n);return{c(){e=y("label"),t=y("span"),t.textContent="Select query",s=E(),o.c(),r=E(),a=y("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>) are not support
<li>The query must have a unique <code>id</code> column.
<br/>
If your query doesn&#39;t have a suitable one, you can use the universal
<code>(ROW_NUMBER() OVER()) as id</code>.</li>
<li>Expressions must be aliased with a valid formatted field name (eg.
<code>MAX(balance) as maxBalance</code>).</li></ul>`,u=E(),g&&g.c(),f=Se(),h(t,"class","txt"),h(e,"for",i=n[8]),h(a,"class","help-block")},m(b,k){S(b,e,k),v(e,t),S(b,s,k),m[l].m(b,k),S(b,r,k),S(b,a,k),S(b,u,k),g&&g.m(b,k),S(b,f,k),d=!0},p(b,k){(!d||k&256&&i!==(i=b[8]))&&h(e,"for",i);let $=l;l=_(b),l===$?m[l].p(b,k):(re(),P(m[$],1,1,()=>{m[$]=null}),ae(),o=m[l],o?o.p(b,k):(o=m[l]=p[l](b),o.c()),A(o,1),o.m(r.parentNode,r)),b[3].length?g?g.p(b,k):(g=qd(b),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(b){d||(A(o),d=!0)},o(b){P(o),d=!1},d(b){b&&w(e),b&&w(s),m[l].d(b),b&&w(r),b&&w(a),b&&w(u),g&&g.d(b),b&&w(f)}}}function o4(n){let e,t;return e=new de({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[l4,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function r4(n,e,t){let i;Xe(n,wi,d=>t(4,i=d));let{collection:s=new kn}=e,l,o=!1,r=[];function a(d){var _;t(3,r=[]);const p=j.getNestedVal(d,"schema",null);if(j.isEmpty(p))return;if(p!=null&&p.message){r.push(p==null?void 0:p.message);return}const m=j.extractColumnsFromQuery((_=s==null?void 0:s.options)==null?void 0:_.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let g in p)for(let b in p[g]){const k=p[g][b].message,$=m[g]||g;r.push(j.sentenize($+": "+k))}}Gt(async()=>{t(2,o=!0);try{t(1,l=(await rt(()=>import("./CodeEditor-68eb45ba.js"),["./CodeEditor-68eb45ba.js","./index-c4d2d831.js"],import.meta.url)).default)}catch(d){console.warn(d)}t(2,o=!1)});function u(d){n.$$.not_equal(s.options.query,d)&&(s.options.query=d,t(0,s))}const f=()=>{r.length&&Ni("schema")};return n.$$set=d=>{"collection"in d&&t(0,s=d.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class a4 extends ve{constructor(e){super(),be(this,e,r4,o4,_e,{collection:0})}}const u4=n=>({active:n&1}),Vd=n=>({active:n[0]});function Hd(n){let e,t,i;const s=n[15].default,l=Tt(s,n,n[14],null);return{c(){e=y("div"),l&&l.c(),h(e,"class","accordion-content")},m(o,r){S(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&Mt(l,s,o,o[14],i?Ct(s,o[14],r,null):Ot(o[14]),null)},i(o){i||(A(l,o),o&&nt(()=>{i&&(t||(t=He(e,kt,{duration:150},!0)),t.run(1))}),i=!0)},o(o){P(l,o),o&&(t||(t=He(e,kt,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&w(e),l&&l.d(o),o&&t&&t.end()}}}function f4(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Tt(a,n,n[14],Vd);let f=n[0]&&Hd(n);return{c(){e=y("div"),t=y("button"),u&&u.c(),i=E(),f&&f.c(),h(t,"type","button"),h(t,"class","accordion-header"),h(t,"draggable",n[2]),x(t,"interactive",n[3]),h(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(d,p){S(d,e,p),v(e,t),u&&u.m(t,null),v(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[K(t,"click",at(n[17])),K(t,"drop",at(n[18])),K(t,"dragstart",n[19]),K(t,"dragenter",n[20]),K(t,"dragleave",n[21]),K(t,"dragover",at(n[16]))],o=!0)},p(d,[p]){u&&u.p&&(!l||p&16385)&&Mt(u,a,d,d[14],l?Ct(a,d[14],p,u4):Ot(d[14]),Vd),(!l||p&4)&&h(t,"draggable",d[2]),(!l||p&8)&&x(t,"interactive",d[3]),d[0]?f?(f.p(d,p),p&1&&A(f,1)):(f=Hd(d),f.c(),A(f,1),f.m(e,null)):f&&(re(),P(f,1,1,()=>{f=null}),ae()),(!l||p&130&&s!==(s="accordion "+(d[7]?"drag-over":"")+" "+d[1]))&&h(e,"class",s),(!l||p&131)&&x(e,"active",d[0])},i(d){l||(A(u,d),A(f),l=!0)},o(d){P(u,d),P(f),l=!1},d(d){d&&w(e),u&&u.d(d),f&&f.d(),n[22](null),o=!1,De(r)}}}function c4(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=wt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:d=!0}=e,{single:p=!1}=e,m=!1;function _(){return!!f}function g(){$(),t(0,f=!0),l("expand")}function b(){t(0,f=!1),clearTimeout(r),l("collapse")}function k(){l("toggle"),f?b():g()}function $(){if(p&&o.closest(".accordions")){const F=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const
<span class="txt">Username/Password</span>`,t=E(),i=y("div"),s=E(),f.c(),l=E(),d&&d.c(),o=Se(),h(e,"class","inline-flex"),h(i,"class","flex-fill")},m(p,m){S(p,e,m),S(p,t,m),S(p,i,m),S(p,s,m),f.m(p,m),S(p,l,m),d&&d.m(p,m),S(p,o,m),r=!0},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[3]?d?m&8&&A(d,1):(d=zd(),d.c(),A(d,1),d.m(o.parentNode,o)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(p){r||(A(d),r=!0)},o(p){P(d),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),p&&w(s),f.d(p),p&&w(l),d&&d.d(p),p&&w(o)}}}function g4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowEmailAuth,S(u,i,f),S(u,s,f),v(s,l),r||(a=K(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Bd(n){let e,t,i,s,l,o,r,a;return i=new de({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[b4,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[v4,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(e,"class","grid grid-sm p-t-sm")},m(u,f){S(u,e,f),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),a=!0},p(u,f){const d={};f&1&&(d.class="form-field "+(j.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),i.$set(d);const p={};f&1&&(p.class="form-field "+(j.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(p.$$scope={dirty:f,ctx:u}),o.$set(p)},i(u){a||(A(i.$$.fragment,u),A(o.$$.fragment,u),u&&nt(()=>{a&&(r||(r=He(e,kt,{duration:150},!0)),r.run(1))}),a=!0)},o(u){P(i.$$.fragment,u),P(o.$$.fragment,u),u&&(r||(r=He(e,kt,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),H(i),H(o),u&&r&&r.end()}}}function b4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(b){n[7](b)}let g={id:n[12],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(g.value=n[0].options.exceptEmailDomains),r=new js({props:g}),se.push(()=>he(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Except domains",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]),h(f,"class","help-block")},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),V(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(m=Ee(We.call(null,s,{text:`Email domains that are NOT allowed to sign up.
This field is disabled if "Only domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]))&&h(e,"for",l);const $={};k&4096&&($.id=b[12]),k&1&&($.disabled=!j.isEmpty(b[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.exceptEmailDomains,ye(()=>a=!1)),r.$set($)},i(b){d||(A(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),H(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function v4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(b){n[8](b)}let g={id:n[12],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(g.value=n[0].options.onlyEmailDomains),r=new js({props:g}),se.push(()=>he(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Only domains",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]),h(f,"class","help-block")},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),V(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(m=Ee(We.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]))&&h(e,"for",l);const $={};k&4096&&($.id=b[12]),k&1&&($.disabled=!j.isEmpty(b[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.onlyEmailDomains,ye(()=>a=!1)),r.$set($)},i(b){d||(A(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),H(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function y4(n){let e,t,i,s;e=new de({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[g4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Bd(n);return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=Se()},m(o,r){V(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=Bd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){H(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function k4(n){let e;return{c(){e=y("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function w4(n){let e;return{c(){e=y("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Ud(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(We.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(nt(()=>{i&&(t||(t=He(e,Ut,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=He(e,Ut,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function S4(n){let e,t,i,s,l,o,r;function a(p,m){return p[0].options.allowEmailAuth?w4:k4}let u=a(n),f=u(n),d=n[2]&&Ud();return{c(){e=y("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
<span class="txt">Email/Password</span>`,t=E(),i=y("div"),s=E(),f.c(),l=E(),d&&d.c(),o=Se(),h(e,"class","inline-flex"),h(i,"class","flex-fill")},m(p,m){S(p,e,m),S(p,t,m),S(p,i,m),S(p,s,m),f.m(p,m),S(p,l,m),d&&d.m(p,m),S(p,o,m),r=!0},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[2]?d?m&4&&A(d,1):(d=Ud(),d.c(),A(d,1),d.m(o.parentNode,o)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(p){r||(A(d),r=!0)},o(p){P(d),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),p&&w(s),f.d(p),p&&w(l),d&&d.d(p),p&&w(o)}}}function $4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowOAuth2Auth,S(u,i,f),S(u,s,f),v(s,l),r||(a=K(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Wd(n){let e,t,i;return{c(){e=y("div"),e.innerHTML='<div class="flex p-t-base"><a href="/_/#/settings/auth-providers" target="_blank" class="btn btn-sm btn-outline"><span class="txt">Manage OAuth2 providers</span></a></div>',h(e,"class","block")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&nt(()=>{i&&(t||(t=He(e,kt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=He(e,kt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function T4(n){let e,t,i,s;e=new de({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[$4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Wd();return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=Se()},m(o,r){V(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=Wd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){H(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function C4(n){let e;return{c(){e=y("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function M4(n){let e;return{c(){e=y("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Yd(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(We.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(nt(()=>{i&&(t||(t=He(e,Ut,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=He(e,Ut,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function O4(n){let e,t,i,s,l,o,r;function a(p,m){return p[0].options.allowOAuth2Auth?M4:C4}let u=a(n),f=u(n),d=n[1]&&Yd();return{c(){e=y("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
<span class="txt">OAuth2</span>`,t=E(),i=y("div"),s=E(),f.c(),l=E(),d&&d.c(),o=Se(),h(e,"class","inline-flex"),h(i,"class","flex-fill")},m(p,m){S(p,e,m),S(p,t,m),S(p,i,m),S(p,s,m),f.m(p,m),S(p,l,m),d&&d.m(p,m),S(p,o,m),r=!0},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[1]?d?m&2&&A(d,1):(d=Yd(),d.c(),A(d,1),d.m(o.parentNode,o)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(p){r||(A(d),r=!0)},o(p){P(d),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),p&&w(s),f.d(p),p&&w(l),d&&d.d(p),p&&w(o)}}}function D4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Minimum password length"),s=E(),l=y("input"),h(e,"for",i=n[12]),h(l,"type","number"),h(l,"id",o=n[12]),l.required=!0,h(l,"min","6"),h(l,"max","72")},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.minPasswordLength),r||(a=K(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&h(e,"for",i),f&4096&&o!==(o=u[12])&&h(l,"id",o),f&1&&gt(l.value)!==u[0].options.minPasswordLength&&ue(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function E4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),l.textContent="Always require email",o=E(),r=y("i"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(l,"class","txt"),h(r,"class","ri-information-line txt-sm link-hint"),h(s,"for",a=n[12])},m(d,p){S(d,e,p),e.checked=n[0].options.requireEmail,S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[K(e,"change",n[11]),Ee(We.call(null,r,{text:`The constraint is applied only for new records.
Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(d,p){p&4096&&t!==(t=d[12])&&h(e,"id",t),p&1&&(e.checked=d[0].options.requireEmail),p&4096&&a!==(a=d[12])&&h(s,"for",a)},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,De(f)}}}function A4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k;return s=new co({props:{single:!0,$$slots:{header:[_4],default:[p4]},$$scope:{ctx:n}}}),o=new co({props:{single:!0,$$slots:{header:[S4],default:[y4]},$$scope:{ctx:n}}}),a=new co({props:{single:!0,$$slots:{header:[O4],default:[T4]},$$scope:{ctx:n}}}),_=new de({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[D4,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),b=new de({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[E4,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("h4"),e.textContent="Auth methods",t=E(),i=y("div"),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=y("hr"),d=E(),p=y("h4"),p.textContent="General",m=E(),z(_.$$.fragment),g=E(),z(b.$$.fragment),h(e,"class","section-title"),h(i,"class","accordions"),h(p,"class","section-title")},m($,C){S($,e,C),S($,t,C),S($,i,C),V(s,i,null),v(i,l),V(o,i,null),v(i,r),V(a,i,null),S($,u,C),S($,f,C),S($,d,C),S($,p,C),S($,m,C),V(_,$,C),S($,g,C),V(b,$,C),k=!0},p($,[C]){const T={};C&8201&&(T.$$scope={dirty:C,ctx:$}),s.$set(T);const O={};C&8197&&(O.$$scope={dirty:C,ctx:$}),o.$set(O);const M={};C&8195&&(M.$$scope={dirty:C,ctx:$}),a.$set(M);const D={};C&12289&&(D.$$scope={dirty:C,ctx:$}),_.$set(D);const I={};C&12289&&(I.$$scope={dirty:C,ctx:$}),b.$set(I)},i($){k||(A(s.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(_.$$.fragment,$),A(b.$$.fragment,$),k=!0)},o($){P(s.$$.fragment,$),P(o.$$.fragment,$),P(a.$$.fragment,$),P(_.$$.fragment,$),P(b.$$.fragment,$),k=!1},d($){$&&w(e),$&&w(t),$&&w(i),H(s),H(o),H(a),$&&w(u),$&&w(f),$&&w(d),$&&w(p),$&&w(m),H(_,$),$&&w(g),H(b,$)}}}function I4(n,e,t){let i,s,l,o;Xe(n,wi,g=>t(4,o=g));let{collection:r=new kn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function d(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function p(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=gt(this.value),t(0,r)}function _(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,b,k,$;n.$$.dirty&1&&r.$isAuth&&j.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!j.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!j.isEmpty((b=o==null?void 0:o.options)==null?void 0:b.onlyEmailDomains)||!j.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!j.isEmpty(($=o==null?void 0:o.options)==null?void 0:$.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,d,p,m,_]}class P4 extends ve{constructor(e){super(),be(this,e,I4,A4,_e,{collection:0})}}function Kd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Jd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Zd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Gd(n){let e;return{c(){e=y("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Xd(n){var r;let e,t,i,s,l=n[3]&&Qd(n),o=!((r=n[2])!=null&&r.$isView)&&xd(n);return{c(){e=y("h6"),e.textContent="Changes:",t=E(),i=y("ul"),l&&l.c(),s=E(),o&&o.c(),h(i,"class","changes-list svelte-xqpcsf")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),l&&l.m(i,null),v(i,s),o&&o.m(i,null)},p(a,u){var f;a[3]?l?l.p(a,u):(l=Qd(a),l.c(),l.m(i,s)):l&&(l.d(1),l=null),(f=a[2])!=null&&f.$isView?o&&(o.d(1),o=null):o?o.p(a,u):(o=xd
`),s=y("strong"),o=U(l),r=E(),a=y("i"),u=E(),f=y("strong"),p=U(d),h(s,"class","txt-strikethrough txt-hint"),h(a,"class","ri-arrow-right-line txt-sm"),h(f,"class","txt"),h(t,"class","inline-flex"),h(e,"class","svelte-xqpcsf")},m(g,b){S(g,e,b),v(e,t),v(t,i),v(t,s),v(s,o),v(t,r),v(t,a),v(t,u),v(t,f),v(f,p)},p(g,b){var k,$;b&2&&l!==(l=((k=g[1])==null?void 0:k.name)+"")&&le(o,l),b&4&&d!==(d=(($=g[2])==null?void 0:$.name)+"")&&le(p,d)},d(g){g&&w(e)}}}function xd(n){let e,t,i,s=n[5],l=[];for(let f=0;f<s.length;f+=1)l[f]=ep(Zd(n,s,f));let o=n[7],r=[];for(let f=0;f<o.length;f+=1)r[f]=tp(Jd(n,o,f));let a=n[6],u=[];for(let f=0;f<a.length;f+=1)u[f]=np(Kd(n,a,f));return{c(){for(let f=0;f<l.length;f+=1)l[f].c();e=E();for(let f=0;f<r.length;f+=1)r[f].c();t=E();for(let f=0;f<u.length;f+=1)u[f].c();i=Se()},m(f,d){for(let p=0;p<l.length;p+=1)l[p]&&l[p].m(f,d);S(f,e,d);for(let p=0;p<r.length;p+=1)r[p]&&r[p].m(f,d);S(f,t,d);for(let p=0;p<u.length;p+=1)u[p]&&u[p].m(f,d);S(f,i,d)},p(f,d){if(d&32){s=f[5];let p;for(p=0;p<s.length;p+=1){const m=Zd(f,s,p);l[p]?l[p].p(m,d):(l[p]=ep(m),l[p].c(),l[p].m(e.parentNode,e))}for(;p<l.length;p+=1)l[p].d(1);l.length=s.length}if(d&128){o=f[7];let p;for(p=0;p<o.length;p+=1){const m=Jd(f,o,p);r[p]?r[p].p(m,d):(r[p]=tp(m),r[p].c(),r[p].m(t.parentNode,t))}for(;p<r.length;p+=1)r[p].d(1);r.length=o.length}if(d&64){a=f[6];let p;for(p=0;p<a.length;p+=1){const m=Kd(f,a,p);u[p]?u[p].p(m,d):(u[p]=np(m),u[p].c(),u[p].m(i.parentNode,i))}for(;p<u.length;p+=1)u[p].d(1);u.length=a.length}},d(f){dt(l,f),f&&w(e),dt(r,f),f&&w(t),dt(u,f),f&&w(i)}}}function ep(n){let e,t,i,s=n[17].name+"",l,o,r;return{c(){e=y("li"),t=U(`Multiple to single value conversion of field
`),i=y("strong"),l=U(s),o=E(),r=y("em"),r.textContent="(will keep only the last array item)",h(r,"class","txt-sm"),h(e,"class","svelte-xqpcsf")},m(a,u){S(a,e,u),v(e,t),v(e,i),v(i,l),v(e,o),v(e,r)},p(a,u){u&32&&s!==(s=a[17].name+"")&&le(l,s)},d(a){a&&w(e)}}}function tp(n){let e,t,i,s,l=n[17].originalName+"",o,r,a,u,f,d=n[17].name+"",p;return{c(){e=y("li"),t=y("div"),i=U(`Renamed field
`),s=y("strong"),o=U(l),r=E(),a=y("i"),u=E(),f=y("strong"),p=U(d),h(s,"class","txt-strikethrough txt-hint"),h(a,"class","ri-arrow-right-line txt-sm"),h(f,"class","txt"),h(t,"class","inline-flex"),h(e,"class","svelte-xqpcsf")},m(m,_){S(m,e,_),v(e,t),v(t,i),v(t,s),v(s,o),v(t,r),v(t,a),v(t,u),v(t,f),v(f,p)},p(m,_){_&128&&l!==(l=m[17].originalName+"")&&le(o,l),_&128&&d!==(d=m[17].name+"")&&le(p,d)},d(m){m&&w(e)}}}function np(n){let e,t,i,s=n[17].name+"",l,o;return{c(){e=y("li"),t=U("Removed field "),i=y("span"),l=U(s),o=E(),h(i,"class","txt-bold"),h(e,"class","txt-danger svelte-xqpcsf")},m(r,a){S(r,e,a),v(e,t),v(e,i),v(i,l),v(e,o)},p(r,a){a&64&&s!==(s=r[17].name+"")&&le(l,s)},d(r){r&&w(e)}}}function L4(n){let e,t,i,s,l,o,r,a,u=n[6].length&&Gd(),f=n[8]&&Xd(n);return{c(){e=y("div"),t=y("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=E(),s=y("div"),l=y("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query,
you'll have to update it manually!`,o=E(),u&&u.c(),r=E(),f&&f.c(),a=Se(),h(t,"class","icon"),h(s,"class","content txt-bold"),h(e,"class","alert alert-warning")},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),v(s,l),v(s,o),u&&u.m(s,null),S(d,r,p),f&&f.m(d,p),S(d,a,p)},p(d,p){d[6].length?u||(u=Gd(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),d[8]?f?f.p(d,p):(f=Xd(d),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(d){d&&w(e),u&&u.d(),d&&w(r),f&&f.d(d),d&&w(a)}}}function N4(n){let e;return{c(){e=y("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function F4(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='<span class="txt">Cancel</span>',t=E(),i=y("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,h(e,"type","button"),h(e,"class","btn btn-transparent"),h(i,"type","button"),h(i,"class","btn btn-expanded")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),e.focus(),s||(l=[K(e,"click",n[11]),K(i,"click",n[12])],s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,De(l)}}}function R4(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[F4],header:[N4],default:[L4]},$$scope:{ctx:n}};return e=new hn({props:i}),n[13](e),e.$on("hide",n[14]),e.$on("show",n[15]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&16777710&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[13](null),H(e,s)}}}function q4(n,e,t){let i,s,l,o,r;const a=wt();let u,f,d;async function p(T,O){t(1,f=T),t(2,d=O),await pn(),i||s.length||l.length||o.length?u==null||u.show():_()}function m(){u==null||u.hide()}function _(){m(),a("confirm")}const g=()=>m(),b=()=>_();function k(T){se[T?"unshift":"push"](()=>{u=T,t(4,u)})}function $(T){me.call(this,n,T)}function C(T){me.call(this,n,T)}return n.$$.update=()=>{var T,O,M;n.$$.dirty&6&&t(3,i=(f==null?void 0:f.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(7,s=((T=d==null?void 0:d.schema)==null?void 0:T.filter(D=>D.id&&!D.toDelete&&D.originalName!=D.name))||[]),n.$$.dirty&4&&t(6,l=((O=d==null?void 0:d.schema)==null?void 0:O.filter(D=>D.id&&D.toDelete))||[]),n.$$.dirty&6&&t(5,o=((M=d==null?void 0:d.schema)==null?void 0:M.filter(D=>{var L,F,q;const I=(L=f==null?void 0:f.schema)==null?void 0:L.find(N=>N.id==D.id);return I?((F=I.options)==null?void 0:F.maxSelect)!=1&&((q=D.options)==null?void 0:q.maxSelect)==1:!1}))||[]),n.$$.dirty&12&&t(8,r=!(d!=null&&d.$isView)||i)},[m,f,d,i,u,o,l,s,r,_,p,g,b,k,$,C]}class j4 extends ve{constructor(e){super(),be(this,e,q4,R4,_e,{show:10,hide:0})}get show(){return this.$$.ctx[10]}get hide(){return this.$$.ctx[0]}}function ip(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function V4(n){let e,t,i;function s(o){n[33](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new YC({props:l}),se.push(()=>he(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function H4(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new a4({props:l}),se.push(()=>he(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function sp(n){let e,t,i,s;function l(r){n[34](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new n4({props:o}),se.push(()=>he(t,"collection",l)),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","tab-item active")},m(r,a){S(r,e,a),V(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ye(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),H(t)}}}function lp(n){let e,t,i,s;function l(r){n[35](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new P4({props:o}),se.push(()=>he(t,"collection",l)),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","tab-item"),x(e,"active",n[3]===Ps)},m(r,a){S(r,e,a),V(t,e,null),s=!0},
<span class="txt">Duplicate</span>`,t=E(),i=y("button"),i.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,h(e,"type","button"),h(e,"class","dropdown-item closable"),h(i,"type","button"),h(i,"class","dropdown-item txt-danger closable")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[K(e,"click",n[24]),K(i,"click",En(at(n[25])))],s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,De(l)}}}function rp(n){let e,t,i,s;return i=new Yn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[U4]},$$scope:{ctx:n}}}),{c(){e=y("i"),t=E(),z(i.$$.fragment),h(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),V(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&1048576&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),H(i,l)}}}function ap(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,d;function p(){return n[27](n[47])}return{c(){e=y("button"),t=y("i"),s=E(),l=y("span"),r=U(o),a=U(" collection"),u=E(),h(t,"class",i=bi(j.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),h(l,"class","txt"),h(e,"type","button"),h(e,"class","dropdown-item closable"),x(e,"selected",n[47]==n[2].type)},m(m,_){S(m,e,_),v(e,t),v(e,s),v(e,l),v(l,r),v(l,a),v(e,u),f||(d=K(e,"click",p),f=!0)},p(m,_){n=m,_[0]&64&&i!==(i=bi(j.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&h(t,"class",i),_[0]&64&&o!==(o=n[48]+"")&&le(r,o),_[0]&68&&x(e,"selected",n[47]==n[2].type)},d(m){m&&w(e),f=!1,d()}}}function U4(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=ap(ip(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Se()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l[0]&131140){t=Object.entries(s[6]);let o;for(o=0;o<t.length;o+=1){const r=ip(s,t,o);i[o]?i[o].p(r,l):(i[o]=ap(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){dt(i,s),s&&w(e)}}}function up(n){let e;return{c(){e=y("div"),e.textContent="System collection",h(e,"class","help-block")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function W4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k=(n[6][n[2].type]||"N/A")+"",$,C,T,O,M,D,I,L,F,q=n[2].$isNew&&rp(n),N=n[2].system&&up();return{c(){e=y("label"),t=U("Name"),s=E(),l=y("input"),f=E(),d=y("div"),p=y("button"),m=y("span"),_=E(),g=y("span"),b=U("Type: "),$=U(k),C=E(),q&&q.c(),M=E(),N&&N.c(),D=Se(),h(e,"for",i=n[46]),h(l,"type","text"),h(l,"id",o=n[46]),l.required=!0,l.disabled=n[13],h(l,"spellcheck","false"),l.autofocus=r=n[2].$isNew,h(l,"placeholder",a=n[2].$isAuth?'eg. "users"':'eg. "posts"'),l.value=u=n[2].name,h(g,"class","txt"),h(p,"type","button"),h(p,"class",T="btn btn-sm p-r-10 p-l-10 "+(n[2].$isNew?"btn-outline":"btn-transparent")),p.disabled=O=!n[2].$isNew,h(d,"class","form-field-addon")},m(R,Y){S(R,e,Y),v(e,t),S(R,s,Y),S(R,l,Y),S(R,f,Y),S(R,d,Y),v(d,p),v(p,m),v(p,_),v(p,g),v(g,b),v(g,$),v(p,C),q&&q.m(p,null),S(R,M,Y),N&&N.m(R,Y),S(R,D,Y),I=!0,n[2].$isNew&&l.focus(),L||(F=K(l,"input",n[26]),L=!0)},p(R,Y){(!I||Y[1]&32768&&i!==(i=R[46]))&&h(e,"for",i),(!I||Y[1]&32768&&o!==(o=R[46]))&&h(l,"id",o),(!I||Y[0]&8192)&&(l.disabled=R[13]),(!I||Y[0]&4&&r!==(r=R[2].$isNew))&&(l.autofocus=r),(!I||Y[0]&4&&a!==(a=R[2].$isAuth?'eg. "users"':'eg. "posts"'))&&h(l,"placeholder",a),(!I||Y[0]&4&&u!==(u=R[2].name)&&l.value!==u)&&(l.value=u),(!I||Y[0]&68)&&k!==(k=(R[6][R[2].type]||"N/A")+"")&&le($,k),R[2].$isNew?q?(q.p(R,Y),Y[0]&4&&A(q,1)):(q=rp(R),q.c(),A(q,1),q.m(p,null)):q&&(re(),P(q,1,1,()=>{q=null}),ae()),(!I||Y[0]&4&&T!==(T="btn btn-sm p-r-10 p-l-10 "+(R[2].$isNew?"btn-outline":"btn-transparent")))&&h(p,"class",T),(!I||Y[0]&4&&O!==(O=!R[2].$isNew))&&(p.disabled=O),R[2].system?N||(N=up(),N.c(),N.m(D.parentNode,D)):N&&(N.d(1),N=null)},i(R){I||(A(q),I=!0)},o(R){P(q),I=!1},d(R){R&&w(e),R&&w(s),R&&w(l),R&&w(f),R&&w(d),q&&q.d(),R&&w(M),N&&N.d(R),R&&w(D),L=!1,F()}}}function fp(n){let e,t,i,s,l,o;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(r,a){S(r,e,a),s=!0,l||(o=Ee(t=We.call(null,e,n[11])),l=!0)},p(r,a){t&&jt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&nt(()=>{s&&(i||(i=He(e,Ut,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i|
<span class="txt">New collection</span>`,h(t,"type","button"),h(t,"class","btn btn-block btn-outline"),h(e,"class","sidebar-footer")},m(l,o){S(l,e,o),v(e,t),i||(s=K(t,"click",n[12]),i=!0)},p:Q,d(l){l&&w(e),i=!1,s()}}}function X4(n){let e,t,i,s,l,o,r,a,u,f,d,p=[],m=new Map,_,g,b,k,$,C,T=n[3];const O=L=>L[15].id;for(let L=0;L<T.length;L+=1){let F=_p(n,T,L),q=O(F);m.set(q,p[L]=vp(q,F))}let M=null;T.length||(M=gp(n));let D=!n[7]&&yp(n),I={};return b=new au({props:I}),n[13](b),b.$on("save",n[14]),{c(){e=y("aside"),t=y("header"),i=y("div"),s=y("div"),l=y("button"),l.innerHTML='<i class="ri-close-line"></i>',o=E(),r=y("input"),a=E(),u=y("hr"),f=E(),d=y("div");for(let L=0;L<p.length;L+=1)p[L].c();M&&M.c(),_=E(),D&&D.c(),g=E(),z(b.$$.fragment),h(l,"type","button"),h(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[4]),h(s,"class","form-field-addon"),h(r,"type","text"),h(r,"placeholder","Search collections..."),h(i,"class","form-field search"),x(i,"active",n[4]),h(t,"class","sidebar-header"),h(u,"class","m-t-5 m-b-xs"),h(d,"class","sidebar-content"),x(d,"fade",n[6]),x(d,"sidebar-content-compact",n[3].length>20),h(e,"class","page-sidebar collection-sidebar")},m(L,F){S(L,e,F),v(e,t),v(t,i),v(i,s),v(s,l),v(i,o),v(i,r),ue(r,n[0]),v(e,a),v(e,u),v(e,f),v(e,d);for(let q=0;q<p.length;q+=1)p[q]&&p[q].m(d,null);M&&M.m(d,null),v(e,_),D&&D.m(e,null),S(L,g,F),V(b,L,F),k=!0,$||(C=[K(l,"click",n[10]),K(r,"input",n[11])],$=!0)},p(L,[F]){(!k||F&16)&&x(l,"hidden",!L[4]),F&1&&r.value!==L[0]&&ue(r,L[0]),(!k||F&16)&&x(i,"active",L[4]),F&42&&(T=L[3],p=yt(p,F,O,1,L,T,m,d,as,vp,null,_p),!T.length&&M?M.p(L,F):T.length?M&&(M.d(1),M=null):(M=gp(L),M.c(),M.m(d,null))),(!k||F&64)&&x(d,"fade",L[6]),(!k||F&8)&&x(d,"sidebar-content-compact",L[3].length>20),L[7]?D&&(D.d(1),D=null):D?D.p(L,F):(D=yp(L),D.c(),D.m(e,null));const q={};b.$set(q)},i(L){k||(A(b.$$.fragment,L),k=!0)},o(L){P(b.$$.fragment,L),k=!1},d(L){L&&w(e);for(let F=0;F<p.length;F+=1)p[F].d();M&&M.d(),D&&D.d(),L&&w(g),n[13](null),H(b,L),$=!1,De(C)}}}function Q4(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function x4(n,e,t){let i,s,l,o,r,a,u;Xe(n,yi,$=>t(5,o=$)),Xe(n,fi,$=>t(9,r=$)),Xe(n,yo,$=>t(6,a=$)),Xe(n,Ds,$=>t(7,u=$));let f,d="";function p($){ln(yi,o=$,o)}const m=()=>t(0,d="");function _(){d=this.value,t(0,d)}const g=()=>f==null?void 0:f.show();function b($){se[$?"unshift":"push"](()=>{f=$,t(2,f)})}const k=$=>{var C;(C=$.detail)!=null&&C.isNew&&$.detail.collection&&p($.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&Q4(),n.$$.dirty&1&&t(1,i=d.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=d!==""),n.$$.dirty&515&&t(3,l=r.filter($=>$.id==d||$.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[d,i,f,l,s,o,a,u,p,r,m,_,g,b,k]}class e5 extends ve{constructor(e){super(),be(this,e,x4,X4,_e,{})}}function kp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function wp(n){n[18]=n[19].default}function Sp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function $p(n){let e;return{c(){e=y("hr"),h(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Tp(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,d=i&&$p();function p(){return e[9](e[14])}return{key:n,first:null,c(){t=Se(),d&&d.c(),s=E(),l=y("button"),r=U(o),a=E(),h(l,"type","button"),h(l,"class","sidebar-item"),x(l,"active",e[5]===e[14]),this.first=t},m(m,_){S(m,t,_),d&&d.m(m,_),S(m,s,_),S(m,l,_),v(l,r),v(l,a),u||(f=K(l,"click",p),u=!0)},p(m,_){e=m,_&8&&(i=e[21]===Object.keys(e[6]).length),i?d||(d=$p(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),_&8&&o!==(o=e[15].label+"")&&le(r,o),_&40&&x(l,"active",e[5]===e[14])},d(m){m&&w(t),d&&d.d(m),m&&w(s),m&&w(l),u=!1,f()}}}function Cp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:i5,then:n5,catch:t5,value:19,blocks:[,,,]};return mu(t=n[15].component,s),{c(){e=Se(),s.block.c()},m(l,o){S(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.an
form-field form-field-list form-field-file
`+(n[3].required?"required":"")+`
`+(n[8]?"dragover":"")+`
`,name:n[3].name,$$slots:{default:[kM,({uniqueId:o})=>({26:o}),({uniqueId:o})=>[o?67108864:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","block")},m(o,r){S(o,e,r),V(t,e,null),i=!0,s||(l=[K(e,"dragover",at(n[23])),K(e,"dragleave",n[24]),K(e,"drop",n[14])],s=!0)},p(o,r){const a={};r[0]&264&&(a.class=`
form-field form-field-list form-field-file
`+(o[3].required?"required":"")+`
`+(o[8]?"dragover":"")+`
`),r[0]&8&&(a.name=o[3].name),r[0]&67110655|r[1]&4&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(A(t.$$.fragment,o),i=!0)},o(o){P(t.$$.fragment,o),i=!1},d(o){o&&w(e),H(t),s=!1,De(l)}}}function SM(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new wn}=e,d,p,m=!1,_="";function g(R){j.removeByValue(u,R),t(1,u)}function b(R){j.pushUnique(u,R),t(1,u)}function k(R){j.isEmpty(a[R])||a.splice(R,1),t(0,a)}function $(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}function C(R){var B,Z;R.preventDefault(),t(8,m=!1);const Y=((B=R.dataTransfer)==null?void 0:B.files)||[];if(!(l||!Y.length)){for(const ee of Y){const ne=s.length+a.length-u.length;if(((Z=f.options)==null?void 0:Z.maxSelect)<=ne)break;a.push(ee)}t(0,a)}}Gt(async()=>{t(9,_=await pe.getAdminFileToken(o.collectionId))});const T=R=>g(R),O=R=>b(R),M=R=>k(R);function D(R){se[R?"unshift":"push"](()=>{d=R,t(6,d)})}const I=()=>{for(let R of d.files)a.push(R);t(0,a),t(6,d.value=null,d)},L=()=>d==null?void 0:d.click();function F(R){se[R?"unshift":"push"](()=>{p=R,t(7,p)})}const q=()=>{t(8,m=!0)},N=()=>{t(8,m=!1)};return n.$$set=R=>{"record"in R&&t(2,o=R.record),"value"in R&&t(15,r=R.value),"uploadedFiles"in R&&t(0,a=R.uploadedFiles),"deletedFileIndexes"in R&&t(1,u=R.deletedFileIndexes),"field"in R&&t(3,f=R.field)},n.$$.update=()=>{var R,Y;n.$$.dirty[0]&1&&(Array.isArray(a)||t(0,a=j.toArray(a))),n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=j.toArray(u))),n.$$.dirty[0]&8&&t(5,i=((R=f.options)==null?void 0:R.maxSelect)>1),n.$$.dirty[0]&32800&&j.isEmpty(r)&&t(15,r=i?[]:""),n.$$.dirty[0]&32768&&t(4,s=j.toArray(r)),n.$$.dirty[0]&27&&t(10,l=(s.length||a.length)&&((Y=f.options)==null?void 0:Y.maxSelect)<=s.length+a.length-u.length),n.$$.dirty[0]&3&&(a!==-1||u!==-1)&&$()},[a,u,o,f,s,i,d,p,m,_,l,g,b,k,C,r,T,O,M,D,I,L,F,q,N]}class $M extends ve{constructor(e){super(),be(this,e,SM,wM,_e,{record:2,value:15,uploadedFiles:0,deletedFileIndexes:1,field:3},null,[-1,-1])}}function Rp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function TM(n,e){e=Rp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=Rp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}const CM=n=>({dragging:n&2,dragover:n&4}),qp=n=>({dragging:n[1],dragover:n[2]});function MM(n){let e,t,i,s;const l=n[8].default,o=Tt(l,n,n[7],qp);return{c(){e=y("div"),o&&o.c(),h(e,"draggable",!0),h(e,"class","draggable svelte-28orm4"),x(e,"dragging",n[1]),x(e,"dragover",n[2])},m(r,a){S(r,e,a),o&&o.m(e,null),t=!0,i||(s=[K(e,"dragover",at(n[9])),K(e,"dragleave",at(n[10])),K(e,"dragend",n[11]),K(e,"dragstart",n[12]),K(e,"drop",n[13])],i=!0)},p(r,[a]){o&&o.p&&(!t||a&134)&&Mt(o,l,r,r[7],t?Ct(l,r[7],a,CM):Ot(r[7]),qp),(!t||a&2)&&x(e,"dragging",r[1]),(!t||a&4)&&x(e,"dragover",r[2])},i(r){t||(A(o,r),t=!0)},o(r){P(o,r),t=!1},d(r){r&&w(e),o&&o.d(r),i=!1,De(s)}}}function OM(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=wt();let{index:o}=e,{list:r=[]}=e,{disabled:a=!1}=e,u=!1,f=!1;function d($,C){!$&&!a||(t(1,u=!0),$.dataTransfer.effectAllowed="move",$.dataTransfer.dropEffect="move",$.dataTransfer.setData("text/plain",C))}function p($,C){if(!$&&!a)return;t(2,f=!1),t(1,u=!1),$.dataTransfer.dropEffect="move";const T=parseInt($.dataTransfer.getData("text/plain"));T<C?(r.splice(C+1,0,r[T]),r.splice(T,1)):(r.splice(C,0,r[T]),r.splice(T+1,1)),t(5,r),l("sort",r)}const m=()=>{t(2,f=!0)},_=()=>{t(2,f=!1)},g=()=>{t(2,f=!1),t(1,u=!1)},b=$=>d($,o),k=$=>p($,o);return n.$$set=$=>{"index"in $&&t(0,o=$.index),"list"in $&&t(5,r=$.list),"disabled"in $&&t(6,a=$.disabled),"$$scope"in $&&t(7,s=$.$$scope)},[o,u,f,d,p,r,a,s,i,m,_,g,b,k]}class DM extends ve{constructor(e){super(),be(this,e,OM,MM,_e,{index:0,list:5,disabled:6})}}function jp(n,e,t){const i=n.slice();i[6]=e[t];const s=j.toArray(i[0][i[
`),D&&D.c(),p=E(),_.c(),g=Se(),h(e,"class","flex m-b-base flex-gap-10"),h(l,"class","list picker-list m-b-base svelte-1u8jhky"),h(f,"class","section-title")},m(N,R){S(N,e,R),V(t,e,null),v(e,i),C&&C.m(e,null),S(N,s,R),S(N,l,R);for(let Y=0;Y<o.length;Y+=1)o[Y]&&o[Y].m(l,null);M&&M.m(l,null),S(N,u,R),S(N,f,R),v(f,d),D&&D.m(f,null),S(N,p,R),L[m].m(N,R),S(N,g,R),b=!0,k||($=Ee(a=TM.call(null,l,n[36])),k=!0)},p(N,R){var Z;const Y={};R[0]&4&&(Y.value=N[2]),R[0]&1024&&(Y.autocompleteCollection=N[10]),t.$set(Y),(Z=N[10])!=null&&Z.$isView?C&&(C.d(1),C=null):C?C.p(N,R):(C=Yp(N),C.c(),C.m(e,null)),R[0]&145324&&(T=N[3],re(),o=yt(o,R,O,1,N,T,r,l,Zt,Gp,null,Wp),ae(),!T.length&&M?M.p(N,R):T.length?M&&(M.d(1),M=null):(M=Kp(N),M.c(),M.m(l,null))),a&&jt(a.update)&&R[0]&2064&&a.update.call(null,N[36]),N[5]>1?D?D.p(N,R):(D=Xp(N),D.c(),D.m(f,null)):D&&(D.d(1),D=null);let B=m;m=F(N),m===B?L[m].p(N,R):(re(),P(L[B],1,1,()=>{L[B]=null}),ae(),_=L[m],_?_.p(N,R):(_=L[m]=I[m](N),_.c()),A(_,1),_.m(g.parentNode,g))},i(N){if(!b){A(t.$$.fragment,N);for(let R=0;R<T.length;R+=1)A(o[R]);A(_),b=!0}},o(N){P(t.$$.fragment,N);for(let R=0;R<o.length;R+=1)P(o[R]);P(_),b=!1},d(N){N&&w(e),H(t),C&&C.d(),N&&w(s),N&&w(l);for(let R=0;R<o.length;R+=1)o[R].d();M&&M.d(),N&&w(u),N&&w(f),D&&D.d(),N&&w(p),L[m].d(N),N&&w(g),k=!1,$()}}}function VM(n){var r;let e,t,i,s=(((r=n[10])==null?void 0:r.name)||"")+"",l,o;return{c(){e=y("h4"),t=U("Select "),i=y("strong"),l=U(s),o=U(" records")},m(a,u){S(a,e,u),v(e,t),v(e,i),v(i,l),v(e,o)},p(a,u){var f;u[0]&1024&&s!==(s=(((f=a[10])==null?void 0:f.name)||"")+"")&&le(l,s)},d(a){a&&w(e)}}}function HM(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='<span class="txt">Cancel</span>',t=E(),i=y("button"),i.innerHTML='<span class="txt">Save selection</span>',h(e,"type","button"),h(e,"class","btn btn-transparent"),h(i,"type","button"),h(i,"class","btn")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[K(e,"click",n[28]),K(i,"click",n[29])],s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,De(l)}}}function zM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[HM],header:[VM],default:[jM]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=je(o,l[a]);e=new hn({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[10]};return i=new ub({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(a,u){V(e,a,u),S(a,t,u),V(i,a,u),s=!0},p(a,u){const f=u[0]&524288?St(l,[l[0],l[1],Kt(a[19])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const d={};u[0]&1024&&(d.collection=a[10]),i.$set(d)},i(a){s||(A(e.$$.fragment,a),A(i.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),s=!1},d(a){n[39](null),H(e,a),a&&w(t),n[42](null),H(i,a)}}}const Lr=100;function BM(n,e,t){let i,s,l,o,r,a,u,f;const d=["value","field","show","hide"];let p=Qe(e,d),m;Xe(n,fi,Le=>t(26,m=Le));const _=wt(),g="picker_"+j.randomString(5);let{value:b}=e,{field:k}=e,$,C,T="",O=[],M=[],D=1,I=0,L=!1,F=!1;function q(){return t(2,T=""),t(3,O=[]),t(6,M=[]),R(),Y(!0),$==null?void 0:$.show()}function N(){return $==null?void 0:$.hide()}async function R(){const Le=j.toArray(b);if(!s||!Le.length)return;t(24,F=!0);let $e=[];const tt=Le.slice(),Dt=[];for(;tt.length>0;){const Ft=[];for(const Vt of tt.splice(0,Lr))Ft.push(`id="${Vt}"`);Dt.push(pe.collection(s).getFullList(Lr,{filter:Ft.join("||"),$autoCancel:!1}))}try{await Promise.all(Dt).then(Ft=>{$e=$e.concat(...Ft)}),t(6,M=[]);for(const Ft of Le){const Vt=j.findByKey($e,"id",Ft);Vt&&M.push(Vt)}T.trim()||t(3,O=j.filterDuplicatesByKey(M.concat(O)))}catch(Ft){pe.errorResponseHandler(Ft)}t(24,F=!1)}async function Y(Le=!1){if(s){t(4,L=!0),Le&&(T.trim()?t(3,O=[]):t(3,O=j.toArray(M).slice()));try{const $e=Le?1:D+1,tt=j.getAllCollectionIdentifiers(o),Dt=await pe.collection(s).getList($e,Lr,{filter:j.normalizeSearchFilter(T,tt),sort:o!=null&&o.$isView?"":"-created",$cancelKey:g+"loadList"});t(3,O=j.filterDuplicatesByKey(O.concat(Dt.items))),D=Dt.page,t(23,I=Dt.totalItems)}catch($e){pe.errorResponseHandler($e)}t(4,L=!
`,h(e,"class","list-item")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function sm(n){var p;let e,t,i,s,l,o,r,a,u,f;i=new er({props:{record:n[15],displayFields:(p=n[2].options)==null?void 0:p.displayFields}});function d(){return n[8](n[15])}return{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),o=y("button"),o.innerHTML='<i class="ri-close-line"></i>',r=E(),h(t,"class","content"),h(o,"type","button"),h(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),h(l,"class","actions"),h(e,"class","list-item")},m(m,_){S(m,e,_),v(e,t),V(i,t,null),v(e,s),v(e,l),v(l,o),v(e,r),a=!0,u||(f=[Ee(We.call(null,o,"Remove")),K(o,"click",d)],u=!0)},p(m,_){var b;n=m;const g={};_&16&&(g.record=n[15]),_&4&&(g.displayFields=(b=n[2].options)==null?void 0:b.displayFields),i.$set(g)},i(m){a||(A(i.$$.fragment,m),a=!0)},o(m){P(i.$$.fragment,m),a=!1},d(m){m&&w(e),H(i),u=!1,De(f)}}}function WM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,d,p,m,_,g,b,k,$=n[4],C=[];for(let M=0;M<$.length;M+=1)C[M]=sm(xp(n,$,M));const T=M=>P(C[M],1,1,()=>{C[M]=null});let O=null;return $.length||(O=tm(n)),{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("div"),d=y("div");for(let M=0;M<C.length;M+=1)C[M].c();O&&O.c(),p=E(),m=y("div"),_=y("button"),_.innerHTML=`<i class="ri-magic-line"></i>
<span class="txt">Open picker</span>`,h(t,"class",i=bi(j.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),h(l,"class","txt"),h(e,"for",a=n[14]),h(d,"class","relations-list svelte-1ynw0pc"),h(_,"type","button"),h(_,"class","btn btn-transparent btn-sm btn-block"),h(m,"class","list-item list-item-btn"),h(f,"class","list")},m(M,D){S(M,e,D),v(e,t),v(e,s),v(e,l),v(l,r),S(M,u,D),S(M,f,D),v(f,d);for(let I=0;I<C.length;I+=1)C[I]&&C[I].m(d,null);O&&O.m(d,null),v(f,p),v(f,m),v(m,_),g=!0,b||(k=K(_,"click",n[9]),b=!0)},p(M,D){if((!g||D&4&&i!==(i=bi(j.getFieldTypeIcon(M[2].type))+" svelte-1ynw0pc"))&&h(t,"class",i),(!g||D&4)&&o!==(o=M[2].name+"")&&le(r,o),(!g||D&16384&&a!==(a=M[14]))&&h(e,"for",a),D&181){$=M[4];let I;for(I=0;I<$.length;I+=1){const L=xp(M,$,I);C[I]?(C[I].p(L,D),A(C[I],1)):(C[I]=sm(L),C[I].c(),A(C[I],1),C[I].m(d,null))}for(re(),I=$.length;I<C.length;I+=1)T(I);ae(),!$.length&&O?O.p(M,D):$.length?O&&(O.d(1),O=null):(O=tm(M),O.c(),O.m(d,null))}},i(M){if(!g){for(let D=0;D<$.length;D+=1)A(C[D]);g=!0}},o(M){C=C.filter(Boolean);for(let D=0;D<C.length;D+=1)P(C[D]);g=!1},d(M){M&&w(e),M&&w(u),M&&w(f),dt(C,M),O&&O.d(),b=!1,k()}}}function YM(n){let e,t,i,s,l={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[WM,({uniqueId:r})=>({14:r}),({uniqueId:r})=>r?16384:0]},$$scope:{ctx:n}};e=new de({props:l}),n[10](e);let o={value:n[0],field:n[2]};return i=new UM({props:o}),n[11](i),i.$on("save",n[12]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(r,a){V(e,r,a),S(r,t,a),V(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&2113591&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[10](null),H(e,r),r&&w(t),n[11](null),H(i,r)}}}const lm=100;function KM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new wn}=e,r,a=[],u=!1;f();async function f(){var T,O;const k=j.toArray(s);if(!((T=o==null?void 0:o.options)!=null&&T.collectionId)||!k.length){t(4,a=[]),t(5,u=!1);return}t(5,u=!0);const $=k.slice(),C=[];for(;$.length>0;){const M=[];for(const D of $.splice(0,lm))M.push(`id="${D}"`);C.push(pe.collection((O=o==null?void 0:o.options)==null?void 0:O.collectionId).getFullList(lm,{filter:M.join("||"),$autoCancel:!1}))}try{let M=[];await Promise.all(C).then(D=>{M=M.concat(...D)});for(const D of k){const I=j.findByKey(M,"id",D);I&&a.push(I)}t(4,a)}catch(M){pe.errorResponseHandler(M)}t(5,u=!1)}function d(k){var $;j.removeByKey(a,"id",k.id),t(4,a),i?t(0,s=a.map(C=>C.id)):t(0,s=(($=a[0])==null?void 0:$.id)||"")}const p=k=>d(k),m=()=>l==null?void 0:l.show();function _(k){se[k?"unshift":"push"](()=>{r=k,t(3,r)})}function g(k){se[k?"unshift":"push"](()=>{l=k,t(1,l)})}const b=k=>{var $;t(4,a=k.detail||[]),t(0,s=i?a.map(C=>C.id):(($=a[0])==null?void 0:$.id)||"")};return n.$$set=k=>{"value"in k&&t(0,s=k.value),"picker"in k&&t(1,l=k.picker),"field"in k&&t(2,o=k.field)},n.$$.update=()=>{var k;n.$$.dirty&4&&t(6,i=((k=o.options)==null?void 0:k.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed())},[s,l,o,r,a,u,i,d,p,m,_,g,b]}class JM extends ve{constructor(e){super(),be(this,e,KM,YM,_e,{value:0,picker:1,field:2})}}const ZM=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],GM=(n,
...
-----END PRIVATE KEY-----`),h(a,"class","help-block")},m(d,p){S(d,e,p),v(e,t),S(d,s,p),S(d,l,p),ue(l,n[5]),S(d,r,p),S(d,a,p),u||(f=K(l,"input",n[16]),u=!0)},p(d,p){p&8388608&&i!==(i=d[23])&&h(e,"for",i),p&8388608&&o!==(o=d[23])&&h(l,"id",o),p&32&&ue(l,d[5])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function MO(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$;return s=new de({props:{class:"form-field required",name:"clientId",$$slots:{default:[wO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"teamId",$$slots:{default:[SO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field required",name:"keyId",$$slots:{default:[$O,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),m=new de({props:{class:"form-field required",name:"duration",$$slots:{default:[TO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),g=new de({props:{class:"form-field required",name:"privateKey",$$slots:{default:[CO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),z(r.$$.fragment),a=E(),u=y("div"),z(f.$$.fragment),d=E(),p=y("div"),z(m.$$.fragment),_=E(),z(g.$$.fragment),h(i,"class","col-lg-6"),h(o,"class","col-lg-6"),h(u,"class","col-lg-6"),h(p,"class","col-lg-6"),h(t,"class","grid"),h(e,"id",n[9]),h(e,"autocomplete","off")},m(C,T){S(C,e,T),v(e,t),v(t,i),V(s,i,null),v(t,l),v(t,o),V(r,o,null),v(t,a),v(t,u),V(f,u,null),v(t,d),v(t,p),V(m,p,null),v(t,_),V(g,t,null),b=!0,k||($=K(e,"submit",at(n[17])),k=!0)},p(C,T){const O={};T&25165828&&(O.$$scope={dirty:T,ctx:C}),s.$set(O);const M={};T&25165832&&(M.$$scope={dirty:T,ctx:C}),r.$set(M);const D={};T&25165840&&(D.$$scope={dirty:T,ctx:C}),f.$set(D);const I={};T&25165888&&(I.$$scope={dirty:T,ctx:C}),m.$set(I);const L={};T&25165856&&(L.$$scope={dirty:T,ctx:C}),g.$set(L)},i(C){b||(A(s.$$.fragment,C),A(r.$$.fragment,C),A(f.$$.fragment,C),A(m.$$.fragment,C),A(g.$$.fragment,C),b=!0)},o(C){P(s.$$.fragment,C),P(r.$$.fragment,C),P(f.$$.fragment,C),P(m.$$.fragment,C),P(g.$$.fragment,C),b=!1},d(C){C&&w(e),H(s),H(r),H(f),H(m),H(g),k=!1,$()}}}function OO(n){let e;return{c(){e=y("h4"),e.textContent="Generate Apple client secret",h(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function DO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("button"),t=U("Close"),i=E(),s=y("button"),l=y("i"),o=E(),r=y("span"),r.textContent="Generate and set secret",h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[7],h(l,"class","ri-key-line"),h(r,"class","txt"),h(s,"type","submit"),h(s,"form",n[9]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],x(s,"btn-loading",n[7])},m(d,p){S(d,e,p),v(e,t),S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=K(e,"click",n[0]),u=!0)},p(d,p){p&128&&(e.disabled=d[7]),p&384&&a!==(a=!d[8]||d[7])&&(s.disabled=a),p&128&&x(s,"btn-loading",d[7])},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,f()}}}function EO(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[DO],header:[OO],default:[MO]},$$scope:{ctx:n}};return e=new hn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[19](null),H(e,s)}}}const po=15777e3;function AO(n,e,t){let i;const s=wt(),l="apple_secret_"+j.randomString(5);let o,r,a,u,f,d,p=!1;function m(F={}){t(2,r=F.clientId||""),t(3,a=F.teamId||""),t(4,u=F.keyId||""),t(5,f=F.privateKey||""),t(6,d=F.duration||po),mn({}),o==null||o.show()}function _(){return o==null?void 0:o.hide()}async function g(){t(7,p=!0);try{const F=await pe.settings.generateAppleClientSecret(r,a,u,f.trim(),d);t(7,p=!1),Jt("Successfully generated client secret."),s("submit",F),o==null||o.hide()}catch(F){pe.errorResponseHandler(
`),r=y("button"),r.textContent="Restore draft",a=E(),u=y("button"),u.innerHTML='<i class="ri-close-line"></i>',f=E(),d=y("div"),h(i,"class","icon"),h(r,"type","button"),h(r,"class","btn btn-sm btn-secondary"),h(l,"class","content"),h(u,"type","button"),h(u,"class","close"),h(u,"aria-label","Discard draft"),h(t,"class","alert alert-info m-0"),h(d,"class","clearfix p-b-base"),h(e,"class","block")},m(b,k){S(b,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(l,r),v(t,a),v(t,u),v(e,f),v(e,d),m=!0,_||(g=[K(r,"click",n[36]),Ee(We.call(null,u,"Discard draft")),K(u,"click",at(n[37]))],_=!0)},p:Q,i(b){m||(p&&p.end(1),m=!0)},o(b){p=Y_(e,kt,{duration:150}),m=!1},d(b){b&&w(e),b&&p&&p.end(),_=!1,De(g)}}}function cm(n){let e,t,i,s,l;return{c(){e=y("div"),t=y("i"),h(t,"class","ri-calendar-event-line txt-disabled"),h(e,"class","form-field-addon")},m(o,r){S(o,e,r),v(e,t),s||(l=Ee(i=We.call(null,t,{text:`Created: ${n[3].created}
Updated: ${n[3].updated}`,position:"left"})),s=!0)},p(o,r){i&&jt(i.update)&&r[0]&8&&i.update.call(null,{text:`Created: ${o[3].created}
Updated: ${o[3].updated}`,position:"left"})},d(o){o&&w(e),s=!1,l()}}}function zO(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g=!n[6]&&cm(n);return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="id",l=E(),o=y("span"),a=E(),g&&g.c(),u=E(),f=y("input"),h(t,"class",bi(j.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),h(s,"class","txt"),h(o,"class","flex-fill"),h(e,"for",r=n[68]),h(f,"type","text"),h(f,"id",d=n[68]),h(f,"placeholder","Leave empty to auto generate..."),h(f,"minlength","15"),f.readOnly=p=!n[6]},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),S(b,a,k),g&&g.m(b,k),S(b,u,k),S(b,f,k),ue(f,n[3].id),m||(_=K(f,"input",n[38]),m=!0)},p(b,k){k[2]&64&&r!==(r=b[68])&&h(e,"for",r),b[6]?g&&(g.d(1),g=null):g?g.p(b,k):(g=cm(b),g.c(),g.m(u.parentNode,u)),k[2]&64&&d!==(d=b[68])&&h(f,"id",d),k[0]&64&&p!==(p=!b[6])&&(f.readOnly=p),k[0]&8&&f.value!==b[3].id&&ue(f,b[3].id)},d(b){b&&w(e),b&&w(a),g&&g.d(b),b&&w(u),b&&w(f),m=!1,_()}}}function dm(n){var u,f;let e,t,i,s,l;function o(d){n[39](d)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new g5({props:r}),se.push(()=>he(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&pm();return{c(){z(e.$$.fragment),i=E(),a&&a.c(),s=Se()},m(d,p){V(e,d,p),S(d,i,p),a&&a.m(d,p),S(d,s,p),l=!0},p(d,p){var _,g;const m={};p[0]&64&&(m.isNew=d[6]),p[0]&1&&(m.collection=d[0]),!t&&p[0]&8&&(t=!0,m.record=d[3],ye(()=>t=!1)),e.$set(m),(g=(_=d[0])==null?void 0:_.schema)!=null&&g.length?a||(a=pm(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(d){l||(A(e.$$.fragment,d),l=!0)},o(d){P(e.$$.fragment,d),l=!1},d(d){H(e,d),d&&w(i),a&&a.d(d),d&&w(s)}}}function pm(n){let e;return{c(){e=y("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function BO(n){let e,t,i;function s(o){n[52](o,n[65])}let l={field:n[65]};return n[3][n[65].name]!==void 0&&(l.value=n[3][n[65].name]),e=new JM({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[65]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[65].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function UO(n){let e,t,i,s,l;function o(f){n[49](f,n[65])}function r(f){n[50](f,n[65])}function a(f){n[51](f,n[65])}let u={field:n[65],record:n[3]};return n[3][n[65].name]!==void 0&&(u.value=n[3][n[65].name]),n[4][n[65].name]!==void 0&&(u.uploadedFiles=n[4][n[65].name]),n[5][n[65].name]!==void 0&&(u.deletedFileIndexes=n[5][n[65].name]),e=new $M({props:u}),se.push(()=>he(e,"value",o)),se.push(()=>he(e,"uploadedFiles",r)),se.push(()=>he(e,"deletedFileIndexes",a)),{c(){z(e.$$.fragment)},m(f,d){V(e,f,d),l=!0},p(f,d){n=f;const p={};d[0]&1&&(p.field=n[65]),d[0]&8&&(p.record=n[3]),!t&&d[0]&9&&(t=!0,p.value=n[3][n[65].name],ye(()=>t=!1)),!i&&d[0]&17&&(i=!0,p.uploadedFiles=n[4][n[65].name],ye(()=>i=!1)),!s&&d[0]&33&&(s=!0,p.deletedFileIndexes=n[5][n[65].name],ye(()=>s=!1)),e.$set(p)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){H(e,f)}}}function WO(n){let e,t,i;function s(o){n[48](o,n[65])}let l={field:n[65]};return n[3][n[65].name]!==void 0&&(l.value=n[3][n[65].name]),e=new Q5({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[65]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[65].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function YO(n){let e,t,i;function s(o){n[47](o,n[65])}let l={field:n[65]};return n[3][n[65].name]!==void 0&&(l.value=n[3][n[65].name]),e=new J5({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[65]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[65].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function KO(n){let e,t,i;function s(o){n[46](o,n[65])}let l={field:n[65]};return n[3][n[65].name]!==void 0&&(l.value=n[3][n[65].name]),e=new U5({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[
<span class="txt">Send verification email</span>`,h(e,"type","button"),h(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[30]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function bm(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Send password reset email</span>`,h(e,"type","button"),h(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[31]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function tD(n){let e,t,i,s,l,o,r,a=n[0].$isAuth&&!n[2].verified&&n[2].email&&gm(n),u=n[0].$isAuth&&n[2].email&&bm(n);return{c(){a&&a.c(),e=E(),u&&u.c(),t=E(),i=y("button"),i.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,s=E(),l=y("button"),l.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,h(i,"type","button"),h(i,"class","dropdown-item closable"),h(l,"type","button"),h(l,"class","dropdown-item txt-danger closable")},m(f,d){a&&a.m(f,d),S(f,e,d),u&&u.m(f,d),S(f,t,d),S(f,i,d),S(f,s,d),S(f,l,d),o||(r=[K(i,"click",n[32]),K(l,"click",En(at(n[33])))],o=!0)},p(f,d){f[0].$isAuth&&!f[2].verified&&f[2].email?a?a.p(f,d):(a=gm(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].$isAuth&&f[2].email?u?u.p(f,d):(u=bm(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&w(e),u&&u.d(f),f&&w(t),f&&w(i),f&&w(s),f&&w(l),o=!1,De(r)}}}function vm(n){let e,t,i,s,l,o;return{c(){e=y("div"),t=y("button"),t.textContent="Account",i=E(),s=y("button"),s.textContent="Authorized providers",h(t,"type","button"),h(t,"class","tab-item"),x(t,"active",n[12]===ls),h(s,"type","button"),h(s,"class","tab-item"),x(s,"active",n[12]===Sl),h(e,"class","tabs-header stretched")},m(r,a){S(r,e,a),v(e,t),v(e,i),v(e,s),l||(o=[K(t,"click",n[34]),K(s,"click",n[35])],l=!0)},p(r,a){a[0]&4096&&x(t,"active",r[12]===ls),a[0]&4096&&x(s,"active",r[12]===Sl)},d(r){r&&w(e),l=!1,De(o)}}}function nD(n){var g;let e,t=n[6]?"New":"Edit",i,s,l,o=((g=n[0])==null?void 0:g.name)+"",r,a,u,f,d,p,m=!n[6]&&_m(n),_=n[0].$isAuth&&!n[6]&&vm(n);return{c(){e=y("h4"),i=U(t),s=E(),l=y("strong"),r=U(o),a=U(" record"),u=E(),m&&m.c(),f=E(),_&&_.c(),d=Se(),h(e,"class","panel-title svelte-qc5ngu")},m(b,k){S(b,e,k),v(e,i),v(e,s),v(e,l),v(l,r),v(e,a),S(b,u,k),m&&m.m(b,k),S(b,f,k),_&&_.m(b,k),S(b,d,k),p=!0},p(b,k){var $;(!p||k[0]&64)&&t!==(t=b[6]?"New":"Edit")&&le(i,t),(!p||k[0]&1)&&o!==(o=(($=b[0])==null?void 0:$.name)+"")&&le(r,o),b[6]?m&&(re(),P(m,1,1,()=>{m=null}),ae()):m?(m.p(b,k),k[0]&64&&A(m,1)):(m=_m(b),m.c(),A(m,1),m.m(f.parentNode,f)),b[0].$isAuth&&!b[6]?_?_.p(b,k):(_=vm(b),_.c(),_.m(d.parentNode,d)):_&&(_.d(1),_=null)},i(b){p||(A(m),p=!0)},o(b){P(m),p=!1},d(b){b&&w(e),b&&w(u),m&&m.d(b),b&&w(f),_&&_.d(b),b&&w(d)}}}function iD(n){let e,t,i,s,l,o=n[6]?"Create":"Save changes",r,a,u,f;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=E(),s=y("button"),l=y("span"),r=U(o),h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[10],h(l,"class","txt"),h(s,"type","submit"),h(s,"form",n[15]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[13]||n[10],x(s,"btn-loading",n[10])},m(d,p){S(d,e,p),v(e,t),S(d,i,p),S(d,s,p),v(s,l),v(l,r),u||(f=K(e,"click",n[29]),u=!0)},p(d,p){p[0]&1024&&(e.disabled=d[10]),p[0]&64&&o!==(o=d[6]?"Create":"Save changes")&&le(r,o),p[0]&9216&&a!==(a=!d[13]||d[10])&&(s.disabled=a),p[0]&1024&&x(s,"btn-loading",d[10])},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,f()}}}function sD(n){var s;let e,t,i={class:`
record-panel
`+(n[14]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((s=n[0])!=null&&s.$isAuth&&!n[6]?"colored-header":"")+`
`,beforeHide:n[53],$$slots:{footer:[iD],header:[nD],default:[eD]},$$scope:{ctx:n}};return e=new hn({props:i}),n[54](e),e.$on("hide",n[55]),e.$on("show",n[56]),{c(){z(e.$$.fragment)},m(l,o){V(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&16449&&(r.class=`
record-panel
`+(l[14]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((a=l[0])!=null&&a.$isAuth&&!l[6]?"colored-header":"")+`
`),o[0]&2176&&(r.beforeHide=l[53]),o[0]&14077|o[2]&128&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[54](null),H(e,l)}}}const ls="form",Sl="providers";function lD(n,e,t){let i,s,l,o;const r=wt(),a="record_"+j.randomString(5);let{collection:u}=e,f,d=null,p=null,m=null,_=!1,g=!1,b={},k={},$=JSON.stringify(null),C=$,T=ls,O=!0,M=!1;function D(ke){return L(ke),t(11,g=!0),t(12,T=ls),f==null?void 0:f.show()}function I(){return f==null?void 0:f.hide()}async function L(ke){t(27,M=!1),mn({}),t(2,d=ke||new Li),t(3,p=d.$clone()),t(4,b={}),t(5,k={}),await pn(),t(9,m=q()),!m||Y(p,m)?t(9,m=null):(delete m.password,delete m.passwordConfirm),t(25,$=JSON.stringify(p)),t(27,M=!0)}function F(){return"record_draft_"+((u==null?void 0:u.id)||"")+"_"+((d==null?void 0:d.id)||"")}function q(ke){try{const Ne=window.localStorage.getItem(F());if(Ne)return new Li(JSON.parse(Ne))}catch{}return ke}function N(ke){window.localStorage.setItem(F(),ke)}function R(){m&&(t(3,p=m),t(9,m=null))}function Y(ke,Ne){var en;const Je=ke==null?void 0:ke.$clone(),Fe=Ne==null?void 0:Ne.$clone(),Nn=(en=u==null?void 0:u.schema)==null?void 0:en.filter(Kn=>Kn.type==="file");for(let Kn of Nn)Je==null||delete Je[Kn.name],Fe==null||delete Fe[Kn.name];return Je==null||delete Je.password,Je==null||delete Je.passwordConfirm,Fe==null||delete Fe.password,Fe==null||delete Fe.passwordConfirm,JSON.stringify(Je)==JSON.stringify(Fe)}function B(){t(9,m=null),window.localStorage.removeItem(F())}function Z(ke=!0){if(_||!o||!(u!=null&&u.id))return;t(10,_=!0);const Ne=ne();let Je;O?Je=pe.collection(u.id).create(Ne):Je=pe.collection(u.id).update(p.id,Ne),Je.then(Fe=>{Jt(O?"Successfully created record.":"Successfully updated record."),B(),ke?(t(11,g=!1),I()):D(Fe),r("save",Fe)}).catch(Fe=>{pe.errorResponseHandler(Fe)}).finally(()=>{t(10,_=!1)})}function ee(){d!=null&&d.id&&vn("Do you really want to delete the selected record?",()=>pe.collection(d.collectionId).delete(d.id).then(()=>{I(),Jt("Successfully deleted record."),r("delete",d)}).catch(ke=>{pe.errorResponseHandler(ke)}))}function ne(){const ke=(p==null?void 0:p.$export())||{},Ne=new FormData,Je={id:ke.id};for(const Fe of(u==null?void 0:u.schema)||[])Je[Fe.name]=!0;u!=null&&u.isAuth&&(Je.username=!0,Je.email=!0,Je.emailVisibility=!0,Je.password=!0,Je.passwordConfirm=!0,Je.verified=!0);for(const Fe in ke)Je[Fe]&&(typeof ke[Fe]>"u"&&(ke[Fe]=null),j.addValueToFormData(Ne,Fe,ke[Fe]));for(const Fe in b){const Nn=j.toArray(b[Fe]);for(const en of Nn)Ne.append(Fe,en)}for(const Fe in k){const Nn=j.toArray(k[Fe]);for(const en of Nn)Ne.append(Fe+"."+en,"")}return Ne}function X(){!(u!=null&&u.id)||!(d!=null&&d.email)||vn(`Do you really want to sent verification email to ${d.email}?`,()=>pe.collection(u.id).requestVerification(d.email).then(()=>{Jt(`Successfully sent verification email to ${d.email}.`)}).catch(ke=>{pe.errorResponseHandler(ke)}))}function fe(){!(u!=null&&u.id)||!(d!=null&&d.email)||vn(`Do you really want to sent password reset email to ${d.email}?`,()=>pe.collection(u.id).requestPasswordReset(d.email).then(()=>{Jt(`Successfully sent password reset email to ${d.email}.`)}).catch(ke=>{pe.errorResponseHandler(ke)}))}function G(){l?vn("You have unsaved changes. Do you really want to discard them?",()=>{ce()}):ce()}async function ce(){const ke=d==null?void 0:d.$clone();if(ke){ke.id="",ke.created="",ke.updated="";const Ne=(u==null?void 0:u.schema)||[];for(const Je of Ne)Je.type==="file"&&delete ke[Je.name]}B(),D(ke),await pn(),t(25,$="")}function ge(ke){ke.ctrlKey&&ke.code=="KeyS"&&(ke.preventDefault(),ke.stopPropagation(),Z(!1))}const Me=()=>I(),Ve=()=>X(),ze=()=>fe(),we=()=>G(),Ce=()=>ee(),Ze=()=>t(12,T=ls),mt=()=>t(12,T=Sl),Ge=()=>R(),Ye=()=>B();function te(){p.id=this.value,t(3,p)}function qe(ke){p=ke,t(3,p)}function xe(ke,Ne){n.$$.not_equal(p[Ne.name],ke)&&(p[Ne.name]=ke,t(3,p))}function Xt(ke,Ne){n.$$.not_equal(p[Ne.name],ke)&&(p[Ne.name]=ke,t(3,p))}function Le(ke,Ne){n.$$.not_equal(p[Ne.name],ke)&&(p[Ne.name]=ke,t(3,p))}function $e(ke,Ne){n.$$.not_equal(p[Ne.name]
`},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function KD(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,h(e,"type","button"),h(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[40]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function JD(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[39]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function Zm(n){let e,t,i,s,l,o,r,a,u,f;function d(){return n[36](n[55])}return{c(){e=y("td"),t=y("div"),i=y("input"),o=E(),r=y("label"),h(i,"type","checkbox"),h(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],h(r,"for",a="checkbox_"+n[55].id),h(t,"class","form-field"),h(e,"class","bulk-select-col min-width")},m(p,m){S(p,e,m),v(e,t),v(t,i),v(t,o),v(t,r),u||(f=[K(i,"change",d),K(t,"click",En(n[26]))],u=!0)},p(p,m){n=p,m[0]&16&&s!==(s="checkbox_"+n[55].id)&&h(i,"id",s),m[0]&80&&l!==(l=n[6][n[55].id])&&(i.checked=l),m[0]&16&&a!==(a="checkbox_"+n[55].id)&&h(r,"for",a)},d(p){p&&w(e),u=!1,De(f)}}}function Gm(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new tr({props:{value:n[55].id}});let d=n[2].$isAuth&&Xm(n);return{c(){e=y("td"),t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),a=U(r),u=E(),d&&d.c(),h(o,"class","txt"),h(i,"class","label"),h(t,"class","flex flex-gap-5"),h(e,"class","col-type-text col-field-id")},m(p,m){S(p,e,m),v(e,t),v(t,i),V(s,i,null),v(i,l),v(i,o),v(o,a),v(t,u),d&&d.m(t,null),f=!0},p(p,m){const _={};m[0]&16&&(_.value=p[55].id),s.$set(_),(!f||m[0]&16)&&r!==(r=p[55].id+"")&&le(a,r),p[2].$isAuth?d?d.p(p,m):(d=Xm(p),d.c(),d.m(t,null)):d&&(d.d(1),d=null)},i(p){f||(A(s.$$.fragment,p),f=!0)},o(p){P(s.$$.fragment,p),f=!1},d(p){p&&w(e),H(s),d&&d.d()}}}function Xm(n){let e;function t(l,o){return l[55].verified?GD:ZD}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function ZD(n){let e,t,i;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=Ee(We.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function GD(n){let e,t,i;return{c(){e=y("i"),h(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=Ee(We.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function Qm(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&xm(n),o=i&&eh(n);return{c(){l&&l.c(),t=E(),o&&o.c(),s=Se()},m(r,a){l&&l.m(r,a),S(r,t,a),o&&o.m(r,a),S(r,s,a)},p(r,a){a[0]&128&&(e=!r[7].includes("@username")),e?l?l.p(r,a):(l=xm(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&128&&(i=!r[7].includes("@email")),i?o?o.p(r,a):(o=eh(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&w(t),o&&o.d(r),r&&w(s)}}}function xm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!j.isEmpty(o[55].username)),t?QD:XD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=y("td"),l.c(),h(e,"class","col-type-text col-field-username")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function XD(n){let e,t=n[55].username+"",i,s;return{c(){e=y("span"),i=U(t),h(e,"class","txt txt-ellipsis"),h(e,"title",s=n[55].username)},m(l,o){S(l,e,o),v(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&le(i,t),o[0]&16&&s!==(s=l[55].username)&&h(e,"title",s)},d(l){l&&w(e)}}}function QD(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function eh(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!j.isEmpty(o[55].email)),t?eE:xD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=y("td"),l.c(),h(e,"class","col-type-text col-field-email")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function xD(n){let e,t=n[55].email+"",i,s;return{c(){e=y("span"),i=U(t),h(e,"class","txt txt-ellipsis"),h(e,"title",s=n[55].email)},m(l,o){S(l,e,o),v(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].email+"
<span class="txt">New record</span>`,h(e,"type","button"),h(e,"class","btn btn-expanded")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[18]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function dE(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,d,p,m,_,g,b,k,$,C,T,O,M,D,I,L,F,q=!n[10]&&fh(n);d=new Na({}),d.$on("refresh",n[16]);let N=!n[2].$isView&&ch(n);k=new Ko({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[19]);function R(Z){n[21](Z)}function Y(Z){n[22](Z)}let B={collection:n[2]};return n[0]!==void 0&&(B.filter=n[0]),n[1]!==void 0&&(B.sort=n[1]),O=new aE({props:B}),n[20](O),se.push(()=>he(O,"filter",R)),se.push(()=>he(O,"sort",Y)),O.$on("select",n[23]),O.$on("new",n[24]),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Collections",s=E(),l=y("div"),r=U(o),a=E(),u=y("div"),q&&q.c(),f=E(),z(d.$$.fragment),p=E(),m=y("div"),_=y("button"),_.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,g=E(),N&&N.c(),b=E(),z(k.$$.fragment),$=E(),C=y("div"),T=E(),z(O.$$.fragment),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(u,"class","inline-flex gap-5"),h(_,"type","button"),h(_,"class","btn btn-outline"),h(m,"class","btns-group"),h(e,"class","page-header"),h(C,"class","clearfix m-b-base")},m(Z,ee){S(Z,e,ee),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),v(e,u),q&&q.m(u,null),v(u,f),V(d,u,null),v(e,p),v(e,m),v(m,_),v(m,g),N&&N.m(m,null),S(Z,b,ee),V(k,Z,ee),S(Z,$,ee),S(Z,C,ee),S(Z,T,ee),V(O,Z,ee),I=!0,L||(F=K(_,"click",n[17]),L=!0)},p(Z,ee){(!I||ee[0]&4)&&o!==(o=Z[2].name+"")&&le(r,o),Z[10]?q&&(q.d(1),q=null):q?q.p(Z,ee):(q=fh(Z),q.c(),q.m(u,f)),Z[2].$isView?N&&(N.d(1),N=null):N?N.p(Z,ee):(N=ch(Z),N.c(),N.m(m,null));const ne={};ee[0]&1&&(ne.value=Z[0]),ee[0]&4&&(ne.autocompleteCollection=Z[2]),k.$set(ne);const X={};ee[0]&4&&(X.collection=Z[2]),!M&&ee[0]&1&&(M=!0,X.filter=Z[0],ye(()=>M=!1)),!D&&ee[0]&2&&(D=!0,X.sort=Z[1],ye(()=>D=!1)),O.$set(X)},i(Z){I||(A(d.$$.fragment,Z),A(k.$$.fragment,Z),A(O.$$.fragment,Z),I=!0)},o(Z){P(d.$$.fragment,Z),P(k.$$.fragment,Z),P(O.$$.fragment,Z),I=!1},d(Z){Z&&w(e),q&&q.d(),H(d),N&&N.d(),Z&&w(b),H(k,Z),Z&&w($),Z&&w(C),Z&&w(T),n[20](null),H(O,Z),L=!1,F()}}}function pE(n){let e,t,i,s,l;return{c(){e=y("h1"),e.textContent="Create your first collection to add records!",t=E(),i=y("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,h(e,"class","m-b-10"),h(i,"type","button"),h(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=K(i,"click",n[14]),s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function mE(n){let e;return{c(){e=y("h1"),e.textContent="You don't have any collections yet.",h(e,"class","m-b-10")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function hE(n){let e,t,i;function s(r,a){return r[10]?mE:pE}let l=s(n),o=l(n);return{c(){e=y("div"),t=y("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=E(),o.c(),h(t,"class","icon"),h(e,"class","placeholder-section m-b-base")},m(r,a){S(r,e,a),v(e,t),v(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&w(e),o.d()}}}function _E(n){let e;return{c(){e=y("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,h(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function gE(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[cE,fE,uE],m=[];function _(C,T){return C[3]&&!C[9].length?0:C[9].length?2:1}e=_(n),t=m[e]=p[e](n);let g={};s=new au({props:g}),n[25](s);let b={};o=new a5({props:b}),n[26](o);let k={collection:n[2]};a=new ub({props:k}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let $={collection:n[2]};return f=new FD({props:$}),n[30](f),{c(){t.c(),i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment)},m(C,T){m[e].m(C,T),S(C,i,T),V(s,C,T),S(C,l,T),V(o,C,T),S(C,r,T),V(a,C,T),S(C,u,T),V(f,C,T),d=!0},p(C,T){let O=e;e=_(C),e===O?m[e].p(C,T):(re(),P(m[O],1,1,()=>{m[O]=null}),ae(),t=m[e],t?t.p(C,T):(t=m[e]=p[e](C),t.c()),A(t,1),t.m(i.parentNode,i));const M={};s.$set(M);const D={};o.$set(D);const I={};T[0]&4&&(I.collection=C[2]),a.$set(I);const L={};T[0]&4&&(L.collection=C[2]),f.$set(L)},i(C){d||(A(t),A(s.$$.fragment,C),A(o.$$.fragment,C),A(a.$$.fragment,C),A(f.$$.fragment,C),d=!0)},o(C){P(t),P(s.$$.fragment,C),P(o.$$.fragment,C),P(a.$$.fragment,C),P(f.$$.fragment,C),d=!1},d(C){m[e].d(C),C&&w(i),n[25](null),H(s,C),C&&w(l),n[26](null),H(o,C),C&&w(r),n[27](null),H(a,C),C&&w(u),n[30](null),H(f,C)}}}function bE(n,e,t){let i,s,l,o,r,a,u;Xe(n,yi,G=>t(2,s=G)),Xe(n,Lt,G=>t(31,l=G)),Xe(n,yo,G=>t(3,o=G)),Xe(n,ka,G=>t(13,r=G)),Xe(n,fi,G=>t(9,a=G)),Xe(n,Ds,G=>t(10,u=G));const f=new URLSearchParams(r);let d,p,m,_,g,b=f.get("filter")||"",k=f.get("sort")||"",$=f.get("collectionId")||(s==null?void 0:s.id);function C(){t(11,$=s==null?void 0:s.id),t(0,b=""),t(1,k="-created"),s!=null&&s.$isView&&!j.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}hy($);const T=()=>d==null?void 0:d.show(),O=()=>d==null?void 0:d.show(s),M=()=>g==null?void 0:g.load(),D=()=>p==null?void 0:p.show(s),I=()=>m==null?void 0:m.show(),L=G=>t(0,b=G.detail);function F(G){se[G?"unshift":"push"](()=>{g=G,t(8,g)})}function q(G){b=G,t(0,b)}function N(G){k=G,t(1,k)}const R=G=>{s.$isView?_.show(G==null?void 0:G.detail):m==null||m.show(G==null?void 0:G.detail)},Y=()=>m==null?void 0:m.show();function B(G){se[G?"unshift":"push"](()=>{d=G,t(4,d)})}function Z(G){se[G?"unshift":"push"](()=>{p=G,t(5,p)})}function ee(G){se[G?"unshift":"push"](()=>{m=G,t(6,m)})}const ne=()=>g==null?void 0:g.reloadLoadedPages(),X=()=>g==null?void 0:g.reloadLoadedPages();function fe(G){se[G?"unshift":"push"](()=>{_=G,t(7,_)})}return n.$$.update=()=>{if(n.$$.dirty[0]&8192&&t(12,i=new URLSearchParams(r)),n.$$.dirty[0]&6152&&!o&&i.get("collectionId")&&i.get("collectionId")!=$&&dy(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&$!=s.id&&C(),n.$$.dirty[0]&7&&(k||b||s!=null&&s.id)){const G=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:b,sort:k}).toString();qi("/collections?"+G)}n.$$.dirty[0]&4&&ln(Lt,l=(s==null?void 0:s.name)||"Collections",l)},[b,k,s,o,d,p,m,_,g,a,u,$,i,r,T,O,M,D,I,L,F,q,N,R,Y,B,Z,ee,ne,X,fe]}class vE extends ve{constructor(e){super(),be(this,e,bE,gE,_e,{},null,[-1,-1])}}function yE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,C,T,O,M,D,I,L;return{c(){e=y("aside"),t=y("div"),i=y("div"),i.textContent="System",s=E(),l=y("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
<span class="txt">Application</span>`,o=E(),r=y("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=E(),u=y("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=E(),d=y("div"),d.innerHTML='<span class="txt">Sync</span>',p=E(),m=y("a"),m.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,_=E(),g=y("a"),g.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,b=E(),k=y("div"),k.textContent="Authentication",$=E(),C=y("a"),C.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,T=E(),O=y("a"),O.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,M=E(),D=y("a"),D.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,h(i,"class","sidebar-title"),h(l,"href","/settings"),h(l,"class","sidebar-list-item"),h(r,"href","/settings/mail"),h(r,"class","sidebar-list-item"),h(u,"href","/settings/storage"),h(u,"class","sidebar-list-item"),h(d,"class","sidebar-title"),h(m,"href","/settings/export-collections"),h(m,"class","sidebar-list-item"),h(g,"href","/settings/import-collections"),h(g,"class","sidebar-list-item"),h(k,"class","sidebar-title"),h(C,"href","/settings/auth-providers"),h(C,"class","sidebar-list-item"),h(O,"href","/settings/tokens"),h(O,"class","sidebar-list-item"),h(D,"href","/settings/admins"),h(D,"class","sidebar-list-item"),h(t,"class","sidebar-content"),h(e,"class","page-sidebar settings-sidebar")},m(F,q){S(F,e,q),v(e,t),v(t,i),v(t,s),v(t,l),v(t,o),v(t,r),v(t,a),v(t,u),v(t,f),v(t,d),v(t,p),v(t,m),v(t,_),v(t,g),v(t,b),v(t,k),v(t,$),v(t,C),v(t,T),v(t,O),v(t,M),v(t,D),I||(L=[Ee(Gn.call(null,l,{path:"/settings"})),Ee(an.call(null,l)),Ee(Gn.call(null,r,{path:"/settings/mail/?.*"})),Ee(an.call(null,r)),Ee(Gn.call(null,u,{path:"/settings/storage/?.*"})),Ee(an.call(null,u)),Ee(Gn.call(null,m,{path:"/settings/export-collections/?.*"})),Ee(an.call(null,m)),Ee(Gn.call(null,g,{path:"/settings/import-collections/?.*"})),Ee(an.call(null,g)),Ee(Gn.call(null,C,{path:"/settings/auth-providers/?.*"})),Ee(an.call(null,C)),Ee(Gn.call(null,O,{path:"/settings/tokens/?.*"})),Ee(an.call(null,O)),Ee(Gn.call(null,D,{path:"/settings/admins/?.*"})),Ee(an.call(null,D))],I=!0)},p:Q,i:Q,o:Q,d(F){F&&w(e),I=!1,De(L)}}}class zi extends ve{constructor(e){super(),be(this,e,null,yE,_e,{})}}function dh(n,e,t){const i=n.slice();return i[30]=e[t],i}function ph(n){let e,t;return e=new de({props:{class:"form-field readonly",name:"id",$$slots:{default:[kE,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&536870914|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function kE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="id",o=E(),r=y("div"),a=y("i"),f=E(),d=y("input"),h(t,"class",j.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"for",l=n[29]),h(a,"class","ri-calendar-event-line txt-disabled"),h(r,"class","form-field-addon"),h(d,"type","text"),h(d,"id",p=n[29]),d.value=m=n[1].id,d.readOnly=!0},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),S(b,r,k),v(r,a),S(b,f,k),S(b,d,k),_||(g=Ee(u=We.call(null,a,{text:`Created: ${n[1].created}
Updated: ${n[1].updated}`,position:"left"})),_=!0)},p(b,k){k[0]&536870912&&l!==(l=b[29])&&h(e,"for",l),u&&jt(u.update)&&k[0]&2&&u.update.call(null,{text:`Created: ${b[1].created}
Updated: ${b[1].updated}`,position:"left"}),k[0]&536870912&&p!==(p=b[29])&&h(d,"id",p),k[0]&2&&m!==(m=b[1].id)&&d.value!==m&&(d.value=m)},d(b){b&&w(e),b&&w(o),b&&w(r),b&&w(f),b&&w(d),_=!1,g()}}}function mh(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=y("button"),t=y("img"),s=E(),dn(t.src,i="./images/avatars/avatar"+n[30]+".svg")||h(t,"src",i),h(t,"alt","Avatar "+n[30]),h(e,"type","button"),h(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){S(u,e,f),v(e,t),v(e,s),o||(r=K(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))&&h(e,"class",l)},d(u){u&&w(e),o=!1,r()}}}function wE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Email",o=E(),r=y("input"),h(t,"class",j.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"for",l=n[29]),h(r,"type","email"),h(r,"autocomplete","off"),h(r,"id",a=n[29]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ue(r,n[3]),u||(f=K(r,"input",n[18]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&h(r,"id",a),p[0]&8&&r.value!==d[3]&&ue(r,d[3])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function hh(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle",$$slots:{default:[SE,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&536870928|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function SE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Change password"),h(e,"type","checkbox"),h(e,"id",t=n[29]),h(s,"for",o=n[29])},m(u,f){S(u,e,f),e.checked=n[4],S(u,i,f),S(u,s,f),v(s,l),r||(a=K(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&h(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function _h(n){let e,t,i,s,l,o,r,a,u;return s=new de({props:{class:"form-field required",name:"password",$$slots:{default:[$E,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[TE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),z(r.$$.fragment),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(t,"class","grid"),h(e,"class","col-12")},m(f,d){S(f,e,d),v(e,t),v(t,i),V(s,i,null),v(t,l),v(t,o),V(r,o,null),u=!0},p(f,d){const p={};d[0]&536871168|d[1]&4&&(p.$$scope={dirty:d,ctx:f}),s.$set(p);const m={};d[0]&536871424|d[1]&4&&(m.$$scope={dirty:d,ctx:f}),r.$set(m)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&nt(()=>{u&&(a||(a=He(t,kt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=He(t,kt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),H(s),H(r),f&&a&&a.end()}}}function $E(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Password",o=E(),r=y("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[29]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[29]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ue(r,n[8]),u||(f=K(r,"input",n[20]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&h(r,"id",a),p[0]&256&&r.value!==d[8]&&ue(r,d[8])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function TE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Password confirm",o=E(),r=y("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[29]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[29]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ue(r,n[9]),u||(f=K(r,"input",n[21]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p
<span class="txt">Delete</span>`,h(e,"type","button"),h(e,"class","dropdown-item txt-danger")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[15]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function DE(n){let e,t,i,s,l,o,r=n[1].$isNew?"Create":"Save changes",a,u,f,d,p,m=!n[1].$isNew&&gh(n);return{c(){m&&m.c(),e=E(),t=y("button"),i=y("span"),i.textContent="Cancel",s=E(),l=y("button"),o=y("span"),a=U(r),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-transparent"),t.disabled=n[6],h(o,"class","txt"),h(l,"type","submit"),h(l,"form",n[11]),h(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],x(l,"btn-loading",n[6])},m(_,g){m&&m.m(_,g),S(_,e,g),S(_,t,g),v(t,i),S(_,s,g),S(_,l,g),v(l,o),v(o,a),f=!0,d||(p=K(t,"click",n[16]),d=!0)},p(_,g){_[1].$isNew?m&&(re(),P(m,1,1,()=>{m=null}),ae()):m?(m.p(_,g),g[0]&2&&A(m,1)):(m=gh(_),m.c(),A(m,1),m.m(e.parentNode,e)),(!f||g[0]&64)&&(t.disabled=_[6]),(!f||g[0]&2)&&r!==(r=_[1].$isNew?"Create":"Save changes")&&le(a,r),(!f||g[0]&1088&&u!==(u=!_[10]||_[6]))&&(l.disabled=u),(!f||g[0]&64)&&x(l,"btn-loading",_[6])},i(_){f||(A(m),f=!0)},o(_){P(m),f=!1},d(_){m&&m.d(_),_&&w(e),_&&w(t),_&&w(s),_&&w(l),d=!1,p()}}}function EE(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[DE],header:[ME],default:[CE]},$$scope:{ctx:n}};return e=new hn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[22]),l[0]&1886|l[1]&4&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[23](null),H(e,s)}}}function AE(n,e,t){let i;const s=wt(),l="admin_"+j.randomString(5);let o,r=new os,a=!1,u=!1,f=0,d="",p="",m="",_=!1;function g(Z){return k(Z),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function k(Z){t(1,r=Z!=null&&Z.$clone?Z.$clone():new os),$()}function $(){t(4,_=!1),t(3,d=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,p=""),t(9,m=""),mn({})}function C(){if(a||!i)return;t(6,a=!0);const Z={email:d,avatar:f};(r.$isNew||_)&&(Z.password=p,Z.passwordConfirm=m);let ee;r.$isNew?ee=pe.admins.create(Z):ee=pe.admins.update(r.id,Z),ee.then(async ne=>{var X;t(7,u=!1),b(),Jt(r.$isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ne),((X=pe.authStore.model)==null?void 0:X.id)===ne.id&&pe.authStore.save(pe.authStore.token,ne)}).catch(ne=>{pe.errorResponseHandler(ne)}).finally(()=>{t(6,a=!1)})}function T(){r!=null&&r.id&&vn("Do you really want to delete the selected admin?",()=>pe.admins.delete(r.id).then(()=>{t(7,u=!1),b(),Jt("Successfully deleted admin."),s("delete",r)}).catch(Z=>{pe.errorResponseHandler(Z)}))}const O=()=>T(),M=()=>b(),D=Z=>t(2,f=Z);function I(){d=this.value,t(3,d)}function L(){_=this.checked,t(4,_)}function F(){p=this.value,t(8,p)}function q(){m=this.value,t(9,m)}const N=()=>i&&u?(vn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function R(Z){se[Z?"unshift":"push"](()=>{o=Z,t(5,o)})}function Y(Z){me.call(this,n,Z)}function B(Z){me.call(this,n,Z)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.$isNew&&d!=""||_||d!==r.email||f!==r.avatar)},[b,r,f,d,_,o,a,u,p,m,i,l,C,T,g,O,M,D,I,L,F,q,N,R,Y,B]}class IE extends ve{constructor(e){super(),be(this,e,AE,EE,_e,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function bh(n,e,t){const i=n.slice();return i[24]=e[t],i}function PE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="id",h(t,"class",j.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function LE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="email",h(t,"class",j.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function NE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="create
`},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function yh(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[17]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function kh(n){let e;return{c(){e=y("span"),e.textContent="You",h(e,"class","label label-warning m-l-5")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function wh(n,e){let t,i,s,l,o,r,a,u,f,d,p,m=e[24].id+"",_,g,b,k,$,C=e[24].email+"",T,O,M,D,I,L,F,q,N,R,Y,B,Z,ee;f=new tr({props:{value:e[24].id}});let ne=e[24].id===e[7].id&&kh();I=new ki({props:{date:e[24].created}}),q=new ki({props:{date:e[24].updated}});function X(){return e[15](e[24])}function fe(...G){return e[16](e[24],...G)}return{key:n,first:null,c(){t=y("tr"),i=y("td"),s=y("figure"),l=y("img"),r=E(),a=y("td"),u=y("div"),z(f.$$.fragment),d=E(),p=y("span"),_=U(m),g=E(),ne&&ne.c(),b=E(),k=y("td"),$=y("span"),T=U(C),M=E(),D=y("td"),z(I.$$.fragment),L=E(),F=y("td"),z(q.$$.fragment),N=E(),R=y("td"),R.innerHTML='<i class="ri-arrow-right-line"></i>',Y=E(),dn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||h(l,"src",o),h(l,"alt","Admin avatar"),h(s,"class","thumb thumb-sm thumb-circle"),h(i,"class","min-width"),h(p,"class","txt"),h(u,"class","label"),h(a,"class","col-type-text col-field-id"),h($,"class","txt txt-ellipsis"),h($,"title",O=e[24].email),h(k,"class","col-type-email col-field-email"),h(D,"class","col-type-date col-field-created"),h(F,"class","col-type-date col-field-updated"),h(R,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(G,ce){S(G,t,ce),v(t,i),v(i,s),v(s,l),v(t,r),v(t,a),v(a,u),V(f,u,null),v(u,d),v(u,p),v(p,_),v(a,g),ne&&ne.m(a,null),v(t,b),v(t,k),v(k,$),v($,T),v(t,M),v(t,D),V(I,D,null),v(t,L),v(t,F),V(q,F,null),v(t,N),v(t,R),v(t,Y),B=!0,Z||(ee=[K(t,"click",X),K(t,"keydown",fe)],Z=!0)},p(G,ce){e=G,(!B||ce&16&&!dn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&h(l,"src",o);const ge={};ce&16&&(ge.value=e[24].id),f.$set(ge),(!B||ce&16)&&m!==(m=e[24].id+"")&&le(_,m),e[24].id===e[7].id?ne||(ne=kh(),ne.c(),ne.m(a,null)):ne&&(ne.d(1),ne=null),(!B||ce&16)&&C!==(C=e[24].email+"")&&le(T,C),(!B||ce&16&&O!==(O=e[24].email))&&h($,"title",O);const Me={};ce&16&&(Me.date=e[24].created),I.$set(Me);const Ve={};ce&16&&(Ve.date=e[24].updated),q.$set(Ve)},i(G){B||(A(f.$$.fragment,G),A(I.$$.fragment,G),A(q.$$.fragment,G),B=!0)},o(G){P(f.$$.fragment,G),P(I.$$.fragment,G),P(q.$$.fragment,G),B=!1},d(G){G&&w(t),H(f),ne&&ne.d(),H(I),H(q),Z=!1,De(ee)}}}function jE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,C,T,O=[],M=new Map,D;function I(X){n[11](X)}let L={class:"col-type-text",name:"id",$$slots:{default:[PE]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new nn({props:L}),se.push(()=>he(o,"sort",I));function F(X){n[12](X)}let q={class:"col-type-email col-field-email",name:"email",$$slots:{default:[LE]},$$scope:{ctx:n}};n[2]!==void 0&&(q.sort=n[2]),u=new nn({props:q}),se.push(()=>he(u,"sort",F));function N(X){n[13](X)}let R={class:"col-type-date col-field-created",name:"created",$$slots:{default:[NE]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),p=new nn({props:R}),se.push(()=>he(p,"sort",N));function Y(X){n[14](X)}let B={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[FE]},$$scope:{ctx:n}};n[2]!==void 0&&(B.sort=n[2]),g=new nn({props:B}),se.push(()=>he(g,"sort",Y));let Z=n[4];const ee=X=>X[24].id;for(let X=0;X<Z.length;X+=1){let fe=bh(n,Z,X),G=ee(fe);M.set(G,O[X]=wh(G,fe))}let ne=null;return Z.length||(ne=vh(n)),{c(){e=y("table"),t=y("thead"),i=y("tr"),s=y("th"),l=E(),z(o.$$.fragment),a=E(),z(u.$$.fragment),d=E(),z(p.$$.fragment),_=E(),z(g.$$.fragment),k=E(),$=y("th"),C=E(),T=y("tbody");for(let X=0;X<O.length;X+=1)O[X].c();ne&&ne.c(),h(s,"class","min-width"),h($,"class","col-type-action min-width"),h(e,"class","table"),x(e,"table-loading",n[5])},m(X,fe){S(X,e,fe),v(e,t),v(t,i),v(i,s),v(i,l),V(o,i,null),v(i,a),V(u,i,null),v(i,d),V(p,i,null),v(i,_),V(g,i,null),v(i,k),v(i,$),v(e,C),v(e
<span class="txt">New admin</span>`,m=E(),z(_.$$.fragment),g=E(),b=y("div"),k=E(),z($.$$.fragment),C=E(),I&&I.c(),T=Se(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(f,"class","flex-fill"),h(p,"type","button"),h(p,"class","btn btn-expanded"),h(e,"class","page-header"),h(b,"class","clearfix m-b-base")},m(L,F){S(L,e,F),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(e,r),V(a,e,null),v(e,u),v(e,f),v(e,d),v(e,p),S(L,m,F),V(_,L,F),S(L,g,F),S(L,b,F),S(L,k,F),V($,L,F),S(L,C,F),I&&I.m(L,F),S(L,T,F),O=!0,M||(D=K(p,"click",n[9]),M=!0)},p(L,F){(!O||F&64)&&le(o,L[6]);const q={};F&2&&(q.value=L[1]),_.$set(q);const N={};F&134217918&&(N.$$scope={dirty:F,ctx:L}),$.$set(N),L[4].length?I?I.p(L,F):(I=Sh(L),I.c(),I.m(T.parentNode,T)):I&&(I.d(1),I=null)},i(L){O||(A(a.$$.fragment,L),A(_.$$.fragment,L),A($.$$.fragment,L),O=!0)},o(L){P(a.$$.fragment,L),P(_.$$.fragment,L),P($.$$.fragment,L),O=!1},d(L){L&&w(e),H(a),L&&w(m),H(_,L),L&&w(g),L&&w(b),L&&w(k),H($,L),L&&w(C),I&&I.d(L),L&&w(T),M=!1,D()}}}function HE(n){let e,t,i,s,l,o;e=new zi({}),i=new In({props:{$$slots:{default:[VE]},$$scope:{ctx:n}}});let r={};return l=new IE({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){V(e,a,u),S(a,t,u),V(i,a,u),S(a,s,u),V(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};l.$set(d)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&w(t),H(i,a),a&&w(s),n[18](null),H(l,a)}}}function zE(n,e,t){let i,s,l;Xe(n,ka,q=>t(21,i=q)),Xe(n,Lt,q=>t(6,s=q)),Xe(n,Pa,q=>t(7,l=q)),ln(Lt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",d=o.get("sort")||"-created";function p(){t(5,u=!0),t(4,a=[]);const q=j.normalizeSearchFilter(f,["id","email","created","updated"]);return pe.admins.getFullList(100,{sort:d||"-created",filter:q}).then(N=>{t(4,a=N),t(5,u=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,u=!1),console.warn(N),m(),pe.errorResponseHandler(N,!1))})}function m(){t(4,a=[])}const _=()=>p(),g=()=>r==null?void 0:r.show(),b=q=>t(1,f=q.detail);function k(q){d=q,t(2,d)}function $(q){d=q,t(2,d)}function C(q){d=q,t(2,d)}function T(q){d=q,t(2,d)}const O=q=>r==null?void 0:r.show(q),M=(q,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(q))},D=()=>t(1,f="");function I(q){se[q?"unshift":"push"](()=>{r=q,t(3,r)})}const L=()=>p(),F=()=>p();return n.$$.update=()=>{if(n.$$.dirty&6&&d!==-1&&f!==-1){const q=new URLSearchParams({filter:f,sort:d}).toString();qi("/settings/admins?"+q),p()}},[p,f,d,r,a,u,s,l,_,g,b,k,$,C,T,O,M,D,I,L,F]}class BE extends ve{constructor(e){super(),be(this,e,zE,HE,_e,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function UE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Email"),s=E(),l=y("input"),h(e,"for",i=n[8]),h(l,"type","email"),h(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0]),l.focus(),r||(a=K(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&h(e,"for",i),f&256&&o!==(o=u[8])&&h(l,"id",o),f&1&&l.value!==u[0]&&ue(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function WE(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("Password"),s=E(),l=y("input"),r=E(),a=y("div"),u=y("a"),u.textContent="Forgotten password?",h(e,"for",i=n[8]),h(l,"type","password"),h(l,"id",o=n[8]),l.required=!0,h(u,"href","/request-password-reset"),h(u,"class","link-hint"),h(a,"class","help-block")},m(p,m){S(p,e,m),v(e,t),S(p,s,m),S(p,l,m),ue(l,n[1]),S(p,r,m),S(p,a,m),v(a,u),f||(d=[K(l,"input",n[5]),Ee(an.call(null,u))],f=!0)},p(p,m){m&256&&i!==(i=p[8])&&h(e,"for",i),m&256&&o!==(o=p[8])&&h(l,"id",o),m&2&&l.value!==p[1]&&ue(l,p[1])},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(r),p&&w(a),f=!1,De(d)}}}function YE(n){let e,t,i,s,l,o,r,a,u,f,d;return s=new de({props:{class:"form-field required",name:"identity",$$slots:{default:[UE,({uniqueId:p})=>({8:p}),({uniqueId:p})=>p?256:0]},$$scope:{ctx:n}}})
<i class="ri-arrow-right-line"></i>`,h(t,"class","content txt-center m-b-base"),h(a,"type","submit"),h(a,"class","btn btn-lg btn-block btn-next"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),h(e,"class","block")},m(p,m){S(p,e,m),v(e,t),v(e,i),V(s,e,null),v(e,l),V(o,e,null),v(e,r),v(e,a),u=!0,f||(d=K(e,"submit",at(n[3])),f=!0)},p(p,m){const _={};m&769&&(_.$$scope={dirty:m,ctx:p}),s.$set(_);const g={};m&770&&(g.$$scope={dirty:m,ctx:p}),o.$set(g),(!u||m&4)&&x(a,"btn-disabled",p[2]),(!u||m&4)&&x(a,"btn-loading",p[2])},i(p){u||(A(s.$$.fragment,p),A(o.$$.fragment,p),u=!0)},o(p){P(s.$$.fragment,p),P(o.$$.fragment,p),u=!1},d(p){p&&w(e),H(s),H(o),f=!1,d()}}}function KE(n){let e,t;return e=new i1({props:{$$slots:{default:[YE]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function JE(n,e,t){let i;Xe(n,ka,d=>t(6,i=d));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),pe.admins.authWithPassword(l,o).then(()=>{Aa(),qi("/")}).catch(()=>{hl("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class ZE extends ve{constructor(e){super(),be(this,e,JE,KE,_e,{})}}function GE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,C,T,O;i=new de({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[QE,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[xE,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),a=new de({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[e6,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[t6,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}});let M=n[3]&&$h(n);return{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),d=E(),p=y("div"),m=y("div"),_=E(),M&&M.c(),g=E(),b=y("button"),k=y("span"),k.textContent="Save changes",h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(m,"class","flex-fill"),h(k,"class","txt"),h(b,"type","submit"),h(b,"class","btn btn-expanded"),b.disabled=$=!n[3]||n[2],x(b,"btn-loading",n[2]),h(p,"class","col-lg-12 flex"),h(e,"class","grid")},m(D,I){S(D,e,I),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,r),V(a,e,null),v(e,u),V(f,e,null),v(e,d),v(e,p),v(p,m),v(p,_),M&&M.m(p,null),v(p,g),v(p,b),v(b,k),C=!0,T||(O=K(b,"click",n[13]),T=!0)},p(D,I){const L={};I&1572865&&(L.$$scope={dirty:I,ctx:D}),i.$set(L);const F={};I&1572865&&(F.$$scope={dirty:I,ctx:D}),o.$set(F);const q={};I&1572865&&(q.$$scope={dirty:I,ctx:D}),a.$set(q);const N={};I&1572865&&(N.$$scope={dirty:I,ctx:D}),f.$set(N),D[3]?M?M.p(D,I):(M=$h(D),M.c(),M.m(p,g)):M&&(M.d(1),M=null),(!C||I&12&&$!==($=!D[3]||D[2]))&&(b.disabled=$),(!C||I&4)&&x(b,"btn-loading",D[2])},i(D){C||(A(i.$$.fragment,D),A(o.$$.fragment,D),A(a.$$.fragment,D),A(f.$$.fragment,D),C=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(a.$$.fragment,D),P(f.$$.fragment,D),C=!1},d(D){D&&w(e),H(i),H(o),H(a),H(f),M&&M.d(),T=!1,O()}}}function XE(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function QE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Application name"),s=E(),l=y("input"),h(e,"for",i=n[19]),h(l,"type","text"),h(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].meta.appName),r||(a=K(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&h(e,"for",i),f&524288&&o!==(o=u[19])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appName&&ue(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function xE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Application url"),s=E(),l=y("inpu
<div class="breadcrumb-item">Application</div></nav>`,t=E(),i=y("div"),s=y("form"),o.c(),h(e,"class","page-header"),h(s,"class","panel"),h(s,"autocomplete","off"),h(i,"class","wrapper")},m(m,_){S(m,e,_),S(m,t,_),S(m,i,_),v(i,s),d[l].m(s,null),r=!0,a||(u=K(s,"submit",at(n[4])),a=!0)},p(m,_){let g=l;l=p(m),l===g?d[l].p(m,_):(re(),P(d[g],1,1,()=>{d[g]=null}),ae(),o=d[l],o?o.p(m,_):(o=d[l]=f[l](m),o.c()),A(o,1),o.m(s,null))},i(m){r||(A(o),r=!0)},o(m){P(o),r=!1},d(m){m&&w(e),m&&w(t),m&&w(i),d[l].d(),a=!1,u()}}}function i6(n){let e,t,i,s;return e=new zi({}),i=new In({props:{$$slots:{default:[n6]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function s6(n,e,t){let i,s,l,o;Xe(n,Ds,M=>t(14,s=M)),Xe(n,So,M=>t(15,l=M)),Xe(n,Lt,M=>t(16,o=M)),ln(Lt,o="Application settings",o);let r={},a={},u=!1,f=!1,d="";p();async function p(){t(1,u=!0);try{const M=await pe.settings.getAll()||{};_(M)}catch(M){pe.errorResponseHandler(M)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const M=await pe.settings.update(j.filterRedactedProps(a));_(M),Jt("Successfully saved application settings.")}catch(M){pe.errorResponseHandler(M)}t(2,f=!1)}}function _(M={}){var D,I;ln(So,l=(D=M==null?void 0:M.meta)==null?void 0:D.appName,l),ln(Ds,s=!!((I=M==null?void 0:M.meta)!=null&&I.hideControls),s),t(0,a={meta:(M==null?void 0:M.meta)||{},logs:(M==null?void 0:M.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function g(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function b(){a.meta.appName=this.value,t(0,a)}function k(){a.meta.appUrl=this.value,t(0,a)}function $(){a.logs.maxDays=gt(this.value),t(0,a)}function C(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>g(),O=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,d=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=d!=JSON.stringify(a))},[a,u,f,i,m,g,r,d,b,k,$,C,T,O]}class l6 extends ve{constructor(e){super(),be(this,e,s6,i6,_e,{})}}function o6(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=je(l,s[o]);return{c(){e=y("input"),ai(e,l)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[7](e),ue(e,n[0]),t||(i=K(e,"input",n[8]),t=!0)},p(o,r){ai(e,l=St(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&ue(e,o[0])},d(o){o&&w(e),n[7](null),t=!1,i()}}}function r6(n){let e,t,i,s,l,o,r=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let u=0;u<r.length;u+=1)a=je(a,r[u]);return{c(){e=y("div"),t=y("button"),t.innerHTML='<i class="ri-key-line"></i>',i=E(),s=y("input"),h(t,"type","button"),h(t,"class","btn btn-transparent btn-circle"),h(e,"class","form-field-addon"),ai(s,a)},m(u,f){S(u,e,f),v(e,t),S(u,i,f),S(u,s,f),s.autofocus&&s.focus(),l||(o=[Ee(We.call(null,t,{position:"left",text:"Set new value"})),K(t,"click",n[6])],l=!0)},p(u,f){ai(s,a=St(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&w(e),u&&w(i),u&&w(s),l=!1,De(o)}}}function a6(n){let e;function t(l,o){return l[3]?r6:o6}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),S(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:Q,o:Q,d(l){s.d(l),l&&w(e)}}}function u6(n,e,t){const i=["value","mask"];let s=Qe(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await pn(),r==null||r.focus()}const f=()=>u();function d(m){se[m?"unshift":"push"](()=>{r=m,t(2,r)})}function p(){l=this.value,t(0,l)}return n.$$set=m=>{e=je(je({},e),Yt(m)),t(5,s=Qe(e,i)),"value"in m&&t(0,l=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,d,p]}class cu extends ve{constructor(e){super(),be(this,e,u6,a6,_e,{value:0,mask:1})}}function f6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g;return{c(){e=y("label"),t=U("Subject"),s=E(),l=y("input"),r=E(),a=y("div"),u=U(`Available placeholder paramete
`),f=y("button"),f.textContent=`{APP_NAME}
`,d=U(`,
`),p=y("button"),p.textContent=`{APP_URL}
`,m=U("."),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31]),h(l,"spellcheck","false"),l.required=!0,h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(a,"class","help-block")},m(b,k){S(b,e,k),v(e,t),S(b,s,k),S(b,l,k),ue(l,n[0].subject),S(b,r,k),S(b,a,k),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),_||(g=[K(l,"input",n[13]),K(f,"click",n[14]),K(p,"click",n[15])],_=!0)},p(b,k){k[1]&1&&i!==(i=b[31])&&h(e,"for",i),k[1]&1&&o!==(o=b[31])&&h(l,"id",o),k[0]&1&&l.value!==b[0].subject&&ue(l,b[0].subject)},d(b){b&&w(e),b&&w(s),b&&w(l),b&&w(r),b&&w(a),_=!1,De(g)}}}function c6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k;return{c(){e=y("label"),t=U("Action URL"),s=E(),l=y("input"),r=E(),a=y("div"),u=U(`Available placeholder parameters:
`),f=y("button"),f.textContent=`{APP_NAME}
`,d=U(`,
`),p=y("button"),p.textContent=`{APP_URL}
`,m=U(`,
`),_=y("button"),_.textContent=`{TOKEN}
`,g=U("."),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31]),h(l,"spellcheck","false"),l.required=!0,h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(_,"type","button"),h(_,"class","label label-sm link-primary txt-mono"),h(_,"title","Required parameter"),h(a,"class","help-block")},m($,C){S($,e,C),v(e,t),S($,s,C),S($,l,C),ue(l,n[0].actionUrl),S($,r,C),S($,a,C),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),v(a,_),v(a,g),b||(k=[K(l,"input",n[16]),K(f,"click",n[17]),K(p,"click",n[18]),K(_,"click",n[19])],b=!0)},p($,C){C[1]&1&&i!==(i=$[31])&&h(e,"for",i),C[1]&1&&o!==(o=$[31])&&h(l,"id",o),C[0]&1&&l.value!==$[0].actionUrl&&ue(l,$[0].actionUrl)},d($){$&&w(e),$&&w(s),$&&w(l),$&&w(r),$&&w(a),b=!1,De(k)}}}function d6(n){let e,t,i,s;return{c(){e=y("textarea"),h(e,"id",t=n[31]),h(e,"class","txt-mono"),h(e,"spellcheck","false"),h(e,"rows","14"),e.required=!0},m(l,o){S(l,e,o),ue(e,n[0].body),i||(s=K(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&h(e,"id",t),o[0]&1&&ue(e,l[0].body)},i:Q,o:Q,d(l){l&&w(e),i=!1,s()}}}function p6(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=Pt(o,r(n)),se.push(()=>he(e,"value",l))),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&V(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ye(()=>t=!1)),u[0]&16&&o!==(o=a[4])){if(e){re();const d=e;P(d.$$.fragment,1,0,()=>{H(d,1)}),ae()}o?(e=Pt(o,r(a)),se.push(()=>he(e,"value",l)),z(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&H(e,a)}}}function m6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,C,T;const O=[p6,d6],M=[];function D(I,L){return I[4]&&!I[5]?0:1}return l=D(n),o=M[l]=O[l](n),{c(){e=y("label"),t=U("Body (HTML)"),s=E(),o.c(),r=E(),a=y("div"),u=U(`Available placeholder parameters:
`),f=y("button"),f.textContent=`{APP_NAME}
`,d=U(`,
`),p=y("button"),p.textContent=`{APP_URL}
`,m=U(`,
`),_=y("button"),_.textContent=`{TOKEN}
`,g=U(`,
`),b=y("button"),b.textContent=`{ACTION_URL}
`,k=U("."),h(e,"for",i=n[31]),h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(_,"type","button"),h(_,"class","label label-sm link-primary txt-mono"),h(b,"type","button"),h(b,"class","label label-sm link-primary txt-mono"),h(b,"title","Required parameter"),h(a,"class","help-block")},m(I,L){S(I,e,L),v(e,t),S(I,s,L),M[l].m(I,L),S(I,r,L),S(I,a,L),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),v(a,_),v(a,g),v(a,b),v(a,k),$=!0,C||(T=[K(f,"click",n[22]),K(p,"click",n[23]),K(_,"click",n[24]),K(b,"click",n[25])],C=!0)},p(I,L){(!$||L[1]&1&&i!==(i=I[31]))&&h(e,"for",i);let F=l;l=D(I),l===F?M[l].p(I,L):(re(),P(M[F],1,1,()=>{M[F]=null}),ae(),o=M[l],o?o.p(I,L):(o=M[l]=O[l](I),o.c()),A(o,1),o.m(r.parentNode,r))},i(I){$||(A(o),$=!0)},o(I){P(o),$=!1},d(I){I&&w(e),I&&w(s),M[l].d(I),I&&w(r),I&&w(a),C=!1,De(T)}}}function h6(n){let e,t,i,s,l,o;return e=new de({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[f6,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[c6,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[m6,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(r,a){V(e,r,a),S(r,t,a),V(i,r,a),S(r,s,a),V(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const d={};a[0]&2&&(d.name=r[1]+".body"),a[0]&49|a[1]&3&&(d.$$scope={dirty:a,ctx:r}),l.$set(d)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){H(e,r),r&&w(t),H(i,r),r&&w(s),H(l,r)}}}function Th(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(We.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=He(e,Ut,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ut,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function _6(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Th();return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),l=U(n[2]),o=E(),r=y("div"),a=E(),f&&f.c(),u=Se(),h(t,"class","ri-draft-line"),h(s,"class","txt"),h(e,"class","inline-flex"),h(r,"class","flex-fill")},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),v(s,l),S(d,o,p),S(d,r,p),S(d,a,p),f&&f.m(d,p),S(d,u,p)},p(d,p){p[0]&4&&le(l,d[2]),d[6]?f?p[0]&64&&A(f,1):(f=Th(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(re(),P(f,1,1,()=>{f=null}),ae())},d(d){d&&w(e),d&&w(o),d&&w(r),d&&w(a),f&&f.d(d),d&&w(u)}}}function g6(n){let e,t;const i=[n[8]];let s={$$slots:{header:[_6],default:[h6]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=je(s,i[l]);return e=new co({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){z(e.$$.fragment)},m(l,o){V(e,l,o),t=!0},p(l,o){const r=o[0]&256?St(i,[Kt(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[26](null),H(e,l)}}}let Ch;function b6(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Qe(e,s),o;Xe(n,wi,X=>t(12,o=X));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,d=Ch,p=!1;function m(){f==null||f.expand()}function _(){f==null||f.collapse()}function g(){f==null||f.collapseSiblings()}async function b(){d||p||(t(5,p=!0),t(4,d=(await rt(()=>import("./CodeEditor-68eb45ba.js"),["./CodeEditor-68eb45ba.js","./index-c4d2d831.js"],import.meta.url)).default),Ch=d,t(5,p=!1))}function k(X){j.copyToClipboard(X),e1(`Copied ${X} to clipboard`,2e3)}b();function $(){u.subject=this.value,t(0,u)}const C=()=>k("{APP_NAME}"),T=()=>k("{APP_URL}");function O(){u.action
<span class="txt">Send test email</span>`,h(e,"type","button"),h(e,"class","btn btn-expanded btn-outline")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[26]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function j6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=E(),s=y("button"),l=y("span"),l.textContent="Save changes",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],h(l,"class","txt"),h(s,"type","submit"),h(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],x(s,"btn-loading",n[3])},m(u,f){S(u,e,f),v(e,t),S(u,i,f),S(u,s,f),v(s,l),r||(a=[K(e,"click",n[24]),K(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&x(s,"btn-loading",u[3])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,De(a)}}}function V6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b;const k=[O6,M6],$=[];function C(T,O){return T[2]?0:1}return p=C(n),m=$[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[5]),r=E(),a=y("div"),u=y("form"),f=y("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",d=E(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","content txt-xl m-b-base"),h(u,"class","panel"),h(u,"autocomplete","off"),h(a,"class","wrapper")},m(T,O){S(T,e,O),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(T,r,O),S(T,a,O),v(a,u),v(u,f),v(u,d),$[p].m(u,null),_=!0,g||(b=K(u,"submit",at(n[27])),g=!0)},p(T,O){(!_||O[0]&32)&&le(o,T[5]);let M=p;p=C(T),p===M?$[p].p(T,O):(re(),P($[M],1,1,()=>{$[M]=null}),ae(),m=$[p],m?m.p(T,O):(m=$[p]=k[p](T),m.c()),A(m,1),m.m(u,null))},i(T){_||(A(m),_=!0)},o(T){P(m),_=!1},d(T){T&&w(e),T&&w(r),T&&w(a),$[p].d(),g=!1,b()}}}function H6(n){let e,t,i,s,l,o;e=new zi({}),i=new In({props:{$$slots:{default:[V6]},$$scope:{ctx:n}}});let r={};return l=new C6({props:r}),n[28](l),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){V(e,a,u),S(a,t,u),V(i,a,u),S(a,s,u),V(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};l.$set(d)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&w(t),H(i,a),a&&w(s),n[28](null),H(l,a)}}}function z6(n,e,t){let i,s,l;Xe(n,Lt,ne=>t(5,l=ne));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];ln(Lt,l="Mail settings",l);let a,u={},f={},d=!1,p=!1;m();async function m(){t(2,d=!0);try{const ne=await pe.settings.getAll()||{};g(ne)}catch(ne){pe.errorResponseHandler(ne)}t(2,d=!1)}async function _(){if(!(p||!s)){t(3,p=!0);try{const ne=await pe.settings.update(j.filterRedactedProps(f));g(ne),mn({}),Jt("Successfully saved mail settings.")}catch(ne){pe.errorResponseHandler(ne)}t(3,p=!1)}}function g(ne={}){t(0,f={meta:(ne==null?void 0:ne.meta)||{},smtp:(ne==null?void 0:ne.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function b(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function k(){f.meta.senderName=this.value,t(0,f)}function $(){f.meta.senderAddress=this.value,t(0,f)}function C(ne){n.$$.not_equal(f.meta.verificationTemplate,ne)&&(f.meta.verificationTemplate=ne,t(0,f))}function T(ne){n.$$.not_equal(f.meta.resetPasswordTemplate,ne)&&(f.meta.resetPasswordTemplate=ne,t(0,f))}function O(ne){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ne)&&(f.meta.confirmEmailChangeTemplate=ne,t(0,f))}function M(){f.smtp.enabled=this.checked,t(0,f)}function D(){f.smtp.host=this.value,t(0,f)}function I(){f.smtp.port=gt(this.value),t(0,f)}function L(ne){n.$$.not_equal(f.smtp.tls,ne)&&(f.smtp.tls=ne,t(0,f))}function F(ne){n.$$.not_equal(f.smtp.authMethod,ne)&&(f.smtp.authMethod=ne,t(0,f))}function q(){f.smtp.username=this.value,t(0,f)}function N(ne){n.$$.not_equal(f.smtp.password,ne)&&(f.smtp.password=ne,t(0,f))}const R=()=>b(),Y=()=>_(),B=()=>a==null?v
the
`),r=y("strong"),u=U(a),f=U(`
to the
`),d=y("strong"),m=U(p),_=U(`.
`),g=y("br"),b=U(`
There are numerous command line tools that can help you, such as:
`),k=y("a"),k.textContent=`rclone
`,$=U(`,
`),C=y("a"),C.textContent=`s5cmd
`,T=U(", etc."),O=E(),M=y("div"),h(i,"class","icon"),h(k,"href","https://github.com/rclone/rclone"),h(k,"target","_blank"),h(k,"rel","noopener noreferrer"),h(k,"class","txt-bold"),h(C,"href","https://github.com/peak/s5cmd"),h(C,"target","_blank"),h(C,"rel","noopener noreferrer"),h(C,"class","txt-bold"),h(l,"class","content"),h(t,"class","alert alert-warning m-0"),h(M,"class","clearfix m-t-base")},m(F,q){S(F,e,q),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(l,r),v(r,u),v(l,f),v(l,d),v(d,m),v(l,_),v(l,g),v(l,b),v(l,k),v(l,$),v(l,C),v(l,T),v(e,O),v(e,M),I=!0},p(F,q){var N;(!I||q&1)&&a!==(a=(N=F[0].s3)!=null&&N.enabled?"S3 storage":"local file system")&&le(u,a),(!I||q&2)&&p!==(p=F[1].s3.enabled?"S3 storage":"local file system")&&le(m,p)},i(F){I||(F&&nt(()=>{I&&(D||(D=He(e,kt,{duration:150},!0)),D.run(1))}),I=!0)},o(F){F&&(D||(D=He(e,kt,{duration:150},!1)),D.run(0)),I=!1},d(F){F&&w(e),F&&D&&D.end()}}}function Ih(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,C,T,O,M;return i=new de({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[K6,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[J6,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field required",name:"s3.region",$$slots:{default:[Z6,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),p=new de({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[G6,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),g=new de({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[X6,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),$=new de({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[Q6,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),a=y("div"),z(u.$$.fragment),f=E(),d=y("div"),z(p.$$.fragment),m=E(),_=y("div"),z(g.$$.fragment),b=E(),k=y("div"),z($.$$.fragment),C=E(),T=y("div"),h(t,"class","col-lg-6"),h(l,"class","col-lg-3"),h(a,"class","col-lg-3"),h(d,"class","col-lg-6"),h(_,"class","col-lg-6"),h(k,"class","col-lg-12"),h(T,"class","col-lg-12"),h(e,"class","grid")},m(D,I){S(D,e,I),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,r),v(e,a),V(u,a,null),v(e,f),v(e,d),V(p,d,null),v(e,m),v(e,_),V(g,_,null),v(e,b),v(e,k),V($,k,null),v(e,C),v(e,T),M=!0},p(D,I){const L={};I&100663298&&(L.$$scope={dirty:I,ctx:D}),i.$set(L);const F={};I&100663298&&(F.$$scope={dirty:I,ctx:D}),o.$set(F);const q={};I&100663298&&(q.$$scope={dirty:I,ctx:D}),u.$set(q);const N={};I&100663298&&(N.$$scope={dirty:I,ctx:D}),p.$set(N);const R={};I&100663298&&(R.$$scope={dirty:I,ctx:D}),g.$set(R);const Y={};I&100663298&&(Y.$$scope={dirty:I,ctx:D}),$.$set(Y)},i(D){M||(A(i.$$.fragment,D),A(o.$$.fragment,D),A(u.$$.fragment,D),A(p.$$.fragment,D),A(g.$$.fragment,D),A($.$$.fragment,D),D&&nt(()=>{M&&(O||(O=He(e,kt,{duration:150},!0)),O.run(1))}),M=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(u.$$.fragment,D),P(p.$$.fragment,D),P(g.$$.fragment,D),P($.$$.fragment,D),D&&(O||(O=He(e,kt,{duration:150},!1)),O.run(0)),M=!1},d(D){D&&w(e),H(i),H(o),H(u),H(p),H(g),H($),D&&O&&O.end()}}}function K6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Endpoint"),s=E(),l=y("input"),h(e,"for",i=n[25]),h(l,"type","text"),h(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.endpoint),r||(a=K(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&h(e,"for",i),f&33554432&&o!==(o=u[25])&&h(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&ue(l,u[1].s3.endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function J6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Bucket"),s=E(),l=y("input"),h(e,"for",i=n[25]),h(l,"type","text"),h(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.bucket),r||(a=K(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[2
<span class="txt">S3 connected successfully</span>`,h(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function eA(n){let e,t,i,s;return{c(){e=y("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,h(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=Ee(t=We.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&jt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&w(e),i=!1,s()}}}function tA(n){let e;return{c(){e=y("span"),h(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function Lh(n){let e,t,i,s;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),v(e,t),i||(s=K(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function nA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b;const k=[W6,U6],$=[];function C(T,O){return T[2]?0:1}return p=C(n),m=$[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[7]),r=E(),a=y("div"),u=y("form"),f=y("div"),f.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,d=E(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","content txt-xl m-b-base"),h(u,"class","panel"),h(u,"autocomplete","off"),h(a,"class","wrapper")},m(T,O){S(T,e,O),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(T,r,O),S(T,a,O),v(a,u),v(u,f),v(u,d),$[p].m(u,null),_=!0,g||(b=K(u,"submit",at(n[20])),g=!0)},p(T,O){(!_||O&128)&&le(o,T[7]);let M=p;p=C(T),p===M?$[p].p(T,O):(re(),P($[M],1,1,()=>{$[M]=null}),ae(),m=$[p],m?m.p(T,O):(m=$[p]=k[p](T),m.c()),A(m,1),m.m(u,null))},i(T){_||(A(m),_=!0)},o(T){P(m),_=!1},d(T){T&&w(e),T&&w(r),T&&w(a),$[p].d(),g=!1,b()}}}function iA(n){let e,t,i,s;return e=new zi({}),i=new In({props:{$$slots:{default:[nA]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}const lo="s3_test_request";function sA(n,e,t){let i,s,l;Xe(n,Lt,N=>t(7,l=N)),ln(Lt,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,d=null,p=null;m();async function m(){t(2,a=!0);try{const N=await pe.settings.getAll()||{};g(N)}catch(N){pe.errorResponseHandler(N)}t(2,a=!1)}async function _(){if(!(u||!s)){t(3,u=!0);try{pe.cancelRequest(lo);const N=await pe.settings.update(j.filterRedactedProps(r));mn({}),await g(N),Aa(),d?cy("Successfully saved but failed to establish S3 connection."):Jt("Successfully saved files storage settings.")}catch(N){pe.errorResponseHandler(N)}t(3,u=!1)}}async function g(N={}){t(1,r={s3:(N==null?void 0:N.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await k()}async function b(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await k()}async function k(){if(t(5,d=null),!!r.s3.enabled){pe.cancelRequest(lo),clearTimeout(p),p=setTimeout(()=>{pe.cancelRequest(lo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await pe.settings.testS3({$cancelKey:lo})}catch(N){t(5,d=N)}t(4,f=!1),clearTimeout(p)}}Gt(()=>()=>{clearTimeout(p)});function $(){r.s3.enabled=this.checked,t(1,r)}function C(){r.s3.endpoint=this.value,t(1,r)}function T(){r.s3.bucket=this.value,t(1,r)}function O(){r.s3.region=this.value,t(1,r)}function M(){r.s3.accessKey=this.value,t(1,r)}function D(N){n.$$.not_equal(r.s3.secret,N)&&(r.s3.secret=N,t(1,r))}function I(){r.s3.forcePathStyle=this.checked,t(1,r)}const L=()=>b(),F=()=>_(),q=()=>_();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,d,s,l,_,b,i,$,C,T,O,M,D,I,L,F,q]}class lA extends ve{constructor(e){super(),be(this,e,sA,iA,_e,{})}}function oA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[20]),h(s,"for",o=n[20])},m(u,f){S(u,e,f),e.checked=n[1].enabled,S(u,i,f),S(u,s,f),v(s,l),r||(a=K(e,"change",n[11]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&h(e,"id",t),f&2&&(e.checked=u[1].enabled),f&1048576&&o!==(o=u[20])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function rA(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=U("Client ID"),s=E(),l=y("input"),h(e,"for",i=n[20]),h(l,"type","text"),h(l,"id",o=n[20]),l.required=r=n[1].enabled},m(f,d){S(f,e,d),v(e,t),S(f,s,d),S(f,l,d),ue(l,n[1].clientId),a||(u=K(l,"input",n[12]),a=!0)},p(f,d){d&1048576&&i!==(i=f[20])&&h(e,"for",i),d&1048576&&o!==(o=f[20])&&h(l,"id",o),d&2&&r!==(r=f[1].enabled)&&(l.required=r),d&2&&l.value!==f[1].clientId&&ue(l,f[1].clientId)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function aA(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(u.value=n[1].clientSecret),l=new cu({props:u}),se.push(()=>he(l,"value",a)),{c(){e=y("label"),t=U("Client secret"),s=E(),z(l.$$.fragment),h(e,"for",i=n[20])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d&1048576&&i!==(i=f[20]))&&h(e,"for"
another PocketBase environment.</p>`,t=E(),i=y("div"),s=y("button"),s.innerHTML='<span class="txt">Copy</span>',l=E(),z(o.$$.fragment),r=E(),a=y("div"),u=y("div"),f=E(),d=y("button"),d.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,h(e,"class","content txt-xl m-b-base"),h(s,"type","button"),h(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),h(i,"tabindex","0"),h(i,"class","export-preview svelte-jm5c4z"),h(u,"class","flex-fill"),h(d,"type","button"),h(d,"class","btn btn-expanded"),h(a,"class","flex m-t-base")},m(g,b){S(g,e,b),S(g,t,b),S(g,i,b),v(i,s),v(i,l),V(o,i,null),n[8](i),S(g,r,b),S(g,a,b),v(a,u),v(a,f),v(a,d),p=!0,m||(_=[K(s,"click",n[7]),K(i,"keydown",n[9]),K(d,"click",n[10])],m=!0)},p(g,b){const k={};b&4&&(k.content=g[2]),o.$set(k)},i(g){p||(A(o.$$.fragment,g),p=!0)},o(g){P(o.$$.fragment,g),p=!1},d(g){g&&w(e),g&&w(t),g&&w(i),H(o),n[8](null),g&&w(r),g&&w(a),m=!1,De(_)}}}function PA(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function LA(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=[PA,IA],_=[];function g(b,k){return b[1]?0:1}return f=g(n),d=_[f]=m[f](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[3]),r=E(),a=y("div"),u=y("div"),d.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(u,"class","panel"),h(a,"class","wrapper")},m(b,k){S(b,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(b,r,k),S(b,a,k),v(a,u),_[f].m(u,null),p=!0},p(b,k){(!p||k&8)&&le(o,b[3]);let $=f;f=g(b),f===$?_[f].p(b,k):(re(),P(_[$],1,1,()=>{_[$]=null}),ae(),d=_[f],d?d.p(b,k):(d=_[f]=m[f](b),d.c()),A(d,1),d.m(u,null))},i(b){p||(A(d),p=!0)},o(b){P(d),p=!1},d(b){b&&w(e),b&&w(r),b&&w(a),_[f].d()}}}function NA(n){let e,t,i,s;return e=new zi({}),i=new In({props:{$$slots:{default:[LA]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function FA(n,e,t){let i,s;Xe(n,Lt,b=>t(3,s=b)),ln(Lt,s="Export collections",s);const l="export_"+j.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await pe.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let b of r)delete b.created,delete b.updated}catch(b){pe.errorResponseHandler(b)}t(1,a=!1)}function f(){j.downloadJson(r,"pb_schema")}function d(){j.copyToClipboard(i),e1("The configuration was copied to your clipboard!",3e3)}const p=()=>d();function m(b){se[b?"unshift":"push"](()=>{o=b,t(0,o)})}const _=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const k=window.getSelection(),$=document.createRange();$.selectNodeContents(o),k.removeAllRanges(),k.addRange($)}},g=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,d,r,p,m,_,g]}class RA extends ve{constructor(e){super(),be(this,e,FA,NA,_e,{})}}function Jh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Zh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Gh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Xh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Qh(n,e,t){const i=n.slice();return i[14]=e[t],i}function xh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function e_(n,e,t){const i=n.slice();return i[30]=e[t],i}function qA(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&t_(),a=n[0].name!==n[1].name&&n_(n);return{c(){e=y("div"),r&&r.c(),t=E(),a&&a.c(),i=E(),s=y("strong"),o=U(l),h(s,"class","txt"),h(e,"class","inline-flex fleg-gap-5")},m(u,f){S(u,e,f),r&&r.m(e,null),v(e,t),a&&a.m(e,null),v(e,i),v(e,s),v(s,o)},p(u,f){u[9]?r||(r=t_(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=n_(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&le(o,l)},d(u){u&&w(e),r&&r.d(),a&&a.d()}}}function jA(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=y("span"),e.textContent="Deleted",t=E(),i=y("strong"),l=U(s),h(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),v(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=
<th width="10%" class="svelte-lmkr38">Old</th>
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=E(),o=y("tbody");for(let T=0;T<_.length;T+=1)_[T].c();r=E(),g&&g.c(),a=E();for(let T=0;T<k.length;T+=1)k[T].c();u=E();for(let T=0;T<C.length;T+=1)C[T].c();h(e,"class","section-title"),h(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(T,O){S(T,e,O),p.m(e,null),S(T,t,O),S(T,i,O),v(i,s),v(i,l),v(i,o);for(let M=0;M<_.length;M+=1)_[M]&&_[M].m(o,null);v(o,r),g&&g.m(o,null),v(o,a);for(let M=0;M<k.length;M+=1)k[M]&&k[M].m(o,null);v(o,u);for(let M=0;M<C.length;M+=1)C[M]&&C[M].m(o,null)},p(T,O){if(d===(d=f(T))&&p?p.p(T,O):(p.d(1),p=d(T),p&&(p.c(),p.m(e,null))),O[0]&7203){m=T[11];let M;for(M=0;M<m.length;M+=1){const D=e_(T,m,M);_[M]?_[M].p(D,O):(_[M]=i_(D),_[M].c(),_[M].m(o,r))}for(;M<_.length;M+=1)_[M].d(1);_.length=m.length}if(T[2]||T[5]?g?g.p(T,O):(g=s_(T),g.c(),g.m(o,a)):g&&(g.d(1),g=null),O[0]&4248){b=T[7];let M;for(M=0;M<b.length;M+=1){const D=Gh(T,b,M);k[M]?k[M].p(D,O):(k[M]=u_(D),k[M].c(),k[M].m(o,u))}for(;M<k.length;M+=1)k[M].d(1);k.length=b.length}if(O[0]&4352){$=T[8];let M;for(M=0;M<$.length;M+=1){const D=Jh(T,$,M);C[M]?C[M].p(D,O):(C[M]=c_(D),C[M].c(),C[M].m(o,null))}for(;M<C.length;M+=1)C[M].d(1);C.length=$.length}},i:Q,o:Q,d(T){T&&w(e),p.d(),T&&w(t),T&&w(i),dt(_,T),g&&g.d(),dt(k,T),dt(C,T)}}}function Vn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function gn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function zA(n,e,t){let i,s,l,{collectionA:o=new kn}=e,{collectionB:r=new kn}=e,{deleteMissing:a=!1}=e,u=[],f=[],d=[],p=[],m=[];const _=Object.keys(new kn().$export()).filter(k=>!["schema","created","updated"].includes(k));function g(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(k=>!f.find($=>k.id==$.id))))}function b(k){return typeof k>"u"?"":j.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,o=k.collectionA),"collectionB"in k&&t(1,r=k.collectionB),"deleteMissing"in k&&t(2,a=k.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&g(),n.$$.dirty[0]&24&&t(6,d=u.filter(k=>!f.find($=>k.id==$.id))),n.$$.dirty[0]&24&&t(7,p=f.filter(k=>u.find($=>$.id==k.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(k=>!u.find($=>$.id==k.id))),n.$$.dirty[0]&7&&t(9,l=j.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,d,p,m,l,s,_,b]}class BA extends ve{constructor(e){super(),be(this,e,zA,HA,_e,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function d_(n,e,t){const i=n.slice();return i[17]=e[t],i}function p_(n){let e,t;return e=new BA({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function UA(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=p_(d_(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Se()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=d_(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=p_(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){dt(s,o),o&&w(e)}}}function WA(n){let e;return{c(){e=y("h4"),e.textContent="Side-by-side diff",h(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function YA(n){let e,t,i,s,l,o,r;return{c(){e=y("button"),t=U("Close"),i=E(),s=y("button"),l=y("span"),l.textContent="Confirm and import",h(e,"type","button"),h(e,"class","btn btn-t
- ${T.join(`
- `)}`,()=>{_()}):_()}async function _(){if(!u){t(4,u=!0);try{await pe.collections.import(o,a),Jt("Successfully imported collections configuration."),i("submit")}catch(T){pe.errorResponseHandler(T)}t(4,u=!1),d()}}const g=()=>m(),b=()=>!u;function k(T){se[T?"unshift":"push"](()=>{s=T,t(1,s)})}function $(T){me.call(this,n,T)}function C(T){me.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&p()},[d,s,r,a,u,m,f,l,o,g,b,k,$,C]}class ZA extends ve{constructor(e){super(),be(this,e,JA,KA,_e,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function m_(n,e,t){const i=n.slice();return i[32]=e[t],i}function h_(n,e,t){const i=n.slice();return i[35]=e[t],i}function __(n,e,t){const i=n.slice();return i[32]=e[t],i}function GA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,C,T,O,M,D;a=new de({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[QA,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let I=!1,L=n[6]&&n[1].length&&!n[7]&&b_(),F=n[6]&&n[1].length&&n[7]&&v_(n),q=n[13].length&&E_(n),N=!!n[0]&&A_(n);return{c(){e=y("input"),t=E(),i=y("div"),s=y("p"),l=U(`Paste below the collections configuration you want to import or
`),o=y("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=E(),z(a.$$.fragment),u=E(),f=E(),L&&L.c(),d=E(),F&&F.c(),p=E(),q&&q.c(),m=E(),_=y("div"),N&&N.c(),g=E(),b=y("div"),k=E(),$=y("button"),C=y("span"),C.textContent="Review",h(e,"type","file"),h(e,"class","hidden"),h(e,"accept",".json"),h(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),h(i,"class","content txt-xl m-b-base"),h(b,"class","flex-fill"),h(C,"class","txt"),h($,"type","button"),h($,"class","btn btn-expanded btn-warning m-l-auto"),$.disabled=T=!n[14],h(_,"class","flex m-t-base")},m(R,Y){S(R,e,Y),n[19](e),S(R,t,Y),S(R,i,Y),v(i,s),v(s,l),v(s,o),S(R,r,Y),V(a,R,Y),S(R,u,Y),S(R,f,Y),L&&L.m(R,Y),S(R,d,Y),F&&F.m(R,Y),S(R,p,Y),q&&q.m(R,Y),S(R,m,Y),S(R,_,Y),N&&N.m(_,null),v(_,g),v(_,b),v(_,k),v(_,$),v($,C),O=!0,M||(D=[K(e,"change",n[20]),K(o,"click",n[21]),K($,"click",n[26])],M=!0)},p(R,Y){(!O||Y[0]&4096)&&x(o,"btn-loading",R[12]);const B={};Y[0]&64&&(B.class="form-field "+(R[6]?"":"field-error")),Y[0]&65|Y[1]&1536&&(B.$$scope={dirty:Y,ctx:R}),a.$set(B),R[6]&&R[1].length&&!R[7]?L||(L=b_(),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),R[6]&&R[1].length&&R[7]?F?F.p(R,Y):(F=v_(R),F.c(),F.m(p.parentNode,p)):F&&(F.d(1),F=null),R[13].length?q?q.p(R,Y):(q=E_(R),q.c(),q.m(m.parentNode,m)):q&&(q.d(1),q=null),R[0]?N?N.p(R,Y):(N=A_(R),N.c(),N.m(_,g)):N&&(N.d(1),N=null),(!O||Y[0]&16384&&T!==(T=!R[14]))&&($.disabled=T)},i(R){O||(A(a.$$.fragment,R),A(I),O=!0)},o(R){P(a.$$.fragment,R),P(I),O=!1},d(R){R&&w(e),n[19](null),R&&w(t),R&&w(i),R&&w(r),H(a,R),R&&w(u),R&&w(f),L&&L.d(R),R&&w(d),F&&F.d(R),R&&w(p),q&&q.d(R),R&&w(m),R&&w(_),N&&N.d(),M=!1,De(D)}}}function XA(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function g_(n){let e;return{c(){e=y("div"),e.textContent="Invalid collections configuration.",h(e,"class","help-block help-block-error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function QA(n){let e,t,i,s,l,o,r,a,u,f,d=!!n[0]&&!n[6]&&g_();return{c(){e=y("label"),t=U("Collections"),s=E(),l=y("textarea"),r=E(),d&&d.c(),a=Se(),h(e,"for",i=n[40]),h(e,"class","p-b-10"),h(l,"id",o=n[40]),h(l,"class","code"),h(l,"spellcheck","false"),h(l,"rows","15"),l.required=!0},m(p,m){S(p,e,m),v(e,t),S(p,s,m),S(p,l,m),ue(l,n[0]),S(p,r,m),d&&d.m(p,m),S(p,a,m),u||(f=K(l,"input",n[22]),u=!0)},p(p,m){m[1]&512&&i!==(i=p[40])&&h(e,"for",i),m[1]&512&&o!==(o=p[40])&&h(l,"id",o),m[0]&1&&ue(l,p[0]),p[0]&&!p[6]?d||(d=g_(),d.c(),d.m(a.parentNode,a)):d&&(d.d(1),d=null)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(r),d&&d.d(p),p&&w(a),u=!1,f()}}}function b_(n){let e;return{c(){e=y("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,h(e,"class","alert alert-info")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function v_(n){let e,t,i,s,l,o=n[9].length&&y_(n),r=n[4].length&&S_(n),a=n[8].length&&M_(n);return{c(){e=y("h5"),e.textContent="Detected changes",t=E(),i=y("div"),o&&o.c(),s=E(),r&&r.c(),l=E(),a&&a.c(),h(e,"class","section-title"),h(i,"class","list")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),o&&o.m(i,null),v(i,s),r&&r.m(i,null),v(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=y_(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=S_(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=M_(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),u&&w(t),u&&w(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function y_(n){let e=[],t=new Map,i,s=n[9];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=__(n,s,o),a=l(r);t.set(a,e[o]=w_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Se()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=yt(e,r,l,1,o,s,t,i.parentNode,as,w_,i,__))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function k_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=y("small"),t=U("("),s=U(i),l=U(")"),h(e,"class","txt-hint")},m(o,r){S(o,e,r),v(e,t),v(e,s),v(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function w_(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&k_(e);return{key:n,first:null,c(){t=y("div"),i=y("span"),i.textContent="Deleted",s=E(),l=y("strong"),r=U(o),a=E(),f&&f.c(),u=E(),h(i,"class","label label-danger list-label svelte-1jx20fl"),h(t,"class","list-item"),this.first=t},m(d,p){S(d,t,p),v(t,i),v(t,s),v(t,l),v(l,r),v(t,a),f&&f.m(t,null),v(t,u)},p(d,p){e=d,p[0]&512&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,p):(f=k_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(d){d&&w(t),f&&f.d()}}}function S_(n){let e=[],t=new Map,i,s=n[4];const l=o=>o[35].old.id+o[35].new.id;for(let o=0;o<s.length;o+=1){let r=h_(n,s,o),a=l(r);t.set(a,e[o]=C_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Se()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=yt(e,r,l,1,o,s,t,i.parentNode,as,C_,i,h_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function $_(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=y("strong"),i=U(t),s=E(),l=y("i"),h(e,"class","txt-strikethrough txt-hint"),h(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),v(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&le(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function T_(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=y("small"),t=U("("),s=U(i),l=U(")"),h(e,"class","txt-hint")},m(o,r){S(o,e,r),v(e,t),v(e,s),v(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&le(s,i)},d(o){o&&w(e)}}}function C_(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,d,p=e[35].old.name!==e[35].new.name&&$_(e),m=e[35].new.id&&T_(e);return{key:n,first:null,c(){t=y("div"),i=y("span"),i.textContent="Changed",s=E(),l=y("div"),p&&p.c(),o=E(),r=y("strong"),u=U(a),f=E(),m&&m.c(),d=E(),h(i,"class","label label-warning list-label svelte-1jx20fl"),h(l,"class","inline-flex flex-gap-5"),h(t,"class","list-item"),this.first=t},m(_,g){S(_,t,g),v(t,i),v(t,s),v(t,l),p&&p.m(l,null),v(l,o),v(l,r),v(r,u),v(l,f),m&&m.m(l,null),v(t,d)},p(_,g){e=_,e[35].old.name!==e[35].new.name?p?p.p(e,g):(p=$_(e),p.c(),p.m(l,o)):p&&(p.d(1),p=null),g[0]&16&&a!==(a=e[35].new.name+"")&&le(u,a),e[35].new.id?m?m.p(e,g):(m=T_(e),m.c(),m.m(l,null)):m&&(m.d(1),m=null)},d(_){_&&w(t),p&&p.d(),m&&m.d()}}}function M_(n){let e=[],t=new Map,i,s=n[8];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=m_(n,s,o),a=l(r);t.set(a,e[o]=D_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Se()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=yt(e,r,l,1,o,s,t,i.parentNode,as,D_,i,m_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function O_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=y("small"),t=U("("),s=U(i),l=U(")"),h(e,"class","txt-hint")},m(o,r){S(o,e,r
imported with different IDs. You can replace them in the import if you want
to.</string>`,l=E(),o=y("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',h(t,"class","icon"),h(s,"class","content"),h(o,"type","button"),h(o,"class","btn btn-warning btn-sm btn-outline"),h(e,"class","alert alert-warning m-t-base")},m(u,f){S(u,e,f),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),r||(a=K(o,"click",n[24]),r=!0)},p:Q,d(u){u&&w(e),r=!1,a()}}}function A_(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear</span>',h(e,"type","button"),h(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[25]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function xA(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=[XA,GA],_=[];function g(b,k){return b[5]?0:1}return f=g(n),d=_[f]=m[f](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[15]),r=E(),a=y("div"),u=y("div"),d.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(u,"class","panel"),h(a,"class","wrapper")},m(b,k){S(b,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(b,r,k),S(b,a,k),v(a,u),_[f].m(u,null),p=!0},p(b,k){(!p||k[0]&32768)&&le(o,b[15]);let $=f;f=g(b),f===$?_[f].p(b,k):(re(),P(_[$],1,1,()=>{_[$]=null}),ae(),d=_[f],d?d.p(b,k):(d=_[f]=m[f](b),d.c()),A(d,1),d.m(u,null))},i(b){p||(A(d),p=!0)},o(b){P(d),p=!1},d(b){b&&w(e),b&&w(r),b&&w(a),_[f].d()}}}function eI(n){let e,t,i,s,l,o;e=new zi({}),i=new In({props:{$$slots:{default:[xA]},$$scope:{ctx:n}}});let r={};return l=new ZA({props:r}),n[27](l),l.$on("submit",n[28]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){V(e,a,u),S(a,t,u),V(i,a,u),S(a,s,u),V(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};l.$set(d)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&w(t),H(i,a),a&&w(s),n[27](null),H(l,a)}}}function tI(n,e,t){let i,s,l,o,r,a,u;Xe(n,Lt,X=>t(15,u=X)),ln(Lt,u="Import collections",u);let f,d,p="",m=!1,_=[],g=[],b=!0,k=[],$=!1;C();async function C(){t(5,$=!0);try{t(2,g=await pe.collections.getFullList(200));for(let X of g)delete X.created,delete X.updated}catch(X){pe.errorResponseHandler(X)}t(5,$=!1)}function T(){if(t(4,k=[]),!!i)for(let X of _){const fe=j.findByKey(g,"id",X.id);!(fe!=null&&fe.id)||!j.hasCollectionChanges(fe,X,b)||k.push({new:X,old:fe})}}function O(){t(1,_=[]);try{t(1,_=JSON.parse(p))}catch{}Array.isArray(_)?t(1,_=j.filterDuplicatesByKey(_)):t(1,_=[]);for(let X of _)delete X.created,delete X.updated,X.schema=j.filterDuplicatesByKey(X.schema)}function M(){var X,fe;for(let G of _){const ce=j.findByKey(g,"name",G.name)||j.findByKey(g,"id",G.id);if(!ce)continue;const ge=G.id,Me=ce.id;G.id=Me;const Ve=Array.isArray(ce.schema)?ce.schema:[],ze=Array.isArray(G.schema)?G.schema:[];for(const we of ze){const Ce=j.findByKey(Ve,"name",we.name);Ce&&Ce.id&&(we.id=Ce.id)}for(let we of _)if(Array.isArray(we.schema))for(let Ce of we.schema)(X=Ce.options)!=null&&X.collectionId&&((fe=Ce.options)==null?void 0:fe.collectionId)===ge&&(Ce.options.collectionId=Me)}t(0,p=JSON.stringify(_,null,4))}function D(X){t(12,m=!0);const fe=new FileReader;fe.onload=async G=>{t(12,m=!1),t(10,f.value="",f),t(0,p=G.target.result),await pn(),_.length||(hl("Invalid collections configuration."),I())},fe.onerror=G=>{console.warn(G),hl("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},fe.readAsText(X)}function I(){t(0,p=""),t(10,f.value="",f),mn({})}function L(X){se[X?"unshift":"push"](()=>{f=X,t(10,f)})}const F=()=>{f.files.length&&D(f.files[0])},q=()=>{f.click()};function N(){p=this.value,t(0,p)}function R(){b=this.checked,t(3,b)}const Y=()=>M(),B=()=>I(),Z=()=>d==null?void 0:d.show(g,_,b);function ee(X){se[X?"unshift":"push"](()=>{d=X,t(11,d)})}const ne=()=>I();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof p<"u"&&O(),n.$$.dirty[0]&3&&t(6,i=!!p&&_.length&&_.length===_.filter(X=>!!X.id&&!!X.name).length),n.$$.dirty[0]&78&&t(9,s=g.filter(X=>i&&b&&!j.findByKey(_,"id"
<span class="txt">Manage admins</span>`,t=E(),i=y("hr"),s=E(),l=y("button"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,h(e,"href","/settings/admins"),h(e,"class","dropdown-item closable"),h(l,"type","button"),h(l,"class","dropdown-item closable")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),S(a,s,u),S(a,l,u),o||(r=[Ee(an.call(null,e)),K(l,"click",n[7])],o=!0)},p:Q,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,De(r)}}}function N_(n){let e,t,i;return t=new fu({props:{scriptSrc:"./libs/tinymce/tinymce.min.js",conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","tinymce-preloader hidden")},m(s,l){S(s,e,l),V(t,e,null),i=!0},p:Q,i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function bI(n){var b;let e,t,i,s,l,o,r,a,u,f,d,p,m;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let _=((b=n[0])==null?void 0:b.id)&&n[1]&&L_(n);o=new Kb({props:{routes:iI}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new cI({}),f=new _I({});let g=n[1]&&!n[2]&&N_(n);return{c(){t=E(),i=y("div"),_&&_.c(),s=E(),l=y("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),d=E(),g&&g.c(),p=Se(),h(l,"class","app-body"),h(i,"class","app-layout")},m(k,$){S(k,t,$),S(k,i,$),_&&_.m(i,null),v(i,s),v(i,l),V(o,l,null),v(l,r),V(a,l,null),S(k,u,$),V(f,k,$),S(k,d,$),g&&g.m(k,$),S(k,p,$),m=!0},p(k,[$]){var C;(!m||$&24)&&e!==(e=j.joinNonEmpty([k[4],k[3],"PocketBase"]," - "))&&(document.title=e),(C=k[0])!=null&&C.id&&k[1]?_?(_.p(k,$),$&3&&A(_,1)):(_=L_(k),_.c(),A(_,1),_.m(i,s)):_&&(re(),P(_,1,1,()=>{_=null}),ae()),k[1]&&!k[2]?g?(g.p(k,$),$&6&&A(g,1)):(g=N_(k),g.c(),A(g,1),g.m(p.parentNode,p)):g&&(re(),P(g,1,1,()=>{g=null}),ae())},i(k){m||(A(_),A(o.$$.fragment,k),A(a.$$.fragment,k),A(f.$$.fragment,k),A(g),m=!0)},o(k){P(_),P(o.$$.fragment,k),P(a.$$.fragment,k),P(f.$$.fragment,k),P(g),m=!1},d(k){k&&w(t),k&&w(i),_&&_.d(),H(o),H(a),k&&w(u),H(f,k),k&&w(d),g&&g.d(k),k&&w(p)}}}function vI(n,e,t){let i,s,l,o;Xe(n,Ds,g=>t(10,i=g)),Xe(n,So,g=>t(3,s=g)),Xe(n,Pa,g=>t(0,l=g)),Xe(n,Lt,g=>t(4,o=g));let r,a=!1,u=!1;function f(g){var b,k,$,C;((b=g==null?void 0:g.detail)==null?void 0:b.location)!==r&&(t(1,a=!!(($=(k=g==null?void 0:g.detail)==null?void 0:k.userData)!=null&&$.showAppSidebar)),r=(C=g==null?void 0:g.detail)==null?void 0:C.location,ln(Lt,o="",o),mn({}),sb())}function d(){qi("/")}async function p(){var g,b;if(l!=null&&l.id)try{const k=await pe.settings.getAll({$cancelKey:"initialAppSettings"});ln(So,s=((g=k==null?void 0:k.meta)==null?void 0:g.appName)||"",s),ln(Ds,i=!!((b=k==null?void 0:k.meta)!=null&&b.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function m(){pe.logout()}const _=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&p()},[l,a,u,s,o,f,d,m,_]}class yI extends ve{constructor(e){super(),be(this,e,vI,bI,_e,{})}}new yI({target:document.getElementById("app")});export{De as A,Jt as B,j as C,qi as D,Se as E,i1 as F,x_ as G,Gt as H,Xe as I,fi as J,wt as K,se as L,nb as M,yt as N,as as O,Zt as P,dt as Q,kn as R,ve as S,qr as T,Vo as _,P as a,E as b,z as c,H as d,y as e,h as f,S as g,v as h,be as i,Ee as j,re as k,an as l,V as m,ae as n,w as o,pe as p,de as q,x as r,_e as s,A as t,K as u,at as v,U as w,le as x,Q as y,ue as z};