pocketbase/ui/dist/assets/index-79bb649c.js

212 lines
934 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 Mb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function z_(n){return n()}function mu(){return Object.create(null)}function Ee(n){n.forEach(z_)}function Vt(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 mn(n,e){return Rl||(Rl=document.createElement("a")),Rl.href=e,n===Rl.href}function Ob(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 Db(n){let e;return _a(n,t=>e=t)(),e}function Je(n,e,t){n.$$.on_destroy.push(_a(e,t))}function wt(n,e,t,i){if(n){const s=B_(n,e,t,i);return n[0](s)}}function B_(n,e,t,i){return n[1]&&i?je(t.ctx.slice(),n[1](i(e))):t.ctx}function St(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 $t(n,e,t,i,s,l){if(s){const o=B_(e,t,i,l);n.p(o,s)}}function Ct(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 Jt(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 wi(n){return n??""}function rn(n,e,t){return n.set(t),e}function De(n){return n&&Vt(n.destroy)?n.destroy:Q}function hu(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const U_=typeof window<"u";let Fo=U_?()=>window.performance.now():()=>Date.now(),ga=U_?n=>requestAnimationFrame(n):Q;const ws=new Set;function W_(n){ws.forEach(e=>{e.c(n)||(ws.delete(e),e.f())}),ws.size!==0&&ga(W_)}function Ro(n){let e;return ws.size===0&&ga(W_),{promise:new Promise(t=>{ws.add(e={c:n,f:t})}),abort(){ws.delete(e)}}}function v(n,e){n.appendChild(e)}function Y_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Eb(n){const e=y("style");return Ab(Y_(n),e),e.sheet}function Ab(n,e){return v(n.head||n,e),e.sheet}function S(n,e,t){n.insertBefore(e,t||null)}function w(n){n.parentNode&&n.parentNode.removeChild(n)}function pt(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function y(n){return document.createElement(n)}function W(n){return document.createTextNode(n)}function E(){return W(" ")}function $e(){return W("")}function J(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 An(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 Ib(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 Pb(n){return Array.from(n.childNodes)}function oe(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_${Lb(f)}_${r}`,p=Y_(n),{stylesheet:m,rules:_}=ho.get(p)||Nb(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 pl(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||Fb())}function Fb(){ga(()=>{_o||(ho.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),ho.clear())})}function Rb(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=Fo()+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&&(_=dl(n,0,1,o,l,r,d)),l||(m=!0)}function b(){d&&pl(n,_),p=!1}return Ro(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),b()),!p)return!1;if(m){const $=k-a,T=0+1*r($/o);f(T,1-T)}return!0}),g(),f(0,1),b}function qb(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,J_(n,s)}}function J_(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 ml;function bi(n){ml=n}function Cl(){if(!ml)throw new Error("Function called outside component initialization");return ml}function xt(n){Cl().$$.on_mount.push(n)}function jb(n){Cl().$$.after_update.push(n)}function ba(n){Cl().$$.on_destroy.push(n)}function Tt(){const n=Cl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=K_(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 ks=[],se=[];let Ss=[];const qr=[],Z_=Promise.resolve();let jr=!1;function G_(){jr||(jr=!0,Z_.then(va))}function an(){return G_(),Z_}function nt(n){Ss.push(n)}function ke(n){qr.push(n)}const nr=new Set;let hs=0;function va(){if(hs!==0)return;const n=ml;do{try{for(;hs<ks.length;){const e=ks[hs];hs++,bi(e),Vb(e.$$)}}catch(e){throw ks.length=0,hs=0,e}for(bi(null),ks.length=0,hs=0;se.length;)se.pop()();for(let e=0;e<Ss.length;e+=1){const t=Ss[e];nr.has(t)||(nr.add(t),t())}Ss.length=0}while(ks.length);for(;qr.length;)qr.pop()();jr=!1,nr.clear(),bi(n)}function Vb(n){if(n.fragment!==null){n.update(),Ee(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(nt)}}function Hb(n){const e=[],t=[];Ss.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Ss=e}let zs;function ya(){return zs||(zs=Promise.resolve(),zs.then(()=>{zs=null})),zs}function is(n,e,t){n.dispatchEvent(K_(`${e?"intro":"outro"}${t}`))}const oo=new Set;let li;function ae(){li={r:0,c:[],p:li}}function ue(){li.r||Ee(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 ka={duration:0};function X_(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&pl(n,o)}function f(){const{delay:p=0,duration:m=300,easing:_=$l,tick:g=Q,css:b}=s||ka;b&&(o=dl(n,0,1,m,p,_,b,a++)),g(0,1);const k=Fo()+p,$=k+m;r&&r.abort(),l=!0,nt(()=>is(n,!0,"start")),r=Ro(T=>{if(l){if(T>=$)return g(1,0),is(n,!0,"end"),u(),l=!1;if(T>=k){const C=_((T-k)/m);g(C,1-C)}}return l})}let d=!1;return{start(){d||(d=!0,pl(n),Vt(s)?(s=s(i),ya().then(f)):f())},invalidate(){d=!1},end(){l&&(u(),l=!1)}}}function wa(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||ka;m&&(o=dl(n,1,0,f,u,d,m));const _=Fo()+u,g=_+f;nt(()=>is(n,!1,"start")),Ro(b=>{if(l){if(b>=g)return p(0,1),is(n,!1,"end"),--r.r||Ee(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=H.parseIndex(e);return i.tableName=t,H.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=H.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?H.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 Bo=In([]);function l1(n,e=4e3){return Uo(n,"info",e)}function Qt(n,e=3e3){return Uo(n,"success",e)}function hl(n,e=4500){return Uo(n,"error",e)}function hy(n,e=4500){return Uo(n,"warning",e)}function Uo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{o1(i)},t)};Bo.update(s=>(La(s,i.message),H.pushOrReplaceByKey(s,i,"message"),s))}function o1(n){Bo.update(e=>(La(e,n),e))}function Pa(){Bo.update(n=>{for(let e of n)La(n,e);return[]})}function La(n,e){let t;typeof e=="string"?t=H.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),H.removeByKey(n,"message",t.message))}const Ci=In({});function un(n){Ci.set(n||{})}function Ri(n){Ci.update(e=>(H.deleteByPath(e,n),e))}const Na=In({});function Gr(n){Na.set(n||{})}const ci=In([]),ui=In({}),yo=In(!1),r1=In({});function _y(n){ci.update(e=>{const t=H.findByKey(e,"id",n);return t?ui.set(t):e.length&&ui.set(e[0]),e})}function gy(n){ui.update(e=>H.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),ci.update(e=>(H.pushOrReplaceByKey(e,n,"id"),Fa(),H.sortCollections(e)))}function by(n){ci.update(e=>(H.removeByKey(e,"id",n.id),ui.update(t=>t.id===n.id?e[0]:t),Fa(),e))}async function vy(n=null){yo.set(!0);try{let e=await pe.collections.getFullList(200,{sort:"+name"});e=H.sortCollections(e),ci.set(e);const t=n&&H.findByKey(e,"id",n);t?ui.set(t):e.length&&ui.set(e[0]),Fa()}catch(e){pe.errorResponseHandler(e)}yo.set(!1)}function Fa(){r1.update(n=>(ci.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 cr="pb_admin_file_token";jo.prototype.logout=function(n=!0){this.authStore.clear(),n&&Vi("/login")};jo.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(H.isEmpty(s.data)||un(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Vi("/")};jo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=Db(r1);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(cr)||"";return(!t||lg(t,15))&&(t&&localStorage.removeItem(cr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(cr,t),this._adminFileTokenRequest=null),t};class yy extends og{save(e,t){super.save(e,t),t instanceof rs&&Gr(t)}clear(){super.clear(),Gr(null)}}const pe=new jo("../",new yy("pb_admin_auth"));pe.authStore.model instanceof rs&&Gr(pe.authStore.model);function ky(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=n[3].default,_=wt(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.2",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)&&$t(_,m,g,g[2],p?St(m,g[2],b,null):Ct(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 wy(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 Pn extends ve{constructor(e){super(),be(this,e,wy,ky,_e,{center:0,class:1})}}function Zu(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 Sy(n){let e,t,i,s=!n[0]&&Zu();const l=n[1].default,o=wt(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=Zu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&$t(o,l,r,r[2],i?St(l,r[2],a,null):Ct(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 $y(n){let e,t;return e=new Pn({props:{class:"full-page",center:!0,$$slots:{default:[Sy]},$$scope:{ctx:n}}}),{c(){U(e.$$.fragment)},m(i,s){z(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){B(e,i)}}}function Cy(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 a1 extends ve{constructor(e){super(),be(this,e,Cy,$y,_e,{nobranding:0})}}function Wo(n){const e=n-1;return e*e*e+1}function Xr(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 fi(n,{delay:e=0,duration:t=400,easing:i=Wo,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]=hu(s),[m,_]=hu(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 yt(n,{delay:e=0,duration:t=400,easing:i=Wo,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 Wt(n,{delay:e=0,duration:t=400,easing:i=Wo,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,Ji;const xr="app-tooltip";function Gu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ni(){return Ji=Ji||document.querySelector("."+xr),Ji||(Ji=document.createElement("div"),Ji.classList.add(xr),document.body.appendChild(Ji)),Ji}function u1(n,e){let t=Ni();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),Ni().classList.remove("active"),Ni().activeNode=void 0}function Ty(n,e){Ni().activeNode=n,clearTimeout(Qr),Qr=setTimeout(()=>{Ni().classList.add("active"),u1(n,e)},isNaN(e.delay)?0:e.delay)}function We(n,e){let t=Gu(e);function i(){Ty(n,t)}function s(){ea()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&H.isFocusable(n))&&n.addEventListener("click",s),Ni(),{update(l){var o,r;t=Gu(l),(r=(o=Ni())==null?void 0:o.activeNode)!=null&&r.contains(n)&&u1(n,t)},destroy(){var l,o;(o=(l=Ni())==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 Xu(n,e,t){const i=n.slice();return i[12]=e[t],i}const My=n=>({}),Qu=n=>({uniqueId:n[4]});function Oy(n){let e,t,i=n[3],s=[];for(let o=0;o<i.length;o+=1)s[o]=xu(Xu(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=$e()},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=Xu(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=xu(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(ae(),a=i.length;a<s.length;a+=1)l(a);ue()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){pt(s,o),o&&w(e)}}}function Dy(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=De(i=We.call(null,t,{position:"left",text:n[3].map(ko).join(`
`)})),o=!0)},p(a,u){i&&Vt(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(ko).join(`
`)})},i(a){l||(a&&nt(()=>{l&&(s||(s=He(t,Wt,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=He(t,Wt,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&w(e),a&&s&&s.end(),o=!1,r()}}}function xu(n){let e,t,i=ko(n[12])+"",s,l,o,r;return{c(){e=y("div"),t=y("pre"),s=W(i),l=E(),h(e,"class","help-block help-block-error")},m(a,u){S(a,e,u),v(e,t),v(t,s),v(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=ko(a[12])+"")&&oe(s,i)},i(a){r||(a&&nt(()=>{r&&(o||(o=He(e,yt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=He(e,yt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&w(e),a&&o&&o.end()}}}function Ey(n){let e,t,i,s,l,o,r;const a=n[9].default,u=wt(a,n,n[8],Qu),f=[Dy,Oy],d=[];function p(m,_){return m[0]&&m[3].length?0:1}return i=p(n),s=d[i]=f[i](n),{c(){e=y("div"),u&&u.c(),t=E(),s.c(),h(e,"class",n[1]),x(e,"error",n[3].length)},m(m,_){S(m,e,_),u&&u.m(e,null),v(e,t),d[i].m(e,null),n[11](e),l=!0,o||(r=J(e,"click",n[10]),o=!0)},p(m,[_]){u&&u.p&&(!l||_&256)&&$t(u,a,m,m[8],l?St(a,m[8],_,My):Ct(m[8]),Qu);let g=i;i=p(m),i===g?d[i].p(m,_):(ae(),P(d[g],1,1,()=>{d[g]=null}),ue(),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 ef="Invalid value";function ko(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||ef:n||ef}function Ay(n,e,t){let i;Je(n,Ci,g=>t(7,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+H.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,d=[];function p(){Ri(r)}xt(()=>(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=H.toArray(H.getNestedVal(i,r)))},[a,u,f,d,o,r,p,i,l,s,m,_]}class de extends ve{constructor(e){super(),be(this,e,Ay,Ey,_e,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function Iy(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=W("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),fe(l,n[0]),l.focus(),r||(a=J(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&1&&l.value!==u[0]&&fe(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Py(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=W("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),fe(l,n[1]),S(d,r,p),S(d,a,p),u||(f=J(l,"input",n[6]),u=!0)},p(d,p){p&512&&i!==(i=d[9])&&h(e,"for",i),p&512&&o!==(o=d[9])&&h(l,"id",o),p&2&&l.value!==d[1]&&fe(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function Ly(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=W("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),fe(l,n[2]),r||(a=J(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&4&&l.value!==u[2]&&fe(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Ny(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:[Iy,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"password",$$slots:{default:[Py,({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),z(s,e,null),v(e,l),z(o,e,null),v(e,r),z(a,e,null),v(e,u),v(e,f),d=!0,p||(m=J(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),B(s),B(o),B(a),p=!1,m()}}}function Fy(n,e,t){const i=Tt();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 Ry extends ve{constructor(e){super(),be(this,e,Fy,Ny,_e,{})}}function tf(n){let e,t;return e=new a1({props:{$$slots:{default:[qy]},$$scope:{ctx:n}}}),{c(){U(e.$$.fragment)},m(i,s){z(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){B(e,i)}}}function qy(n){let e,t;return e=new Ry({}),e.$on("submit",n[1]),{c(){U(e.$$.fragment)},m(i,s){z(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){B(e,i)}}}function jy(n){let e,t,i=n[0]&&tf(n);return{c(){i&&i.c(),e=$e()},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=tf(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(ae(),P(i,1,1,()=>{i=null}),ue())},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function Vy(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?Vi("/collections"):pe.logout()}return[i,async()=>{t(0,i=!1),await an(),window.location.search=""}]}class Hy extends ve{constructor(e){super(),be(this,e,Vy,jy,_e,{})}}const Nt=In(""),wo=In(""),Es=In(!1);function zy(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),fe(e,n[7]),i||(s=J(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&h(e,"placeholder",t),o&128&&e.value!==l[7]&&fe(e,l[7])},i:Q,o:Q,d(l){l&&w(e),n[13](null),i=!1,s()}}}function By(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=Lt(o,r(n)),se.push(()=>he(e,"value",l)),e.$on("submit",n[10])),{c(){e&&U(e.$$.fragment),i=$e()},m(a,u){e&&z(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],ke(()=>t=!1)),u&16&&o!==(o=a[4])){if(e){ae();const d=e;P(d.$$.fragment,1,0,()=>{B(d,1)}),ue()}o?(e=Lt(o,r(a)),se.push(()=>he(e,"value",l)),e.$on("submit",a[10]),U(e.$$.fragment),A(e.$$.fragment,1),z(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&&B(e,a)}}}function nf(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,fi,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=He(e,fi,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function sf(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 l2(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",H.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 o2(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",H.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 r2(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",H.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 a2(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",H.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 u2(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",H.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 af(n){let e;function t(l,o){return l[6]?c2:f2}let i=t(n),s=i(n);return{c(){s.c(),e=$e()},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 f2(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&uf(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=uf(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function c2(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 uf(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[19]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function ff(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 cf(n,e){var Me,Ze,mt;let t,i,s,l=((Me=e[23].method)==null?void 0:Me.toUpperCase())+"",o,r,a,u,f,d=e[23].url+"",p,m,_,g,b,k,$=(e[23].referer||"N/A")+"",T,C,D,M,O,I=(e[23].userIp||"N/A")+"",L,F,q,N,R,j=e[23].status+"",V,K,ee,te,G,ce,X,le,ye,Se,Ve=(((Ze=e[23].meta)==null?void 0:Ze.errorMessage)||((mt=e[23].meta)==null?void 0:mt.errorData))&&ff();te=new $i({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=W(l),a=E(),u=y("td"),f=y("span"),p=W(d),_=E(),Ve&&Ve.c(),g=E(),b=y("td"),k=y("span"),T=W($),D=E(),M=y("td"),O=y("span"),L=W(I),q=E(),N=y("td"),R=y("span"),V=W(j),K=E(),ee=y("td"),U(te.$$.fragment),G=E(),ce=y("td"),ce.innerHTML='<i class="ri-arrow-right-line"></i>',X=E(),h(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),h(i,"class","col-type-text col-field-method min-width"),h(f,"class","txt txt-ellipsis"),h(f,"title",m=e[23].url),h(u,"class","col-type-text col-field-url"),h(k,"class","txt txt-ellipsis"),h(k,"title",C=e[23].referer),x(k,"txt-hint",!e[23].referer),h(b,"class","col-type-text col-field-referer"),h(O,"class","txt txt-ellipsis"),h(O,"title",F=e[23].userIp),x(O,"txt-hint",!e[23].userIp),h(M,"class","col-type-number col-field-userIp"),h(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(ce,"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,T),v(t,D),v(t,M),v(M,O),v(O,L),v(t,q),v(t,N),v(N,R),v(R,V),v(t,K),v(t,ee),z(te,ee,null),v(t,G),v(t,ce),v(t,X),le=!0,ye||(Se=[J(t,"click",ze),J(t,"keydown",we)],ye=!0)},p(Ge,Ye){var qe,xe,en;e=Ge,(!le||Ye&8)&&l!==(l=((qe=e[23].method)==null?void 0:qe.toUpperCase())+"")&&oe(o,l),(!le||Ye&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&h(s,"class",r),(!le||Ye&8)&&d!==(d=e[23].url+"")&&oe(p,d),(!le||Ye&8&&m!==(m=e[23].url))&&h(f,"title",m),(xe=e[23].meta)!=null&&xe.errorMessage||(en=e[23].meta)!=null&&en.errorData?Ve||(Ve=ff(),Ve.c(),Ve.m(u,null)):Ve&&(Ve.d(1),Ve=null),(!le||Ye&8)&&$!==($=(e[23].referer||"N/A")+"")&&oe(T,$),(!le||Ye&8&&C!==(C=e[23].referer))&&h(k,"title",C),(!le||Ye&8)&&x(k,"txt-hint",!e[23].referer),(!le||Ye&8)&&I!==(I=(e[23].userIp||"N/A")+"")&&oe(L,I),(!le||Ye&8&&F!==(F=e[23].userIp))&&h(O,"title",F),(!le||Ye&8)&&x(O,"txt-hint",!e[23].userIp),(!le||Ye&8)&&j!==(j=e[23].status+"")&&oe(V,j),(!le||Ye&8)&&x(R,"label-danger",e[23].status>=400);const ne={};Ye&8&&(ne.date=e[23].created),te.$set(ne)},i(Ge){le||(A(te.$$.fragment,Ge),le=!0)},o(Ge){P(te.$$.fragment,Ge),le=!1},d(Ge){Ge&&w(t),Ve&&Ve.d(),B(te),ye=!1,Ee(Se)}}}function d2(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M,O,I,L=[],F=new Map,q;function N(we){n[11](we)}let R={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[s2]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),s=new ln({props:R}),se.push(()=>he(s,"sort",N));function j(we){n[12](we)}let V={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[l2]},$$scope:{ctx:n}};n[1]!==void 0&&(V.sort=n[1]),r=new ln({props:V}),se.push(()=>he(r,"sort",j));function K(we){n[13](we)}let ee={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[o2]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),f=new ln({props:ee}),se.push(()=>he(f,"sort",K));function te(we){n[14](we)}let G={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 mi(){}const _2=function(){let n=0;return function(){return n++}}();function ct(n){return n===null||typeof n>"u"}function kt(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 jt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function jn(n,e){return jt(n)?n:e}function st(n,e){return typeof n>"u"?e:n}const g2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,f1=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function It(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function dt(n,e,t,i){let s,l,o;if(kt(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 So(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function $o(n){if(kt(n))return n.map($o);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]]=$o(n[t[s]]);return e}return n}function c1(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function b2(n,e,t,i){if(!c1(n))return;const s=e[n],l=t[n];et(s)&&et(l)?_l(s,l,i):e[n]=$o(l)}function _l(n,e,t){const i=kt(e)?e:[e],s=i.length;if(!et(n))return n;t=t||{};const l=t.merger||b2;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 ol(n,e){return _l(n,e,{merger:v2})}function v2(n,e,t){if(!c1(n))return;const i=e[n],s=t[n];et(i)&&et(s)?ol(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=$o(s))}const mf={"":n=>n,x:n=>n.x,y:n=>n.y};function qi(n,e){return(mf[e]||(mf[e]=y2(e)))(n)}function y2(n){const e=k2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function k2(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 ja(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Wn=n=>typeof n<"u",ji=n=>typeof n=="function",hf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function w2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Ft=Math.PI,_t=2*Ft,S2=_t+Ft,Co=Number.POSITIVE_INFINITY,$2=Ft/180,Pt=Ft/2,Ks=Ft/4,_f=Ft*2/3,Bn=Math.log10,ri=Math.sign;function gf(n){const e=Math.round(n);n=rl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Bn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function C2(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 As(n){return!isNaN(parseFloat(n))&&isFinite(n)}function rl(n,e,t){return Math.abs(n-e)<t}function T2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function d1(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*(Ft/180)}function Va(n){return n*(180/Ft)}function bf(n){if(!jt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function p1(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*Ft&&(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 M2(n,e){return(n-e+S2)%_t-Ft}function On(n){return(n%_t+_t)%_t}function gl(n,e,t,i){const s=On(n),l=On(e),o=On(t),r=On(l-s),a=On(o-s),u=On(s-l),f=On(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function on(n,e,t){return Math.max(e,Math.min(t,n))}function O2(n){return on(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 Ha(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 ns=(n,e,t,i)=>Ha(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),D2=(n,e,t)=>Ha(n,t,i=>n[i][e]>=t);function E2(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 Ii=(n,e,t)=>Math.max(Math.min(n,t),e);function nl(n){return Ii(Al(n*2.55),0,255)}function Fi(n){return Ii(Al(n*255),0,255)}function gi(n){return Ii(Al(n/2.55)/100,0,1)}function Sf(n){return Ii(Al(n*100),0,100)}const qn={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"],L2=n=>na[n&15],N2=n=>na[(n&240)>>4]+na[n&15],Wl=n=>(n&240)>>4===(n&15),F2=n=>Wl(n.r)&&Wl(n.g)&&Wl(n.b)&&Wl(n.a);function R2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&qn[n[1]]*17,g:255&qn[n[2]]*17,b:255&qn[n[3]]*17,a:e===5?qn[n[4]]*17:255}:(e===7||e===9)&&(t={r:qn[n[1]]<<4|qn[n[2]],g:qn[n[3]]<<4|qn[n[4]],b:qn[n[5]]<<4|qn[n[6]],a:e===9?qn[n[7]]<<4|qn[n[8]]:255})),t}const q2=(n,e)=>n<255?e(n):"";function j2(n){var e=F2(n)?L2:N2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+q2(n.a,e):void 0}const V2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function y1(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 H2(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 z2(n,e,t){const i=y1(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 B2(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 za(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=B2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Ba(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Fi)}function Ua(n,e,t){return Ba(y1,n,e,t)}function U2(n,e,t){return Ba(z2,n,e,t)}function W2(n,e,t){return Ba(H2,n,e,t)}function k1(n){return(n%360+360)%360}function Y2(n){const e=V2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?nl(+e[5]):Fi(+e[5]));const s=k1(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=U2(s,l,o):e[1]==="hsv"?i=W2(s,l,o):i=Ua(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function K2(n,e){var t=za(n);t[0]=k1(t[0]+e),t=Ua(t),n.r=t[0],n.g=t[1],n.b=t[2]}function J2(n){if(!n)return;const e=za(n),t=e[0],i=Sf(e[1]),s=Sf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${gi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const $f={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"},Cf={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 Xk{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=_1.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 hi=new Xk;const Rf="transparent",Qk={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Mf(n||Rf),s=i.valid&&Mf(e||Rf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class xk{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||Qk[e.type||typeof o],this._easing=al[e.easing]||al.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 ew=["x","y","borderWidth","radius","tension"],tw=["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 nw=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:tw},numbers:{type:"number",properties:ew}});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 F1{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 bS(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 mc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Dn(e.bodyFont),u=Dn(e.titleFont),f=Dn(e.footerFont),d=l.length,p=s.length,m=i.length,_=Yn(e.padding);let g=_.height,b=0,k=i.reduce((C,D)=>C+D.before.length+D.lines.length+D.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,d&&(g+=d*u.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),k){const C=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=m*C+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}p&&(g+=e.footerMarginTop+p*f.lineHeight+(p-1)*e.footerSpacing);let $=0;const T=function(C){b=Math.max(b,t.measureText(C).width+$)};return t.save(),t.font=u.string,dt(n.title,T),t.font=a.string,dt(n.beforeBody.concat(n.afterBody),T),$=e.displayColors?o+2+e.boxPadding:0,dt(i,C=>{dt(C.before,T),dt(C.lines,T),dt(C.after,T)}),$=0,t.font=f.string,dt(n.footer,T),t.restore(),b+=_.width,{width:b,height:g}}function vS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function yS(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 kS(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"),yS(u,n,e,t)&&(u="center"),u}function hc(n,e,t){const i=t.yAlign||e.yAlign||vS(n,t);return{xAlign:t.xAlign||e.xAlign||kS(n,e,t,i),yAlign:i}}function wS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function SS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function _c(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}=Cs(o);let _=wS(e,r);const g=SS(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:on(_,0,i.width-e.width),y:on(g,0,i.height-e.height)}}function to(n,e,t){const i=Yn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function gc(n){return si([],_i(n))}function $S(n,e,t){return Hi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function bc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ca extends Ti{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 F1(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=$S(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,_i(s)),r=si(r,_i(l)),r=si(r,_i(o)),r}getBeforeBody(e,t){return gc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return dt(e,l=>{const o={before:[],lines:[],after:[]},r=bc(i,l);si(o.before,_i(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 WS={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"}};H1._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 WS},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 Tc(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,Wt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=He(e,Wt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function YS(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=W(n[1]),t=E(),s=W(i)},m(l,o){S(l,e,o),S(l,t,o),S(l,s,o)},p(l,o){o&2&&oe(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&oe(s,i)},d(l){l&&w(e),l&&w(t),l&&w(s)}}}function KS(n){let e;return{c(){e=W("Loading...")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function JS(n){let e,t,i,s,l,o=n[2]&&Tc();function r(f,d){return f[2]?KS:YS}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"),Rr(i,"height","250px"),Rr(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=Tc(),o.c(),A(o,1),o.m(e,t)):o&&(ae(),P(o,1,1,()=>{o=null}),ue()),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 ZS(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=[])}xt(()=>(Po.register(zi,Go,Jo,ou,Nl,gS,CS),t(6,o=new Po(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:m=>m.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>m.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function p(m){se[m?"unshift":"push"](()=>{l=m,t(0,l)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,s=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function $(T){return T instanceof a?new a(T.type,$(T.content),T.alias):Array.isArray(T)?T.map($):T.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function($){return Object.prototype.toString.call($).slice(8,-1)},objId:function($){return $.__id||Object.defineProperty($,"__id",{value:++l}),$.__id},clone:function $(T,C){C=C||{};var D,M;switch(r.util.type(T)){case"Object":if(M=r.util.objId(T),C[M])return C[M];D={},C[M]=D;for(var O in T)T.hasOwnProperty(O)&&(D[O]=$(T[O],C));return D;case"Array":return M=r.util.objId(T),C[M]?C[M]:(D=[],C[M]=D,T.forEach(function(I,L){D[L]=$(I,C)}),D);default:return T}},getLanguage:function($){for(;$;){var T=s.exec($.className);if(T)return T[1].toLowerCase();$=$.parentElement}return"none"},setLanguage:function($,T){$.className=$.className.replace(RegExp(s,"gi"),""),$.classList.add("language-"+T)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(D){var $=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(D.stack)||[])[1];if($){var T=document.getElementsByTagName("script");for(var C in T)if(T[C].src==$)return T[C]}return null}},isActive:function($,T,C){for(var D="no-"+T;$;){var M=$.classList;if(M.contains(T))return!0;if(M.contains(D))return!1;$=$.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function($,T){var C=r.util.clone(r.languages[$]);for(var D in T)C[D]=T[D];return C},insertBefore:function($,T,C,D){D=D||r.languages;var M=D[$],O={};for(var I in M)if(M.hasOwnProperty(I)){if(I==T)for(var L in C)C.hasOwnProperty(L)&&(O[L]=C[L]);C.hasOwnProperty(I)||(O[I]=M[I])}var F=D[$];return D[$]=O,r.languages.DFS(r.languages,function(q,N){N===F&&q!=$&&(this[q]=O)}),O},DFS:function $(T,C,D,M){M=M||{};var O=r.util.objId;for(var I in T)if(T.hasOwnProperty(I)){C.call(T,I,T[I],D||I);var L=T[I],F=r.util.type(L);F==="Object"&&!M[O(L)]?(M[O(L)]=!0,$(L,C,null,M)):F==="Array"&&!M[O(L)]&&(M[O(L)]=!0,$(L,C,I,M))}}},plugins:{},highlightAll:function($,T){r.highlightAllUnder(document,$,T)},highlightAllUnder:function($,T,C){var D={callback:C,container:$,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",D),D.elements=Array.prototype.slice.apply(D.container.querySelectorAll(D.selector)),r.hooks.run("before-all-elements-highlight",D);for(var M=0,O;O=D.elements[M++];)r.highlightElement(O,T===!0,D.callback)},highlightElement:function($,T,C){var D=r.util.getLanguage($),M=r.languages[D];r.util.setLanguage($,D);var O=$.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,D);var I=$.textContent,L={element:$,language:D,grammar:M,code:I};function F(N){L.highlightedCode=N,r.hooks.run("before-insert",L),L.element.innerHTML=L.highlightedCode,r.hooks.run("after-highlight",L),r.hooks.run("complete",L),C&&C.call(L.element)}if(r.hooks.run("before-sanity-check",L),O=L.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!L.code){r.hooks.run("complete",L),C&&C.call(L.element);return}if(r.hooks.run("before-highlight",L),!L.grammar){F(r.util.encode(L.code));return}if(T&&i.Worker){var 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($,T,C){var D={code:$,grammar:T,language:C};if(r.hooks.run("before-tokenize",D),!D.grammar)throw new Error('The language "'+D.language+'" has no grammar.');return D.tokens=r.tokenize(D.code,D.grammar),r.hooks.run("after-tokenize",D),a.stringify(r.util.encode(D.tokens),D.language)},tokenize:function($,T){var C=T.rest;if(C){for(var D in C)T[D]=C[D];delete T.rest}var M=new d;return p(M,M.head,$),f($,M,T,M.head,0),_(M)},hooks:{all:{},add:function
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(L+1))}k.textContent=M,t.highlightElement(k)},function(M){b.setAttribute(r,f),k.textContent=M})}}),t.plugins.fileHighlight={highlight:function(b){for(var k=(b||document).querySelectorAll(d),$=0,T;T=k[$++];)t.highlightElement(T)}};var _=!1;t.fileHighlight=function(){_||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),_=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(XS);const xs=ma;var Oc={},QS={get exports(){return Oc},set exports(n){Oc=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}}}})})()})(QS);(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 xS(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 e$(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=xs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),xs.highlight(a,xs.languages[l]||xs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof xs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class rb extends ve{constructor(e){super(),be(this,e,e$,xS,_e,{class:0,content:2,language:3})}}const t$=n=>({}),Dc=n=>({}),n$=n=>({}),Ec=n=>({});function Ac(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T=n[4]&&!n[2]&&Ic(n);const C=n[19].header,D=wt(C,n,n[18],Ec);let M=n[4]&&n[2]&&Pc(n);const O=n[19].default,I=wt(O,n,n[18],null),L=n[19].footer,F=wt(L,n,n[18],Dc);return{c(){e=y("div"),t=y("div"),s=E(),l=y("div"),o=y("div"),T&&T.c(),r=E(),D&&D.c(),a=E(),M&&M.c(),u=E(),f=y("div"),I&&I.c(),d=E(),p=y("div"),F&&F.c(),h(t,
<span class="txt">New index</span>`,f=E(),U(d.$$.fragment),h(e,"class","section-title"),h(u,"type","button"),h(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),h(r,"class","indexes-list svelte-167lbwu")},m(O,I){S(O,e,I),v(e,t),v(e,s),v(e,l),S(O,o,I),S(O,r,I);for(let L=0;L<k.length;L+=1)k[L]&&k[L].m(r,null);v(r,a),v(r,u),S(O,f,I),z(d,O,I),m=!0,_||(g=J(u,"click",n[5]),_=!0)},p(O,[I]){var F,q,N;if((!m||I&1)&&i!==(i=(((q=(F=O[0])==null?void 0:F.indexes)==null?void 0:q.length)||0)+"")&&oe(s,i),I&7){b=((N=O[0])==null?void 0:N.indexes)||[];let R;for(R=0;R<b.length;R+=1){const j=Bc(O,b,R);k[R]?k[R].p(j,I):(k[R]=Wc(j),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=O[0],ke(()=>p=!1)),d.$set(L)},i(O){m||(A(d.$$.fragment,O),m=!0)},o(O){P(d.$$.fragment,O),m=!1},d(O){O&&w(e),O&&w(o),O&&w(r),pt(k,O),O&&w(f),n[6](null),B(d,O),_=!1,g()}}}const Yc=n=>n.name;function P$(n,e,t){let i;Je(n,Ci,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),Ri("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),Ri("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 L$ extends ve{constructor(e){super(),be(this,e,P$,I$,_e,{collection:0})}}function Kc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Jc(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=W(l),r=E(),h(t,"class","icon "+n[6].icon+" svelte-1p626x7"),h(s,"class","txt"),h(e,"tabindex","0"),h(e,"class","dropdown-item closable svelte-1p626x7")},m(p,m){S(p,e,m),v(e,t),v(e,i),v(e,s),v(s,o),v(e,r),a||(u=[J(e,"click",An(f)),J(e,"keydown",An(d))],a=!0)},p(p,m){n=p},d(p){p&&w(e),a=!1,Ee(u)}}}function N$(n){let e,t=n[2],i=[];for(let s=0;s<t.length;s+=1)i[s]=Jc(Kc(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=$e()},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=Kc(s,t,o);i[o]?i[o].p(r,l):(i[o]=Jc(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){pt(i,s),s&&w(e)}}}function F$(n){let e,t,i,s,l,o,r,a,u,f;return o=new Kn({props:{class:"dropdown field-types-dropdown",$$slots:{default:[N$]},$$scope:{ctx:n}}}),{c(){e=y("button"),t=y("i"),i=E(),s=y("div"),s.textContent="New field",l=E(),U(o.$$.fragment),h(t,"class","ri-add-line"),h(s,"class","txt"),h(e,"type","button"),h(e,"class",r=wi(n[0])+" svelte-1p626x7")},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),v(e,l),z(o,e,null),a=!0,u||(f=J(e,"click",n[1]),u=!0)},p(d,[p]){const m={};p&512&&(m.$$scope={dirty:p,ctx:d}),o.$set(m),(!a||p&1&&r!==(r=wi(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),B(o),u=!1,f()}}}function R$(n,e,t){let{class:i=""}=e;const s=Tt(),l=[{label:"Plain text",value:"text",icon:H.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:H.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:H.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:H.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:H.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:H.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:H.getFieldTypeIcon("date")},{label:"Select",value:"select",icon:H.getFieldTypeIcon("select")},{label:"File",value:"file",icon:H.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:H.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:H.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=!H.isEmpty(b[0].options.onlyDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.exceptDomains,ke(()=>a=!1)),r.$set($)},i(b){d||(A(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),B(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function _C(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:!H.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(g.value=n[0].options.onlyDomains),r=new Vs({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(),U(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),z(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(m=De(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=!H.isEmpty(b[0].options.exceptDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.onlyDomains,ke(()=>a=!1)),r.$set($)},i(b){d||(A(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),B(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function gC(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:[hC,({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:[_C,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),U(i.$$.fragment),s=E(),l=y("div"),U(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),z(i,t,null),v(e,s),v(e,l),z(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),B(i),B(o)}}}function bC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[gC]},$$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 di({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(){U(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?Mt(s,[a&2&&{key:r[1]},a&4&&Zt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){B(e,r)}}}function vC(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),Jt(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 fb extends ve{constructor(e){super(),be(this,e,vC,bC,_e,{field:0,key:1})}}function yC(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 fb({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(){U(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?Mt(s,[a&2&&{key:r[1]},a&4&&Zt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){B(e,r)}}}function kC(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),Jt(_)),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 wC extends ve{constructor(e){super(),be(this,e,kC,yC,_e,{field:0,key:1})}}function SC(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 di({props:o}),se.push(()=>he(e,"field",l)),e.$on("rename",n[4]),e.$on(
<span class='flatpickr-weekday'>
`+Z.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function ce(){t.calendarContainer.classList.add("hasWeeks");var Y=ft("div","flatpickr-weekwrapper");Y.appendChild(ft("span","flatpickr-weekday",t.l10n.weekAbbreviation));var Z=ft("div","flatpickr-weeks");return Y.appendChild(Z),{weekWrapper:Y,weekNumbers:Z}}function X(Y,Z){Z===void 0&&(Z=!0);var ie=Z?Y:Y-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"),Fn())}function le(Y,Z){if(Y===void 0&&(Y=!0),Z===void 0&&(Z=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,Z===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ie=Ar(t.config),re=ie.hours,Te=ie.minutes,Pe=ie.seconds;m(re,Te,Pe)}t.redraw(),Y&&Fe("onChange")}function ye(){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 Se(){t.config!==void 0&&Fe("onDestroy");for(var Y=t._handlers.length;Y--;)t._handlers[Y].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 Z=t.calendarContainer.parentNode;if(Z.lastChild&&Z.removeChild(Z.lastChild),Z.parentNode){for(;Z.firstChild;)Z.parentNode.insertBefore(Z.firstChild,Z);Z.parentNode.removeChild(Z)}}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(Y){return t.calendarContainer.contains(Y)}function ze(Y){if(t.isOpen&&!t.config.inline){var Z=Tn(Y),ie=Ve(Z),re=Z===t.input||Z===t.altInput||t.element.contains(Z)||Y.path&&Y.path.indexOf&&(~Y.path.indexOf(t.input)||~Y.path.indexOf(t.altInput)),Te=!re&&!ie&&!Ve(Y.relatedTarget),Pe=!t.config.ignoredFocusElements.some(function(Le){return Le.contains(Z)});Te&&Pe&&(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(Y){if(!(!Y||t.config.minDate&&Y<t.config.minDate.getFullYear()||t.config.maxDate&&Y>t.config.maxDate.getFullYear())){var Z=Y,ie=t.currentYear!==Z;t.currentYear=Z||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 Me(Y,Z){var ie;Z===void 0&&(Z=!0);var re=t.parseDate(Y,void 0,Z);if(t.config.minDate&&re&&Mn(re,t.config.minDate,Z!==void 0?Z:!t.minDateHasTime)<0||t.config.maxDate&&re&&Mn(re,t.config.maxDate,Z!==void 0?Z:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)retu
2023-04-18 01:59:04 +08:00
`),r=y("code"),r.textContent="multipart/form-data",a=W(`
requests, the following normalization rules are applied if the `),u=y("code"),u.textContent="json",f=W(` field
is a
2023-04-18 01:59:04 +08:00
`),d=y("strong"),d.textContent="plain string",p=W(`:
`),m=y("ul"),_=y("li"),_.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",g=E(),b=y("li"),b.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",k=E(),$=y("li"),$.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",T=E(),C=y("li"),C.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",D=E(),M=y("li"),I=W(O),L=W(" 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(),j=y("li"),j.textContent="double quoted strings are left as they are (aka. without normalizations)",V=E(),K=y("li"),K.textContent="any other string (empty string too) is double quoted",ee=W(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your
data inside an object, eg.`),te=y("code"),te.textContent='{"data": anything}',h(i,"class","content"),h(t,"class","alert alert-warning m-b-0 m-t-10"),h(e,"class","block")},m(X,le){S(X,e,le),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(i,r),v(i,a),v(i,u),v(i,f),v(i,d),v(i,p),v(i,m),v(m,_),v(m,g),v(m,b),v(m,k),v(m,$),v(m,T),v(m,C),v(m,D),v(m,M),v(M,I),v(M,L),v(M,F),v(m,q),v(m,N),v(m,R),v(m,j),v(m,V),v(m,K),v(i,ee),v(i,te),ce=!0},i(X){ce||(X&&nt(()=>{ce&&(G||(G=He(e,yt,{duration:150},!0)),G.run(1))}),ce=!0)},o(X){X&&(G||(G=He(e,yt,{duration:150},!1)),G.run(0)),ce=!1},d(X){X&&w(e),X&&G&&G.end()}}}function mT(n){let e,t,i,s,l,o,r;function a(p,m){return p[2]?pT:dT}let u=a(n),f=u(n),d=n[2]&&$d();return{c(){e=y("button"),t=y("strong"),t.textContent="String value normalizations",i=E(),f.c(),s=E(),d&&d.c(),l=$e(),h(t,"class","txt"),h(e,"type","button"),h(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(p,m){S(p,e,m),v(e,t),v(e,i),f.m(e,null),S(p,s,m),d&&d.m(p,m),S(p,l,m),o||(r=J(e,"click",n[4]),o=!0)},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(e,null))),p[2]?d?m&4&&A(d,1):(d=$d(),d.c(),A(d,1),d.m(l.parentNode,l)):d&&(ae(),P(d,1,1,()=>{d=null}),ue())},d(p){p&&w(e),f.d(),p&&w(s),d&&d.d(p),p&&w(l),o=!1,r()}}}function hT(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[mT]},$$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 di({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(){U(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&10?Mt(s,[a&2&&{key:r[1]},a&8&&Zt(r[3])]):{};a&4100&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){B(e,r)}}}function _T(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),Jt(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 gT extends ve{constructor(e){super(),be(this,e,_T,hT,_e,{field:0,key:1})}}function bT(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=y("span"),i=W(t),s=E(),l=y("small"),r=W(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")+"")&&oe(i,t),u&1&&o!==(o=a[0].mimeType+"")&&oe(r,o)},i:Q,o:Q,d(a){a&&w(e),a&&w(s),a&&w(l)}}}function vT(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Cd extends ve{constructor(e){super(),be(this,e,vT,bT,_e,{item:0})}}const yT=[{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,O){(!k||O&67108864&&l!==(l=M[26]))&&h(e,"for",l);const I={};O&67108864&&(I.id=M[26]),O&8&&(I.items=M[3]),!a&&O&1&&(a=!0,I.keyOfSelected=M[0].options.mimeTypes,ke(()=>a=!1)),r.$set(I);const L={};O&268435457&&(L.$$scope={dirty:O,ctx:M}),b.$set(L)},i(M){k||(A(r.$$.fragment,M),A(b.$$.fragment,M),k=!0)},o(M){P(r.$$.fragment,M),P(b.$$.fragment,M),k=!1},d(M){M&&w(e),M&&w(o),B(r,M),M&&w(u),M&&w(f),B(b),$=!1,T()}}}function CT(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 TT(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D;function M(I){n[13](I)}let O={id:n[26],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(O.value=n[0].options.thumbs),r=new Vs({props:O}),se.push(()=>he(r,"value",M)),$=new Kn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[CT]},$$scope:{ctx:n}}}),{c(){e=y("label"),t=y("span"),t.textContent="Thumb sizes",i=E(),s=y("i"),o=E(),U(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(),U($.$$.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),z(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),z($,m,null),T=!0,C||(D=De(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"})),C=!0)},p(I,L){(!T||L&67108864&&l!==(l=I[26]))&&h(e,"for",l);const F={};L&67108864&&(F.id=I[26]),!a&&L&1&&(a=!0,F.value=I[0].options.thumbs,ke(()=>a=!1)),r.$set(F);const q={};L&268435456&&(q.$$scope={dirty:L,ctx:I}),$.$set(q)},i(I){T||(A(r.$$.fragment,I),A($.$$.fragment,I),T=!0)},o(I){P(r.$$.fragment,I),P($.$$.fragment,I),T=!1},d(I){I&&w(e),I&&w(o),B(r,I),I&&w(u),I&&w(f),B($),C=!1,D()}}}function MT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=W("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),fe(l,n[0].options.maxSize),S(d,r,p),S(d,a,p),u||(f=J(l,"input",n[14]),u=!0)},p(d,p){p&67108864&&i!==(i=d[26])&&h(e,"for",i),p&67108864&&o!==(o=d[26])&&h(l,"id",o),p&1&&gt(l.value)!==d[0].options.maxSize&&fe(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 Td(n){let e,t,i;return t=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[OT,({uniqueId:s})=>({26:s}),({uniqueId:s})=>s?67108864:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),U(t.$$.fragment),h(e,"class","col-sm-3")},m(s,l){S(s,e,l),z(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),B(t)}}}function OT(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=W("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),fe(l,n[0].options.maxSelect),r||(a=J(l,"input",n[15]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&h(e,"for",i),f&67108864&&o!==(o=u[26])&&h(l,"id",o),f&1&&gt(l.value)!==u[0].options.maxSelect&&fe(l,u[0].options.maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function DT(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:[$T,({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:[TT,({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:[MT,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}});let _=!n[2]&&Td(n);return{c(){e=y("div"),t=y("div"),U(i.$$.fragment),s=E(),l=y("div"),U(o.$$.fragment),a=E(),u=y("div"),U(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=J(i,"click",n[17]),s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function FT(n){let e,t,i;function s(o){n[18](o)}let l={id:n[33],searchable:n[3].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[3],disabled:!n[34]||n[0].id,$$slots:{afterOptions:[NT]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Bi({props:l}),se.push(()=>he(e,"keyOfSelected",s)),{c(){U(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[1]&4&&(a.id=o[33]),r[0]&8&&(a.searchable=o[3].length>5),r[0]&8&&(a.items=o[3]),r[0]&1|r[1]&8&&(a.disabled=!o[34]||o[0].id),r[0]&16|r[1]&16&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){B(e,o)}}}function RT(n){let e,t,i;function s(o){n[19](o)}let l={id:n[33],items:n[8],disabled:!n[34]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Bi({props:l}),se.push(()=>he(e,"keyOfSelected",s)),{c(){U(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[1]&4&&(a.id=o[33]),r[1]&8&&(a.disabled=!o[34]),!t&&r[0]&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){B(e,o)}}}function qT(n){let e,t,i,s;return e=new de({props:{class:"form-field required "+(n[34]?"":"disabled"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[FT,({uniqueId:l})=>({33:l}),({uniqueId:l})=>[0,l?4:0]]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field form-field-single-multiple-select "+(n[34]?"":"disabled"),inlineError:!0,$$slots:{default:[RT,({uniqueId:l})=>({33:l}),({uniqueId:l})=>[0,l?4:0]]},$$scope:{ctx:n}}}),{c(){U(e.$$.fragment),t=E(),U(i.$$.fragment)},m(l,o){z(e,l,o),S(l,t,o),z(i,l,o),s=!0},p(l,o){const r={};o[1]&8&&(r.class="form-field required "+(l[34]?"":"disabled")),o[0]&2&&(r.name="schema."+l[1]+".options.collectionId"),o[0]&25|o[1]&28&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o[1]&8&&(a.class="form-field form-field-single-multiple-select "+(l[34]?"":"disabled")),o[0]&4|o[1]&28&&(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){B(e,l),l&&w(t),B(i,l)}}}function Md(n){let e,t,i,s,l,o;return t=new de({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[jT,({uniqueId:r})=>({33:r}),({uniqueId:r})=>[0,r?4:0]]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[VT,({uniqueId:r})=>({33:r}),({uniqueId:r})=>[0,r?4:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),U(t.$$.fragment),i=E(),s=y("div"),U(l.$$.fragment),h(e,"class","col-sm-6"),h(s,"class","col-sm-6")},m(r,a){S(r,e,a),z(t,e,null),S(r,i,a),S(r,s,a),z(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]&20&&(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]&20&&(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),B(t),r&&w(i),r&&w(s),B(l)}}}function jT(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=W("Min select"),s=E(),l=y("input"),h(e,"for",i=n[33]),h(l,"type","number"),h(l,"id",o=n[33]),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),fe(l,n[0].options.minSelect),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&h(e,"for",i),f[1]&4&&o!==(o=u[33])&&h(l,"id",o),f[0]&1&&gt(l.value)!==u[0].options.minSelect&&fe(l,u[0].options.minSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function VT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=W("Max select"),s=E(),l=y("input"),h(e,"for",i=
2023-04-18 01:59:04 +08:00
`),t=y("code"),t.textContent="username",i=W(` ,
`),s=y("code"),s.textContent="email",l=W(` ,
`),o=y("code"),o.textContent="emailVisibility",r=W(` ,
`),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 Ed(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=Lt(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=$e(),i&&U(i.$$.fragment),l=$e(),this.first=t},m(m,_){S(m,t,_),i&&z(i,m,_),S(m,l,_),o=!0},p(m,_){e=m;const g={};if(_&1&&(g.key=e[4](e[17])),!s&&_&1&&(s=!0,g.field=e[17],ke(()=>s=!1)),_&1&&d!==(d=e[1][e[17].type])){if(i){ae();const b=i;P(b.$$.fragment,1,0,()=>{B(b,1)}),ue()}d?(i=Lt(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),U(i.$$.fragment),A(i.$$.fragment,1),z(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&&B(i,m)}}}function KT(n){let e,t,i,s,l,o,r,a,u,f,d,p,m=[],_=new Map,g,b,k,$,T,C,D,M,O=n[0].$isAuth&&Dd(),I=n[0].schema;const L=N=>N[17];for(let N=0;N<I.length;N+=1){let R=Od(n,I,N),j=L(R);_.set(j,m[N]=Ed(j,R))}b=new q$({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]),C=new L$({props:q}),se.push(()=>he(C,"collection",F)),{c(){e=y("div"),t=y("p"),i=W(`System fields:
2023-04-18 01:59:04 +08:00
`),s=y("code"),s.textContent="id",l=W(` ,
`),o=y("code"),o.textContent="created",r=W(` ,
`),a=y("code"),a.textContent="updated",u=E(),O&&O.c(),f=W(`
.`),d=E(),p=y("div");for(let N=0;N<m.length;N+=1)m[N].c();g=E(),U(b.$$.fragment),k=E(),$=y("hr"),T=E(),U(C.$$.fragment),h(s,"class","txt-sm"),h(o,"class","txt-sm"),h(a,"class","txt-sm"),h(t,"class","txt-sm"),h(e,"class","block m-b-25"),h(p,"class","accordions schema-fields")},m(N,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),O&&O.m(t,null),v(t,f),S(N,d,R),S(N,p,R);for(let j=0;j<m.length;j+=1)m[j]&&m[j].m(p,null);S(N,g,R),z(b,N,R),S(N,k,R),S(N,$,R),S(N,T,R),z(C,N,R),M=!0},p(N,[R]){N[0].$isAuth?O||(O=Dd(),O.c(),O.m(t,f)):O&&(O.d(1),O=null),R&119&&(I=N[0].schema,ae(),m=vt(m,R,L,1,N,I,_,p,Kt,Ed,null,Od),ue());const j={};!D&&R&1&&(D=!0,j.collection=N[0],ke(()=>D=!1)),C.$set(j)},i(N){if(!M){for(let R=0;R<I.length;R+=1)A(m[R]);A(b.$$.fragment,N),A(C.$$.fragment,N),M=!0}},o(N){for(let R=0;R<m.length;R+=1)P(m[R]);P(b.$$.fragment,N),P(C.$$.fragment,N),M=!1},d(N){N&&w(e),O&&O.d(),N&&w(d),N&&w(p);for(let R=0;R<m.length;R+=1)m[R].d();N&&w(g),B(b,N),N&&w(k),N&&w($),N&&w(T),B(C,N)}}}function JT(n,e){n&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.dropEffect="move",n.dataTransfer.setData("text/plain",e))}function ZT(n,e,t){let i,{collection:s=new kn}=e;const l={text:iC,number:uC,bool:dC,email:fb,url:wC,editor:CC,date:HC,select:cT,json:gT,file:LT,relation:YT};function o(C){s.schema[C]&&(s.schema.splice(C,1),t(0,s))}function r(C="text"){const D=new wn({name:a(),type:C});D.onMountSelect=!0,s.schema.push(D),t(0,s)}function a(C="field"){let D="";for(;u(C+D);)++D;return C+D}function u(C){return!!s.schema.find(D=>D.name===C)}function f(C){return i.findIndex(D=>D===C)}function d(C,D){var M;!((M=s==null?void 0:s.schema)!=null&&M.length)||C===D||!D||t(0,s.indexes=s.indexes.map(O=>H.replaceIndexColumn(O,C,D)),s)}function p(C,D){if(!C)return;C.dataTransfer.dropEffect="move";const M=parseInt(C.dataTransfer.getData("text/plain")),O=s.schema;M<D?(O.splice(D+1,0,O[M]),O.splice(M,1)):(O.splice(D,0,O[M]),O.splice(M+1,1)),t(0,s.schema=O,s),un({})}function m(C,D,M,O){M[O]=C,t(0,s)}const _=C=>o(C),g=C=>d(C.detail.oldName,C.detail.newName),b=(C,D)=>JT(D.detail,C),k=(C,D)=>p(D.detail,C),$=C=>r(C.detail);function T(C){s=C,t(0,s)}return n.$$set=C=>{"collection"in C&&t(0,s=C.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&(t(0,s=s||new kn),t(0,s.schema=[],s)),n.$$.dirty&1&&(i=s.schema.filter(C=>!C.toDelete)||[])},[s,l,o,r,f,d,p,m,_,g,b,k,$,T]}class GT extends ve{constructor(e){super(),be(this,e,ZT,KT,_e,{collection:0})}}const XT=n=>({isAdminOnly:n&512}),Ad=n=>({isAdminOnly:n[9]}),QT=n=>({isAdminOnly:n&512}),Id=n=>({isAdminOnly:n[9]}),xT=n=>({isAdminOnly:n&512}),Pd=n=>({isAdminOnly:n[9]});function e4(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:[n4,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){U(e.$$.fragment)},m(i,s){z(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){B(e,i)}}}function t4(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 Ld(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-lock-line"></i>
<span class="txt">Set Admins only</span>`,h(e,"type","button"),h(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[11]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function Nd(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML=`<small class="txt svelte-1akuazq">Unlock and set custom rule</small>
<div class="icon svelte-1akuazq"><i class="ri-lock-unlock-line svelte-1akuazq"></i></div>`,h(e,"type","button"),h(e,"class","unlock-overlay svelte-1akuazq"),h(e,"aria-label","Unlock and set custom rule")},m(o,r){S(o,e,r),i=!0,s||(l=J(e,"click",n[10]),s=!0)},p:Q,i(o){i||(o&&nt(()=>{i&&(t||(t=He(e,Wt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Wt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function n4(n){let e,t,i,s,l,o,r=n[9]?"- Admins only":"",a,u,f,d,p,m,_,g,b,k,$;const T=n[12].beforeLabel,C=wt(T,n,n[15],Pd),D=n[12].afterLabel,M=wt(D,n,n[15],Id);let O=!n[9]&&Ld(n);function I(j){n[14](j)}var L=n[7];function F(j){let V={id:j[18],baseCollection:j[1],disabled:j[9],placeholder:j[9]?"":j[5]};return j[0]!==void 0&&(V.value=j[0]),{props:V}}L&&(m=Lt(L,F(n)),n[13](m),se.push(()=>he(m,"value",I)));let q=n[9]&&Nd(n);const N=n[12].default,R=wt(N,n,n[15],Ad);return{c(){e=y("div"),t=y("label"),C&&C.c(),i=E(),s=y("span"),l=W(n[2]),o=E(),a=W(r),u=E(),M&&M.c(),f=E(),O&&O.c(),p=E(),m&&U(m.$$.fragment),g=E(),q&&q.c(),b=E(),k=y("div"),R&&R.c(),h(s,"class","txt"),x(s,"txt-hint",n[9]),h(t,"for",d=n[18]),h(e,"class","input-wrapper svelte-1akuazq"),h(k,"class","help-block")},m(j,V){S(j,e,V),v(e,t),C&&C.m(t,null),v(t,i),v(t,s),v(s,l),v(s,o),v(s,a),v(t,u),M&&M.m(t,null),v(t,f),O&&O.m(t,null),v(e,p),m&&z(m,e,null),v(e,g),q&&q.m(e,null),S(j,b,V),S(j,k,V),R&&R.m(k,null),$=!0},p(j,V){C&&C.p&&(!$||V&33280)&&$t(C,T,j,j[15],$?St(T,j[15],V,xT):Ct(j[15]),Pd),(!$||V&4)&&oe(l,j[2]),(!$||V&512)&&r!==(r=j[9]?"- Admins only":"")&&oe(a,r),(!$||V&512)&&x(s,"txt-hint",j[9]),M&&M.p&&(!$||V&33280)&&$t(M,D,j,j[15],$?St(D,j[15],V,QT):Ct(j[15]),Id),j[9]?O&&(O.d(1),O=null):O?O.p(j,V):(O=Ld(j),O.c(),O.m(t,null)),(!$||V&262144&&d!==(d=j[18]))&&h(t,"for",d);const K={};if(V&262144&&(K.id=j[18]),V&2&&(K.baseCollection=j[1]),V&512&&(K.disabled=j[9]),V&544&&(K.placeholder=j[9]?"":j[5]),!_&&V&1&&(_=!0,K.value=j[0],ke(()=>_=!1)),V&128&&L!==(L=j[7])){if(m){ae();const ee=m;P(ee.$$.fragment,1,0,()=>{B(ee,1)}),ue()}L?(m=Lt(L,F(j)),j[13](m),se.push(()=>he(m,"value",I)),U(m.$$.fragment),A(m.$$.fragment,1),z(m,e,g)):m=null}else L&&m.$set(K);j[9]?q?(q.p(j,V),V&512&&A(q,1)):(q=Nd(j),q.c(),A(q,1),q.m(e,null)):q&&(ae(),P(q,1,1,()=>{q=null}),ue()),R&&R.p&&(!$||V&33280)&&$t(R,N,j,j[15],$?St(N,j[15],V,XT):Ct(j[15]),Ad)},i(j){$||(A(C,j),A(M,j),m&&A(m.$$.fragment,j),A(q),A(R,j),$=!0)},o(j){P(C,j),P(M,j),m&&P(m.$$.fragment,j),P(q),P(R,j),$=!1},d(j){j&&w(e),C&&C.d(j),M&&M.d(j),O&&O.d(),n[13](null),m&&B(m),q&&q.d(),j&&w(b),j&&w(k),R&&R.d(j)}}}function i4(n){let e,t,i,s;const l=[t4,e4],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=$e()},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):(ae(),P(o[f],1,1,()=>{o[f]=null}),ue(),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 Fd;function s4(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,_=Fd,g=!1;b();async function b(){_||g||(t(8,g=!0),t(7,_=(await rt(()=>import("./FilterAutocompleteInput-ee8801ec.js"),["./FilterAutocompleteInput-ee8801ec.js","./index-8390b00e.js"],import.meta.url)).default),Fd=_,t(8,g=!1))}async function k(){t(0,r=m||""),await an(),p==null||p.focus()}async function $(){m=r,t(0,r=null)}function T(D){se[D?"unshift":"push"](()=>{p=D,t(6,p)})}function C(D){r=D,t(0,r)}return n.$$set=D=>{"collection"in D&&t(1,o=D.collection),"rule"in D&&t(0,r=D.rule),"label"in D&&t(2,a=D.label),"formKey"in D&&t(3,u=D.formKey),"required"in D&&t(4,f=D.required),"placeholder"in D&&t(5,d=D.placeholder),"$$scope"in D&&t(15,l=D.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,d,p,_,g,i,k,$,s,T,C,l]}class Os extends ve{constructor(e){super(),be(this,e,s4,i4,_e,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Rd(n,e,t){const i=n.s
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.auth.*</code>`,m=E(),_=y("hr"),g=E(),b=y("p"),b.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",k=E(),$=y("div"),$.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",T=E(),C=y("hr"),D=E(),M=y("p"),M.innerHTML=`Example rule:
<br/>
<code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,h(s,"class","m-b-0"),h(o,"class","inline-flex flex-gap-5"),h(a,"class","m-t-10 m-b-5"),h(f,"class","m-b-0"),h(p,"class","inline-flex flex-gap-5"),h(_,"class","m-t-10 m-b-5"),h(b,"class","m-b-0"),h($,"class","inline-flex flex-gap-5"),h(C,"class","m-t-10 m-b-5"),h(i,"class","content"),h(t,"class","alert alert-warning m-0")},m(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,T),v(i,C),v(i,D),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 j=Rd(q,L,R);F[R]?F[R].p(j,N):(F[R]=jd(j),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&&(O||(O=He(e,yt,{duration:150},!0)),O.run(1))}),I=!0)},o(q){q&&(O||(O=He(e,yt,{duration:150},!1)),O.run(0)),I=!1},d(q){q&&w(e),pt(F,q),q&&O&&O.end()}}}function jd(n){let e,t=n[11]+"",i;return{c(){e=y("code"),i=W(t)},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&4&&t!==(t=s[11]+"")&&oe(i,t)},d(s){s&&w(e)}}}function Vd(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],$$slots:{afterLabel:[l4,({isAdminOnly:b})=>({10:b}),({isAdminOnly:b})=>b?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(d.rule=n[0].createRule),e=new Os({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 Os({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 Os({props:g}),se.push(()=>he(r,"rule",_)),{c(){U(e.$$.fragment),i=E(),U(s.$$.fragment),o=E(),U(r.$$.fragment)},m(b,k){z(e,b,k),S(b,i,k),z(s,b,k),S(b,o,k),z(r,b,k),u=!0},p(b,k){const $={};k&1&&($.collection=b[0]),k&17408&&($.$$scope={dirty:k,ctx:b}),!t&&k&1&&(t=!0,$.rule=b[0].createRule,ke(()=>t=!1)),e.$set($);const T={};k&1&&(T.collection=b[0]),!l&&k&1&&(l=!0,T.rule=b[0].updateRule,ke(()=>l=!1)),s.$set(T);const C={};k&1&&(C.collection=b[0]),!a&&k&1&&(a=!0,C.rule=b[0].deleteRule,ke(()=>a=!1)),r.$set(C)},i(b){u||(A(e.$$.fragment,b),A(s.$$.fragment,b),A(r.$$.fragment,b),u=!0)},o(b){P(e.$$.fragment,b),P(s.$$.fragment,b),P(r.$$.fragment,b),u=!1},d(b){B(e,b),b&&w(i),B(s,b),b&&w(o),B(r,b)}}}function Hd(n){let e,t,i;return{c(){e=y("i"),h(e,"class","ri-information-line link-hint")},m(s,l){S(s,e,l),t||(i=De(We.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(s){s&&w(e),t=!1,i()}}}function l4(n){let e,t=!n[10]&&Hd();return{c(){t&&t.c(),e=$e()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[10]?t&&(t.d(1),t=null):t||(t=Hd(),t.c(),t.m(e.parentNode,e))},d(i){t&&t.d(i),i&&w(e)}}}function zd(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:[o4]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Os({props:l}),se.push(()=>he(e,"rule",s)),{c(){U(e.$$.fragment)},m(o,r){z(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&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){B(e,o)}}}function o4(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 r4(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,$,T,C,D=n[1]&&qd(n);function M(j){n[4](j)}let O={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(O.rule=n[0].listRule),f=new Os({props:O}),se.push(()=>he(f,"rule",M));function I(j){n[5](j)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new Os({props:L}),se.push(()=>he(m,"rule",I));let F=!((N=n[0])!=null&&N.$isView)&&Vd(n),q=((R=n[0])==null?void 0:R.$isAuth)&&zd(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=W(o),a=E(),D&&D.c(),u=E(),U(f.$$.fragment),p=E(),U(m.$$.fragment),g=E(),F&&F.c(),b=E(),q&&q.c(),k=$e(),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(j,V){S(j,e,V),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),D&&D.m(e,null),S(j,u,V),z(f,j,V),S(j,p,V),z(m,j,V),S(j,g,V),F&&F.m(j,V),S(j,b,V),q&&q.m(j,V),S(j,k,V),$=!0,T||(C=J(l,"click",n[3]),T=!0)},p(j,[V]){var te,G;(!$||V&2)&&o!==(o=j[1]?"Hide available fields":"Show available fields")&&oe(r,o),j[1]?D?(D.p(j,V),V&2&&A(D,1)):(D=qd(j),D.c(),A(D,1),D.m(e,null)):D&&(ae(),P(D,1,1,()=>{D=null}),ue());const K={};V&1&&(K.collection=j[0]),!d&&V&1&&(d=!0,K.rule=j[0].listRule,ke(()=>d=!1)),f.$set(K);const ee={};V&1&&(ee.collection=j[0]),!_&&V&1&&(_=!0,ee.rule=j[0].viewRule,ke(()=>_=!1)),m.$set(ee),(te=j[0])!=null&&te.$isView?F&&(ae(),P(F,1,1,()=>{F=null}),ue()):F?(F.p(j,V),V&1&&A(F,1)):(F=Vd(j),F.c(),A(F,1),F.m(b.parentNode,b)),(G=j[0])!=null&&G.$isAuth?q?(q.p(j,V),V&1&&A(q,1)):(q=zd(j),q.c(),A(q,1),q.m(k.parentNode,k)):q&&(ae(),P(q,1,1,()=>{q=null}),ue())},i(j){$||(A(D),A(f.$$.fragment,j),A(m.$$.fragment,j),A(F),A(q),$=!0)},o(j){P(D),P(f.$$.fragment,j),P(m.$$.fragment,j),P(F),P(q),$=!1},d(j){j&&w(e),D&&D.d(),j&&w(u),B(f,j),j&&w(p),B(m,j),j&&w(g),F&&F.d(j),j&&w(b),q&&q.d(j),j&&w(k),T=!1,C()}}}function a4(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=H.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,d,p]}class u4 extends ve{constructor(e){super(),be(this,e,a4,r4,_e,{collection:0})}}function Bd(n,e,t){const i=n.slice();return i[9]=e[t],i}function f4(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=Lt(o,r(n)),se.push(()=>he(e,"value",l)),e.$on("change",n[6])),{c(){e&&U(e.$$.fragment),i=$e()},m(a,u){e&&z(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ke(()=>t=!1)),u&2&&o!==(o=a[1])){if(e){ae();const d=e;P(d.$$.fragment,1,0,()=>{B(d,1)}),ue()}o?(e=Lt(o,r(a)),se.push(()=>he(e,"value",l)),e.$on("change",a[6]),U(e.$$.fragment),A(e.$$.fragment,1),z(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&&B(e,a)}}}function c4(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 Ud(n){let e,t,i=n[3],s=[];for(let l=0;l<i.length;l+=1)s[l]=Wd(Bd(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=Bd(l,i,r);s[r]?s[r].p(a,o):(s[r]=Wd(a),s[r].c(),s[r].m(t,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=i.length}},d(l){l&&w(e),pt(s,l)}}}function Wd(n){let e,t=n[9]+"",i;return{c(){e=y("p"),i=W(t)},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&oe(i,t)},d(s){s&&w(e)}}}function d4(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[c4,f4],m=[];function _(b,k){return b[2]?0:1}l=_(n),o=m[l]=p[l](n);let g=n[3].length&&Ud(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 suppo
<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=$e(),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):(ae(),P(m[$],1,1,()=>{m[$]=null}),ue(),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=Ud(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 p4(n){let e,t;return e=new de({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[d4,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){U(e.$$.fragment)},m(i,s){z(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){B(e,i)}}}function m4(n,e,t){let i;Je(n,Ci,d=>t(4,i=d));let{collection:s=new kn}=e,l,o=!1,r=[];function a(d){var _;t(3,r=[]);const p=H.getNestedVal(d,"schema",null);if(H.isEmpty(p))return;if(p!=null&&p.message){r.push(p==null?void 0:p.message);return}const m=H.extractColumnsFromQuery((_=s==null?void 0:s.options)==null?void 0:_.query);H.removeByValue(m,"id"),H.removeByValue(m,"created"),H.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(H.sentenize($+": "+k))}}xt(async()=>{t(2,o=!0);try{t(1,l=(await rt(()=>import("./CodeEditor-f9d91cfd.js"),["./CodeEditor-f9d91cfd.js","./index-8390b00e.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&&Ri("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 h4 extends ve{constructor(e){super(),be(this,e,m4,p4,_e,{collection:0})}}const _4=n=>({active:n&1}),Yd=n=>({active:n[0]});function Kd(n){let e,t,i;const s=n[15].default,l=wt(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)&&$t(l,s,o,o[14],i?St(s,o[14],r,null):Ct(o[14]),null)},i(o){i||(A(l,o),o&&nt(()=>{i&&(t||(t=He(e,yt,{duration:150},!0)),t.run(1))}),i=!0)},o(o){P(l,o),o&&(t||(t=He(e,yt,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&w(e),l&&l.d(o),o&&t&&t.end()}}}function g4(n){let e,t,i,s,l,o,r;const a=n[15].header,u=wt(a,n,n[14],Yd);let f=n[0]&&Kd(n);return{c(){e=y("div"),t=y("button"),u&&u.c(),i=E(),f&&f.c(),h(t,"type","button"),h(t,"class","accordion-header"),h(t,"draggable",n[2]),x(t,"interactive",n[3]),h(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(d,p){S(d,e,p),v(e,t),u&&u.m(t,null),v(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[J(t,"click",at(n[17])),J(t,"drop",at(n[18])),J(t,"dragstart",n[19]),J(t,"dragenter",n[20]),J(t,"dragleave",n[21]),J(t,"dragover",at(n[16]))],o=!0)},p(d,[p]){u&&u.p&&(!l||p&16385)&&$t(u,a,d,d[14],l?St(a,d[14],p,_4):Ct(d[14]),Yd),(!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=Kd(d),f.c(),A(f,1),f.m(e,null)):f&&(ae(),P(f,1,1,()=>{f=null}),ue()),(!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,Ee(r)}}}function b4(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=Tt();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=$e(),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=Jd(),d.c(),A(d,1),d.m(o.parentNode,o)):d&&(ae(),P(d,1,1,()=>{d=null}),ue())},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=W("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowEmailAuth,S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Zd(n){let e,t,i,s,l,o,r,a;return i=new de({props:{class:"form-field "+(H.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[C4,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field "+(H.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[T4,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),U(i.$$.fragment),s=E(),l=y("div"),U(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),z(i,t,null),v(e,s),v(e,l),z(o,l,null),a=!0},p(u,f){const d={};f&1&&(d.class="form-field "+(H.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 "+(H.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,yt,{duration:150},!0)),r.run(1))}),a=!0)},o(u){P(i.$$.fragment,u),P(o.$$.fragment,u),u&&(r||(r=He(e,yt,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),B(i),B(o),u&&r&&r.end()}}}function C4(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:!H.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(g.value=n[0].options.exceptEmailDomains),r=new Vs({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(),U(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),z(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(m=De(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=!H.isEmpty(b[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set($)},i(b){d||(A(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),B(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function T4(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:!H.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(g.value=n[0].options.onlyEmailDomains),r=new Vs({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(),U(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),z(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(m=De(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=!H.isEmpty(b[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set($)},i(b){d||(A(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),B(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function M4(n){let e,t,i,s;e=new de({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[$4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Zd(n);return{c(){U(e.$$.fragment),t=E(),l&&l.c(),i=$e()},m(o,r){z(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=Zd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),P(l,1,1,()=>{l=null}),ue())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){B(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function O4(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 D4(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 Gd(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=De(We.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(nt(()=>{i&&(t||(t=He(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=He(e,Wt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function E4(n){let e,t,i,s,l,o,r;function a(p,m){return p[0].options.allowEmailAuth?D4:O4}let u=a(n),f=u(n),d=n[2]&&Gd();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=$e(),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=Gd(),d.c(),A(d,1),d.m(o.parentNode,o)):d&&(ae(),P(d,1,1,()=>{d=null}),ue())},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 A4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=W("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowOAuth2Auth,S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Xd(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,yt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=He(e,yt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function I4(n){let e,t,i,s;e=new de({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[A4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Xd();return{c(){U(e.$$.fragment),t=E(),l&&l.c(),i=$e()},m(o,r){z(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=Xd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),P(l,1,1,()=>{l=null}),ue())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){B(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function P4(n){let e;return{c(){e=y("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function L4(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 Qd(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=De(We.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(nt(()=>{i&&(t||(t=He(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=He(e,Wt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function N4(n){let e,t,i,s,l,o,r;function a(p,m){return p[0].options.allowOAuth2Auth?L4:P4}let u=a(n),f=u(n),d=n[1]&&Qd();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=$e(),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=Qd(),d.c(),A(d,1),d.m(o.parentNode,o)):d&&(ae(),P(d,1,1,()=>{d=null}),ue())},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 F4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=W("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),fe(l,n[0].options.minPasswordLength),r||(a=J(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&h(e,"for",i),f&4096&&o!==(o=u[12])&&h(l,"id",o),f&1&&gt(l.value)!==u[0].options.minPasswordLength&&fe(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function R4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),l.textContent="Always require email",o=E(),r=y("i"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(l,"class","txt"),h(r,"class","ri-information-line txt-sm link-hint"),h(s,"for",a=n[12])},m(d,p){S(d,e,p),e.checked=n[0].options.requireEmail,S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[J(e,"change",n[11]),De(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,Ee(f)}}}function q4(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:[S4],default:[y4]},$$scope:{ctx:n}}}),o=new co({props:{single:!0,$$slots:{header:[E4],default:[M4]},$$scope:{ctx:n}}}),a=new co({props:{single:!0,$$slots:{header:[N4],default:[I4]},$$scope:{ctx:n}}}),_=new de({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[F4,({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:[R4,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("h4"),e.textContent="Auth methods",t=E(),i=y("div"),U(s.$$.fragment),l=E(),U(o.$$.fragment),r=E(),U(a.$$.fragment),u=E(),f=y("hr"),d=E(),p=y("h4"),p.textContent="General",m=E(),U(_.$$.fragment),g=E(),U(b.$$.fragment),h(e,"class","section-title"),h(i,"class","accordions"),h(p,"class","section-title")},m($,T){S($,e,T),S($,t,T),S($,i,T),z(s,i,null),v(i,l),z(o,i,null),v(i,r),z(a,i,null),S($,u,T),S($,f,T),S($,d,T),S($,p,T),S($,m,T),z(_,$,T),S($,g,T),z(b,$,T),k=!0},p($,[T]){const C={};T&8201&&(C.$$scope={dirty:T,ctx:$}),s.$set(C);const D={};T&8197&&(D.$$scope={dirty:T,ctx:$}),o.$set(D);const M={};T&8195&&(M.$$scope={dirty:T,ctx:$}),a.$set(M);const O={};T&12289&&(O.$$scope={dirty:T,ctx:$}),_.$set(O);const I={};T&12289&&(I.$$scope={dirty:T,ctx:$}),b.$set(I)},i($){k||(A(s.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(_.$$.fragment,$),A(b.$$.fragment,$),k=!0)},o($){P(s.$$.fragment,$),P(o.$$.fragment,$),P(a.$$.fragment,$),P(_.$$.fragment,$),P(b.$$.fragment,$),k=!1},d($){$&&w(e),$&&w(t),$&&w(i),B(s),B(o),B(a),$&&w(u),$&&w(f),$&&w(d),$&&w(p),$&&w(m),B(_,$),$&&w(g),B(b,$)}}}function j4(n,e,t){let i,s,l,o;Je(n,Ci,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&&H.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!H.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!H.isEmpty((b=o==null?void 0:o.options)==null?void 0:b.onlyEmailDomains)||!H.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!H.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 V4 extends ve{constructor(e){super(),be(this,e,j4,q4,_e,{collection:0})}}function xd(n,e,t){const i=n.slice();return i[17]=e[t],i}function ep(n,e,t){const i=n.slice();return i[17]=e[t],i}function tp(n,e,t){const i=n.slice();return i[17]=e[t],i}function np(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 ip(n){var r;let e,t,i,s,l=n[3]&&sp(n),o=!((r=n[2])!=null&&r.$isView)&&lp(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=sp(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=lp
`),s=y("strong"),o=W(l),r=E(),a=y("i"),u=E(),f=y("strong"),p=W(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)+"")&&oe(o,l),b&4&&d!==(d=(($=g[2])==null?void 0:$.name)+"")&&oe(p,d)},d(g){g&&w(e)}}}function lp(n){let e,t,i,s=n[5],l=[];for(let f=0;f<s.length;f+=1)l[f]=op(tp(n,s,f));let o=n[7],r=[];for(let f=0;f<o.length;f+=1)r[f]=rp(ep(n,o,f));let a=n[6],u=[];for(let f=0;f<a.length;f+=1)u[f]=ap(xd(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=$e()},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=tp(f,s,p);l[p]?l[p].p(m,d):(l[p]=op(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=ep(f,o,p);r[p]?r[p].p(m,d):(r[p]=rp(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=xd(f,a,p);u[p]?u[p].p(m,d):(u[p]=ap(m),u[p].c(),u[p].m(i.parentNode,i))}for(;p<u.length;p+=1)u[p].d(1);u.length=a.length}},d(f){pt(l,f),f&&w(e),pt(r,f),f&&w(t),pt(u,f),f&&w(i)}}}function op(n){let e,t,i,s=n[17].name+"",l,o,r;return{c(){e=y("li"),t=W(`Multiple to single value conversion of field
`),i=y("strong"),l=W(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+"")&&oe(l,s)},d(a){a&&w(e)}}}function rp(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=W(`Renamed field
`),s=y("strong"),o=W(l),r=E(),a=y("i"),u=E(),f=y("strong"),p=W(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+"")&&oe(o,l),_&128&&d!==(d=m[17].name+"")&&oe(p,d)},d(m){m&&w(e)}}}function ap(n){let e,t,i,s=n[17].name+"",l,o;return{c(){e=y("li"),t=W("Removed field "),i=y("span"),l=W(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+"")&&oe(l,s)},d(r){r&&w(e)}}}function H4(n){let e,t,i,s,l,o,r,a,u=n[6].length&&np(),f=n[8]&&ip(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=$e(),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=np(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),d[8]?f?f.p(d,p):(f=ip(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 z4(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 B4(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='<span class="txt">Cancel</span>',t=E(),i=y("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,h(e,"type","button"),h(e,"class","btn btn-transparent"),h(i,"type","button"),h(i,"class","btn btn-expanded")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),e.focus(),s||(l=[J(e,"click",n[11]),J(i,"click",n[12])],s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Ee(l)}}}function U4(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[B4],header:[z4],default:[H4]},$$scope:{ctx:n}};return e=new hn({props:i}),n[13](e),e.$on("hide",n[14]),e.$on("show",n[15]),{c(){U(e.$$.fragment)},m(s,l){z(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),B(e,s)}}}function W4(n,e,t){let i,s,l,o,r;const a=Tt();let u,f,d;async function p(C,D){t(1,f=C),t(2,d=D),await an(),i||s.length||l.length||o.length?u==null||u.show():_()}function m(){u==null||u.hide()}function _(){m(),a("confirm")}const g=()=>m(),b=()=>_();function k(C){se[C?"unshift":"push"](()=>{u=C,t(4,u)})}function $(C){me.call(this,n,C)}function T(C){me.call(this,n,C)}return n.$$.update=()=>{var C,D,M;n.$$.dirty&6&&t(3,i=(f==null?void 0:f.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(7,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(O=>O.id&&!O.toDelete&&O.originalName!=O.name))||[]),n.$$.dirty&4&&t(6,l=((D=d==null?void 0:d.schema)==null?void 0:D.filter(O=>O.id&&O.toDelete))||[]),n.$$.dirty&6&&t(5,o=((M=d==null?void 0:d.schema)==null?void 0:M.filter(O=>{var L,F,q;const I=(L=f==null?void 0:f.schema)==null?void 0:L.find(N=>N.id==O.id);return I?((F=I.options)==null?void 0:F.maxSelect)!=1&&((q=O.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,$,T]}class Y4 extends ve{constructor(e){super(),be(this,e,W4,U4,_e,{show:10,hide:0})}get show(){return this.$$.ctx[10]}get hide(){return this.$$.ctx[0]}}function up(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function K4(n){let e,t,i;function s(o){n[33](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new GT({props:l}),se.push(()=>he(e,"collection",s)),{c(){U(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){B(e,o)}}}function J4(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new h4({props:l}),se.push(()=>he(e,"collection",s)),{c(){U(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){B(e,o)}}}function fp(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 u4({props:o}),se.push(()=>he(t,"collection",l)),{c(){e=y("div"),U(t.$$.fragment),h(e,"class","tab-item active")},m(r,a){S(r,e,a),z(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),B(t)}}}function cp(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 V4({props:o}),se.push(()=>he(t,"collection",l)),{c(){e=y("div"),U(t.$$.fragment),h(e,"class","tab-item"),x(e,"active",n[3]===Ls)},m(r,a){S(r,e,a),z(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=[J(e,"click",n[24]),J(i,"click",An(at(n[25])))],s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Ee(l)}}}function pp(n){let e,t,i,s;return i=new Kn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[X4]},$$scope:{ctx:n}}}),{c(){e=y("i"),t=E(),U(i.$$.fragment),h(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),z(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),B(i,l)}}}function mp(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=W(o),a=W(" collection"),u=E(),h(t,"class",i=wi(H.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),h(l,"class","txt"),h(e,"type","button"),h(e,"class","dropdown-item closable"),x(e,"selected",n[47]==n[2].type)},m(m,_){S(m,e,_),v(e,t),v(e,s),v(e,l),v(l,r),v(l,a),v(e,u),f||(d=J(e,"click",p),f=!0)},p(m,_){n=m,_[0]&64&&i!==(i=wi(H.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&h(t,"class",i),_[0]&64&&o!==(o=n[48]+"")&&oe(r,o),_[0]&68&&x(e,"selected",n[47]==n[2].type)},d(m){m&&w(e),f=!1,d()}}}function X4(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=mp(up(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=$e()},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=up(s,t,o);i[o]?i[o].p(r,l):(i[o]=mp(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){pt(i,s),s&&w(e)}}}function hp(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 Q4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k=(n[6][n[2].type]||"N/A")+"",$,T,C,D,M,O,I,L,F,q=n[2].$isNew&&pp(n),N=n[2].system&&hp();return{c(){e=y("label"),t=W("Name"),s=E(),l=y("input"),f=E(),d=y("div"),p=y("button"),m=y("span"),_=E(),g=y("span"),b=W("Type: "),$=W(k),T=E(),q&&q.c(),M=E(),N&&N.c(),O=$e(),h(e,"for",i=n[46]),h(l,"type","text"),h(l,"id",o=n[46]),l.required=!0,l.disabled=n[13],h(l,"spellcheck","false"),l.autofocus=r=n[2].$isNew,h(l,"placeholder",a=n[2].$isAuth?'eg. "users"':'eg. "posts"'),l.value=u=n[2].name,h(g,"class","txt"),h(p,"type","button"),h(p,"class",C="btn btn-sm p-r-10 p-l-10 "+(n[2].$isNew?"btn-outline":"btn-transparent")),p.disabled=D=!n[2].$isNew,h(d,"class","form-field-addon")},m(R,j){S(R,e,j),v(e,t),S(R,s,j),S(R,l,j),S(R,f,j),S(R,d,j),v(d,p),v(p,m),v(p,_),v(p,g),v(g,b),v(g,$),v(p,T),q&&q.m(p,null),S(R,M,j),N&&N.m(R,j),S(R,O,j),I=!0,n[2].$isNew&&l.focus(),L||(F=J(l,"input",n[26]),L=!0)},p(R,j){(!I||j[1]&32768&&i!==(i=R[46]))&&h(e,"for",i),(!I||j[1]&32768&&o!==(o=R[46]))&&h(l,"id",o),(!I||j[0]&8192)&&(l.disabled=R[13]),(!I||j[0]&4&&r!==(r=R[2].$isNew))&&(l.autofocus=r),(!I||j[0]&4&&a!==(a=R[2].$isAuth?'eg. "users"':'eg. "posts"'))&&h(l,"placeholder",a),(!I||j[0]&4&&u!==(u=R[2].name)&&l.value!==u)&&(l.value=u),(!I||j[0]&68)&&k!==(k=(R[6][R[2].type]||"N/A")+"")&&oe($,k),R[2].$isNew?q?(q.p(R,j),j[0]&4&&A(q,1)):(q=pp(R),q.c(),A(q,1),q.m(p,null)):q&&(ae(),P(q,1,1,()=>{q=null}),ue()),(!I||j[0]&4&&C!==(C="btn btn-sm p-r-10 p-l-10 "+(R[2].$isNew?"btn-outline":"btn-transparent")))&&h(p,"class",C),(!I||j[0]&4&&D!==(D=!R[2].$isNew))&&(p.disabled=D),R[2].system?N||(N=hp(),N.c(),N.m(O.parentNode,O)):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(O),L=!1,F()}}}function _p(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=De(t=We.call(null,e,n[11])),l=!0)},p(r,a){t&&Vt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&nt(()=>{s&&(i||(i=He(e,Wt,{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=J(t,"click",n[12]),i=!0)},p:Q,d(l){l&&w(e),i=!1,s()}}}function sM(n){let e,t,i,s,l,o,r,a,u,f,d,p=[],m=new Map,_,g,b,k,$,T,C=n[3];const D=L=>L[15].id;for(let L=0;L<C.length;L+=1){let F=wp(n,C,L),q=D(F);m.set(q,p[L]=Cp(q,F))}let M=null;C.length||(M=Sp(n));let O=!n[7]&&Tp(n),I={};return b=new fu({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(),O&&O.c(),g=E(),U(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),fe(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,_),O&&O.m(e,null),S(L,g,F),z(b,L,F),k=!0,$||(T=[J(l,"click",n[10]),J(r,"input",n[11])],$=!0)},p(L,[F]){(!k||F&16)&&x(l,"hidden",!L[4]),F&1&&r.value!==L[0]&&fe(r,L[0]),(!k||F&16)&&x(i,"active",L[4]),F&42&&(C=L[3],p=vt(p,F,D,1,L,C,m,d,us,Cp,null,wp),!C.length&&M?M.p(L,F):C.length?M&&(M.d(1),M=null):(M=Sp(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]?O&&(O.d(1),O=null):O?O.p(L,F):(O=Tp(L),O.c(),O.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(),O&&O.d(),L&&w(g),n[13](null),B(b,L),$=!1,Ee(T)}}}function lM(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function oM(n,e,t){let i,s,l,o,r,a,u;Je(n,ui,$=>t(5,o=$)),Je(n,ci,$=>t(9,r=$)),Je(n,yo,$=>t(6,a=$)),Je(n,Es,$=>t(7,u=$));let f,d="";function p($){rn(ui,o=$,o)}const m=()=>t(0,d="");function _(){d=this.value,t(0,d)}const g=()=>f==null?void 0:f.show();function b($){se[$?"unshift":"push"](()=>{f=$,t(2,f)})}const k=$=>{var T;(T=$.detail)!=null&&T.isNew&&$.detail.collection&&p($.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&lM(),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 rM extends ve{constructor(e){super(),be(this,e,oM,sM,_e,{})}}function Mp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Op(n){n[18]=n[19].default}function Dp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Ep(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 Ap(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,d=i&&Ep();function p(){return e[9](e[14])}return{key:n,first:null,c(){t=$e(),d&&d.c(),s=E(),l=y("button"),r=W(o),a=E(),h(l,"type","button"),h(l,"class","sidebar-item"),x(l,"active",e[5]===e[14]),this.first=t},m(m,_){S(m,t,_),d&&d.m(m,_),S(m,s,_),S(m,l,_),v(l,r),v(l,a),u||(f=J(l,"click",p),u=!0)},p(m,_){e=m,_&8&&(i=e[21]===Object.keys(e[6]).length),i?d||(d=Ep(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),_&8&&o!==(o=e[15].label+"")&&oe(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 Ip(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:fM,then:uM,catch:aM,value:19,blocks:[,,,]};return _u(t=n[15].component,s),{c(){e=$e(),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:[O6,({uniqueId:o})=>({26:o}),({uniqueId:o})=>[o?67108864:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),U(t.$$.fragment),h(e,"class","block")},m(o,r){S(o,e,r),z(t,e,null),i=!0,s||(l=[J(e,"dragover",at(n[23])),J(e,"dragleave",n[24]),J(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),B(t),s=!1,Ee(l)}}}function E6(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){H.removeByValue(u,R),t(1,u)}function b(R){H.pushUnique(u,R),t(1,u)}function k(R){H.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 T(R){var V,K;R.preventDefault(),t(8,m=!1);const j=((V=R.dataTransfer)==null?void 0:V.files)||[];if(!(l||!j.length)){for(const ee of j){const te=s.length+a.length-u.length;if(((K=f.options)==null?void 0:K.maxSelect)<=te)break;a.push(ee)}t(0,a)}}xt(async()=>{t(9,_=await pe.getAdminFileToken(o.collectionId))});const C=R=>g(R),D=R=>b(R),M=R=>k(R);function O(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,j;n.$$.dirty[0]&1&&(Array.isArray(a)||t(0,a=H.toArray(a))),n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=H.toArray(u))),n.$$.dirty[0]&8&&t(5,i=((R=f.options)==null?void 0:R.maxSelect)>1),n.$$.dirty[0]&32800&&H.isEmpty(r)&&t(15,r=i?[]:""),n.$$.dirty[0]&32768&&t(4,s=H.toArray(r)),n.$$.dirty[0]&27&&t(10,l=(s.length||a.length)&&((j=f.options)==null?void 0:j.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,T,r,C,D,M,O,I,L,F,q,N]}class A6 extends ve{constructor(e){super(),be(this,e,E6,D6,_e,{record:2,value:15,uploadedFiles:0,deletedFileIndexes:1,field:3},null,[-1,-1])}}function Bp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function I6(n,e){e=Bp(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=Bp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}const P6=n=>({dragging:n&2,dragover:n&4}),Up=n=>({dragging:n[1],dragover:n[2]});function L6(n){let e,t,i,s;const l=n[8].default,o=wt(l,n,n[7],Up);return{c(){e=y("div"),o&&o.c(),h(e,"draggable",!0),h(e,"class","draggable svelte-28orm4"),x(e,"dragging",n[1]),x(e,"dragover",n[2])},m(r,a){S(r,e,a),o&&o.m(e,null),t=!0,i||(s=[J(e,"dragover",at(n[9])),J(e,"dragleave",at(n[10])),J(e,"dragend",n[11]),J(e,"dragstart",n[12]),J(e,"drop",n[13])],i=!0)},p(r,[a]){o&&o.p&&(!t||a&134)&&$t(o,l,r,r[7],t?St(l,r[7],a,P6):Ct(r[7]),Up),(!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,Ee(s)}}}function N6(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=Tt();let{index:o}=e,{list:r=[]}=e,{disabled:a=!1}=e,u=!1,f=!1;function d($,T){!$&&!a||(t(1,u=!0),$.dataTransfer.effectAllowed="move",$.dataTransfer.dropEffect="move",$.dataTransfer.setData("text/plain",T))}function p($,T){if(!$&&!a)return;t(2,f=!1),t(1,u=!1),$.dataTransfer.dropEffect="move";const C=parseInt($.dataTransfer.getData("text/plain"));C<T?(r.splice(T+1,0,r[C]),r.splice(C,1)):(r.splice(T,0,r[C]),r.splice(C+1,1)),t(5,r),l("sort",r)}const m=()=>{t(2,f=!0)},_=()=>{t(2,f=!1)},g=()=>{t(2,f=!1),t(1,u=!1)},b=$=>d($,o),k=$=>p($,o);return n.$$set=$=>{"index"in $&&t(0,o=$.index),"list"in $&&t(5,r=$.list),"disabled"in $&&t(6,a=$.disabled),"$$scope"in $&&t(7,s=$.$$scope)},[o,u,f,d,p,r,a,s,i,m,_,g,b,k]}class F6 extends ve{constructor(e){super(),be(this,e,N6,L6,_e,{index:0,list:5,disabled:6})}}function Wp(n,e,t){const i=n.slice();i[6]=e[t];const s=H.toArray(i[0][i[
`),O&&O.c(),p=E(),_.c(),g=$e(),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),z(t,e,null),v(e,i),T&&T.m(e,null),S(N,s,R),S(N,l,R);for(let j=0;j<o.length;j+=1)o[j]&&o[j].m(l,null);M&&M.m(l,null),S(N,u,R),S(N,f,R),v(f,d),O&&O.m(f,null),S(N,p,R),L[m].m(N,R),S(N,g,R),b=!0,k||($=De(a=I6.call(null,l,n[36])),k=!0)},p(N,R){var K;const j={};R[0]&4&&(j.value=N[2]),R[0]&1024&&(j.autocompleteCollection=N[10]),t.$set(j),(K=N[10])!=null&&K.$isView?T&&(T.d(1),T=null):T?T.p(N,R):(T=Qp(N),T.c(),T.m(e,null)),R[0]&145324&&(C=N[3],ae(),o=vt(o,R,D,1,N,C,r,l,Kt,nm,null,Xp),ue(),!C.length&&M?M.p(N,R):C.length?M&&(M.d(1),M=null):(M=xp(N),M.c(),M.m(l,null))),a&&Vt(a.update)&&R[0]&2064&&a.update.call(null,N[36]),N[5]>1?O?O.p(N,R):(O=im(N),O.c(),O.m(f,null)):O&&(O.d(1),O=null);let V=m;m=F(N),m===V?L[m].p(N,R):(ae(),P(L[V],1,1,()=>{L[V]=null}),ue(),_=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<C.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),B(t),T&&T.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),O&&O.d(),N&&w(p),L[m].d(N),N&&w(g),k=!1,$()}}}function K6(n){var r;let e,t,i,s=(((r=n[10])==null?void 0:r.name)||"")+"",l,o;return{c(){e=y("h4"),t=W("Select "),i=y("strong"),l=W(s),o=W(" 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)||"")+"")&&oe(l,s)},d(a){a&&w(e)}}}function J6(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">Set selection</span>',h(e,"type","button"),h(e,"class","btn btn-transparent"),h(i,"type","button"),h(i,"class","btn")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[J(e,"click",n[28]),J(i,"click",n[29])],s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Ee(l)}}}function Z6(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[J6],header:[K6],default:[Y6]},$$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 mb({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){U(e.$$.fragment),t=E(),U(i.$$.fragment)},m(a,u){z(e,a,u),S(a,t,u),z(i,a,u),s=!0},p(a,u){const f=u[0]&524288?Mt(l,[l[0],l[1],Zt(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),B(e,a),a&&w(t),n[42](null),B(i,a)}}}const Pr=100;function G6(n,e,t){let i,s,l,o,r,a,u,f;const d=["value","field","show","hide"];let p=Qe(e,d),m;Je(n,ci,Ne=>t(26,m=Ne));const _=Tt(),g="picker_"+H.randomString(5);let{value:b}=e,{field:k}=e,$,T,C="",D=[],M=[],O=1,I=0,L=!1,F=!1;function q(){return t(2,C=""),t(3,D=[]),t(6,M=[]),R(),j(!0),$==null?void 0:$.show()}function N(){return $==null?void 0:$.hide()}async function R(){const Ne=H.toArray(b);if(!s||!Ne.length)return;t(24,F=!0);let Ce=[];const tt=Ne.slice(),Et=[];for(;tt.length>0;){const Rt=[];for(const Ht of tt.splice(0,Pr))Rt.push(`id="${Ht}"`);Et.push(pe.collection(s).getFullList(Pr,{filter:Rt.join("||"),$autoCancel:!1}))}try{await Promise.all(Et).then(Rt=>{Ce=Ce.concat(...Rt)}),t(6,M=[]);for(const Rt of Ne){const Ht=H.findByKey(Ce,"id",Rt);Ht&&M.push(Ht)}C.trim()||t(3,D=H.filterDuplicatesByKey(M.concat(D)))}catch(Rt){pe.errorResponseHandler(Rt)}t(24,F=!1)}async function j(Ne=!1){if(s){t(4,L=!0),Ne&&(C.trim()?t(3,D=[]):t(3,D=H.toArray(M).slice()));try{const Ce=Ne?1:O+1,tt=H.getAllCollectionIdentifiers(o),Et=await pe.collection(s).getList(Ce,Pr,{filter:H.normalizeSearchFilter(C,tt),sort:o!=null&&o.$isView?"":"-created",$cancelKey:g+"loadList"});t(3,D=H.filterDuplicatesByKey(D.concat(Et.items))),O=Et.page,t(23,I=Et.totalItems)}catch(Ce){pe.errorResponseHandler(Ce)}t(4,L=!1
`,h(e,"class","list-item")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function fm(n,e){var m;let t,i,s,l,o,r,a,u,f,d;s=new xo({props:{record:e[17],displayFields:(m=e[2].options)==null?void 0:m.displayFields}});function p(){return e[9](e[17])}return{key:n,first:null,c(){t=y("div"),i=y("div"),U(s.$$.fragment),l=E(),o=y("div"),r=y("button"),r.innerHTML='<i class="ri-close-line"></i>',a=E(),h(i,"class","content"),h(r,"type","button"),h(r,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),h(o,"class","actions"),h(t,"class","list-item"),this.first=t},m(_,g){S(_,t,g),v(t,i),z(s,i,null),v(t,l),v(t,o),v(o,r),v(t,a),u=!0,f||(d=[De(We.call(null,r,"Remove")),J(r,"click",p)],f=!0)},p(_,g){var k;e=_;const b={};g&16&&(b.record=e[17]),g&4&&(b.displayFields=(k=e[2].options)==null?void 0:k.displayFields),s.$set(b)},i(_){u||(A(s.$$.fragment,_),u=!0)},o(_){P(s.$$.fragment,_),u=!1},d(_){_&&w(t),B(s),f=!1,Ee(d)}}}function Q6(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,d,p=[],m=new Map,_,g,b,k,$,T,C=n[4];const D=O=>O[17].id;for(let O=0;O<C.length;O+=1){let I=lm(n,C,O),L=D(I);m.set(L,p[O]=fm(L,I))}let M=null;return C.length||(M=rm(n)),{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=W(o),u=E(),f=y("div"),d=y("div");for(let O=0;O<p.length;O+=1)p[O].c();M&&M.c(),_=E(),g=y("div"),b=y("button"),b.innerHTML=`<i class="ri-magic-line"></i>
<span class="txt">Open picker</span>`,h(t,"class",i=wi(H.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),h(l,"class","txt"),h(e,"for",a=n[16]),h(d,"class","relations-list svelte-1ynw0pc"),h(b,"type","button"),h(b,"class","btn btn-transparent btn-sm btn-block"),h(g,"class","list-item list-item-btn"),h(f,"class","list")},m(O,I){S(O,e,I),v(e,t),v(e,s),v(e,l),v(l,r),S(O,u,I),S(O,f,I),v(f,d);for(let L=0;L<p.length;L+=1)p[L]&&p[L].m(d,null);M&&M.m(d,null),v(f,_),v(f,g),v(g,b),k=!0,$||(T=J(b,"click",n[10]),$=!0)},p(O,I){(!k||I&4&&i!==(i=wi(H.getFieldTypeIcon(O[2].type))+" svelte-1ynw0pc"))&&h(t,"class",i),(!k||I&4)&&o!==(o=O[2].name+"")&&oe(r,o),(!k||I&65536&&a!==(a=O[16]))&&h(e,"for",a),I&181&&(C=O[4],ae(),p=vt(p,I,D,1,O,C,m,d,Kt,fm,null,lm),ue(),!C.length&&M?M.p(O,I):C.length?M&&(M.d(1),M=null):(M=rm(O),M.c(),M.m(d,null)))},i(O){if(!k){for(let I=0;I<C.length;I+=1)A(p[I]);k=!0}},o(O){for(let I=0;I<p.length;I+=1)P(p[I]);k=!1},d(O){O&&w(e),O&&w(u),O&&w(f);for(let I=0;I<p.length;I+=1)p[I].d();M&&M.d(),$=!1,T()}}}function x6(n){let e,t,i,s,l={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[Q6,({uniqueId:r})=>({16:r}),({uniqueId:r})=>r?65536:0]},$$scope:{ctx:n}};e=new de({props:l}),n[11](e);let o={value:n[0],field:n[2]};return i=new X6({props:o}),n[12](i),i.$on("save",n[13]),{c(){U(e.$$.fragment),t=E(),U(i.$$.fragment)},m(r,a){z(e,r,a),S(r,t,a),z(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&8454199&&(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[11](null),B(e,r),r&&w(t),n[12](null),B(i,r)}}}const cm=100;function e5(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new wn}=e,r,a=[],u=!1,f;function d(){if(u)return!1;const T=H.toArray(s);return t(4,a=a.filter(C=>T.includes(C.id))),T.length!=a.length}async function p(){var M,O;const T=H.toArray(s);if(t(4,a=[]),!((M=o==null?void 0:o.options)!=null&&M.collectionId)||!T.length){t(5,u=!1);return}t(5,u=!0);const C=T.slice(),D=[];for(;C.length>0;){const I=[];for(const L of C.splice(0,cm))I.push(`id="${L}"`);D.push(pe.collection((O=o==null?void 0:o.options)==null?void 0:O.collectionId).getFullList(cm,{filter:I.join("||"),$autoCancel:!1}))}try{let I=[];await Promise.all(D).then(L=>{I=I.concat(...L)});for(const L of T){const F=H.findByKey(I,"id",L);F&&a.push(F)}t(4,a)}catch(I){pe.errorResponseHandler(I)}t(5,u=!1)}function m(T){var C;H.removeByKey(a,"id",T.id),t(4,a),i?t(0,s=a.map(D=>D.id)):t(0,s=((C=a[0])==null?void 0:C.id)||"")}ba(()=>{clearTimeout(f)});const _=T=>m(T),g=()=>l==null?void 0:l.show();function b(T){se[T?"unshift":"push"](()=>{r=T,t(3,r)})}function k(T){se[T?"unshift":"push"](()=>{l=T,t(1,l)})}const $=T=>{var C;t(4,a=T.detail||[]),t(0,s=i?a.map(D=>D.id):((C=a[0])==null?void 0:C.id)||"")};return n.$$set=T=>{"value"in T&&t(0,s=T.value),"picker"in T&&t(1,l=T.picker),"field"in T&&t(2,o=T.field)},n.$$.update=()=>{var T;n.$$.dirty&4&&t(6,i=((T=o.options)==null?void 0:T.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed()),n.$$.dirty&273&&d()&&(clearTimeout(f),t(8,f=setTimeout(p,0)))},[s,l,o,r,a,u,i,m,f,_,g,b,k,$]}class t5 extends ve{constructor(e){super(),be(this,e,e5,x6,_e,{value:0,picker:1,field:2})}}const n5=["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","Se
...
-----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),fe(l,n[5]),S(d,r,p),S(d,a,p),u||(f=J(l,"input",n[16]),u=!0)},p(d,p){p&8388608&&i!==(i=d[23])&&h(e,"for",i),p&8388608&&o!==(o=d[23])&&h(l,"id",o),p&32&&fe(l,d[5])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function L5(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:[D5,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"teamId",$$slots:{default:[E5,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field required",name:"keyId",$$slots:{default:[A5,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),m=new de({props:{class:"form-field required",name:"duration",$$slots:{default:[I5,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),g=new de({props:{class:"form-field required",name:"privateKey",$$slots:{default:[P5,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),t=y("div"),i=y("div"),U(s.$$.fragment),l=E(),o=y("div"),U(r.$$.fragment),a=E(),u=y("div"),U(f.$$.fragment),d=E(),p=y("div"),U(m.$$.fragment),_=E(),U(g.$$.fragment),h(i,"class","col-lg-6"),h(o,"class","col-lg-6"),h(u,"class","col-lg-6"),h(p,"class","col-lg-6"),h(t,"class","grid"),h(e,"id",n[9]),h(e,"autocomplete","off")},m(T,C){S(T,e,C),v(e,t),v(t,i),z(s,i,null),v(t,l),v(t,o),z(r,o,null),v(t,a),v(t,u),z(f,u,null),v(t,d),v(t,p),z(m,p,null),v(t,_),z(g,t,null),b=!0,k||($=J(e,"submit",at(n[17])),k=!0)},p(T,C){const D={};C&25165828&&(D.$$scope={dirty:C,ctx:T}),s.$set(D);const M={};C&25165832&&(M.$$scope={dirty:C,ctx:T}),r.$set(M);const O={};C&25165840&&(O.$$scope={dirty:C,ctx:T}),f.$set(O);const I={};C&25165888&&(I.$$scope={dirty:C,ctx:T}),m.$set(I);const L={};C&25165856&&(L.$$scope={dirty:C,ctx:T}),g.$set(L)},i(T){b||(A(s.$$.fragment,T),A(r.$$.fragment,T),A(f.$$.fragment,T),A(m.$$.fragment,T),A(g.$$.fragment,T),b=!0)},o(T){P(s.$$.fragment,T),P(r.$$.fragment,T),P(f.$$.fragment,T),P(m.$$.fragment,T),P(g.$$.fragment,T),b=!1},d(T){T&&w(e),B(s),B(r),B(f),B(m),B(g),k=!1,$()}}}function N5(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 F5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("button"),t=W("Close"),i=E(),s=y("button"),l=y("i"),o=E(),r=y("span"),r.textContent="Generate and set secret",h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[7],h(l,"class","ri-key-line"),h(r,"class","txt"),h(s,"type","submit"),h(s,"form",n[9]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],x(s,"btn-loading",n[7])},m(d,p){S(d,e,p),v(e,t),S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=J(e,"click",n[0]),u=!0)},p(d,p){p&128&&(e.disabled=d[7]),p&384&&a!==(a=!d[8]||d[7])&&(s.disabled=a),p&128&&x(s,"btn-loading",d[7])},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,f()}}}function R5(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[F5],header:[N5],default:[L5]},$$scope:{ctx:n}};return e=new hn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){U(e.$$.fragment)},m(s,l){z(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),B(e,s)}}}const po=15777e3;function q5(n,e,t){let i;const s=Tt(),l="apple_secret_"+H.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),un({}),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),Qt("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=[J(r,"click",n[36]),De(We.call(null,u,"Discard draft")),J(u,"click",at(n[37]))],_=!0)},p:Q,i(b){m||(p&&p.end(1),m=!0)},o(b){p=wa(e,yt,{duration:150}),m=!1},d(b){b&&w(e),b&&p&&p.end(),_=!1,Ee(g)}}}function gm(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=De(i=We.call(null,t,{text:`Created: ${n[3].created}
Updated: ${n[3].updated}`,position:"left"})),s=!0)},p(o,r){i&&Vt(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 Z5(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g=!n[6]&&gm(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",wi(H.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),h(s,"class","txt"),h(o,"class","flex-fill"),h(e,"for",r=n[69]),h(f,"type","text"),h(f,"id",d=n[69]),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),fe(f,n[3].id),m||(_=J(f,"input",n[38]),m=!0)},p(b,k){k[2]&128&&r!==(r=b[69])&&h(e,"for",r),b[6]?g&&(g.d(1),g=null):g?g.p(b,k):(g=gm(b),g.c(),g.m(u.parentNode,u)),k[2]&128&&d!==(d=b[69])&&h(f,"id",d),k[0]&64&&p!==(p=!b[6])&&(f.readOnly=p),k[0]&8&&f.value!==b[3].id&&fe(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 bm(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 $M({props:r}),se.push(()=>he(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&vm();return{c(){U(e.$$.fragment),i=E(),a&&a.c(),s=$e()},m(d,p){z(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],ke(()=>t=!1)),e.$set(m),(g=(_=d[0])==null?void 0:_.schema)!=null&&g.length?a||(a=vm(),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){B(e,d),d&&w(i),a&&a.d(d),d&&w(s)}}}function vm(n){let e;return{c(){e=y("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function G5(n){let e,t,i;function s(o){n[52](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new t5({props:l}),se.push(()=>he(e,"value",s)),{c(){U(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[66]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[66].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){B(e,o)}}}function X5(n){let e,t,i,s,l;function o(f){n[49](f,n[66])}function r(f){n[50](f,n[66])}function a(f){n[51](f,n[66])}let u={field:n[66],record:n[3]};return n[3][n[66].name]!==void 0&&(u.value=n[3][n[66].name]),n[4][n[66].name]!==void 0&&(u.uploadedFiles=n[4][n[66].name]),n[5][n[66].name]!==void 0&&(u.deletedFileIndexes=n[5][n[66].name]),e=new A6({props:u}),se.push(()=>he(e,"value",o)),se.push(()=>he(e,"uploadedFiles",r)),se.push(()=>he(e,"deletedFileIndexes",a)),{c(){U(e.$$.fragment)},m(f,d){z(e,f,d),l=!0},p(f,d){n=f;const p={};d[0]&1&&(p.field=n[66]),d[0]&8&&(p.record=n[3]),!t&&d[0]&9&&(t=!0,p.value=n[3][n[66].name],ke(()=>t=!1)),!i&&d[0]&17&&(i=!0,p.uploadedFiles=n[4][n[66].name],ke(()=>i=!1)),!s&&d[0]&33&&(s=!0,p.deletedFileIndexes=n[5][n[66].name],ke(()=>s=!1)),e.$set(p)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){B(e,f)}}}function Q5(n){let e,t,i;function s(o){n[48](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new l6({props:l}),se.push(()=>he(e,"value",s)),{c(){U(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[66]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[66].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){B(e,o)}}}function x5(n){let e,t,i;function s(o){n[47](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new t6({props:l}),se.push(()=>he(e,"value",s)),{c(){U(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[66]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[66].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){B(e,o)}}}function eO(n){let e,t,i;function s(o){n[46](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new XM({props:l}),se.push(()=>he(e,"value",s)),{c(){U(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};
<span class="txt">Send verification email</span>`,h(e,"type","button"),h(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[30]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function $m(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Send password reset email</span>`,h(e,"type","button"),h(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[31]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function aO(n){let e,t,i,s,l,o,r,a=n[0].$isAuth&&!n[2].verified&&n[2].email&&Sm(n),u=n[0].$isAuth&&n[2].email&&$m(n);return{c(){a&&a.c(),e=E(),u&&u.c(),t=E(),i=y("button"),i.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,s=E(),l=y("button"),l.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,h(i,"type","button"),h(i,"class","dropdown-item closable"),h(l,"type","button"),h(l,"class","dropdown-item txt-danger closable")},m(f,d){a&&a.m(f,d),S(f,e,d),u&&u.m(f,d),S(f,t,d),S(f,i,d),S(f,s,d),S(f,l,d),o||(r=[J(i,"click",n[32]),J(l,"click",An(at(n[33])))],o=!0)},p(f,d){f[0].$isAuth&&!f[2].verified&&f[2].email?a?a.p(f,d):(a=Sm(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].$isAuth&&f[2].email?u?u.p(f,d):(u=$m(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&w(e),u&&u.d(f),f&&w(t),f&&w(i),f&&w(s),f&&w(l),o=!1,Ee(r)}}}function Cm(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]===os),h(s,"type","button"),h(s,"class","tab-item"),x(s,"active",n[12]===Sl),h(e,"class","tabs-header stretched")},m(r,a){S(r,e,a),v(e,t),v(e,i),v(e,s),l||(o=[J(t,"click",n[34]),J(s,"click",n[35])],l=!0)},p(r,a){a[0]&4096&&x(t,"active",r[12]===os),a[0]&4096&&x(s,"active",r[12]===Sl)},d(r){r&&w(e),l=!1,Ee(o)}}}function uO(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]&&wm(n),_=n[0].$isAuth&&!n[6]&&Cm(n);return{c(){e=y("h4"),i=W(t),s=E(),l=y("strong"),r=W(o),a=W(" record"),u=E(),m&&m.c(),f=E(),_&&_.c(),d=$e(),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")&&oe(i,t),(!p||k[0]&1)&&o!==(o=(($=b[0])==null?void 0:$.name)+"")&&oe(r,o),b[6]?m&&(ae(),P(m,1,1,()=>{m=null}),ue()):m?(m.p(b,k),k[0]&64&&A(m,1)):(m=wm(b),m.c(),A(m,1),m.m(f.parentNode,f)),b[0].$isAuth&&!b[6]?_?_.p(b,k):(_=Cm(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 fO(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=W(o),h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[10],h(l,"class","txt"),h(s,"type","submit"),h(s,"form",n[15]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[13]||n[10],x(s,"btn-loading",n[10])},m(d,p){S(d,e,p),v(e,t),S(d,i,p),S(d,s,p),v(s,l),v(l,r),u||(f=J(e,"click",n[29]),u=!0)},p(d,p){p[0]&1024&&(e.disabled=d[10]),p[0]&64&&o!==(o=d[6]?"Create":"Save changes")&&oe(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 cO(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:[fO],header:[uO],default:[rO]},$$scope:{ctx:n}};return e=new hn({props:i}),n[54](e),e.$on("hide",n[55]),e.$on("show",n[56]),{c(){U(e.$$.fragment)},m(l,o){z(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]&256&&(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),B(e,l)}}}const os="form",Sl="providers";function dO(n,e,t){let i,s,l,o;const r=Tt(),a="record_"+H.randomString(5);let{collection:u}=e,f,d=null,p=null,m=null,_=!1,g=!1,b={},k={},$=JSON.stringify(null),T=$,C=os,D=!0,M=!1;function O(ge){return L(ge),t(11,g=!0),t(12,C=os),f==null?void 0:f.show()}function I(){return f==null?void 0:f.hide()}async function L(ge){t(27,M=!1),un({}),t(2,d=ge||new ki),t(3,p=d.$clone()),t(4,b={}),t(5,k={}),await an(),t(9,m=N()),!m||V(p,m)?t(9,m=null):(delete m.password,delete m.passwordConfirm),t(25,$=JSON.stringify(p)),t(27,M=!0)}async function F(ge){var Fe,Xe;un({}),t(2,d=ge||new ki),t(4,b={}),t(5,k={});const Ae=((Xe=(Fe=u==null?void 0:u.schema)==null?void 0:Fe.filter(Ot=>Ot.type!="file"))==null?void 0:Xe.map(Ot=>Ot.name))||[];for(let Ot in ge.$export())Ae.includes(Ot)||t(3,p[Ot]=ge[Ot],p);await an(),t(25,$=JSON.stringify(p)),K()}function q(){return"record_draft_"+((u==null?void 0:u.id)||"")+"_"+((d==null?void 0:d.id)||"")}function N(ge){try{const Ae=window.localStorage.getItem(q());if(Ae)return new ki(JSON.parse(Ae))}catch{}return ge}function R(ge){window.localStorage.setItem(q(),ge)}function j(){m&&(t(3,p=m),t(9,m=null))}function V(ge,Ae){var $n;const Fe=ge==null?void 0:ge.$clone(),Xe=Ae==null?void 0:Ae.$clone(),Ot=($n=u==null?void 0:u.schema)==null?void 0:$n.filter(Fn=>Fn.type==="file");for(let Fn of Ot)Fe==null||delete Fe[Fn.name],Xe==null||delete Xe[Fn.name];return Fe==null||delete Fe.password,Fe==null||delete Fe.passwordConfirm,Xe==null||delete Xe.password,Xe==null||delete Xe.passwordConfirm,JSON.stringify(Fe)==JSON.stringify(Xe)}function K(){t(9,m=null),window.localStorage.removeItem(q())}function ee(ge=!0){if(_||!o||!(u!=null&&u.id))return;t(10,_=!0);const Ae=G();let Fe;D?Fe=pe.collection(u.id).create(Ae):Fe=pe.collection(u.id).update(p.id,Ae),Fe.then(Xe=>{Qt(D?"Successfully created record.":"Successfully updated record."),K(),ge?(t(11,g=!1),I()):F(Xe),r("save",Xe)}).catch(Xe=>{pe.errorResponseHandler(Xe)}).finally(()=>{t(10,_=!1)})}function te(){d!=null&&d.id&&vn("Do you really want to delete the selected record?",()=>pe.collection(d.collectionId).delete(d.id).then(()=>{I(),Qt("Successfully deleted record."),r("delete",d)}).catch(ge=>{pe.errorResponseHandler(ge)}))}function G(){const ge=(p==null?void 0:p.$export())||{},Ae=new FormData,Fe={id:ge.id};for(const Xe of(u==null?void 0:u.schema)||[])Fe[Xe.name]=!0;u!=null&&u.isAuth&&(Fe.username=!0,Fe.email=!0,Fe.emailVisibility=!0,Fe.password=!0,Fe.passwordConfirm=!0,Fe.verified=!0);for(const Xe in ge)Fe[Xe]&&(typeof ge[Xe]>"u"&&(ge[Xe]=null),H.addValueToFormData(Ae,Xe,ge[Xe]));for(const Xe in b){const Ot=H.toArray(b[Xe]);for(const $n of Ot)Ae.append(Xe,$n)}for(const Xe in k){const Ot=H.toArray(k[Xe]);for(const $n of Ot)Ae.append(Xe+"."+$n,"")}return Ae}function ce(){!(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(()=>{Qt(`Successfully sent verification email to ${d.email}.`)}).catch(ge=>{pe.errorResponseHandler(ge)}))}function X(){!(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(()=>{Qt(`Successfully sent password reset email to ${d.email}.`)}).catch(ge=>{pe.errorResponseHandler(ge)}))}function le(){l?vn("You have unsaved changes. Do you really want to discard them?",()=>{ye()}):ye()}async function ye(){const ge=d==null?void 0:d.$clone();if(ge){ge.id="",ge.created="",ge.updated="";const Ae=(u==null?void 0:u.schema)||[];for(const Fe of Ae)Fe.type==="file"&&delete ge[Fe.name]}K(),O(ge),await an(),t(25,$="")}function Se(ge){(ge.ctrlKey||ge.metaKey)&&ge.code=="KeyS"&&(ge.preventDefault(),ge.stopPropagation(),ee(!1))}const Ve=()=>I(),ze=()=>ce(),we=()=>X(),Me=()=>le(),Ze=()=>te(),mt=()=>t(12,C=os),Ge=()=>t(12,C=Sl),Ye=()=>j(),ne=()=>K();funct
`},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function eD(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,h(e,"type","button"),h(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[40]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function tD(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[39]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function th(n){let e,t,i,s,l,o,r,a,u,f;function d(){return n[36](n[55])}return{c(){e=y("td"),t=y("div"),i=y("input"),o=E(),r=y("label"),h(i,"type","checkbox"),h(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],h(r,"for",a="checkbox_"+n[55].id),h(t,"class","form-field"),h(e,"class","bulk-select-col min-width")},m(p,m){S(p,e,m),v(e,t),v(t,i),v(t,o),v(t,r),u||(f=[J(i,"change",d),J(t,"click",An(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,Ee(f)}}}function nh(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new er({props:{value:n[55].id}});let d=n[2].$isAuth&&ih(n);return{c(){e=y("td"),t=y("div"),i=y("div"),U(s.$$.fragment),l=E(),o=y("div"),a=W(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),z(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+"")&&oe(a,r),p[2].$isAuth?d?d.p(p,m):(d=ih(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),B(s),d&&d.d()}}}function ih(n){let e;function t(l,o){return l[55].verified?iD:nD}let i=t(n),s=i(n);return{c(){s.c(),e=$e()},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 nD(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=De(We.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function iD(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=De(We.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function sh(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&lh(n),o=i&&oh(n);return{c(){l&&l.c(),t=E(),o&&o.c(),s=$e()},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=lh(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=oh(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 lh(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].username)),t?lD:sD}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 sD(n){let e,t=n[55].username+"",i,s;return{c(){e=y("span"),i=W(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+"")&&oe(i,t),o[0]&16&&s!==(s=l[55].username)&&h(e,"title",s)},d(l){l&&w(e)}}}function lD(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 oh(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].email)),t?rD:oD}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 oD(n){let e,t=n[55].email+"",i,s;return{c(){e=y("span"),i=W(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=J(e,"click",n[18]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function vD(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M,O,I,L,F,q=!n[10]&&_h(n);d=new Ra({}),d.$on("refresh",n[16]);let N=!n[2].$isView&&gh(n);k=new Yo({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[19]);function R(K){n[21](K)}function j(K){n[22](K)}let V={collection:n[2]};return n[0]!==void 0&&(V.filter=n[0]),n[1]!==void 0&&(V.sort=n[1]),D=new hD({props:V}),n[20](D),se.push(()=>he(D,"filter",R)),se.push(()=>he(D,"sort",j)),D.$on("select",n[23]),D.$on("new",n[24]),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Collections",s=E(),l=y("div"),r=W(o),a=E(),u=y("div"),q&&q.c(),f=E(),U(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(),U(k.$$.fragment),$=E(),T=y("div"),C=E(),U(D.$$.fragment),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(u,"class","inline-flex gap-5"),h(_,"type","button"),h(_,"class","btn btn-outline"),h(m,"class","btns-group"),h(e,"class","page-header"),h(T,"class","clearfix m-b-base")},m(K,ee){S(K,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),z(d,u,null),v(e,p),v(e,m),v(m,_),v(m,g),N&&N.m(m,null),S(K,b,ee),z(k,K,ee),S(K,$,ee),S(K,T,ee),S(K,C,ee),z(D,K,ee),I=!0,L||(F=J(_,"click",n[17]),L=!0)},p(K,ee){(!I||ee[0]&4)&&o!==(o=K[2].name+"")&&oe(r,o),K[10]?q&&(q.d(1),q=null):q?q.p(K,ee):(q=_h(K),q.c(),q.m(u,f)),K[2].$isView?N&&(N.d(1),N=null):N?N.p(K,ee):(N=gh(K),N.c(),N.m(m,null));const te={};ee[0]&1&&(te.value=K[0]),ee[0]&4&&(te.autocompleteCollection=K[2]),k.$set(te);const G={};ee[0]&4&&(G.collection=K[2]),!M&&ee[0]&1&&(M=!0,G.filter=K[0],ke(()=>M=!1)),!O&&ee[0]&2&&(O=!0,G.sort=K[1],ke(()=>O=!1)),D.$set(G)},i(K){I||(A(d.$$.fragment,K),A(k.$$.fragment,K),A(D.$$.fragment,K),I=!0)},o(K){P(d.$$.fragment,K),P(k.$$.fragment,K),P(D.$$.fragment,K),I=!1},d(K){K&&w(e),q&&q.d(),B(d),N&&N.d(),K&&w(b),B(k,K),K&&w($),K&&w(T),K&&w(C),n[20](null),B(D,K),L=!1,F()}}}function yD(n){let e,t,i,s,l;return{c(){e=y("h1"),e.textContent="Create your first collection to add records!",t=E(),i=y("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,h(e,"class","m-b-10"),h(i,"type","button"),h(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=J(i,"click",n[14]),s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function kD(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 wD(n){let e,t,i;function s(r,a){return r[10]?kD:yD}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 SD(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 $D(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[bD,gD,_D],m=[];function _(T,C){return T[3]&&!T[9].length?0:T[9].length?2:1}e=_(n),t=m[e]=p[e](n);let g={};s=new fu({props:g}),n[25](s);let b={};o=new hM({props:b}),n[26](o);let k={collection:n[2]};a=new mb({props:k}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let $={collection:n[2]};return f=new BO({props:$}),n[30](f),{c(){t.c(),i=E(),U(s.$$.fragment),l=E(),U(o.$$.fragment),r=E(),U(a.$$.fragment),u=E(),U(f.$$.fragment)},m(T,C){m[e].m(T,C),S(T,i,C),z(s,T,C),S(T,l,C),z(o,T,C),S(T,r,C),z(a,T,C),S(T,u,C),z(f,T,C),d=!0},p(T,C){let D=e;e=_(T),e===D?m[e].p(T,C):(ae(),P(m[D],1,1,()=>{m[D]=null}),ue(),t=m[e],t?t.p(T,C):(t=m[e]=p[e](T),t.c()),A(t,1),t.m(i.parentNode,i));const M={};s.$set(M);const O={};o.$set(O);const I={};C[0]&4&&(I.collection=T[2]),a.$set(I);const L={};C[0]&4&&(L.collection=T[2]),f.$set(L)},i(T){d||(A(t),A(s.$$.fragment,T),A(o.$$.fragment,T),A(a.$$.fragment,T),A(f.$$.fragment,T),d=!0)},o(T){P(t),P(s.$$.fragment,T),P(o.$$.fragment,T),P(a.$$.fragment,T),P(f.$$.fragment,T),d=!1},d(T){m[e].d(T),T&&w(i),n[25](null),B(s,T),T&&w(l),n[26](null),B(o,T),T&&w(r),n[27](null),B(a,T),T&&w(u),n[30](null),B(f,T)}}}function CD(n,e,t){let i,s,l,o,r,a,u;Je(n,ui,X=>t(2,s=X)),Je(n,Nt,X=>t(31,l=X)),Je(n,yo,X=>t(3,o=X)),Je(n,Sa,X=>t(13,r=X)),Je(n,ci,X=>t(9,a=X)),Je(n,Es,X=>t(10,u=X));const f=new URLSearchParams(r);let d,p,m,_,g,b=f.get("filter")||"",k=f.get("sort")||"",$=f.get("collectionId")||(s==null?void 0:s.id);function T(){t(11,$=s==null?void 0:s.id),t(0,b=""),t(1,k="-created"),s!=null&&s.$isView&&!H.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}vy($);const C=()=>d==null?void 0:d.show(),D=()=>d==null?void 0:d.show(s),M=()=>g==null?void 0:g.load(),O=()=>p==null?void 0:p.show(s),I=()=>m==null?void 0:m.show(),L=X=>t(0,b=X.detail);function F(X){se[X?"unshift":"push"](()=>{g=X,t(8,g)})}function q(X){b=X,t(0,b)}function N(X){k=X,t(1,k)}const R=X=>{s.$isView?_.show(X==null?void 0:X.detail):m==null||m.show(X==null?void 0:X.detail)},j=()=>m==null?void 0:m.show();function V(X){se[X?"unshift":"push"](()=>{d=X,t(4,d)})}function K(X){se[X?"unshift":"push"](()=>{p=X,t(5,p)})}function ee(X){se[X?"unshift":"push"](()=>{m=X,t(6,m)})}const te=()=>g==null?void 0:g.reloadLoadedPages(),G=()=>g==null?void 0:g.reloadLoadedPages();function ce(X){se[X?"unshift":"push"](()=>{_=X,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")!=$&&_y(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&$!=s.id&&T(),n.$$.dirty[0]&7&&(k||b||s!=null&&s.id)){const X=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:b,sort:k}).toString();Vi("/collections?"+X)}n.$$.dirty[0]&4&&rn(Nt,l=(s==null?void 0:s.name)||"Collections",l)},[b,k,s,o,d,p,m,_,g,a,u,$,i,r,C,D,M,O,I,L,F,q,N,R,j,V,K,ee,te,G,ce]}class TD extends ve{constructor(e){super(),be(this,e,CD,$D,_e,{},null,[-1,-1])}}function MD(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M,O,I,L;return{c(){e=y("aside"),t=y("div"),i=y("div"),i.textContent="System",s=E(),l=y("a"),l.innerHTML=`<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>
2023-04-18 11:32:01 +08:00
<span class="txt">Import collections</span>`,b=E(),k=y("div"),k.textContent="Authentication",$=E(),T=y("a"),T.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,C=E(),D=y("a"),D.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,M=E(),O=y("a"),O.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,h(i,"class","sidebar-title"),h(l,"href","/settings"),h(l,"class","sidebar-list-item"),h(r,"href","/settings/mail"),h(r,"class","sidebar-list-item"),h(u,"href","/settings/storage"),h(u,"class","sidebar-list-item"),h(d,"class","sidebar-title"),h(m,"href","/settings/export-collections"),h(m,"class","sidebar-list-item"),h(g,"href","/settings/import-collections"),h(g,"class","sidebar-list-item"),h(k,"class","sidebar-title"),h(T,"href","/settings/auth-providers"),h(T,"class","sidebar-list-item"),h(D,"href","/settings/tokens"),h(D,"class","sidebar-list-item"),h(O,"href","/settings/admins"),h(O,"class","sidebar-list-item"),h(t,"class","sidebar-content"),h(e,"class","page-sidebar settings-sidebar")},m(F,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,T),v(t,C),v(t,D),v(t,M),v(t,O),I||(L=[De(Gn.call(null,l,{path:"/settings"})),De(dn.call(null,l)),De(Gn.call(null,r,{path:"/settings/mail/?.*"})),De(dn.call(null,r)),De(Gn.call(null,u,{path:"/settings/storage/?.*"})),De(dn.call(null,u)),De(Gn.call(null,m,{path:"/settings/export-collections/?.*"})),De(dn.call(null,m)),De(Gn.call(null,g,{path:"/settings/import-collections/?.*"})),De(dn.call(null,g)),De(Gn.call(null,T,{path:"/settings/auth-providers/?.*"})),De(dn.call(null,T)),De(Gn.call(null,D,{path:"/settings/tokens/?.*"})),De(dn.call(null,D)),De(Gn.call(null,O,{path:"/settings/admins/?.*"})),De(dn.call(null,O))],I=!0)},p:Q,i:Q,o:Q,d(F){F&&w(e),I=!1,Ee(L)}}}class Ui extends ve{constructor(e){super(),be(this,e,null,MD,_e,{})}}function bh(n,e,t){const i=n.slice();return i[30]=e[t],i}function vh(n){let e,t;return e=new de({props:{class:"form-field readonly",name:"id",$$slots:{default:[OD,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){U(e.$$.fragment)},m(i,s){z(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){B(e,i)}}}function OD(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",H.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=De(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&&Vt(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 yh(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(),mn(t.src,i="./images/avatars/avatar"+n[30]+".svg")||h(t,"src",i),h(t,"alt","Avatar "+n[30]),h(e,"type","button"),h(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){S(u,e,f),v(e,t),v(e,s),o||(r=J(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))&&h(e,"class",l)},d(u){u&&w(e),o=!1,r()}}}function DD(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",H.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),fe(r,n[3]),u||(f=J(r,"input",n[18]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&h(r,"id",a),p[0]&8&&r.value!==d[3]&&fe(r,d[3])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function kh(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle",$$slots:{default:[ED,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){U(e.$$.fragment)},m(i,s){z(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){B(e,i)}}}function ED(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=W("Change password"),h(e,"type","checkbox"),h(e,"id",t=n[29]),h(s,"for",o=n[29])},m(u,f){S(u,e,f),e.checked=n[4],S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&h(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function wh(n){let e,t,i,s,l,o,r,a,u;return s=new de({props:{class:"form-field required",name:"password",$$slots:{default:[AD,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ID,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),i=y("div"),U(s.$$.fragment),l=E(),o=y("div"),U(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),z(s,i,null),v(t,l),v(t,o),z(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,yt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=He(t,yt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),B(s),B(r),f&&a&&a.end()}}}function AD(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),fe(r,n[8]),u||(f=J(r,"input",n[20]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&h(r,"id",a),p[0]&256&&r.value!==d[8]&&fe(r,d[8])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function ID(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),fe(r,n[9]),u||(f=J(r,"input",n[21]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p
<span class="txt">Delete</span>`,h(e,"type","button"),h(e,"class","dropdown-item txt-danger")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[15]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function FD(n){let e,t,i,s,l,o,r=n[1].$isNew?"Create":"Save changes",a,u,f,d,p,m=!n[1].$isNew&&Sh(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=W(r),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-transparent"),t.disabled=n[6],h(o,"class","txt"),h(l,"type","submit"),h(l,"form",n[11]),h(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],x(l,"btn-loading",n[6])},m(_,g){m&&m.m(_,g),S(_,e,g),S(_,t,g),v(t,i),S(_,s,g),S(_,l,g),v(l,o),v(o,a),f=!0,d||(p=J(t,"click",n[16]),d=!0)},p(_,g){_[1].$isNew?m&&(ae(),P(m,1,1,()=>{m=null}),ue()):m?(m.p(_,g),g[0]&2&&A(m,1)):(m=Sh(_),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")&&oe(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 RD(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[FD],header:[LD],default:[PD]},$$scope:{ctx:n}};return e=new hn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){U(e.$$.fragment)},m(s,l){z(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),B(e,s)}}}function qD(n,e,t){let i;const s=Tt(),l="admin_"+H.randomString(5);let o,r=new rs,a=!1,u=!1,f=0,d="",p="",m="",_=!1;function g(K){return k(K),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function k(K){t(1,r=K!=null&&K.$clone?K.$clone():new rs),$()}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=""),un({})}function T(){if(a||!i)return;t(6,a=!0);const K={email:d,avatar:f};(r.$isNew||_)&&(K.password=p,K.passwordConfirm=m);let ee;r.$isNew?ee=pe.admins.create(K):ee=pe.admins.update(r.id,K),ee.then(async te=>{var G;t(7,u=!1),b(),Qt(r.$isNew?"Successfully created admin.":"Successfully updated admin."),s("save",te),((G=pe.authStore.model)==null?void 0:G.id)===te.id&&pe.authStore.save(pe.authStore.token,te)}).catch(te=>{pe.errorResponseHandler(te)}).finally(()=>{t(6,a=!1)})}function C(){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(),Qt("Successfully deleted admin."),s("delete",r)}).catch(K=>{pe.errorResponseHandler(K)}))}const D=()=>C(),M=()=>b(),O=K=>t(2,f=K);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(K){se[K?"unshift":"push"](()=>{o=K,t(5,o)})}function j(K){me.call(this,n,K)}function V(K){me.call(this,n,K)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.$isNew&&d!=""||_||d!==r.email||f!==r.avatar)},[b,r,f,d,_,o,a,u,p,m,i,l,T,C,g,D,M,O,I,L,F,q,N,R,j,V]}class jD extends ve{constructor(e){super(),be(this,e,qD,RD,_e,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function $h(n,e,t){const i=n.slice();return i[24]=e[t],i}function VD(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",H.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 HD(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",H.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 zD(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 Th(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[17]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function Mh(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 Oh(n,e){let t,i,s,l,o,r,a,u,f,d,p,m=e[24].id+"",_,g,b,k,$,T=e[24].email+"",C,D,M,O,I,L,F,q,N,R,j,V,K,ee;f=new er({props:{value:e[24].id}});let te=e[24].id===e[7].id&&Mh();I=new $i({props:{date:e[24].created}}),q=new $i({props:{date:e[24].updated}});function G(){return e[15](e[24])}function ce(...X){return e[16](e[24],...X)}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"),U(f.$$.fragment),d=E(),p=y("span"),_=W(m),g=E(),te&&te.c(),b=E(),k=y("td"),$=y("span"),C=W(T),M=E(),O=y("td"),U(I.$$.fragment),L=E(),F=y("td"),U(q.$$.fragment),N=E(),R=y("td"),R.innerHTML='<i class="ri-arrow-right-line"></i>',j=E(),mn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||h(l,"src",o),h(l,"alt","Admin avatar"),h(s,"class","thumb thumb-sm thumb-circle"),h(i,"class","min-width"),h(p,"class","txt"),h(u,"class","label"),h(a,"class","col-type-text col-field-id"),h($,"class","txt txt-ellipsis"),h($,"title",D=e[24].email),h(k,"class","col-type-email col-field-email"),h(O,"class","col-type-date col-field-created"),h(F,"class","col-type-date col-field-updated"),h(R,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(X,le){S(X,t,le),v(t,i),v(i,s),v(s,l),v(t,r),v(t,a),v(a,u),z(f,u,null),v(u,d),v(u,p),v(p,_),v(a,g),te&&te.m(a,null),v(t,b),v(t,k),v(k,$),v($,C),v(t,M),v(t,O),z(I,O,null),v(t,L),v(t,F),z(q,F,null),v(t,N),v(t,R),v(t,j),V=!0,K||(ee=[J(t,"click",G),J(t,"keydown",ce)],K=!0)},p(X,le){e=X,(!V||le&16&&!mn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&h(l,"src",o);const ye={};le&16&&(ye.value=e[24].id),f.$set(ye),(!V||le&16)&&m!==(m=e[24].id+"")&&oe(_,m),e[24].id===e[7].id?te||(te=Mh(),te.c(),te.m(a,null)):te&&(te.d(1),te=null),(!V||le&16)&&T!==(T=e[24].email+"")&&oe(C,T),(!V||le&16&&D!==(D=e[24].email))&&h($,"title",D);const Se={};le&16&&(Se.date=e[24].created),I.$set(Se);const Ve={};le&16&&(Ve.date=e[24].updated),q.$set(Ve)},i(X){V||(A(f.$$.fragment,X),A(I.$$.fragment,X),A(q.$$.fragment,X),V=!0)},o(X){P(f.$$.fragment,X),P(I.$$.fragment,X),P(q.$$.fragment,X),V=!1},d(X){X&&w(t),B(f),te&&te.d(),B(I),B(q),K=!1,Ee(ee)}}}function YD(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D=[],M=new Map,O;function I(G){n[11](G)}let L={class:"col-type-text",name:"id",$$slots:{default:[VD]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new ln({props:L}),se.push(()=>he(o,"sort",I));function F(G){n[12](G)}let q={class:"col-type-email col-field-email",name:"email",$$slots:{default:[HD]},$$scope:{ctx:n}};n[2]!==void 0&&(q.sort=n[2]),u=new ln({props:q}),se.push(()=>he(u,"sort",F));function N(G){n[13](G)}let R={class:"col-type-date col-field-created",name:"created",$$slots:{default:[zD]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),p=new ln({props:R}),se.push(()=>he(p,"sort",N));function j(G){n[14](G)}let V={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[BD]},$$scope:{ctx:n}};n[2]!==void 0&&(V.sort=n[2]),g=new ln({props:V}),se.push(()=>he(g,"sort",j));let K=n[4];const ee=G=>G[24].id;for(let G=0;G<K.length;G+=1){let ce=$h(n,K,G),X=ee(ce);M.set(X,D[G]=Oh(X,ce))}let te=null;return K.length||(te=Ch(n)),{c(){e=y("table"),t=y("thead"),i=y("tr"),s=y("th"),l=E(),U(o.$$.fragment),a=E(),U(u.$$.fragment),d=E(),U(p.$$.fragment),_=E(),U(g.$$.fragment),k=E(),$=y("th"),T=E(),C=y("tbody");for(let G=0;G<D.length;G+=1)D[G].c();te&&te.c(),h(s,"class","min-width"),h($,"class","col-type-action min-width"),h(e,"class","table"),x(e,"table-loading",n[5])},m(G,ce){S(G,e,ce),v(e,t),v(t,i),v(i,s),v(i,l),z(o,i,null),v(i,a),z(u,i,null),v(i,d),z(p,i,null),v(i,_),z(g,i,null),v(i,k),v(i,$),v(e,T),v(e
<span class="txt">New admin</span>`,m=E(),U(_.$$.fragment),g=E(),b=y("div"),k=E(),U($.$$.fragment),T=E(),I&&I.c(),C=$e(),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),z(a,e,null),v(e,u),v(e,f),v(e,d),v(e,p),S(L,m,F),z(_,L,F),S(L,g,F),S(L,b,F),S(L,k,F),z($,L,F),S(L,T,F),I&&I.m(L,F),S(L,C,F),D=!0,M||(O=J(p,"click",n[9]),M=!0)},p(L,F){(!D||F&64)&&oe(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=Dh(L),I.c(),I.m(C.parentNode,C)):I&&(I.d(1),I=null)},i(L){D||(A(a.$$.fragment,L),A(_.$$.fragment,L),A($.$$.fragment,L),D=!0)},o(L){P(a.$$.fragment,L),P(_.$$.fragment,L),P($.$$.fragment,L),D=!1},d(L){L&&w(e),B(a),L&&w(m),B(_,L),L&&w(g),L&&w(b),L&&w(k),B($,L),L&&w(T),I&&I.d(L),L&&w(C),M=!1,O()}}}function JD(n){let e,t,i,s,l,o;e=new Ui({}),i=new Pn({props:{$$slots:{default:[KD]},$$scope:{ctx:n}}});let r={};return l=new jD({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){U(e.$$.fragment),t=E(),U(i.$$.fragment),s=E(),U(l.$$.fragment)},m(a,u){z(e,a,u),S(a,t,u),z(i,a,u),S(a,s,u),z(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){B(e,a),a&&w(t),B(i,a),a&&w(s),n[18](null),B(l,a)}}}function ZD(n,e,t){let i,s,l;Je(n,Sa,q=>t(21,i=q)),Je(n,Nt,q=>t(6,s=q)),Je(n,Na,q=>t(7,l=q)),rn(Nt,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=H.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 T(q){d=q,t(2,d)}function C(q){d=q,t(2,d)}const D=q=>r==null?void 0:r.show(q),M=(q,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(q))},O=()=>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();Vi("/settings/admins?"+q),p()}},[p,f,d,r,a,u,s,l,_,g,b,k,$,T,C,D,M,O,I,L,F]}class GD extends ve{constructor(e){super(),be(this,e,ZD,JD,_e,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function XD(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=W("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),fe(l,n[0]),l.focus(),r||(a=J(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&h(e,"for",i),f&256&&o!==(o=u[8])&&h(l,"id",o),f&1&&l.value!==u[0]&&fe(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function QD(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=W("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),fe(l,n[1]),S(p,r,m),S(p,a,m),v(a,u),f||(d=[J(l,"input",n[5]),De(dn.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]&&fe(l,p[1])},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(r),p&&w(a),f=!1,Ee(d)}}}function xD(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:[XD,({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),z(s,e,null),v(e,l),z(o,e,null),v(e,r),v(e,a),u=!0,f||(d=J(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),B(s),B(o),f=!1,d()}}}function eE(n){let e,t;return e=new a1({props:{$$slots:{default:[xD]},$$scope:{ctx:n}}}),{c(){U(e.$$.fragment)},m(i,s){z(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){B(e,i)}}}function tE(n,e,t){let i;Je(n,Sa,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(()=>{Pa(),Vi("/")}).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 nE extends ve{constructor(e){super(),be(this,e,tE,eE,_e,{})}}function iE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D;i=new de({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[lE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[oE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),a=new de({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[rE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[aE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}});let M=n[3]&&Eh(n);return{c(){e=y("div"),t=y("div"),U(i.$$.fragment),s=E(),l=y("div"),U(o.$$.fragment),r=E(),U(a.$$.fragment),u=E(),U(f.$$.fragment),d=E(),p=y("div"),m=y("div"),_=E(),M&&M.c(),g=E(),b=y("button"),k=y("span"),k.textContent="Save changes",h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(m,"class","flex-fill"),h(k,"class","txt"),h(b,"type","submit"),h(b,"class","btn btn-expanded"),b.disabled=$=!n[3]||n[2],x(b,"btn-loading",n[2]),h(p,"class","col-lg-12 flex"),h(e,"class","grid")},m(O,I){S(O,e,I),v(e,t),z(i,t,null),v(e,s),v(e,l),z(o,l,null),v(e,r),z(a,e,null),v(e,u),z(f,e,null),v(e,d),v(e,p),v(p,m),v(p,_),M&&M.m(p,null),v(p,g),v(p,b),v(b,k),T=!0,C||(D=J(b,"click",n[13]),C=!0)},p(O,I){const L={};I&1572865&&(L.$$scope={dirty:I,ctx:O}),i.$set(L);const F={};I&1572865&&(F.$$scope={dirty:I,ctx:O}),o.$set(F);const q={};I&1572865&&(q.$$scope={dirty:I,ctx:O}),a.$set(q);const N={};I&1572865&&(N.$$scope={dirty:I,ctx:O}),f.$set(N),O[3]?M?M.p(O,I):(M=Eh(O),M.c(),M.m(p,g)):M&&(M.d(1),M=null),(!T||I&12&&$!==($=!O[3]||O[2]))&&(b.disabled=$),(!T||I&4)&&x(b,"btn-loading",O[2])},i(O){T||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(a.$$.fragment,O),A(f.$$.fragment,O),T=!0)},o(O){P(i.$$.fragment,O),P(o.$$.fragment,O),P(a.$$.fragment,O),P(f.$$.fragment,O),T=!1},d(O){O&&w(e),B(i),B(o),B(a),B(f),M&&M.d(),C=!1,D()}}}function sE(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 lE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=W("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),fe(l,n[0].meta.appName),r||(a=J(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&h(e,"for",i),f&524288&&o!==(o=u[19])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appName&&fe(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function oE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=W("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=J(s,"submit",at(n[4])),a=!0)},p(m,_){let g=l;l=p(m),l===g?d[l].p(m,_):(ae(),P(d[g],1,1,()=>{d[g]=null}),ue(),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 fE(n){let e,t,i,s;return e=new Ui({}),i=new Pn({props:{$$slots:{default:[uE]},$$scope:{ctx:n}}}),{c(){U(e.$$.fragment),t=E(),U(i.$$.fragment)},m(l,o){z(e,l,o),S(l,t,o),z(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){B(e,l),l&&w(t),B(i,l)}}}function cE(n,e,t){let i,s,l,o;Je(n,Es,M=>t(14,s=M)),Je(n,wo,M=>t(15,l=M)),Je(n,Nt,M=>t(16,o=M)),rn(Nt,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(H.filterRedactedProps(a));_(M),Qt("Successfully saved application settings.")}catch(M){pe.errorResponseHandler(M)}t(2,f=!1)}}function _(M={}){var O,I;rn(wo,l=(O=M==null?void 0:M.meta)==null?void 0:O.appName,l),rn(Es,s=!!((I=M==null?void 0:M.meta)!=null&&I.hideControls),s),t(0,a={meta:(M==null?void 0:M.meta)||{},logs:(M==null?void 0:M.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function g(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function b(){a.meta.appName=this.value,t(0,a)}function k(){a.meta.appUrl=this.value,t(0,a)}function $(){a.logs.maxDays=gt(this.value),t(0,a)}function T(){a.meta.hideControls=this.checked,t(0,a)}const C=()=>g(),D=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,d=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=d!=JSON.stringify(a))},[a,u,f,i,m,g,r,d,b,k,$,T,C,D]}class dE extends ve{constructor(e){super(),be(this,e,cE,fE,_e,{})}}function pE(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),fe(e,n[0]),t||(i=J(e,"input",n[8]),t=!0)},p(o,r){ai(e,l=Mt(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&fe(e,o[0])},d(o){o&&w(e),n[7](null),t=!1,i()}}}function mE(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=[De(We.call(null,t,{position:"left",text:"Set new value"})),J(t,"click",n[6])],l=!0)},p(u,f){ai(s,a=Mt(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,Ee(o)}}}function hE(n){let e;function t(l,o){return l[3]?mE:pE}let i=t(n),s=i(n);return{c(){s.c(),e=$e()},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 _E(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 an(),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),Jt(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 pu extends ve{constructor(e){super(),be(this,e,_E,hE,_e,{value:0,mask:1})}}function gE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g;return{c(){e=y("label"),t=W("Subject"),s=E(),l=y("input"),r=E(),a=y("div"),u=W(`Available placeholder paramete
`),f=y("button"),f.textContent=`{APP_NAME}
2023-04-18 01:59:04 +08:00
`,d=W(`,
`),p=y("button"),p.textContent=`{APP_URL}
`,m=W("."),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),fe(l,n[0].subject),S(b,r,k),S(b,a,k),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),_||(g=[J(l,"input",n[13]),J(f,"click",n[14]),J(p,"click",n[15])],_=!0)},p(b,k){k[1]&1&&i!==(i=b[31])&&h(e,"for",i),k[1]&1&&o!==(o=b[31])&&h(l,"id",o),k[0]&1&&l.value!==b[0].subject&&fe(l,b[0].subject)},d(b){b&&w(e),b&&w(s),b&&w(l),b&&w(r),b&&w(a),_=!1,Ee(g)}}}function bE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k;return{c(){e=y("label"),t=W("Action URL"),s=E(),l=y("input"),r=E(),a=y("div"),u=W(`Available placeholder parameters:
`),f=y("button"),f.textContent=`{APP_NAME}
2023-04-18 01:59:04 +08:00
`,d=W(`,
`),p=y("button"),p.textContent=`{APP_URL}
2023-04-18 01:59:04 +08:00
`,m=W(`,
`),_=y("button"),_.textContent=`{TOKEN}
`,g=W("."),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31]),h(l,"spellcheck","false"),l.required=!0,h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(_,"type","button"),h(_,"class","label label-sm link-primary txt-mono"),h(_,"title","Required parameter"),h(a,"class","help-block")},m($,T){S($,e,T),v(e,t),S($,s,T),S($,l,T),fe(l,n[0].actionUrl),S($,r,T),S($,a,T),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),v(a,_),v(a,g),b||(k=[J(l,"input",n[16]),J(f,"click",n[17]),J(p,"click",n[18]),J(_,"click",n[19])],b=!0)},p($,T){T[1]&1&&i!==(i=$[31])&&h(e,"for",i),T[1]&1&&o!==(o=$[31])&&h(l,"id",o),T[0]&1&&l.value!==$[0].actionUrl&&fe(l,$[0].actionUrl)},d($){$&&w(e),$&&w(s),$&&w(l),$&&w(r),$&&w(a),b=!1,Ee(k)}}}function vE(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),fe(e,n[0].body),i||(s=J(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&h(e,"id",t),o[0]&1&&fe(e,l[0].body)},i:Q,o:Q,d(l){l&&w(e),i=!1,s()}}}function yE(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=Lt(o,r(n)),se.push(()=>he(e,"value",l))),{c(){e&&U(e.$$.fragment),i=$e()},m(a,u){e&&z(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ke(()=>t=!1)),u[0]&16&&o!==(o=a[4])){if(e){ae();const d=e;P(d.$$.fragment,1,0,()=>{B(d,1)}),ue()}o?(e=Lt(o,r(a)),se.push(()=>he(e,"value",l)),U(e.$$.fragment),A(e.$$.fragment,1),z(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&&B(e,a)}}}function kE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C;const D=[yE,vE],M=[];function O(I,L){return I[4]&&!I[5]?0:1}return l=O(n),o=M[l]=D[l](n),{c(){e=y("label"),t=W("Body (HTML)"),s=E(),o.c(),r=E(),a=y("div"),u=W(`Available placeholder parameters:
`),f=y("button"),f.textContent=`{APP_NAME}
2023-04-18 01:59:04 +08:00
`,d=W(`,
`),p=y("button"),p.textContent=`{APP_URL}
2023-04-18 01:59:04 +08:00
`,m=W(`,
`),_=y("button"),_.textContent=`{TOKEN}
2023-04-18 01:59:04 +08:00
`,g=W(`,
`),b=y("button"),b.textContent=`{ACTION_URL}
`,k=W("."),h(e,"for",i=n[31]),h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(_,"type","button"),h(_,"class","label label-sm link-primary txt-mono"),h(b,"type","button"),h(b,"class","label label-sm link-primary txt-mono"),h(b,"title","Required parameter"),h(a,"class","help-block")},m(I,L){S(I,e,L),v(e,t),S(I,s,L),M[l].m(I,L),S(I,r,L),S(I,a,L),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),v(a,_),v(a,g),v(a,b),v(a,k),$=!0,T||(C=[J(f,"click",n[22]),J(p,"click",n[23]),J(_,"click",n[24]),J(b,"click",n[25])],T=!0)},p(I,L){(!$||L[1]&1&&i!==(i=I[31]))&&h(e,"for",i);let F=l;l=O(I),l===F?M[l].p(I,L):(ae(),P(M[F],1,1,()=>{M[F]=null}),ue(),o=M[l],o?o.p(I,L):(o=M[l]=D[l](I),o.c()),A(o,1),o.m(r.parentNode,r))},i(I){$||(A(o),$=!0)},o(I){P(o),$=!1},d(I){I&&w(e),I&&w(s),M[l].d(I),I&&w(r),I&&w(a),T=!1,Ee(C)}}}function wE(n){let e,t,i,s,l,o;return e=new de({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[gE,({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:[bE,({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:[kE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){U(e.$$.fragment),t=E(),U(i.$$.fragment),s=E(),U(l.$$.fragment)},m(r,a){z(e,r,a),S(r,t,a),z(i,r,a),S(r,s,a),z(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){B(e,r),r&&w(t),B(i,r),r&&w(s),B(l,r)}}}function Ah(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=De(We.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=He(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function SE(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Ah();return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),l=W(n[2]),o=E(),r=y("div"),a=E(),f&&f.c(),u=$e(),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&&oe(l,d[2]),d[6]?f?p[0]&64&&A(f,1):(f=Ah(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(ae(),P(f,1,1,()=>{f=null}),ue())},d(d){d&&w(e),d&&w(o),d&&w(r),d&&w(a),f&&f.d(d),d&&w(u)}}}function $E(n){let e,t;const i=[n[8]];let s={$$slots:{header:[SE],default:[wE]},$$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(){U(e.$$.fragment)},m(l,o){z(e,l,o),t=!0},p(l,o){const r=o[0]&256?Mt(i,[Zt(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),B(e,l)}}}let Ih;function CE(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Qe(e,s),o;Je(n,Ci,G=>t(12,o=G));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,d=Ih,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-f9d91cfd.js"),["./CodeEditor-f9d91cfd.js","./index-8390b00e.js"],import.meta.url)).default),Ih=d,t(5,p=!1))}function k(G){H.copyToClipboard(G),l1(`Copied ${G} to clipboard`,2e3)}b();function $(){u.subject=this.value,t(0,u)}const T=()=>k("{APP_NAME}"),C=()=>k("{APP_URL}");function D(){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=J(e,"click",n[26]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function YE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=E(),s=y("button"),l=y("span"),l.textContent="Save changes",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],h(l,"class","txt"),h(s,"type","submit"),h(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],x(s,"btn-loading",n[3])},m(u,f){S(u,e,f),v(e,t),S(u,i,f),S(u,s,f),v(s,l),r||(a=[J(e,"click",n[24]),J(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&x(s,"btn-loading",u[3])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Ee(a)}}}function KE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b;const k=[NE,LE],$=[];function T(C,D){return C[2]?0:1}return p=T(n),m=$[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=W(n[5]),r=E(),a=y("div"),u=y("form"),f=y("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",d=E(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","content txt-xl m-b-base"),h(u,"class","panel"),h(u,"autocomplete","off"),h(a,"class","wrapper")},m(C,D){S(C,e,D),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(C,r,D),S(C,a,D),v(a,u),v(u,f),v(u,d),$[p].m(u,null),_=!0,g||(b=J(u,"submit",at(n[27])),g=!0)},p(C,D){(!_||D[0]&32)&&oe(o,C[5]);let M=p;p=T(C),p===M?$[p].p(C,D):(ae(),P($[M],1,1,()=>{$[M]=null}),ue(),m=$[p],m?m.p(C,D):(m=$[p]=k[p](C),m.c()),A(m,1),m.m(u,null))},i(C){_||(A(m),_=!0)},o(C){P(m),_=!1},d(C){C&&w(e),C&&w(r),C&&w(a),$[p].d(),g=!1,b()}}}function JE(n){let e,t,i,s,l,o;e=new Ui({}),i=new Pn({props:{$$slots:{default:[KE]},$$scope:{ctx:n}}});let r={};return l=new PE({props:r}),n[28](l),{c(){U(e.$$.fragment),t=E(),U(i.$$.fragment),s=E(),U(l.$$.fragment)},m(a,u){z(e,a,u),S(a,t,u),z(i,a,u),S(a,s,u),z(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){B(e,a),a&&w(t),B(i,a),a&&w(s),n[28](null),B(l,a)}}}function ZE(n,e,t){let i,s,l;Je(n,Nt,te=>t(5,l=te));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];rn(Nt,l="Mail settings",l);let a,u={},f={},d=!1,p=!1;m();async function m(){t(2,d=!0);try{const te=await pe.settings.getAll()||{};g(te)}catch(te){pe.errorResponseHandler(te)}t(2,d=!1)}async function _(){if(!(p||!s)){t(3,p=!0);try{const te=await pe.settings.update(H.filterRedactedProps(f));g(te),un({}),Qt("Successfully saved mail settings.")}catch(te){pe.errorResponseHandler(te)}t(3,p=!1)}}function g(te={}){t(0,f={meta:(te==null?void 0:te.meta)||{},smtp:(te==null?void 0:te.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function b(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function k(){f.meta.senderName=this.value,t(0,f)}function $(){f.meta.senderAddress=this.value,t(0,f)}function T(te){n.$$.not_equal(f.meta.verificationTemplate,te)&&(f.meta.verificationTemplate=te,t(0,f))}function C(te){n.$$.not_equal(f.meta.resetPasswordTemplate,te)&&(f.meta.resetPasswordTemplate=te,t(0,f))}function D(te){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,te)&&(f.meta.confirmEmailChangeTemplate=te,t(0,f))}function M(){f.smtp.enabled=this.checked,t(0,f)}function O(){f.smtp.host=this.value,t(0,f)}function I(){f.smtp.port=gt(this.value),t(0,f)}function L(te){n.$$.not_equal(f.smtp.tls,te)&&(f.smtp.tls=te,t(0,f))}function F(te){n.$$.not_equal(f.smtp.authMethod,te)&&(f.smtp.authMethod=te,t(0,f))}function q(){f.smtp.username=this.value,t(0,f)}function N(te){n.$$.not_equal(f.smtp.password,te)&&(f.smtp.password=te,t(0,f))}const R=()=>b(),j=()=>_(),V=()=>a==null?v
the
2023-04-18 01:59:04 +08:00
`),r=y("strong"),u=W(a),f=W(`
to the
2023-04-18 01:59:04 +08:00
`),d=y("strong"),m=W(p),_=W(`.
`),g=y("br"),b=W(`
There are numerous command line tools that can help you, such as:
`),k=y("a"),k.textContent=`rclone
2023-04-18 01:59:04 +08:00
`,$=W(`,
2023-04-18 11:32:01 +08:00
`),T=y("a"),T.textContent=`s5cmd
`,C=W(", etc."),D=E(),M=y("div"),h(i,"class","icon"),h(k,"href","https://github.com/rclone/rclone"),h(k,"target","_blank"),h(k,"rel","noopener noreferrer"),h(k,"class","txt-bold"),h(T,"href","https://github.com/peak/s5cmd"),h(T,"target","_blank"),h(T,"rel","noopener noreferrer"),h(T,"class","txt-bold"),h(l,"class","content"),h(t,"class","alert alert-warning m-0"),h(M,"class","clearfix m-t-base")},m(F,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,T),v(l,C),v(e,D),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")&&oe(u,a),(!I||q&2)&&p!==(p=F[1].s3.enabled?"S3 storage":"local file system")&&oe(m,p)},i(F){I||(F&&nt(()=>{I&&(O||(O=He(e,yt,{duration:150},!0)),O.run(1))}),I=!0)},o(F){F&&(O||(O=He(e,yt,{duration:150},!1)),O.run(0)),I=!1},d(F){F&&w(e),F&&O&&O.end()}}}function qh(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M;return i=new de({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[eA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[tA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field required",name:"s3.region",$$slots:{default:[nA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),p=new de({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[iA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),g=new de({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[sA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),$=new de({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[lA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),U(i.$$.fragment),s=E(),l=y("div"),U(o.$$.fragment),r=E(),a=y("div"),U(u.$$.fragment),f=E(),d=y("div"),U(p.$$.fragment),m=E(),_=y("div"),U(g.$$.fragment),b=E(),k=y("div"),U($.$$.fragment),T=E(),C=y("div"),h(t,"class","col-lg-6"),h(l,"class","col-lg-3"),h(a,"class","col-lg-3"),h(d,"class","col-lg-6"),h(_,"class","col-lg-6"),h(k,"class","col-lg-12"),h(C,"class","col-lg-12"),h(e,"class","grid")},m(O,I){S(O,e,I),v(e,t),z(i,t,null),v(e,s),v(e,l),z(o,l,null),v(e,r),v(e,a),z(u,a,null),v(e,f),v(e,d),z(p,d,null),v(e,m),v(e,_),z(g,_,null),v(e,b),v(e,k),z($,k,null),v(e,T),v(e,C),M=!0},p(O,I){const L={};I&100663298&&(L.$$scope={dirty:I,ctx:O}),i.$set(L);const F={};I&100663298&&(F.$$scope={dirty:I,ctx:O}),o.$set(F);const q={};I&100663298&&(q.$$scope={dirty:I,ctx:O}),u.$set(q);const N={};I&100663298&&(N.$$scope={dirty:I,ctx:O}),p.$set(N);const R={};I&100663298&&(R.$$scope={dirty:I,ctx:O}),g.$set(R);const j={};I&100663298&&(j.$$scope={dirty:I,ctx:O}),$.$set(j)},i(O){M||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(p.$$.fragment,O),A(g.$$.fragment,O),A($.$$.fragment,O),O&&nt(()=>{M&&(D||(D=He(e,yt,{duration:150},!0)),D.run(1))}),M=!0)},o(O){P(i.$$.fragment,O),P(o.$$.fragment,O),P(u.$$.fragment,O),P(p.$$.fragment,O),P(g.$$.fragment,O),P($.$$.fragment,O),O&&(D||(D=He(e,yt,{duration:150},!1)),D.run(0)),M=!1},d(O){O&&w(e),B(i),B(o),B(u),B(p),B(g),B($),O&&D&&D.end()}}}function eA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=W("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),fe(l,n[1].s3.endpoint),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&h(e,"for",i),f&33554432&&o!==(o=u[25])&&h(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&fe(l,u[1].s3.endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function tA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=W("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),fe(l,n[1].s3.bucket),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[2
2023-04-18 11:32:01 +08:00
<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 rA(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=De(t=We.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Vt(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 aA(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 Vh(n){let e,t,i,s;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),v(e,t),i||(s=J(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function uA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b;const k=[QE,XE],$=[];function T(C,D){return C[2]?0:1}return p=T(n),m=$[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=W(n[7]),r=E(),a=y("div"),u=y("form"),f=y("div"),f.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,d=E(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","content txt-xl m-b-base"),h(u,"class","panel"),h(u,"autocomplete","off"),h(a,"class","wrapper")},m(C,D){S(C,e,D),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(C,r,D),S(C,a,D),v(a,u),v(u,f),v(u,d),$[p].m(u,null),_=!0,g||(b=J(u,"submit",at(n[20])),g=!0)},p(C,D){(!_||D&128)&&oe(o,C[7]);let M=p;p=T(C),p===M?$[p].p(C,D):(ae(),P($[M],1,1,()=>{$[M]=null}),ue(),m=$[p],m?m.p(C,D):(m=$[p]=k[p](C),m.c()),A(m,1),m.m(u,null))},i(C){_||(A(m),_=!0)},o(C){P(m),_=!1},d(C){C&&w(e),C&&w(r),C&&w(a),$[p].d(),g=!1,b()}}}function fA(n){let e,t,i,s;return e=new Ui({}),i=new Pn({props:{$$slots:{default:[uA]},$$scope:{ctx:n}}}),{c(){U(e.$$.fragment),t=E(),U(i.$$.fragment)},m(l,o){z(e,l,o),S(l,t,o),z(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){B(e,l),l&&w(t),B(i,l)}}}const lo="s3_test_request";function cA(n,e,t){let i,s,l;Je(n,Nt,N=>t(7,l=N)),rn(Nt,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(H.filterRedactedProps(r));un({}),await g(N),Pa(),d?hy("Successfully saved but failed to establish S3 connection."):Qt("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)}}xt(()=>()=>{clearTimeout(p)});function $(){r.s3.enabled=this.checked,t(1,r)}function T(){r.s3.endpoint=this.value,t(1,r)}function C(){r.s3.bucket=this.value,t(1,r)}function D(){r.s3.region=this.value,t(1,r)}function M(){r.s3.accessKey=this.value,t(1,r)}function O(N){n.$$.not_equal(r.s3.secret,N)&&(r.s3.secret=N,t(1,r))}function I(){r.s3.forcePathStyle=this.checked,t(1,r)}const L=()=>b(),F=()=>_(),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,$,T,C,D,M,O,I,L,F,q]}class dA extends ve{constructor(e){super(),be(this,e,cA,fA,_e,{})}}function pA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=W("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[20]),h(s,"for",o=n[20])},m(u,f){S(u,e,f),e.checked=n[1].enabled,S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[11]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&h(e,"id",t),f&2&&(e.checked=u[1].enabled),f&1048576&&o!==(o=u[20])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function mA(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=W("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),fe(l,n[1].clientId),a||(u=J(l,"input",n[12]),a=!0)},p(f,d){d&1048576&&i!==(i=f[20])&&h(e,"for",i),d&1048576&&o!==(o=f[20])&&h(l,"id",o),d&2&&r!==(r=f[1].enabled)&&(l.required=r),d&2&&l.value!==f[1].clientId&&fe(l,f[1].clientId)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function hA(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 pu({props:u}),se.push(()=>he(l,"value",a)),{c(){e=y("label"),t=W("Client secret"),s=E(),U(l.$$.fragment),h(e,"for",i=n[20])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),z(l,f,d),r=!0},p(f,d){(!r||d&1048576&&i!==(i=f[20]))&&h(e,"for"
2023-04-18 01:59:04 +08:00
another PocketBase environment.</p>`,t=E(),i=y("div"),s=y("button"),s.innerHTML='<span class="txt">Copy</span>',l=E(),U(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),z(o,i,null),n[8](i),S(g,r,b),S(g,a,b),v(a,u),v(a,f),v(a,d),p=!0,m||(_=[J(s,"click",n[7]),J(i,"keydown",n[9]),J(d,"click",n[10])],m=!0)},p(g,b){const k={};b&4&&(k.content=g[2]),o.$set(k)},i(g){p||(A(o.$$.fragment,g),p=!0)},o(g){P(o.$$.fragment,g),p=!1},d(g){g&&w(e),g&&w(t),g&&w(i),B(o),n[8](null),g&&w(r),g&&w(a),m=!1,Ee(_)}}}function VA(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 HA(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=[VA,jA],_=[];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=W(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)&&oe(o,b[3]);let $=f;f=g(b),f===$?_[f].p(b,k):(ae(),P(_[$],1,1,()=>{_[$]=null}),ue(),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 zA(n){let e,t,i,s;return e=new Ui({}),i=new Pn({props:{$$slots:{default:[HA]},$$scope:{ctx:n}}}),{c(){U(e.$$.fragment),t=E(),U(i.$$.fragment)},m(l,o){z(e,l,o),S(l,t,o),z(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){B(e,l),l&&w(t),B(i,l)}}}function BA(n,e,t){let i,s;Je(n,Nt,b=>t(3,s=b)),rn(Nt,s="Export collections",s);const l="export_"+H.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(){H.downloadJson(r,"pb_schema")}function d(){H.copyToClipboard(i),l1("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 UA extends ve{constructor(e){super(),be(this,e,BA,zA,_e,{})}}function e_(n,e,t){const i=n.slice();return i[14]=e[t],i}function t_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function n_(n,e,t){const i=n.slice();return i[14]=e[t],i}function i_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function s_(n,e,t){const i=n.slice();return i[14]=e[t],i}function l_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function o_(n,e,t){const i=n.slice();return i[30]=e[t],i}function WA(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&r_(),a=n[0].name!==n[1].name&&a_(n);return{c(){e=y("div"),r&&r.c(),t=E(),a&&a.c(),i=E(),s=y("strong"),o=W(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=r_(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=a_(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&oe(o,l)},d(u){u&&w(e),r&&r.d(),a&&a.d()}}}function YA(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=W(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 C=0;C<_.length;C+=1)_[C].c();r=E(),g&&g.c(),a=E();for(let C=0;C<k.length;C+=1)k[C].c();u=E();for(let C=0;C<T.length;C+=1)T[C].c();h(e,"class","section-title"),h(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(C,D){S(C,e,D),p.m(e,null),S(C,t,D),S(C,i,D),v(i,s),v(i,l),v(i,o);for(let M=0;M<_.length;M+=1)_[M]&&_[M].m(o,null);v(o,r),g&&g.m(o,null),v(o,a);for(let M=0;M<k.length;M+=1)k[M]&&k[M].m(o,null);v(o,u);for(let M=0;M<T.length;M+=1)T[M]&&T[M].m(o,null)},p(C,D){if(d===(d=f(C))&&p?p.p(C,D):(p.d(1),p=d(C),p&&(p.c(),p.m(e,null))),D[0]&7203){m=C[11];let M;for(M=0;M<m.length;M+=1){const O=o_(C,m,M);_[M]?_[M].p(O,D):(_[M]=u_(O),_[M].c(),_[M].m(o,r))}for(;M<_.length;M+=1)_[M].d(1);_.length=m.length}if(C[2]||C[5]?g?g.p(C,D):(g=f_(C),g.c(),g.m(o,a)):g&&(g.d(1),g=null),D[0]&4248){b=C[7];let M;for(M=0;M<b.length;M+=1){const O=n_(C,b,M);k[M]?k[M].p(O,D):(k[M]=h_(O),k[M].c(),k[M].m(o,u))}for(;M<k.length;M+=1)k[M].d(1);k.length=b.length}if(D[0]&4352){$=C[8];let M;for(M=0;M<$.length;M+=1){const O=e_(C,$,M);T[M]?T[M].p(O,D):(T[M]=g_(O),T[M].c(),T[M].m(o,null))}for(;M<T.length;M+=1)T[M].d(1);T.length=$.length}},i:Q,o:Q,d(C){C&&w(e),p.d(),C&&w(t),C&&w(i),pt(_,C),g&&g.d(),pt(k,C),pt(T,C)}}}function Hn(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"?"":H.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=H.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,d,p,m,l,s,_,b]}class GA extends ve{constructor(e){super(),be(this,e,ZA,JA,_e,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function b_(n,e,t){const i=n.slice();return i[17]=e[t],i}function v_(n){let e,t;return e=new GA({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){U(e.$$.fragment)},m(i,s){z(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){B(e,i)}}}function XA(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=v_(b_(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=$e()},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=b_(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=v_(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(ae(),a=i.length;a<s.length;a+=1)l(a);ue()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){pt(s,o),o&&w(e)}}}function QA(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 xA(n){let e,t,i,s,l,o,r;return{c(){e=y("button"),t=W("Close"),i=E(),s=y("button"),l=y("span"),l.textContent="Confirm and import",h(e,"type","button"),h(e,"class","btn btn-t
2023-04-18 11:32:01 +08:00
- ${C.join(`
- `)}`,()=>{_()}):_()}async function _(){if(!u){t(4,u=!0);try{await pe.collections.import(o,a),Qt("Successfully imported collections configuration."),i("submit")}catch(C){pe.errorResponseHandler(C)}t(4,u=!1),d()}}const g=()=>m(),b=()=>!u;function k(C){se[C?"unshift":"push"](()=>{s=C,t(1,s)})}function $(C){me.call(this,n,C)}function T(C){me.call(this,n,C)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&p()},[d,s,r,a,u,m,f,l,o,g,b,k,$,T]}class nI extends ve{constructor(e){super(),be(this,e,tI,eI,_e,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function y_(n,e,t){const i=n.slice();return i[32]=e[t],i}function k_(n,e,t){const i=n.slice();return i[35]=e[t],i}function w_(n,e,t){const i=n.slice();return i[32]=e[t],i}function iI(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M,O;a=new de({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[lI,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let I=!1,L=n[6]&&n[1].length&&!n[7]&&$_(),F=n[6]&&n[1].length&&n[7]&&C_(n),q=n[13].length&&F_(n),N=!!n[0]&&R_(n);return{c(){e=y("input"),t=E(),i=y("div"),s=y("p"),l=W(`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(),U(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"),T=y("span"),T.textContent="Review",h(e,"type","file"),h(e,"class","hidden"),h(e,"accept",".json"),h(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),h(i,"class","content txt-xl m-b-base"),h(b,"class","flex-fill"),h(T,"class","txt"),h($,"type","button"),h($,"class","btn btn-expanded btn-warning m-l-auto"),$.disabled=C=!n[14],h(_,"class","flex m-t-base")},m(R,j){S(R,e,j),n[19](e),S(R,t,j),S(R,i,j),v(i,s),v(s,l),v(s,o),S(R,r,j),z(a,R,j),S(R,u,j),S(R,f,j),L&&L.m(R,j),S(R,d,j),F&&F.m(R,j),S(R,p,j),q&&q.m(R,j),S(R,m,j),S(R,_,j),N&&N.m(_,null),v(_,g),v(_,b),v(_,k),v(_,$),v($,T),D=!0,M||(O=[J(e,"change",n[20]),J(o,"click",n[21]),J($,"click",n[26])],M=!0)},p(R,j){(!D||j[0]&4096)&&x(o,"btn-loading",R[12]);const V={};j[0]&64&&(V.class="form-field "+(R[6]?"":"field-error")),j[0]&65|j[1]&1536&&(V.$$scope={dirty:j,ctx:R}),a.$set(V),R[6]&&R[1].length&&!R[7]?L||(L=$_(),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),R[6]&&R[1].length&&R[7]?F?F.p(R,j):(F=C_(R),F.c(),F.m(p.parentNode,p)):F&&(F.d(1),F=null),R[13].length?q?q.p(R,j):(q=F_(R),q.c(),q.m(m.parentNode,m)):q&&(q.d(1),q=null),R[0]?N?N.p(R,j):(N=R_(R),N.c(),N.m(_,g)):N&&(N.d(1),N=null),(!D||j[0]&16384&&C!==(C=!R[14]))&&($.disabled=C)},i(R){D||(A(a.$$.fragment,R),A(I),D=!0)},o(R){P(a.$$.fragment,R),P(I),D=!1},d(R){R&&w(e),n[19](null),R&&w(t),R&&w(i),R&&w(r),B(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,Ee(O)}}}function sI(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 S_(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 lI(n){let e,t,i,s,l,o,r,a,u,f,d=!!n[0]&&!n[6]&&S_();return{c(){e=y("label"),t=W("Collections"),s=E(),l=y("textarea"),r=E(),d&&d.c(),a=$e(),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),fe(l,n[0]),S(p,r,m),d&&d.m(p,m),S(p,a,m),u||(f=J(l,"input",n[22]),u=!0)},p(p,m){m[1]&512&&i!==(i=p[40])&&h(e,"for",i),m[1]&512&&o!==(o=p[40])&&h(l,"id",o),m[0]&1&&fe(l,p[0]),p[0]&&!p[6]?d||(d=S_(),d.c(),d.m(a.parentNode,a)):d&&(d.d(1),d=null)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(r),d&&d.d(p),p&&w(a),u=!1,f()}}}function $_(n){let e;return{c(){e=y("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,h(e,"class","alert alert-info")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function C_(n){let e,t,i,s,l,o=n[9].length&&T_(n),r=n[4].length&&D_(n),a=n[8].length&&P_(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=T_(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=D_(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=P_(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 T_(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=w_(n,s,o),a=l(r);t.set(a,e[o]=O_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=$e()},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=vt(e,r,l,1,o,s,t,i.parentNode,us,O_,i,w_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function M_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=y("small"),t=W("("),s=W(i),l=W(")"),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+"")&&oe(s,i)},d(o){o&&w(e)}}}function O_(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&M_(e);return{key:n,first:null,c(){t=y("div"),i=y("span"),i.textContent="Deleted",s=E(),l=y("strong"),r=W(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+"")&&oe(r,o),e[32].id?f?f.p(e,p):(f=M_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(d){d&&w(t),f&&f.d()}}}function D_(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=k_(n,s,o),a=l(r);t.set(a,e[o]=I_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=$e()},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=vt(e,r,l,1,o,s,t,i.parentNode,us,I_,i,k_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function E_(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=y("strong"),i=W(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+"")&&oe(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function A_(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=y("small"),t=W("("),s=W(i),l=W(")"),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+"")&&oe(s,i)},d(o){o&&w(e)}}}function I_(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_(e),m=e[35].new.id&&A_(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=W(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_(e),p.c(),p.m(l,o)):p&&(p.d(1),p=null),g[0]&16&&a!==(a=e[35].new.name+"")&&oe(u,a),e[35].new.id?m?m.p(e,g):(m=A_(e),m.c(),m.m(l,null)):m&&(m.d(1),m=null)},d(_){_&&w(t),p&&p.d(),m&&m.d()}}}function P_(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=y_(n,s,o),a=l(r);t.set(a,e[o]=N_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=$e()},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=vt(e,r,l,1,o,s,t,i.parentNode,us,N_,i,y_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function L_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=y("small"),t=W("("),s=W(i),l=W(")"),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=J(o,"click",n[24]),r=!0)},p:Q,d(u){u&&w(e),r=!1,a()}}}function R_(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear</span>',h(e,"type","button"),h(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[25]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function oI(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=[sI,iI],_=[];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=W(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)&&oe(o,b[15]);let $=f;f=g(b),f===$?_[f].p(b,k):(ae(),P(_[$],1,1,()=>{_[$]=null}),ue(),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 rI(n){let e,t,i,s,l,o;e=new Ui({}),i=new Pn({props:{$$slots:{default:[oI]},$$scope:{ctx:n}}});let r={};return l=new nI({props:r}),n[27](l),l.$on("submit",n[28]),{c(){U(e.$$.fragment),t=E(),U(i.$$.fragment),s=E(),U(l.$$.fragment)},m(a,u){z(e,a,u),S(a,t,u),z(i,a,u),S(a,s,u),z(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){B(e,a),a&&w(t),B(i,a),a&&w(s),n[27](null),B(l,a)}}}function aI(n,e,t){let i,s,l,o,r,a,u;Je(n,Nt,G=>t(15,u=G)),rn(Nt,u="Import collections",u);let f,d,p="",m=!1,_=[],g=[],b=!0,k=[],$=!1;T();async function T(){t(5,$=!0);try{t(2,g=await pe.collections.getFullList(200));for(let G of g)delete G.created,delete G.updated}catch(G){pe.errorResponseHandler(G)}t(5,$=!1)}function C(){if(t(4,k=[]),!!i)for(let G of _){const ce=H.findByKey(g,"id",G.id);!(ce!=null&&ce.id)||!H.hasCollectionChanges(ce,G,b)||k.push({new:G,old:ce})}}function D(){t(1,_=[]);try{t(1,_=JSON.parse(p))}catch{}Array.isArray(_)?t(1,_=H.filterDuplicatesByKey(_)):t(1,_=[]);for(let G of _)delete G.created,delete G.updated,G.schema=H.filterDuplicatesByKey(G.schema)}function M(){var G,ce;for(let X of _){const le=H.findByKey(g,"name",X.name)||H.findByKey(g,"id",X.id);if(!le)continue;const ye=X.id,Se=le.id;X.id=Se;const Ve=Array.isArray(le.schema)?le.schema:[],ze=Array.isArray(X.schema)?X.schema:[];for(const we of ze){const Me=H.findByKey(Ve,"name",we.name);Me&&Me.id&&(we.id=Me.id)}for(let we of _)if(Array.isArray(we.schema))for(let Me of we.schema)(G=Me.options)!=null&&G.collectionId&&((ce=Me.options)==null?void 0:ce.collectionId)===ye&&(Me.options.collectionId=Se)}t(0,p=JSON.stringify(_,null,4))}function O(G){t(12,m=!0);const ce=new FileReader;ce.onload=async X=>{t(12,m=!1),t(10,f.value="",f),t(0,p=X.target.result),await an(),_.length||(hl("Invalid collections configuration."),I())},ce.onerror=X=>{console.warn(X),hl("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},ce.readAsText(G)}function I(){t(0,p=""),t(10,f.value="",f),un({})}function L(G){se[G?"unshift":"push"](()=>{f=G,t(10,f)})}const F=()=>{f.files.length&&O(f.files[0])},q=()=>{f.click()};function N(){p=this.value,t(0,p)}function R(){b=this.checked,t(3,b)}const j=()=>M(),V=()=>I(),K=()=>d==null?void 0:d.show(g,_,b);function ee(G){se[G?"unshift":"push"](()=>{d=G,t(11,d)})}const te=()=>I();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof p<"u"&&D(),n.$$.dirty[0]&3&&t(6,i=!!p&&_.length&&_.length===_.filter(G=>!!G.id&&!!G.name).length),n.$$.dirty[0]&78&&t(9,s=g.filter(G=>i&&b&&!H.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=[De(dn.call(null,e)),J(l,"click",n[7])],o=!0)},p:Q,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,Ee(r)}}}function H_(n){let e,t,i;return t=new du({props:{scriptSrc:"./libs/tinymce/tinymce.min.js",conf:H.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=y("div"),U(t.$$.fragment),h(e,"class","tinymce-preloader hidden")},m(s,l){S(s,e,l),z(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),B(t)}}}function CI(n){var b;let e,t,i,s,l,o,r,a,u,f,d,p,m;document.title=e=H.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let _=((b=n[0])==null?void 0:b.id)&&n[1]&&V_(n);o=new Xb({props:{routes:fI}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new bI({}),f=new SI({});let g=n[1]&&!n[2]&&H_(n);return{c(){t=E(),i=y("div"),_&&_.c(),s=E(),l=y("div"),U(o.$$.fragment),r=E(),U(a.$$.fragment),u=E(),U(f.$$.fragment),d=E(),g&&g.c(),p=$e(),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),z(o,l,null),v(l,r),z(a,l,null),S(k,u,$),z(f,k,$),S(k,d,$),g&&g.m(k,$),S(k,p,$),m=!0},p(k,[$]){var T;(!m||$&24)&&e!==(e=H.joinNonEmpty([k[4],k[3],"PocketBase"]," - "))&&(document.title=e),(T=k[0])!=null&&T.id&&k[1]?_?(_.p(k,$),$&3&&A(_,1)):(_=V_(k),_.c(),A(_,1),_.m(i,s)):_&&(ae(),P(_,1,1,()=>{_=null}),ue()),k[1]&&!k[2]?g?(g.p(k,$),$&6&&A(g,1)):(g=H_(k),g.c(),A(g,1),g.m(p.parentNode,p)):g&&(ae(),P(g,1,1,()=>{g=null}),ue())},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(),B(o),B(a),k&&w(u),B(f,k),k&&w(d),g&&g.d(k),k&&w(p)}}}function TI(n,e,t){let i,s,l,o;Je(n,Es,g=>t(10,i=g)),Je(n,wo,g=>t(3,s=g)),Je(n,Na,g=>t(0,l=g)),Je(n,Nt,g=>t(4,o=g));let r,a=!1,u=!1;function f(g){var b,k,$,T;((b=g==null?void 0:g.detail)==null?void 0:b.location)!==r&&(t(1,a=!!(($=(k=g==null?void 0:g.detail)==null?void 0:k.userData)!=null&&$.showAppSidebar)),r=(T=g==null?void 0:g.detail)==null?void 0:T.location,rn(Nt,o="",o),un({}),ub())}function d(){Vi("/")}async function p(){var g,b;if(l!=null&&l.id)try{const k=await pe.settings.getAll({$cancelKey:"initialAppSettings"});rn(wo,s=((g=k==null?void 0:k.meta)==null?void 0:g.appName)||"",s),rn(Es,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 MI extends ve{constructor(e){super(),be(this,e,TI,CI,_e,{})}}new MI({target:document.getElementById("app")});export{Ee as A,Qt as B,H as C,Vi as D,$e as E,a1 as F,sg as G,xt as H,Je as I,ci as J,Tt as K,se as L,rb as M,vt as N,us as O,Kt as P,pt as Q,jo as R,ve as S,kn as T,Rr as U,P as a,E as b,U as c,B as d,y as e,h as f,S as g,v as h,be as i,De as j,ae as k,dn as l,z as m,ue as n,w as o,pe as p,de as q,x as r,_e as s,A as t,J as u,at as v,W as w,oe as x,Q as y,fe as z};