pocketbase/ui/dist/assets/index-353b753a.js

195 lines
859 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 G(){}const kl=n=>n;function Xe(n,e){for(const t in e)n[t]=e[t];return n}function bb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Lh(n){return n()}function iu(){return Object.create(null)}function Le(n){n.forEach(Lh)}function zt(n){return typeof n=="function"}function be(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Rl;function Hn(n,e){return Rl||(Rl=document.createElement("a")),Rl.href=e,n===Rl.href}function vb(n){return Object.keys(n).length===0}function Nh(n,...e){if(n==null)return G;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Je(n,e,t){n.$$.on_destroy.push(Nh(e,t))}function Nt(n,e,t,i){if(n){const s=Fh(n,e,t,i);return n[0](s)}}function Fh(n,e,t,i){return n[1]&&i?Xe(t.ctx.slice(),n[1](i(e))):t.ctx}function Ft(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 Rt(n,e,t,i,s,l){if(s){const o=Fh(e,t,i,l);n.p(o,s)}}function jt(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 Gn(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function At(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 yi(n){return n??""}function Yt(n,e,t){return n.set(t),e}function Pe(n){return n&&zt(n.destroy)?n.destroy:G}const Rh=typeof window<"u";let No=Rh?()=>window.performance.now():()=>Date.now(),fa=Rh?n=>requestAnimationFrame(n):G;const _s=new Set;function jh(n){_s.forEach(e=>{e.c(n)||(_s.delete(e),e.f())}),_s.size!==0&&fa(jh)}function Fo(n){let e;return _s.size===0&&fa(jh),{promise:new Promise(t=>{_s.add(e={c:n,f:t})}),abort(){_s.delete(e)}}}function b(n,e){n.appendChild(e)}function Hh(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function yb(n){const e=v("style");return kb(Hh(n),e),e.sheet}function kb(n,e){return b(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 bt(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function v(n){return document.createElement(n)}function B(n){return document.createTextNode(n)}function D(){return B(" ")}function Ae(){return B("")}function K(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function pt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function yn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Zn(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:p(n,i,e[i])}function ht(n){return n===""?null:+n}function wb(n){return Array.from(n.childNodes)}function re(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function de(n,e){n.value=e??""}function Ar(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function Q(n,e,t){n.classList[t?"add":"remove"](e)}function qh(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEven
`;for(let _=0;_<=1;_+=a){const y=e+(t-e)*l(_);u+=_*100+`%{${o(y,1-y)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${Sb(f)}_${r}`,d=Hh(n),{stylesheet:m,rules:h}=po.get(d)||Tb(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${c} ${i}ms linear ${s}ms 1 both`,mo+=1,c}function al(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(", "),mo-=s,mo||Cb())}function Cb(){fa(()=>{mo||(po.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),po.clear())})}function $b(n,e,t,i){if(!e)return G;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return G;const{delay:l=0,duration:o=300,easing:r=kl,start:a=No()+l,end:u=a+o,tick:f=G,css:c}=t(n,{from:e,to:s},i);let d=!0,m=!1,h;function g(){c&&(h=rl(n,0,1,o,l,r,c)),l||(m=!0)}function _(){c&&al(n,h),d=!1}return Fo(y=>{if(!m&&y>=a&&(m=!0),m&&y>=u&&(f(1,0),_()),!d)return!1;if(m){const k=y-a,T=0+1*r(k/o);f(T,1-T)}return!0}),g(),f(0,1),_}function Mb(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,Vh(n,s)}}function Vh(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 ul;function li(n){ul=n}function wl(){if(!ul)throw new Error("Function called outside component initialization");return ul}function nn(n){wl().$$.on_mount.push(n)}function Db(n){wl().$$.after_update.push(n)}function zh(n){wl().$$.on_destroy.push(n)}function $t(){const n=wl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=qh(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function We(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const ms=[],ie=[],oo=[],Ir=[],Bh=Promise.resolve();let Pr=!1;function Uh(){Pr||(Pr=!0,Bh.then(ca))}function cn(){return Uh(),Bh}function st(n){oo.push(n)}function we(n){Ir.push(n)}const xo=new Set;let as=0;function ca(){if(as!==0)return;const n=ul;do{try{for(;as<ms.length;){const e=ms[as];as++,li(e),Ob(e.$$)}}catch(e){throw ms.length=0,as=0,e}for(li(null),ms.length=0,as=0;ie.length;)ie.pop()();for(let e=0;e<oo.length;e+=1){const t=oo[e];xo.has(t)||(xo.add(t),t())}oo.length=0}while(ms.length);for(;Ir.length;)Ir.pop()();Pr=!1,xo.clear(),li(n)}function Ob(n){if(n.fragment!==null){n.update(),Le(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(st)}}let Rs;function da(){return Rs||(Rs=Promise.resolve(),Rs.then(()=>{Rs=null})),Rs}function Bi(n,e,t){n.dispatchEvent(qh(`${e?"intro":"outro"}${t}`))}const ro=new Set;let Yn;function pe(){Yn={r:0,c:[],p:Yn}}function me(){Yn.r||Le(Yn.c),Yn=Yn.p}function A(n,e){n&&n.i&&(ro.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(ro.has(n))return;ro.add(n),Yn.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const pa={duration:0};function Wh(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&al(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=kl,tick:g=G,css:_}=s||pa;_&&(o=rl(n,0,1,m,d,h,_,a++)),g(0,1);const y=No()+d,k=y+m;r&&r.abort(),l=!0,st(()=>Bi(n,!0,"start")),r=Fo(T=>{if(l){if(T>=k)return g(1,0),Bi(n,!0,"end"),u(),l=!1;if(T>=y){const C=h((T-y)/m);g(C,1-C)}}return l})}let c=!1;return{start(){c||(c=!0,al(n),zt(s)?(s=s(i),da().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function Yh(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Yn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:c=kl,tick:d=G,css:m}=s||pa;m&&(o=rl(n,1,0,f,u,c,m));const h=No()+u,g=h+f;st(()=>Bi(n,!1,"start")),Fo(_=>{if(l){if(_>=g)return d(0,1),Bi(n,!1,"end"),--r.r||Le(r.c),!1;if(_>=h){const y=c((_-h)/f);d(1-y,y)}}return l})}return zt(s)?da().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=D(),i=v("div"),p(e,"class","block txt-center m-b-lg"),p(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 ov(n){let e,t,i,s=!n[0]&&Ru();const l=n[1].default,o=Nt(l,n,n[2],null);return{c(){e=v("div"),s&&s.c(),t=D(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){S(r,e,a),s&&s.m(e,null),b(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Ru(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Rt(o,l,r,r[2],i?Ft(l,r[2],a,null):jt(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 rv(n){let e,t;return e=new kn({props:{class:"full-page",center:!0,$$slots:{default:[ov]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function av(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 e_ extends ye{constructor(e){super(),ve(this,e,av,rv,be,{nobranding:0})}}function ju(n,e,t){const i=n.slice();return i[11]=e[t],i}const uv=n=>({}),Hu=n=>({uniqueId:n[3]});function fv(n){let e=(n[11]||bo)+"",t;return{c(){t=B(e)},m(i,s){S(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||bo)+"")&&re(t,e)},d(i){i&&w(t)}}}function cv(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||bo)+"",i;return{c(){e=v("pre"),i=B(t)},m(o,r){S(o,e,r),b(e,i)},p(o,r){var a,u;r&4&&t!==(t=(((a=o[11])==null?void 0:a.message)||((u=o[11])==null?void 0:u.code)||bo)+"")&&re(i,t)},d(o){o&&w(e)}}}function qu(n){let e,t;function i(o,r){return typeof o[11]=="object"?cv:fv}let s=i(n),l=s(n);return{c(){e=v("div"),l.c(),t=D(),p(e,"class","help-block help-block-error")},m(o,r){S(o,e,r),l.m(e,null),b(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&w(e),l.d()}}}function dv(n){let e,t,i,s,l;const o=n[7].default,r=Nt(o,n,n[6],Hu);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=qu(ju(n,a,f));return{c(){e=v("div"),r&&r.c(),t=D();for(let f=0;f<u.length;f+=1)u[f].c();p(e,"class",n[0]),Q(e,"error",n[2].length)},m(f,c){S(f,e,c),r&&r.m(e,null),b(e,t);for(let d=0;d<u.length;d+=1)u[d].m(e,null);n[9](e),i=!0,s||(l=K(e,"click",n[8]),s=!0)},p(f,[c]){if(r&&r.p&&(!i||c&64)&&Rt(r,o,f,f[6],i?Ft(o,f[6],c,uv):jt(f[6]),Hu),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const m=ju(f,a,d);u[d]?u[d].p(m,c):(u[d]=qu(m),u[d].c(),u[d].m(e,null))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}(!i||c&1)&&p(e,"class",f[0]),(!i||c&5)&&Q(e,"error",f[2].length)},i(f){i||(A(r,f),i=!0)},o(f){P(r,f),i=!1},d(f){f&&w(e),r&&r.d(f),bt(u,f),n[9](null),s=!1,l()}}}const bo="Invalid value";function pv(n,e,t){let i;Je(n,Ci,h=>t(5,i=h));let{$$slots:s={},$$scope:l}=e;const o="field_"+V.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){Ts(r)}nn(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(h){We.call(this,n,h)}function m(h){ie[h?"unshift":"push"](()=>{u=h,t(1,u)})}return n.$$set=h=>{"name"in h&&t(4,r=h.name),"class"in h&&t(0,a=h.class),"$$scope"in h&&t(6,l=h.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=V.toArray(V.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,m]}class _e extends ye{constructor(e){super(),ve(this,e,pv,dv,be,{name:4,class:0})}}function mv(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Email"),s=D(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),de(l,n[0]),l.focus(),r||(a=K(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&de(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function hv(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=B("Password"),s=D(),l=v("input"),r=D(),a=v(
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),Q(f,"btn-disabled",n[3]),Q(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,g){S(h,e,g),b(e,t),b(e,i),j(s,e,null),b(e,l),j(o,e,null),b(e,r),j(a,e,null),b(e,u),b(e,f),c=!0,d||(m=K(e,"submit",pt(n[4])),d=!0)},p(h,[g]){const _={};g&1537&&(_.$$scope={dirty:g,ctx:h}),s.$set(_);const y={};g&1538&&(y.$$scope={dirty:g,ctx:h}),o.$set(y);const k={};g&1540&&(k.$$scope={dirty:g,ctx:h}),a.$set(k),(!c||g&8)&&Q(f,"btn-disabled",h[3]),(!c||g&8)&&Q(f,"btn-loading",h[3])},i(h){c||(A(s.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!0)},o(h){P(s.$$.fragment,h),P(o.$$.fragment,h),P(a.$$.fragment,h),c=!1},d(h){h&&w(e),H(s),H(o),H(a),d=!1,m()}}}function bv(n,e,t){const i=$t();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await he.admins.create({email:s,password:l,passwordConfirm:o}),await he.admins.authWithPassword(s,l),i("submit")}catch(d){he.errorResponseHandler(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class vv extends ye{constructor(e){super(),ve(this,e,bv,_v,be,{})}}function Vu(n){let e,t;return e=new e_({props:{$$slots:{default:[yv]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function yv(n){let e,t;return e=new vv({}),e.$on("submit",n[1]),{c(){q(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p:G,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function kv(n){let e,t,i=n[0]&&Vu(n);return{c(){i&&i.c(),e=Ae()},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=Vu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(pe(),P(i,1,1,()=>{i=null}),me())},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function wv(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){he.logout(!1),t(0,i=!0);return}he.authStore.isValid?Ti("/collections"):he.logout()}return[i,async()=>{t(0,i=!1),await cn(),window.location.search=""}]}class Sv extends ye{constructor(e){super(),ve(this,e,wv,kv,be,{})}}const St=Pn(""),vo=Pn(""),Cs=Pn(!1);function Bo(n){const e=n-1;return e*e*e+1}function yo(n,{delay:e=0,duration:t=400,easing:i=kl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function En(n,{delay:e=0,duration:t=400,easing:i=Bo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${u} translate(${(1-c)*s}px, ${(1-c)*l}px);
opacity: ${a-f*d}`}}function Ht(n,{delay:e=0,duration:t=400,easing:i=Bo}={}){const s=getComputedStyle(n),l=+s.opacity,o=parseFloat(s.height),r=parseFloat(s.paddingTop),a=parseFloat(s.paddingBottom),u=parseFloat(s.marginTop),f=parseFloat(s.marginBottom),c=parseFloat(s.borderTopWidth),d=parseFloat(s.borderBottomWidth);return{delay:e,duration:t,easing:i,css:m=>`overflow: hidden;opacity: ${Math.min(m*20,1)*l};height: ${m*o}px;padding-top: ${m*r}px;padding-bottom: ${m*a}px;margin-top: ${m*u}px;margin-bottom: ${m*f}px;border-top-width: ${m*c}px;border-bottom-width: ${m*d}px;`}}function It(n,{delay:e=0,duration:t=400,easing:i=Bo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
`}}function Tv(n){let e,t,i,s;return{c(){e=v("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){S(l,e,o),n[13](e),de(e,n[7]),i||(s=K(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&de(e,l[7])},i:G,o:G,d(l){l&&w(e),n[13](null),i=!1,s()}}}function Cv(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=Kt(o,r(n)),ie.push(()=>ke(e,"value",l)),e.$on("submit",n[10])),{c(){e&&q(e.$$.fragment),i=Ae()},m(a,u){e&&j(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],we(()=>t=!1)),o!==(o=a[4])){if(e){pe();const c=e;P(c.$$.fragment,1,0,()=>{H(c,1)}),me()}o?(e=Kt(o,r(a)),ie.push(()=>ke(e,"value",l)),e.$on("submit",a[10]),q(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&H(e,a)}}}function zu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Bu();return{c(){r&&r.c(),e=D(),t=v("button"),t.innerHTML='<span class="txt">Clear</span>',p(t,"type","button"),p(t,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),S(a,e,u),S(a,t,u),s=!0,l||(o=K(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&A(r,1):(r=Bu(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(pe(),P(r,1,1,()=>{r=null}),me())},i(a){s||(A(r),a&&st(()=>{i||(i=Be(t,En,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),a&&(i||(i=Be(t,En,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&w(e),a&&w(t),a&&i&&i.end(),l=!1,o()}}}function Bu(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&st(()=>{t||(t=Be(e,En,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=Be(e,En,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function $v(n){let e,t,i,s,l,o,r,a,u,f;const c=[Cv,Tv],d=[];function m(g,_){return g[4]&&!g[5]?0:1}l=m(n),o=d[l]=c[l](n);let h=(n[0].length||n[7].length)&&zu(n);return{c(){e=v("form"),t=v("label"),i=v("i"),s=D(),o.c(),r=D(),h&&h.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(g,_){S(g,e,_),b(e,t),b(t,i),b(e,s),d[l].m(e,null),b(e,r),h&&h.m(e,null),a=!0,u||(f=[K(e,"click",yn(n[11])),K(e,"submit",pt(n[10]))],u=!0)},p(g,[_]){let y=l;l=m(g),l===y?d[l].p(g,_):(pe(),P(d[y],1,1,()=>{d[y]=null}),me(),o=d[l],o?o.p(g,_):(o=d[l]=c[l](g),o.c()),A(o,1),o.m(e,r)),g[0].length||g[7].length?h?(h.p(g,_),_&129&&A(h,1)):(h=zu(g),h.c(),A(h,1),h.m(e,null)):h&&(pe(),P(h,1,1,()=>{h=null}),me())},i(g){a||(A(o),A(h),a=!0)},o(g){P(o),P(h),a=!1},d(g){g&&w(e),d[l].d(),h&&h.d(),u=!1,Le(f)}}}function Mv(n,e,t){const i=$t(),s="search_"+V.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new bn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function m(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function h(){t(0,l=d),i("submit",l)}async function g(){u||f||(t(5,f=!0),t(4,u=(await ft(()=>import("./FilterAutocompleteInput-47d03028.js"),["./FilterAutocompleteInput-47d03028.js","./index-0935db40.js"],import.meta.url)).default),t(5,f=!1))}nn(()=>{g()});function _(M){We.call(this,n,M)}function y(M){d=M,t(7,d),t(0,l)}function k(M){ie[M?"unshift":"push"](()=>{c=M,t(6,c)})}function T(){d=this.value,t(7,d),t(0,l)}const C=()=>{m(!1),h()};return n.$$set=M=>{"value"in M&&t(0,l=M.value),"placeholder"in M&&t(1,o=M.placeholder),"autocompleteCollection"in M&&t(2,r=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,m,h,_,y,k,T,C]}class Uo extends ye{cons
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function zv(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="url",p(t,"class",V.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:G,d(l){l&&w(e)}}}function Bv(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="referer",p(t,"class",V.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:G,d(l){l&&w(e)}}}function Uv(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="User IP",p(t,"class",V.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:G,d(l){l&&w(e)}}}function Wv(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="status",p(t,"class",V.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:G,d(l){l&&w(e)}}}function Yv(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="created",p(t,"class",V.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:G,d(l){l&&w(e)}}}function Ju(n){let e;function t(l,o){return l[6]?Jv:Kv}let i=t(n),s=i(n);return{c(){s.c(),e=Ae()},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 Kv(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Zu(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No logs found.",s=D(),o&&o.c(),l=D(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),b(e,t),b(t,i),b(t,s),o&&o.m(t,null),b(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Zu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function Jv(n){let e;return{c(){e=v("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Zu(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[19]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function Gu(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Xu(n,e){var Se,Ue,lt;let t,i,s,l=((Se=e[23].method)==null?void 0:Se.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,m,h,g,_,y,k=(e[23].referer||"N/A")+"",T,C,M,$,O,E=(e[23].userIp||"N/A")+"",I,L,N,F,W,Z=e[23].status+"",ne,J,te,ee,z,X,Y,le,He,Re,Fe=(((Ue=e[23].meta)==null?void 0:Ue.errorMessage)||((lt=e[23].meta)==null?void 0:lt.errorData))&&Gu();ee=new Zi({props:{date:e[23].created}});function qe(){return e[17](e[23])}function ge(...ue){return e[18](e[23],...ue)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("span"),o=B(l),a=D(),u=v("td"),f=v("span"),d=B(c),h=D(),Fe&&Fe.c(),g=D(),_=v("td"),y=v("span"),T=B(k),M=D(),$=v("td"),O=v("span"),I=B(E),N=D(),F=v("td"),W=v("span"),ne=B(Z),J=D(),te=v("td"),q(ee.$$.fragment),z=D(),X=v("td"),X.innerHTML='<i class="ri-arrow-right-line"></i>',Y=D(),p(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",m=e[23].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",C=e[23].referer),Q(y,"txt-hint",!e[23].referer),p(_,"class","col-type-text col-field-referer"),p(O,"class","txt txt-ellipsis"),p(O,"title",L=e[23].userIp),Q(O,"txt-hint",!e[23].userIp),p($,"class","col-type-number col-field-userIp"),p(W,"class","label"),Q(W,"label-danger",e[23].status>=400),p(F,"class","col-type-number col-field-status"),p(te,"class","col-type-date col-field-created"),p(X,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ue,fe){S(ue,t,fe),b(t,i),b(i,s),b(s,o),b(t,a),b(t,u),b(u,f),b(f,d),b(u,h),Fe&&Fe.m(u,null),b(t,g),b(t,_),b(_,y),b(y,T),b(t,M),b(t,$),b($,O),b(O,I),b(t,N),b(t,F),b(F,W),b(W,ne),b(t,J),b(t,te),j(ee,te,null),b(t,z),b(t,X),b(t,Y),le=!0,He||(Re=[K(t,"click",qe),K(t,"keydown",ge)],He=!0)},p(ue,fe){var oe,je,Me;e=ue,(!le||fe&8)&&l!==(l=((oe=e[23].method)==null?void 0:oe.toUpperCase())+"")&&re(o,l),(!le||fe&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&p(s,"class",r),(!le||fe&8)&&c!==(c=e[23].url+"")&&re(d,c),(!le||fe&8&&m!==(m=e[23].url))&&p(f,"title",m),(je=e[23].meta)!=null&&je.errorMessage||(Me=e[23].meta)!=null&&Me.errorData?Fe||(Fe=Gu(),Fe.c(),Fe.m(u,null)):Fe&&(Fe.d(1),Fe=null),(!le||fe&8)&&k!==(k=(e[23].referer||"N/A")+"")&&re(T,k),(!le||fe&8&&C!==(C=e[23].referer))&&p(y,"title",C),(!le||fe&8)&&Q(y,"txt-hint",!e[23].referer),(!le||fe&8)&&E!==(E=(e[23].userIp||"N/A")+"")&&re(I,E),(!le||fe&8&&L!==(L=e[23].userIp))&&p(O,"title",L),(!le||fe&8)&&Q(O,"txt-hint",!e[23].userIp),(!le||fe&8)&&Z!==(Z=e[23].status+"")&&re(ne,Z),(!le||fe&8)&&Q(W,"label-danger",e[23].status>=400);const ae={};fe&8&&(ae.date=e[23].created),ee.$set(ae)},i(ue){le||(A(ee.$$.fragment,ue),le=!0)},o(ue){P(ee.$$.fragment,ue),le=!1},d(ue){ue&&w(t),Fe&&Fe.d(),H(ee),He=!1,Le(Re)}}}function Zv(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,y,k,T,C,M,$,O,E,I=[],L=new Map,N;function F(ge){n[11](ge)}let W={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[Vv]},$$scope:{ctx:n}};n[1]!==void 0&&(W.sort=n[1]),s=new Ut({props:W}),ie.push(()=>ke(s,"sort",F));function Z(ge){n[12](ge)}let ne={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[zv]},$$scope:{ctx:n}};n[1]!==void 0&&(ne.sort=n[1]),r=new Ut({props:ne}),ie.push(()=>ke(r,"sort",Z));function J(ge){n[13](ge)}let te={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[Bv]},$$scope:{ctx:n}};n[1]!==void 0&&(te.sort=n[1]),f=new Ut({props:te}),ie.push(()=>ke(f,"sort",J));function ee(ge){n[14](ge)}let z={disable:!0,class:"col-type-number col-f
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/function ti(){}const xv=function(){let n=0;return function(){return n++}}();function ut(n){return n===null||typeof n>"u"}function gt(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 Ge(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Ct=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Tn(n,e){return Ct(n)?n:e}function et(n,e){return typeof n>"u"?e:n}const ey=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,n_=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function yt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function ct(n,e,t,i){let s,l,o;if(gt(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(Ge(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function ko(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 wo(n){if(gt(n))return n.map(wo);if(Ge(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=wo(n[t[s]]);return e}return n}function i_(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function ty(n,e,t,i){if(!i_(n))return;const s=e[n],l=t[n];Ge(s)&&Ge(l)?dl(s,l,i):e[n]=wo(l)}function dl(n,e,t){const i=gt(e)?e:[e],s=i.length;if(!Ge(n))return n;t=t||{};const l=t.merger||ty;for(let o=0;o<s;++o){if(e=i[o],!Ge(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 tl(n,e){return dl(n,e,{merger:ny})}function ny(n,e,t){if(!i_(n))return;const i=e[n],s=t[n];Ge(i)&&Ge(s)?tl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=wo(s))}const ef={"":n=>n,x:n=>n.x,y:n=>n.y};function ki(n,e){return(ef[e]||(ef[e]=iy(e)))(n)}function iy(n){const e=sy(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function sy(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 Ea(n){return n.charAt(0).toUpperCase()+n.slice(1)}const An=n=>typeof n<"u",wi=n=>typeof n=="function",tf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function ly(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Tt=Math.PI,dt=2*Tt,oy=dt+Tt,So=Number.POSITIVE_INFINITY,ry=Tt/180,kt=Tt/2,zs=Tt/4,nf=Tt*2/3,Dn=Math.log10,Jn=Math.sign;function sf(n){const e=Math.round(n);n=nl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Dn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function ay(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 $s(n){return!isNaN(parseFloat(n))&&isFinite(n)}function nl(n,e,t){return Math.abs(n-e)<t}function uy(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function s_(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 jn(n){return n*(Tt/180)}function Aa(n){return n*(180/Tt)}function lf(n){if(!Ct(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function l_(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*Tt&&(l+=dt),{angle:l,distance:s}}function Jr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function fy(n,e){return(n-e+oy)%dt-Tt}function gn(n){return(n%dt+dt)%dt}function pl(n,e,t,i){const s=gn(n),l=gn(e),o=gn(t),r=gn(l-s),a=gn(o-s),u=gn(s-l),f=gn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function Wt(n,e,t){return Math.max(e,Math.min(t,n))}function cy(n){return Wt(n,-32768,32767)}function ml(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ia(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 zi=(n,e,t,i)=>Ia(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),dy=(n,e,t)=>Ia(n,t,i=>n[i][e]>=t);function py(n,e,
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function Ol(n){return n+.5|0}const hi=(n,e,t)=>Math.max(Math.min(n,t),e);function Xs(n){return hi(Ol(n*2.55),0,255)}function vi(n){return hi(Ol(n*255),0,255)}function si(n){return hi(Ol(n/2.55)/100,0,1)}function ff(n){return hi(Ol(n*100),0,100)}const Sn={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},Zr=[..."0123456789ABCDEF"],_y=n=>Zr[n&15],by=n=>Zr[(n&240)>>4]+Zr[n&15],Wl=n=>(n&240)>>4===(n&15),vy=n=>Wl(n.r)&&Wl(n.g)&&Wl(n.b)&&Wl(n.a);function yy(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Sn[n[1]]*17,g:255&Sn[n[2]]*17,b:255&Sn[n[3]]*17,a:e===5?Sn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Sn[n[1]]<<4|Sn[n[2]],g:Sn[n[3]]<<4|Sn[n[4]],b:Sn[n[5]]<<4|Sn[n[6]],a:e===9?Sn[n[7]]<<4|Sn[n[8]]:255})),t}const ky=(n,e)=>n<255?e(n):"";function wy(n){var e=vy(n)?_y:by;return n?"#"+e(n.r)+e(n.g)+e(n.b)+ky(n.a,e):void 0}const Sy=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function d_(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 Ty(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function Cy(n,e,t){const i=d_(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 $y(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 Pa(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=$y(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function La(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(vi)}function Na(n,e,t){return La(d_,n,e,t)}function My(n,e,t){return La(Cy,n,e,t)}function Dy(n,e,t){return La(Ty,n,e,t)}function p_(n){return(n%360+360)%360}function Oy(n){const e=Sy.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Xs(+e[5]):vi(+e[5]));const s=p_(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=My(s,l,o):e[1]==="hsv"?i=Dy(s,l,o):i=Na(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function Ey(n,e){var t=Pa(n);t[0]=p_(t[0]+e),t=Na(t),n.r=t[0],n.g=t[1],n.b=t[2]}function Ay(n){if(!n)return;const e=Pa(n),t=e[0],i=ff(e[1]),s=ff(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${si(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const cf={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},df={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class L2{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=a_.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 ni=new L2;const Tf="transparent",N2={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=mf(n||Tf),s=i.valid&&mf(e||Tf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class F2{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||N2[e.type||typeof o],this._easing=il[e.easing]||il.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 R2=["x","y","borderWidth","radius","tension"],j2=["color","borderColor","backgroundColor"];tt.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 H2=Object.keys(tt.animation);tt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});tt.set("animations",{colors:{type:"color",properties:j2},numbers:{type:"number",properties:R2}});tt.describe("animations",{_fallback:"animation"});tt.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 D_{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!Ge(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!Ge(s))return;const l={};for(con
`)>-1?n.split(`
`):n}function tS(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function tc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=_n(e.bodyFont),u=_n(e.titleFont),f=_n(e.footerFont),c=l.length,d=s.length,m=i.length,h=In(e.padding);let g=h.height,_=0,y=i.reduce((C,M)=>C+M.before.length+M.lines.length+M.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const C=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=m*C+(y-m)*a.lineHeight+(y-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let k=0;const T=function(C){_=Math.max(_,t.measureText(C).width+k)};return t.save(),t.font=u.string,ct(n.title,T),t.font=a.string,ct(n.beforeBody.concat(n.afterBody),T),k=e.displayColors?o+2+e.boxPadding:0,ct(i,C=>{ct(C.before,T),ct(C.lines,T),ct(C.after,T)}),k=0,t.font=f.string,ct(n.footer,T),t.restore(),_+=h.width,{width:_,height:g}}function nS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function iS(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 sS(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"),iS(u,n,e,t)&&(u="center"),u}function nc(n,e,t){const i=t.yAlign||e.yAlign||nS(n,t);return{xAlign:t.xAlign||e.xAlign||sS(n,e,t,i),yAlign:i}}function lS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function oS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function ic(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=vs(o);let h=lS(e,r);const g=oS(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+s:r==="right"&&(h+=Math.max(c,m)+s),{x:Wt(h,0,i.width-e.width),y:Wt(g,0,i.height-e.height)}}function to(n,e,t){const i=In(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function sc(n){return Wn([],ii(n))}function rS(n,e,t){return $i(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function lc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class sa extends ai{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 D_(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=rS(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=Wn(r,ii(s)),r=Wn(r,ii(l)),r=Wn(r,ii(o)),r}getBeforeBody(e,t){return sc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return ct(e,l=>{const o={before:[],lines:[],after:[]},r=lc(i,l);Wn(o.before,ii(r.beforeLabel.call(this,l))
* chartjs-adapter-luxon v1.3.0
* https://www.chartjs.org
* (c) 2022 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const DS={datetime:Ve.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Ve.TIME_WITH_SECONDS,minute:Ve.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};P_._date.override({_id:"luxon",_create:function(n){return Ve.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return DS},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=Ve.fromFormat(n,e,t):n=Ve.fromISO(n,t):n instanceof Date?n=Ve.fromJSDate(n,t):i==="object"&&!(n instanceof Ve)&&(n=Ve.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function pc(n){let e,t,i;return{c(){e=v("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&st(()=>{t||(t=Be(e,It,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=Be(e,It,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function OS(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=B(n[1]),t=D(),s=B(i)},m(l,o){S(l,e,o),S(l,t,o),S(l,s,o)},p(l,o){o&2&&re(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&re(s,i)},d(l){l&&w(e),l&&w(t),l&&w(s)}}}function ES(n){let e;return{c(){e=B("Loading...")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function AS(n){let e,t,i,s,l,o=n[2]&&pc();function r(f,c){return f[2]?ES:OS}let a=r(n),u=a(n);return{c(){e=v("div"),o&&o.c(),t=D(),i=v("canvas"),s=D(),l=v("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),Ar(i,"height","250px"),Ar(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){S(f,e,c),o&&o.m(e,null),b(e,t),b(e,i),n[8](i),S(f,s,c),S(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=pc(),o.c(),A(o,1),o.m(e,t)):o&&(pe(),P(o,1,1,()=>{o=null}),me()),c&4&&Q(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){P(o)},d(f){f&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function IS(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),he.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(m=>{c();for(let h of m)r.push({x:new Date(h.date),y:h.total}),t(1,a+=h.total);r.push({x:new Date,y:void 0})}).catch(m=>{m!=null&&m.isAbort||(c(),console.warn(m),he.errorResponseHandler(m,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}nn(()=>(Ao.register(Mi,Jo,Yo,Xa,Pl,eS,aS),t(6,o=new Ao(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 d(m){ie[m?"unshift":"push"](()=>{l=m,t(0,l)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,s=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o
* 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 k(T){return T instanceof a?new a(T.type,k(T.content),T.alias):Array.isArray(T)?T.map(k):T.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(k){return Object.prototype.toString.call(k).slice(8,-1)},objId:function(k){return k.__id||Object.defineProperty(k,"__id",{value:++l}),k.__id},clone:function k(T,C){C=C||{};var M,$;switch(r.util.type(T)){case"Object":if($=r.util.objId(T),C[$])return C[$];M={},C[$]=M;for(var O in T)T.hasOwnProperty(O)&&(M[O]=k(T[O],C));return M;case"Array":return $=r.util.objId(T),C[$]?C[$]:(M=[],C[$]=M,T.forEach(function(E,I){M[I]=k(E,C)}),M);default:return T}},getLanguage:function(k){for(;k;){var T=s.exec(k.className);if(T)return T[1].toLowerCase();k=k.parentElement}return"none"},setLanguage:function(k,T){k.className=k.className.replace(RegExp(s,"gi"),""),k.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(M){var k=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(k){var T=document.getElementsByTagName("script");for(var C in T)if(T[C].src==k)return T[C]}return null}},isActive:function(k,T,C){for(var M="no-"+T;k;){var $=k.classList;if($.contains(T))return!0;if($.contains(M))return!1;k=k.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(k,T){var C=r.util.clone(r.languages[k]);for(var M in T)C[M]=T[M];return C},insertBefore:function(k,T,C,M){M=M||r.languages;var $=M[k],O={};for(var E in $)if($.hasOwnProperty(E)){if(E==T)for(var I in C)C.hasOwnProperty(I)&&(O[I]=C[I]);C.hasOwnProperty(E)||(O[E]=$[E])}var L=M[k];return M[k]=O,r.languages.DFS(r.languages,function(N,F){F===L&&N!=k&&(this[N]=O)}),O},DFS:function k(T,C,M,$){$=$||{};var O=r.util.objId;for(var E in T)if(T.hasOwnProperty(E)){C.call(T,E,T[E],M||E);var I=T[E],L=r.util.type(I);L==="Object"&&!$[O(I)]?($[O(I)]=!0,k(I,C,null,$)):L==="Array"&&!$[O(I)]&&($[O(I)]=!0,k(I,C,E,$))}}},plugins:{},highlightAll:function(k,T){r.highlightAllUnder(document,k,T)},highlightAllUnder:function(k,T,C){var M={callback:C,container:k,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),r.hooks.run("before-all-elements-highlight",M);for(var $=0,O;O=M.elements[$++];)r.highlightElement(O,T===!0,M.callback)},highlightElement:function(k,T,C){var M=r.util.getLanguage(k),$=r.languages[M];r.util.setLanguage(k,M);var O=k.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,M);var E=k.textContent,I={element:k,language:M,grammar:$,code:E};function L(F){I.highlightedCode=F,r.hooks.run("before-insert",I),I.element.innerHTML=I.highlightedCode,r.hooks.run("after-highlight",I),r.hooks.run("complete",I),C&&C.call(I.element)}if(r.hooks.run("before-sanity-check",I),O=I.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!I.code){r.hooks.run("complete",I),C&&C.call(I.element);return}if(r.hooks.run("before-highlight",I),!I.grammar){L(r.util.encode(I.code));return}if(T&&i.Worker){var N=new Worker(r.filename);N.onmessage=function(F){L(F.data)},N.postMessage(JSON.stringify({language:I.language,code:I.code,immediateClose:!0}))}else L(r.highlight(I.code,I.grammar,I.language))},highlight:function(k,T,C){var M={code:k,grammar:T,language:C};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function(k,T){var C=T.rest;if(C){for(var M in C)T[M]=C[M];delete T.rest}var $=new c;return d($,$.head,k),f(k,$,T,$.head,0),h($)},hooks:{all:{},add:function
`),_.hasAttribute("data-start")||_.setAttribute("data-start",String(I+1))}y.textContent=$,t.highlightElement(y)},function($){_.setAttribute(r,f),y.textContent=$})}}),t.plugins.fileHighlight={highlight:function(_){for(var y=(_||document).querySelectorAll(c),k=0,T;T=y[k++];)t.highlightElement(T)}};var h=!1;t.fileHighlight=function(){h||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),h=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(LS);const Js=ra;var hc={},NS={get exports(){return hc},set exports(n){hc=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),c=0,d=0;d<f.length;++d){var m=s(f[d]);c+=m,c>r&&(f[d]=`
`+f[d],c=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 c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,m="",h="",g=!1,_=0;_<d.length;++_){var y=d[_];y==o.element?g=!0:y.nodeName==="#text"&&(g?h+=y.nodeValue:m+=y.nodeValue,a.removeChild(y),--_)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=m+o.code+h,o.code=r.normalize(o.code,o.settings);else{var k=m+o.element.innerHTML+h;o.element.innerHTML=r.normalize(k,o.settings),o.code=o.element.textContent}}}})})()})(NS);(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 FS(n){let e,t,i;return{c(){e=v("div"),t=v("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){S(s,e,l),b(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")&&p(e,"class",i)},i:G,o:G,d(s){s&&w(e)}}}function RS(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=Js.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Js.highlight(a,Js.languages[l]||Js.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 Js<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class x_ extends ye{constructor(e){super(),ve(this,e,RS,FS,be,{class:0,content:2,language:3})}}const jS=n=>({}),gc=n=>({}),HS=n=>({}),_c=n=>({});function bc(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,y,k,T=n[4]&&!n[2]&&vc(n);const C=n[19].header,M=Nt(C,n,n[18],_c);let $=n[4]&&n[2]&&yc(n);const O=n[19].default,E=Nt(O,n,n[18],null),I=n[19].footer,L=Nt(I,n,n[18],gc);return{c(){e=v("div"),t=v("div"),s=D(),l=v("div"),o=v("div"),T&&T.c(),r=D(),M&&M.c(),a=D(),$&&$.c(),u=D(),f=v("div"),E&&E.c(),c=D(),d=v("div"),L&&L.c(),p(t,
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&16&&l!==(l=_[4]))&&p(e,"for",l);const k={};y&16&&(k.id=_[4]),y&1&&(k.disabled=!V.isEmpty(_[0].onlyDomains)),!a&&y&1&&(a=!0,k.value=_[0].exceptDomains,we(()=>a=!1)),r.$set(k)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){P(r.$$.fragment,_),c=!1},d(_){_&&w(e),_&&w(o),H(r,_),_&&w(u),_&&w(f),d=!1,m()}}}function W3(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(_){n[3](_)}let g={id:n[4]+".options.onlyDomains",disabled:!V.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(g.value=n[0].onlyDomains),r=new Ns({props:g}),ie.push(()=>ke(r,"value",h)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=D(),s=v("i"),o=D(),q(r.$$.fragment),u=D(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]+".options.onlyDomains"),p(f,"class","help-block")},m(_,y){S(_,e,y),b(e,t),b(e,i),b(e,s),S(_,o,y),j(r,_,y),S(_,u,y),S(_,f,y),c=!0,d||(m=Pe(Ye.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&16&&l!==(l=_[4]+".options.onlyDomains"))&&p(e,"for",l);const k={};y&16&&(k.id=_[4]+".options.onlyDomains"),y&1&&(k.disabled=!V.isEmpty(_[0].exceptDomains)),!a&&y&1&&(a=!0,k.value=_[0].onlyDomains,we(()=>a=!1)),r.$set(k)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){P(r.$$.fragment,_),c=!1},d(_){_&&w(e),_&&w(o),H(r,_),_&&w(u),_&&w(f),d=!1,m()}}}function Y3(n){let e,t,i,s,l,o,r;return i=new _e({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[U3,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new _e({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[W3,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){S(a,e,u),b(e,t),j(i,t,null),b(e,s),b(e,l),j(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),H(i),H(o)}}}function K3(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.exceptDomains,r)&&(s.exceptDomains=r,t(0,s))}function o(r){n.$$.not_equal(s.onlyDomains,r)&&(s.onlyDomains=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class nb extends ye{constructor(e){super(),ve(this,e,K3,Y3,be,{key:1,options:0})}}function J3(n){let e,t,i,s;function l(a){n[2](a)}function o(a){n[3](a)}let r={};return n[0]!==void 0&&(r.key=n[0]),n[1]!==void 0&&(r.options=n[1]),e=new nb({props:r}),ie.push(()=>ke(e,"key",l)),ie.push(()=>ke(e,"options",o)),{c(){q(e.$$.fragment)},m(a,u){j(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],we(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],we(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){H(e,a)}}}function Z3(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){i=r,t(0,i)}function o(r){s=r,t(1,s)}return n.$$set=r=>{"key"in r&&t(0,i=r.key),"options"in r&&t(1,s=r.options)},[i,s,l,o]}class G3 extends ye{constructor(e){super(),ve(this,e,Z3,J3,be,{key:0,options:1})}}function X3(n,e,t){let{key:i=""}=e,{options:s={}}=e;return n.$$set=l=>{"key"in l&&t(0,i=l.key),"options"in l&&t(1,s=l.options)},[i,s]}class Q3 extends ye{constructor(e){super(),ve(this,e,X3,null,be,{key:0,options:1})}}var wr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ks={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onR
<span class='flatpickr-weekday'>
`+U.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function X(){t.calendarContainer.classList.add("hasWeeks");var R=at("div","flatpickr-weekwrapper");R.appendChild(at("span","flatpickr-weekday",t.l10n.weekAbbreviation));var U=at("div","flatpickr-weeks");return R.appendChild(U),{weekWrapper:R,weekNumbers:U}}function Y(R,U){U===void 0&&(U=!0);var x=U?R:R-t.currentMonth;x<0&&t._hidePrevMonthArrow===!0||x>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=x,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Qe("onYearChange"),W()),F(),Qe("onMonthChange"),Ei())}function le(R,U){if(R===void 0&&(R=!0),U===void 0&&(U=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,U===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var x=$r(t.config),se=x.hours,Ce=x.minutes,Ee=x.seconds;m(se,Ce,Ee)}t.redraw(),R&&Qe("onChange")}function He(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Qe("onClose")}function Re(){t.config!==void 0&&Qe("onDestroy");for(var R=t._handlers.length;R--;)t._handlers[R].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var U=t.calendarContainer.parentNode;if(U.lastChild&&U.removeChild(U.lastChild),U.parentNode){for(;U.firstChild;)U.parentNode.insertBefore(U.firstChild,U);U.parentNode.removeChild(U)}}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(x){try{delete t[x]}catch{}})}function Fe(R){return t.calendarContainer.contains(R)}function qe(R){if(t.isOpen&&!t.config.inline){var U=mn(R),x=Fe(U),se=U===t.input||U===t.altInput||t.element.contains(U)||R.path&&R.path.indexOf&&(~R.path.indexOf(t.input)||~R.path.indexOf(t.altInput)),Ce=!se&&!x&&!Fe(R.relatedTarget),Ee=!t.config.ignoredFocusElements.some(function(Ie){return Ie.contains(U)});Ce&&Ee&&(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 ge(R){if(!(!R||t.config.minDate&&R<t.config.minDate.getFullYear()||t.config.maxDate&&R>t.config.maxDate.getFullYear())){var U=R,x=t.currentYear!==U;t.currentYear=U||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)),x&&(t.redraw(),Qe("onYearChange"),W())}}function Se(R,U){var x;U===void 0&&(U=!0);var se=t.parseDate(R,void 0,U);if(t.config.minDate&&se&&hn(se,t.config.minDate,U!==void 0?U:!t.minDateHasTime)<0||t.config.maxDate&&se&&hn(se,t.config.maxDate,U!==void 0?U:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(se===voi
Leave empty for no restriction.`,position:"top"})),k=!0)},p($,O){(!y||O&4096&&l!==(l=$[12]))&&p(e,"for",l);const E={};O&4096&&(E.id=$[12]),O&4&&(E.items=$[2]),!a&&O&1&&(a=!0,E.keyOfSelected=$[0].mimeTypes,we(()=>a=!1)),r.$set(E);const I={};O&8193&&(I.$$scope={dirty:O,ctx:$}),_.$set(I)},i($){y||(A(r.$$.fragment,$),A(_.$$.fragment,$),y=!0)},o($){P(r.$$.fragment,$),P(_.$$.fragment,$),y=!1},d($){$&&w(e),$&&w(o),H(r,$),$&&w(u),$&&w(f),H(_),k=!1,T()}}}function DT(n){let e;return{c(){e=v("ul"),e.innerHTML=`<li><strong>WxH</strong>
(eg. 100x50) - crop to WxH viewbox (from center)</li>
<li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li>
<li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li>
<li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li>
<li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li>
<li><strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,p(e,"class","m-0")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function OT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,y,k,T,C,M;function $(E){n[10](E)}let O={id:n[12],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(O.value=n[0].thumbs),r=new Ns({props:O}),ie.push(()=>ke(r,"value",$)),k=new Qn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[DT]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Thumb sizes",i=D(),s=v("i"),o=D(),q(r.$$.fragment),u=D(),f=v("div"),c=v("span"),c.textContent="Use comma as separator.",d=D(),m=v("button"),h=v("span"),h.textContent="Supported formats",g=D(),_=v("i"),y=D(),q(k.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(_,"class","ri-arrow-drop-down-fill"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,I){S(E,e,I),b(e,t),b(e,i),b(e,s),S(E,o,I),j(r,E,I),S(E,u,I),S(E,f,I),b(f,c),b(f,d),b(f,m),b(m,h),b(m,g),b(m,_),b(m,y),j(k,m,null),T=!0,C||(M=Pe(Ye.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(E,I){(!T||I&4096&&l!==(l=E[12]))&&p(e,"for",l);const L={};I&4096&&(L.id=E[12]),!a&&I&1&&(a=!0,L.value=E[0].thumbs,we(()=>a=!1)),r.$set(L);const N={};I&8192&&(N.$$scope={dirty:I,ctx:E}),k.$set(N)},i(E){T||(A(r.$$.fragment,E),A(k.$$.fragment,E),T=!0)},o(E){P(r.$$.fragment,E),P(k.$$.fragment,E),T=!1},d(E){E&&w(e),E&&w(o),H(r,E),E&&w(u),E&&w(f),H(k),C=!1,M()}}}function ET(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return i=new _e({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[TT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),o=new _e({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[CT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),u=new _e({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[MT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),d=new _e({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[OT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),r=D(),a=v("div"),q(u.$$.fragment),f=D(),c=v("div"),q(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(c,"class","col-sm-12"),p(e,"class","grid")},m(h,g){S(h,e,g),b(e,t),j(i,t,null),b(e,s),b(e,l),j(o,l,null),b(e,r),b(e,a),j(u,a,null),b(e,f),b(e,c),j(d,c,null),m=!0},p(h,[g]){const _={};g&2&&(_.name="schema."+h[1]+".options.maxSize"),g&12289&&(_.$$scope={dirty:g,ctx:h}),i.$set(_);const y={};g&2&&(y.name="schema."+h[1]+".options.maxSelect"),g&12289&&(y.$$scope={dirty:g,ctx:h}),o.$set(y);const k={};g&2&&(k.name="schema."+h[1]+".options.mimeTypes"),g&12293&&(k.$$scope={dirty:g,ctx:h}),u.$set(k);const T={};g&2&&(T.name="schema."+h[1]+".options.thumbs"),g&12289&&(T.$$scope={dirty:g,ctx:h}),d.$set(T)},i(h){m||(A(i.$$.fragment,h),A(o.$$.fragment,h),A(u.$$.fragment,h),A(d.$$.fragment,h),m=!0)},o(h){P(i.$$.fragment,h),P(o.$$.fragment,h),P(u.$$.fragment,h),P(d.$$.fragment,h),m=!1},d(h){h&&w(e),H(i),H(o),H(u),H(d)}}}function AT(n,e,t){let{key:i=""}=e,{options:s={}}=e,l=ST.slice();function o(){if(V.isEmpty(s.mimeTypes))return;const g=[];for(const _ of s.mimeTypes)l.find(y=>y.mimeType===_)||g.push({mimeType:_});g.length&&t(2,l=l.concat(g))}function r(){s.maxSize=ht(this.value),t(0,s)}function a(){s.maxSelect=ht(this.value),t(0,s)}function u(g){n.$$.not_equal(s.mimeTypes,g)&&(s.mimeTypes=g,t(0,s))}const f=()=>{t(0,s.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},c=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlfo
<span class="txt">New collection</span>`,p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=K(i,"click",n[7]),s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function LT(n){let e,t,i,s,l,o,r;function a(f){n[8](f)}let u={searchable:n[2].length>5,selectPlaceholder:"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[2],$$slots:{afterOptions:[PT]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new Ls({props:u}),ie.push(()=>ke(l,"keyOfSelected",a)),{c(){e=v("label"),t=B("Collection"),s=D(),q(l.$$.fragment),p(e,"for",i=n[18])},m(f,c){S(f,e,c),b(e,t),S(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&262144&&i!==(i=f[18]))&&p(e,"for",i);const d={};c&4&&(d.searchable=f[2].length>5),c&4&&(d.items=f[2]),c&524296&&(d.$$scope={dirty:c,ctx:f}),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].collectionId,we(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),H(l,f)}}}function NT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("span"),t.textContent="Max select",i=D(),s=v("i"),o=D(),r=v("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[18]),p(r,"type","number"),p(r,"id",a=n[18]),p(r,"step","1"),p(r,"min","1")},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),S(c,o,d),S(c,r,d),de(r,n[0].maxSelect),u||(f=[Pe(Ye.call(null,s,{text:"Leave empty for no limit.",position:"top"})),K(r,"input",n[9])],u=!0)},p(c,d){d&262144&&l!==(l=c[18])&&p(e,"for",l),d&262144&&a!==(a=c[18])&&p(r,"id",a),d&1&&ht(r.value)!==c[0].maxSelect&&de(r,c[0].maxSelect)},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,Le(f)}}}function FT(n){let e,t,i,s,l,o,r,a,u,f,c;function d(h){n[10](h)}let m={multiple:!0,searchable:!0,id:n[18],selectPlaceholder:"Auto",items:n[4]};return n[0].displayFields!==void 0&&(m.selected=n[0].displayFields),r=new xa({props:m}),ie.push(()=>ke(r,"selected",d)),{c(){e=v("label"),t=v("span"),t.textContent="Display fields",i=D(),s=v("i"),o=D(),q(r.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[18])},m(h,g){S(h,e,g),b(e,t),b(e,i),b(e,s),S(h,o,g),j(r,h,g),u=!0,f||(c=Pe(Ye.call(null,s,{text:"Optionally select the field(s) that will be used in the listings UI. Leave empty for auto.",position:"top"})),f=!0)},p(h,g){(!u||g&262144&&l!==(l=h[18]))&&p(e,"for",l);const _={};g&262144&&(_.id=h[18]),g&16&&(_.items=h[4]),!a&&g&1&&(a=!0,_.selected=h[0].displayFields,we(()=>a=!1)),r.$set(_)},i(h){u||(A(r.$$.fragment,h),u=!0)},o(h){P(r.$$.fragment,h),u=!1},d(h){h&&w(e),h&&w(o),H(r,h),f=!1,c()}}}function RT(n){let e,t,i,s,l,o,r;function a(f){n[11](f)}let u={id:n[18],items:n[5]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new Ls({props:u}),ie.push(()=>ke(l,"keyOfSelected",a)),{c(){e=v("label"),t=B("Cascade delete"),s=D(),q(l.$$.fragment),p(e,"for",i=n[18])},m(f,c){S(f,e,c),b(e,t),S(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&262144&&i!==(i=f[18]))&&p(e,"for",i);const d={};c&262144&&(d.id=f[18]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,we(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),H(l,f)}}}function jT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g;i=new _e({props:{class:"form-field required",name:"schema."+n[1]+".options.collectionId",$$slots:{default:[LT,({uniqueId:y})=>({18:y}),({uniqueId:y})=>y?262144:0]},$$scope:{ctx:n}}}),o=new _e({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[NT,({uniqueId:y})=>({18:y}),({uniqueId:y})=>y?262144:0]},$$scope:{ctx:n}}}),u=new _e({props:{class:"form-field",name:"schema."+n[1]+".options.displayFields",$$slots:{default:[FT,({uniqueId:y})=>({18:y}),({uniqueId:y})=>y?262144:0]},$$scope:{ctx:n}}}),d=new _e({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[RT,({uniqueId:y})=>({18:y}),({uniqueId:y})=>y?262144:0]},$$scope:{ctx:n}}});let _={};return h=new tu({props:_}),n[12](h),h.$on("save",n[13]),{c(){e=v("div"),t=v("div"),q(i.$$
(aka. not ${V.zeroDefaultStr(n[0])}).`,position:"right"}))],d=!0)},p(h,g){g[1]&4096&&t!==(t=h[43])&&p(e,"id",t),g[0]&1&&(e.checked=h[0].required),g[0]&1&&o!==(o=gs(h[0])+"")&&re(r,o),f&&zt(f.update)&&g[0]&1&&f.update.call(null,{text:`Requires the field value to be ${gs(h[0])}
(aka. not ${V.zeroDefaultStr(h[0])}).`,position:"right"}),g[1]&4096&&c!==(c=h[43])&&p(s,"for",c)},d(h){h&&w(e),h&&w(i),h&&w(s),d=!1,Le(m)}}}function Jc(n){let e,t;return e=new _e({props:{class:"form-field form-field-toggle m-0",name:"unique",$$slots:{default:[tC,({uniqueId:i})=>({43:i}),({uniqueId:i})=>[0,i?4096:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&1|s[1]&12288&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function tC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[43]),p(s,"for",o=n[43])},m(u,f){S(u,e,f),e.checked=n[0].unique,S(u,i,f),S(u,s,f),b(s,l),r||(a=K(e,"change",n[31]),r=!0)},p(u,f){f[1]&4096&&t!==(t=u[43])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].unique),f[1]&4096&&o!==(o=u[43])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Zc(n){let e,t,i,s,l,o,r,a,u,f;a=new Qn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[nC]},$$scope:{ctx:n}}});let c=n[8]&&Gc(n);return{c(){e=v("div"),t=v("div"),i=D(),s=v("div"),l=v("button"),o=v("i"),r=D(),q(a.$$.fragment),u=D(),c&&c.c(),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(l,"type","button"),p(l,"aria-label","More"),p(l,"class","btn btn-circle btn-sm btn-transparent"),p(s,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","col-sm-4 txt-right")},m(d,m){S(d,e,m),b(e,t),b(e,i),b(e,s),b(s,l),b(l,o),b(l,r),j(a,l,null),b(s,u),c&&c.m(s,null),f=!0},p(d,m){const h={};m[1]&8192&&(h.$$scope={dirty:m,ctx:d}),a.$set(h),d[8]?c?c.p(d,m):(c=Gc(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i(d){f||(A(a.$$.fragment,d),f=!0)},o(d){P(a.$$.fragment,d),f=!1},d(d){d&&w(e),H(a),c&&c.d()}}}function nC(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Remove</span>',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[9]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function Gc(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Done</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-outline btn-expanded-sm")},m(s,l){S(s,e,l),t||(i=K(e,"click",yn(n[3])),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function iC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,y,k,T,C,M,$;s=new _e({props:{class:"form-field required "+(n[0].id?"disabled":""),name:"schema."+n[1]+".type",$$slots:{default:[VT,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}}),r=new _e({props:{class:`
form-field
required
`+(n[5]?"":"invalid")+`
`+(n[0].id&&n[0].system?"disabled":"")+`
`,name:"schema."+n[1]+".name",$$slots:{default:[zT,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}});const O=[xT,QT,XT,GT,ZT,JT,KT,YT,WT,UT,BT],E=[];function I(F,W){return F[0].type==="text"?0:F[0].type==="number"?1:F[0].type==="bool"?2:F[0].type==="email"?3:F[0].type==="url"?4:F[0].type==="editor"?5:F[0].type==="date"?6:F[0].type==="select"?7:F[0].type==="json"?8:F[0].type==="file"?9:F[0].type==="relation"?10:-1}~(f=I(n))&&(c=E[f]=O[f](n)),h=new _e({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[eC,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}});let L=n[0].type!=="file"&&Jc(n),N=!n[0].toDelete&&Zc(n);return{c(){e=v("form"),t=v("div"),i=v("div"),q(s.$$.fragment),l=D(),o=v("div"),q(r.$$.fragment),a=D(),u=v("div"),c&&c.c(),d=D(),m=v("div"),q(h.$$.fragment),g=D(),_=v("div"),L&&L.c(),y=D(),N&&N.c(),k=D(),T=v("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(m,"class","col-sm-4 flex"),p(_,"class","col-sm-4 flex"),p(t,"class","grid"),p(T,"type","submit"),p(T,"class","hidden"),p(T,"tabindex","-1"),p(e,"class","field-form")},m(F,W){S(F,e,W),b(e,t),b(t,i),j(s,i,null),b(t,l),b(t,o),j(r,o,null),b(t,a),b(t,u),~f&&E[f].m(u,null),b(t,d),b(t,m),j(h,m,null),b(t,g),b(t,_),L&&L.m(_,null),b(t,y),N&&N.m(t,null),b(e,k),b(e,T),C=!0,M||($=[K(e,"dragstart",oC),K(e,"submit",pt(n[32]))],M=!0)},p(F,W){const Z={};W[0]&1&&(Z.class="form-field required "+(F[0].id?"disabled":"")),W[0]&2&&(Z.name="schema."+F[1]+".type"),W[0]&1|W[1]&12288&&(Z.$$scope={dirty:W,ctx:F}),s.$set(Z);const ne={};W[0]&33&&(ne.class=`
form-field
required
`+(F[5]?"":"invalid")+`
`+(F[0].id&&F[0].system?"disabled":"")+`
`),W[0]&2&&(ne.name="schema."+F[1]+".name"),W[0]&33|W[1]&12288&&(ne.$$scope={dirty:W,ctx:F}),r.$set(ne);let J=f;f=I(F),f===J?~f&&E[f].p(F,W):(c&&(pe(),P(E[J],1,1,()=>{E[J]=null}),me()),~f?(c=E[f],c?c.p(F,W):(c=E[f]=O[f](F),c.c()),A(c,1),c.m(u,null)):c=null);const te={};W[0]&1|W[1]&12288&&(te.$$scope={dirty:W,ctx:F}),h.$set(te),F[0].type!=="file"?L?(L.p(F,W),W[0]&1&&A(L,1)):(L=Jc(F),L.c(),A(L,1),L.m(_,null)):L&&(pe(),P(L,1,1,()=>{L=null}),me()),F[0].toDelete?N&&(pe(),P(N,1,1,()=>{N=null}),me()):N?(N.p(F,W),W[0]&1&&A(N,1)):(N=Zc(F),N.c(),A(N,1),N.m(t,null))},i(F){C||(A(s.$$.fragment,F),A(r.$$.fragment,F),A(c),A(h.$$.fragment,F),A(L),A(N),C=!0)},o(F){P(s.$$.fragment,F),P(r.$$.fragment,F),P(c),P(h.$$.fragment,F),P(L),P(N),C=!1},d(F){F&&w(e),H(s),H(r),~f&&E[f].d(),H(h),L&&L.d(),N&&N.d(),M=!1,Le($)}}}function Xc(n){let e,t,i,s,l=n[0].system&&Qc(),o=!n[0].id&&xc(n),r=n[0].required&&ed(n),a=n[0].unique&&td();return{c(){e=v("div"),l&&l.c(),t=D(),o&&o.c(),i=D(),r&&r.c(),s=D(),a&&a.c(),p(e,"class","inline-flex")},m(u,f){S(u,e,f),l&&l.m(e,null),b(e,t),o&&o.m(e,null),b(e,i),r&&r.m(e,null),b(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=Qc(),l.c(),l.m(e,t)):l&&(l.d(1),l=null),u[0].id?o&&(o.d(1),o=null):o?o.p(u,f):(o=xc(u),o.c(),o.m(e,i)),u[0].required?r?r.p(u,f):(r=ed(u),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=td(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function Qc(n){let e;return{c(){e=v("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function xc(n){let e;return{c(){e=v("span"),e.textContent="New",p(e,"class","label"),Q(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){S(t,e,i)},p(t,i){i[0]&257&&Q(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&w(e)}}}function ed(n){let e,t=gs(n[0])+"",i;return{c(){e=v("span"),i=B(t),p(e,"class","label label-success")},m(s,l){S(s,e,l),b(e,i)},p(s,l){l[0]&1&&t!==(t=gs(s[0])+"")&&re(i,t)},d(s){s&&w(e)}}}function td(n){let e;return{c(){e=v("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function nd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Pe(Ye.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(st(()=>{t||(t=Be(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=Be(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function id(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,l){S(s,e,l),t||(i=K(e,"click",yn(n[16])),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function sC(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,m,h,g,_,y=!n[0].toDelete&&Xc(n),k=n[7]&&!n[0].system&&nd(),T=n[0].toDelete&&id(n);return{c(){e=v("div"),t=v("span"),i=v("i"),l=D(),o=v("strong"),a=B(r),f=D(),y&&y.c(),c=D(),d=v("div"),m=D(),k&&k.c(),h=D(),T&&T.c(),g=Ae(),p(i,"class",s=yi(V.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),p(t,"class","icon field-type"),p(o,"class","title field-name svelte-1tpxlm5"),p(o,"title",u=n[0].name),Q(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m(C,M){S(C,e,M),b(e,t),b(t,i),b(e,l),b(e,o),b(o,a),S(C,f,M),y&&y.m(C,M),S(C,c,M),S(C,d,M),S(C,m,M),k&&k.m(C,M),S(C,h,M),T&&T.m(C,M),S(C,g,M),_=!0},p(C,M){(!_||M[0]&1&&s!==(s=yi(V.getFieldTypeIcon(C[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!_||M[0]&1)&&r!==(r=(C[0].name||"-")+"")&&re(a,r),(!_||M[0]&1&&u!==(u=C[0].name))&&p(o,"title",u),(!_||M[0]&1)&&Q(o,"txt-strikethrough",C[0].toDelete),C[0].toDelete?y&&(y.d(1),y=null):y?y.p(C,M):(y=Xc(C),y.c(),y.m(c.parentNode,c)),C[7]&&!C[0].system?k?M[0]&129&&A(k,1):(k=nd(),k.c(),A(k,1),k.m(h.parentNode,h)):k&&(pe(),P(k,1,1,()=>{k=null}),me()),C[0].toDelete?T?T.p(C,M):(T=id(C),T.c(),T.m(g.parentNode,g)):T&&(T.d(1),T=null)},i(C){_||(A(k),_=!0)},o(C){P(k),_=!1},d(C){C&&w(e),C&&w(f),y&&y.d(C),C&&w(c),C&&w(d),C&&w(m),k&&k.d(C),C&&w(h),T&&T.d(C),C&&w(g)}}}func
`),t=v("code"),t.textContent="username",i=B(` ,
`),s=v("code"),s.textContent="email",l=B(` ,
`),o=v("code"),o.textContent="emailVisibility",r=B(` ,
`),a=v("code"),a.textContent="verified",p(t,"class","txt-sm"),p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(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 od(n,e){let t,i,s,l;function o(c){e[6](c,e[13],e[14],e[15])}function r(){return e[7](e[15])}function a(...c){return e[8](e[15],...c)}function u(...c){return e[9](e[15],...c)}let f={key:e[15],excludeNames:e[1].concat(e[4](e[13]))};return e[13]!==void 0&&(f.field=e[13]),i=new aC({props:f}),ie.push(()=>ke(i,"field",o)),i.$on("remove",r),i.$on("dragstart",a),i.$on("drop",u),{key:n,first:null,c(){t=Ae(),q(i.$$.fragment),this.first=t},m(c,d){S(c,t,d),j(i,c,d),l=!0},p(c,d){e=c;const m={};d&1&&(m.key=e[15]),d&3&&(m.excludeNames=e[1].concat(e[4](e[13]))),!s&&d&1&&(s=!0,m.field=e[13],we(()=>s=!1)),i.$set(m)},i(c){l||(A(i.$$.fragment,c),l=!0)},o(c){P(i.$$.fragment,c),l=!1},d(c){c&&w(t),H(i,c)}}}function uC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=[],h=new Map,g,_,y,k,T,C,M,$,O,E,I,L=n[0].isAuth&&ld(),N=n[0].schema;const F=W=>W[13];for(let W=0;W<N.length;W+=1){let Z=sd(n,N,W),ne=F(Z);h.set(ne,m[W]=od(ne,Z))}return{c(){e=v("div"),t=v("p"),i=B(`System fields:
`),s=v("code"),s.textContent="id",l=B(` ,
`),o=v("code"),o.textContent="created",r=B(` ,
`),a=v("code"),a.textContent="updated",u=D(),L&&L.c(),f=B(`
.`),c=D(),d=v("div");for(let W=0;W<m.length;W+=1)m[W].c();g=D(),_=v("div"),y=D(),k=v("button"),T=v("i"),C=D(),M=v("span"),M.textContent="New field",p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm"),p(t,"class","txt-sm"),p(e,"class","block m-b-25"),p(d,"class","accordions"),p(_,"class","clearfix m-t-xs"),p(T,"class","ri-add-line"),p(M,"class","txt"),p(k,"type","button"),p(k,"class",$="btn btn-block "+(n[0].schema.length?"btn-transparent":"btn-secondary"))},m(W,Z){S(W,e,Z),b(e,t),b(t,i),b(t,s),b(t,l),b(t,o),b(t,r),b(t,a),b(t,u),L&&L.m(t,null),b(t,f),S(W,c,Z),S(W,d,Z);for(let ne=0;ne<m.length;ne+=1)m[ne].m(d,null);S(W,g,Z),S(W,_,Z),S(W,y,Z),S(W,k,Z),b(k,T),b(k,C),b(k,M),O=!0,E||(I=K(k,"click",n[3]),E=!0)},p(W,[Z]){W[0].isAuth?L||(L=ld(),L.c(),L.m(t,f)):L&&(L.d(1),L=null),Z&55&&(N=W[0].schema,pe(),m=wt(m,Z,F,1,W,N,h,d,tn,od,null,sd),me()),(!O||Z&1&&$!==($="btn btn-block "+(W[0].schema.length?"btn-transparent":"btn-secondary")))&&p(k,"class",$)},i(W){if(!O){for(let Z=0;Z<N.length;Z+=1)A(m[Z]);O=!0}},o(W){for(let Z=0;Z<m.length;Z+=1)P(m[Z]);O=!1},d(W){W&&w(e),L&&L.d(),W&&w(c),W&&w(d);for(let Z=0;Z<m.length;Z+=1)m[Z].d();W&&w(g),W&&w(_),W&&w(y),W&&w(k),E=!1,I()}}}function fC(n,e){n&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.dropEffect="move",n.dataTransfer.setData("text/plain",e))}function cC(n,e,t){let{collection:i=new bn}=e;const s=["id","created","updated","collectionId","collectionName","expand","true","false","null"];let l=[];function o(_){i.schema[_]&&(i.schema.splice(_,1),t(0,i))}function r(){const _=new dn({name:a()});_.onMountExpand=!0,i.schema.push(_),t(0,i)}function a(_="field"){let y="";for(;u(_+y);)++y;return _+y}function u(_){return!!i.schema.find(y=>y.name===_)}function f(_){let y=[];if(_.toDelete)return y;for(let k of i.schema)k===_||k.toDelete||y.push(k.name);return y}function c(_,y){if(!_)return;_.dataTransfer.dropEffect="move";const k=parseInt(_.dataTransfer.getData("text/plain")),T=i.schema;k<y?(T.splice(y+1,0,T[k]),T.splice(k,1)):(T.splice(y,0,T[k]),T.splice(k+1,1)),t(0,i.schema=T,i)}function d(_,y,k,T){k[T]=_,t(0,i)}const m=_=>o(_),h=(_,y)=>fC(y==null?void 0:y.detail,_),g=(_,y)=>c(y==null?void 0:y.detail,_);return n.$$set=_=>{"collection"in _&&t(0,i=_.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof i.schema>"u"&&(t(0,i=i||new bn),t(0,i.schema=[],i)),n.$$.dirty&1&&(i.isAuth?t(1,l=s.concat(["username","email","emailVisibility","verified","tokenKey","passwordHash","lastResetSentAt","lastVerificationSentAt","password","passwordConfirm","oldPassword"])):t(1,l=s.slice(0)))},[i,l,o,r,f,c,d,m,h,g]}class dC extends ye{constructor(e){super(),ve(this,e,cC,uC,be,{collection:0})}}const pC=n=>({isAdminOnly:n&256}),rd=n=>({isAdminOnly:n[8]});function mC(n){let e,t;return e=new _e({props:{class:"form-field rule-field m-0 "+(n[4]?"requied":"")+" "+(n[8]?"disabled":""),name:n[3],$$slots:{default:[kC,({uniqueId:i})=>({17:i}),({uniqueId:i})=>i?131072:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&272&&(l.class="form-field rule-field m-0 "+(i[4]?"requied":"")+" "+(i[8]?"disabled":"")),s&8&&(l.name=i[3]),s&147815&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function hC(n){let e;return{c(){e=v("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function gC(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-lock-line"></i>
<span class="txt">Set Admins only</span>`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1walzui")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[10]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function _C(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-lock-unlock-line"></i>
<span class="txt">Set custom rule</span>`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-success lock-toggle svelte-1walzui")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[9]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function bC(n){let e;return{c(){e=B("Leave empty to grant everyone access.")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function vC(n){let e,t,i,s,l;return{c(){e=B(`Only admins will be able to perform this action (
`),t=v("button"),t.textContent="unlock to change",i=B(`
).`),p(t,"type","button"),p(t,"class","link-hint")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=K(t,"click",n[9]),s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function yC(n){let e;function t(l,o){return l[8]?vC:bC}let i=t(n),s=i(n);return{c(){e=v("p"),s.c()},m(l,o){S(l,e,o),s.m(e,null)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null)))},d(l){l&&w(e),s.d()}}}function kC(n){let e,t,i,s,l=n[8]?"Admins only":"Custom rule",o,r,a,u,f,c,d,m,h;function g(E,I){return E[8]?_C:gC}let _=g(n),y=_(n);function k(E){n[13](E)}var T=n[6];function C(E){let I={id:E[17],baseCollection:E[1],disabled:E[8]};return E[0]!==void 0&&(I.value=E[0]),{props:I}}T&&(f=Kt(T,C(n)),n[12](f),ie.push(()=>ke(f,"value",k)));const M=n[11].default,$=Nt(M,n,n[14],rd),O=$||yC(n);return{c(){e=v("label"),t=v("span"),i=B(n[2]),s=B(" - "),o=B(l),r=D(),y.c(),u=D(),f&&q(f.$$.fragment),d=D(),m=v("div"),O&&O.c(),p(t,"class","txt"),p(e,"for",a=n[17]),p(m,"class","help-block")},m(E,I){S(E,e,I),b(e,t),b(t,i),b(t,s),b(t,o),b(e,r),y.m(e,null),S(E,u,I),f&&j(f,E,I),S(E,d,I),S(E,m,I),O&&O.m(m,null),h=!0},p(E,I){(!h||I&4)&&re(i,E[2]),(!h||I&256)&&l!==(l=E[8]?"Admins only":"Custom rule")&&re(o,l),_===(_=g(E))&&y?y.p(E,I):(y.d(1),y=_(E),y&&(y.c(),y.m(e,null))),(!h||I&131072&&a!==(a=E[17]))&&p(e,"for",a);const L={};if(I&131072&&(L.id=E[17]),I&2&&(L.baseCollection=E[1]),I&256&&(L.disabled=E[8]),!c&&I&1&&(c=!0,L.value=E[0],we(()=>c=!1)),T!==(T=E[6])){if(f){pe();const N=f;P(N.$$.fragment,1,0,()=>{H(N,1)}),me()}T?(f=Kt(T,C(E)),E[12](f),ie.push(()=>ke(f,"value",k)),q(f.$$.fragment),A(f.$$.fragment,1),j(f,d.parentNode,d)):f=null}else T&&f.$set(L);$?$.p&&(!h||I&16640)&&Rt($,M,E,E[14],h?Ft(M,E[14],I,pC):jt(E[14]),rd):O&&O.p&&(!h||I&256)&&O.p(E,h?I:-1)},i(E){h||(f&&A(f.$$.fragment,E),A(O,E),h=!0)},o(E){f&&P(f.$$.fragment,E),P(O,E),h=!1},d(E){E&&w(e),y.d(),E&&w(u),n[12](null),f&&H(f,E),E&&w(d),E&&w(m),O&&O.d(E)}}}function wC(n){let e,t,i,s;const l=[hC,mC],o=[];function r(a,u){return a[7]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Ae()},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):(pe(),P(o[f],1,1,()=>{o[f]=null}),me(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}let ad;function SC(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,c=null,d=null,m=ad,h=!1;g();async function g(){m||h||(t(7,h=!0),t(6,m=(await ft(()=>import("./FilterAutocompleteInput-47d03028.js"),["./FilterAutocompleteInput-47d03028.js","./index-0935db40.js"],import.meta.url)).default),ad=m,t(7,h=!1))}async function _(){t(0,r=d||""),await cn(),c==null||c.focus()}async function y(){d=r,t(0,r=null)}function k(C){ie[C?"unshift":"push"](()=>{c=C,t(5,c)})}function T(C){r=C,t(0,r)}return n.$$set=C=>{"collection"in C&&t(1,o=C.collection),"rule"in C&&t(0,r=C.rule),"label"in C&&t(2,a=C.label),"formKey"in C&&t(3,u=C.formKey),"required"in C&&t(4,f=C.required),"$$scope"in C&&t(14,l=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(8,i=r===null)},[r,o,a,u,f,c,m,h,i,_,y,s,k,T,l]}class hs extends ye{constructor(e){super(),ve(this,e,SC,wC,be,{collection:1,rule:0,label:2,formKey:3,required:4})}}function ud(n,e,t){const i=n.slice();return i[9]=e[t],i}function fd(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,y,k,T,C,M,$,O,E,I,L,N,F,W,Z,ne=n[0].schema,J=[];for(let te=0;te<ne.length;te+=1)J[te]=cd(ud(n,ne,te));return{c(){e=v("div"),t=v("div"),i=v("div"),s=v("p"),s.textContent="The following record fields are available:",l=D(),o=v("div"),r=v("code"),r.textContent="id",a=D(),u=v("code"),u.textContent="created",f=D(),c=v("code"),c.textContent="updated",d=D();for(let te=0;te<J.length;te+=1)J[te].c();m=D(),h=v("hr"),g=D(),_=v("p"),_.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",y=D(),k=v("div"),k.innerHTML=`<code>@request.method</code>
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.auth.*</code>`,T=D(),C=v("hr"),M=D(),$=v("p"),$.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",O=D(),E=v("div"),E.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",I=D(),L=v("hr"),N=D(),F=v("p"),F.innerHTML=`Example rule:
<br/>
<code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(_,"class","m-b-0"),p(k,"class","inline-flex flex-gap-5"),p(C,"class","m-t-10 m-b-5"),p($,"class","m-b-0"),p(E,"class","inline-flex flex-gap-5"),p(L,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(te,ee){S(te,e,ee),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o),b(o,r),b(o,a),b(o,u),b(o,f),b(o,c),b(o,d);for(let z=0;z<J.length;z+=1)J[z].m(o,null);b(i,m),b(i,h),b(i,g),b(i,_),b(i,y),b(i,k),b(i,T),b(i,C),b(i,M),b(i,$),b(i,O),b(i,E),b(i,I),b(i,L),b(i,N),b(i,F),Z=!0},p(te,ee){if(ee&1){ne=te[0].schema;let z;for(z=0;z<ne.length;z+=1){const X=ud(te,ne,z);J[z]?J[z].p(X,ee):(J[z]=cd(X),J[z].c(),J[z].m(o,null))}for(;z<J.length;z+=1)J[z].d(1);J.length=ne.length}},i(te){Z||(te&&st(()=>{W||(W=Be(e,Ht,{duration:150},!0)),W.run(1)}),Z=!0)},o(te){te&&(W||(W=Be(e,Ht,{duration:150},!1)),W.run(0)),Z=!1},d(te){te&&w(e),bt(J,te),te&&W&&W.end()}}}function TC(n){let e,t=n[9].name+"",i;return{c(){e=v("code"),i=B(t)},m(s,l){S(s,e,l),b(e,i)},p(s,l){l&1&&t!==(t=s[9].name+"")&&re(i,t)},d(s){s&&w(e)}}}function CC(n){let e,t=n[9].name+"",i,s;return{c(){e=v("code"),i=B(t),s=B(".*")},m(l,o){S(l,e,o),b(e,i),b(e,s)},p(l,o){o&1&&t!==(t=l[9].name+"")&&re(i,t)},d(l){l&&w(e)}}}function cd(n){let e;function t(l,o){return l[9].type==="relation"||l[9].type==="user"?CC:TC}let i=t(n),s=i(n);return{c(){s.c(),e=Ae()},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 dd(n){let e,t,i,s,l;function o(a){n[8](a)}let r={label:"Manage action",formKey:"options.manageRule",collection:n[0],$$slots:{default:[$C]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(r.rule=n[0].options.manageRule),i=new hs({props:r}),ie.push(()=>ke(i,"rule",o)),{c(){e=v("hr"),t=D(),q(i.$$.fragment),p(e,"class","m-t-sm m-b-sm")},m(a,u){S(a,e,u),S(a,t,u),j(i,a,u),l=!0},p(a,u){const f={};u&1&&(f.collection=a[0]),u&4096&&(f.$$scope={dirty:u,ctx:a}),!s&&u&1&&(s=!0,f.rule=a[0].options.manageRule,we(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(e),a&&w(t),H(i,a)}}}function $C(n){let e,t,i;return{c(){e=v("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=D(),i=v("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:G,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function MC(n){var ae;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,g,_,y,k,T,C,M,$,O,E,I,L,N,F,W,Z,ne,J,te,ee,z,X,Y=n[1]&&fd(n);function le(oe){n[3](oe)}let He={label:"List/Search action",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(He.rule=n[0].listRule),f=new hs({props:He}),ie.push(()=>ke(f,"rule",le));function Re(oe){n[4](oe)}let Fe={label:"View action",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(Fe.rule=n[0].viewRule),g=new hs({props:Fe}),ie.push(()=>ke(g,"rule",Re));function qe(oe){n[5](oe)}let ge={label:"Create action",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(ge.rule=n[0].createRule),C=new hs({props:ge}),ie.push(()=>ke(C,"rule",qe));function Se(oe){n[6](oe)}let Ue={label:"Update action",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(Ue.rule=n[0].updateRule),I=new hs({props:Ue}),ie.push(()=>ke(I,"rule",Se));function lt(oe){n[7](oe)}let ue={label:"Delete action",formKey:"deleteRule",collection:n[0]};n[0].deleteRule!==void 0&&(ue.rule=n[0].deleteRule),Z=new hs({props:ue}),ie.push(()=>ke(Z,"rule",lt));let fe=((ae=n[0])==null?void 0:ae.isAuth)&&dd(n);return{c(){e=v("div"),t=v("div"),i=v("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=D(),l=v("button"),r=B(o),a=D(),Y&&Y.c(),u=D(),q(f.$$.fragment),d=D(),m=v("hr"),h=D(),q(g.$$.fragment),y=D(),k=v("hr"),T=D(),q(C.$$.fragment),$=D(),O=v("hr"),E=D(),q(I.$$.fragment),N=D(),F=v("hr"),W=D(),q(Z.$$.fragment),J=D(),fe&&fe.c(),te=Ae(),p(l,"type","button"),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-base"),p(m,"class","m-t-sm m-b-sm"),p(k,"class","m-t-sm m-b-sm"),p(O,"class","m-t-sm m-b-sm"),p(F,"class","m-t-sm m-b-sm")},m(oe,je){S(oe,e,je),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),Y&&Y.m(e,null),S(oe,u,je),j(f,oe,je),S(oe,d,je),S(oe,m,je),S(oe,h,je),j(g,oe,je),S(oe,y,je),S(oe,k,je),S(oe,T,je),j(C,oe,je),S(oe,$,je),S(oe,O,je),S(oe,E,je),j(I,oe,je),S(oe,N,je),S(oe,F,je),S(oe,W,je),j(Z,oe,je),S(oe,J,je),fe&&fe.m(oe,je),S(oe,te,je),ee=!0,z||(X=K(l,"click",n[2]),z=!0)},p(oe,[je]){var nt;(!ee||je&2)&&o!==(o=oe[1]?"Hide available fields":"Show available fields")&&re(r,o),oe[1]?Y?(Y.p(oe,je),je&2&&A(Y,1)):(Y=fd(oe),Y.c(),A(Y,1),Y.m(e,null)):Y&&(pe(),P(Y,1,1,()=>{Y=null}),me());const Me={};je&1&&(Me.collection=oe[0]),!c&&je&1&&(c=!0,Me.rule=oe[0].listRule,we(()=>c=!1)),f.$set(Me);const Te={};je&1&&(Te.collection=oe[0]),!_&&je&1&&(_=!0,Te.rule=oe[0].viewRule,we(()=>_=!1)),g.$set(Te);const ce={};je&1&&(ce.collection=oe[0]),!M&&je&1&&(M=!0,ce.rule=oe[0].createRule,we(()=>M=!1)),C.$set(ce);const $e={};je&1&&($e.collection=oe[0]),!L&&je&1&&(L=!0,$e.rule=oe[0].updateRule,we(()=>L=!1)),I.$set($e);const Ze={};je&1&&(Ze.collection=oe[0]),!ne&&je&1&&(ne=!0,Ze.rule=oe[0].deleteRule,we(()=>ne=!1)),Z.$set(Ze),(nt=oe[0])!=null&&nt.isAuth?fe?(fe.p(oe,je),je&1&&A(fe,1)):(fe=dd(oe),fe.c(),A(fe,1),fe.m(te.parentNode,te)):fe&&(pe(),P(fe,1,1,()=>{fe=null}),me())},i(oe){ee||(A(Y),A(f.$$.fragment,oe),A(g.$$.fragment,oe),A(C.$$.fragment,oe),A(I.$$.fragment,oe),A(Z.$$.fragment,oe),A(fe),ee=!0)},o(oe){P(Y),P(f.$$.fragment,oe),P(g.$$.fragment,oe),P(C.$$.fragment,oe),P(I.$$.fragment,oe),P(Z.$$.fragment,oe),P(fe),ee=!1},d(oe){oe&&w(e),Y&&Y.d(),oe&&w(u),H(f,oe),oe&&w(d),oe&&w(m),oe&&w(h),H(g,oe),oe&&w(y),oe&&w(k),oe&&w(T),H(C,oe),oe&&w($),oe&&w(O),oe&&w(E),H(I,oe),oe&&w(N),oe&&w(F),oe&&w(W),H(Z,oe),oe&&w(J),fe&&fe.d(oe),oe&&w(te),z=!1,X()}}}function DC(n,e,t){let{collection:i=new bn}=e,s=!1;const l=()=>t(1,s=!s);function o(d){n.$$.not_equal(i.listRule,d)&&(i.listRule=d,t(0,i))}function r(d){n.$$.not_equal(i.viewRule,d)&&(i.viewRule=d,t(0,i))}function a(d){n.$$.not_equal(i.createRule,d)&&(i.createRule=d,t(0,i))}function u(d){n.$$.not_equal(i.updateRule,d)&&(i.updateRule=d,t(0,i))}function f(d){n.$$.not_equal(i.deleteRule,d)&&(i.deleteRule=d,t(0,i))}function c(d){n.$$.not_equal(i.options.manageRule,d)&&(i.options.manageRule=d,t(0,i))}return n.$$set=d=>{"collection"in d&&t(0,i=d.collection)},[i,s,l,o,r,a,u,f,c]}class OC extends ye{constructor(e){super(),ve(this,e,DC,MC,be,{collection:0})}}function EC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowUsernameAuth,S(u,i,f),S(u,s,f),b(s,l),r||(a=K(e,"change",n[5]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function AC(n){let e,t;return e=new _e({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[EC,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&12289&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function IC(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function PC(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function pd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fi
<span class="txt">Username/Password</span>`,t=D(),i=v("div"),s=D(),f.c(),l=D(),c&&c.c(),o=Ae(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[3]?c?m&8&&A(c,1):(c=pd(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(pe(),P(c,1,1,()=>{c=null}),me())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function NC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(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),b(s,l),r||(a=K(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function md(n){let e,t,i,s,l,o,r,a;return i=new _e({props:{class:"form-field "+(V.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[FC,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new _e({props:{class:"form-field "+(V.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[RC,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(u,f){S(u,e,f),b(e,t),j(i,t,null),b(e,s),b(e,l),j(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(V.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(V.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(A(i.$$.fragment,u),A(o.$$.fragment,u),u&&st(()=>{r||(r=Be(e,Ht,{duration:150},!0)),r.run(1)}),a=!0)},o(u){P(i.$$.fragment,u),P(o.$$.fragment,u),u&&(r||(r=Be(e,Ht,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),H(i),H(o),u&&r&&r.end()}}}function FC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(_){n[7](_)}let g={id:n[12],disabled:!V.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(g.value=n[0].options.exceptEmailDomains),r=new Ns({props:g}),ie.push(()=>ke(r,"value",h)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=D(),s=v("i"),o=D(),q(r.$$.fragment),u=D(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(_,y){S(_,e,y),b(e,t),b(e,i),b(e,s),S(_,o,y),j(r,_,y),S(_,u,y),S(_,f,y),c=!0,d||(m=Pe(Ye.call(null,s,{text:`Email domains that are NOT allowed to sign up.
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&p(e,"for",l);const k={};y&4096&&(k.id=_[12]),y&1&&(k.disabled=!V.isEmpty(_[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,k.value=_[0].options.exceptEmailDomains,we(()=>a=!1)),r.$set(k)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){P(r.$$.fragment,_),c=!1},d(_){_&&w(e),_&&w(o),H(r,_),_&&w(u),_&&w(f),d=!1,m()}}}function RC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(_){n[8](_)}let g={id:n[12],disabled:!V.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(g.value=n[0].options.onlyEmailDomains),r=new Ns({props:g}),ie.push(()=>ke(r,"value",h)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=D(),s=v("i"),o=D(),q(r.$$.fragment),u=D(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(_,y){S(_,e,y),b(e,t),b(e,i),b(e,s),S(_,o,y),j(r,_,y),S(_,u,y),S(_,f,y),c=!0,d||(m=Pe(Ye.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&p(e,"for",l);const k={};y&4096&&(k.id=_[12]),y&1&&(k.disabled=!V.isEmpty(_[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,k.value=_[0].options.onlyEmailDomains,we(()=>a=!1)),r.$set(k)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){P(r.$$.fragment,_),c=!1},d(_){_&&w(e),_&&w(o),H(r,_),_&&w(u),_&&w(f),d=!1,m()}}}function jC(n){let e,t,i,s;e=new _e({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[NC,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&md(n);return{c(){q(e.$$.fragment),t=D(),l&&l.c(),i=Ae()},m(o,r){j(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=md(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(pe(),P(l,1,1,()=>{l=null}),me())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){H(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function HC(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function qC(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function hd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Pe(Ye.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(st(()=>{t||(t=Be(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=Be(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function VC(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowEmailAuth?qC:HC}let u=a(n),f=u(n),c=n[2]&&hd();return{c(){e=v("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
<span class="txt">Email/Password</span>`,t=D(),i=v("div"),s=D(),f.c(),l=D(),c&&c.c(),o=Ae(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[2]?c?m&4&&A(c,1):(c=hd(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(pe(),P(c,1,1,()=>{c=null}),me())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function zC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(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),b(s,l),r||(a=K(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function gd(n){let e,t,i;return{c(){e=v("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>',p(e,"class","block")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&st(()=>{t||(t=Be(e,Ht,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=Be(e,Ht,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function BC(n){let e,t,i,s;e=new _e({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[zC,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&gd();return{c(){q(e.$$.fragment),t=D(),l&&l.c(),i=Ae()},m(o,r){j(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=gd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(pe(),P(l,1,1,()=>{l=null}),me())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){H(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function UC(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function WC(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function _d(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Pe(Ye.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(st(()=>{t||(t=Be(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=Be(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function YC(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowOAuth2Auth?WC:UC}let u=a(n),f=u(n),c=n[1]&&_d();return{c(){e=v("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
<span class="txt">OAuth2</span>`,t=D(),i=v("div"),s=D(),f.c(),l=D(),c&&c.c(),o=Ae(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[1]?c?m&2&&A(c,1):(c=_d(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(pe(),P(c,1,1,()=>{c=null}),me())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function KC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Minimum password length"),s=D(),l=v("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),l.required=!0,p(l,"min","6"),p(l,"max","72")},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),de(l,n[0].options.minPasswordLength),r||(a=K(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(l,"id",o),f&1&&ht(l.value)!==u[0].options.minPasswordLength&&de(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function JC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=D(),s=v("label"),l=v("span"),l.textContent="Always require email",o=D(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(s,"for",a=n[12])},m(c,d){S(c,e,d),e.checked=n[0].options.requireEmail,S(c,i,d),S(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[11]),Pe(Ye.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(c,d){d&4096&&t!==(t=c[12])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Le(f)}}}function ZC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,y;return s=new ys({props:{single:!0,$$slots:{header:[LC],default:[AC]},$$scope:{ctx:n}}}),o=new ys({props:{single:!0,$$slots:{header:[VC],default:[jC]},$$scope:{ctx:n}}}),a=new ys({props:{single:!0,$$slots:{header:[YC],default:[BC]},$$scope:{ctx:n}}}),h=new _e({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[KC,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),_=new _e({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[JC,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("h4"),e.textContent="Auth methods",t=D(),i=v("div"),q(s.$$.fragment),l=D(),q(o.$$.fragment),r=D(),q(a.$$.fragment),u=D(),f=v("hr"),c=D(),d=v("h4"),d.textContent="General",m=D(),q(h.$$.fragment),g=D(),q(_.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(k,T){S(k,e,T),S(k,t,T),S(k,i,T),j(s,i,null),b(i,l),j(o,i,null),b(i,r),j(a,i,null),S(k,u,T),S(k,f,T),S(k,c,T),S(k,d,T),S(k,m,T),j(h,k,T),S(k,g,T),j(_,k,T),y=!0},p(k,[T]){const C={};T&8201&&(C.$$scope={dirty:T,ctx:k}),s.$set(C);const M={};T&8197&&(M.$$scope={dirty:T,ctx:k}),o.$set(M);const $={};T&8195&&($.$$scope={dirty:T,ctx:k}),a.$set($);const O={};T&12289&&(O.$$scope={dirty:T,ctx:k}),h.$set(O);const E={};T&12289&&(E.$$scope={dirty:T,ctx:k}),_.$set(E)},i(k){y||(A(s.$$.fragment,k),A(o.$$.fragment,k),A(a.$$.fragment,k),A(h.$$.fragment,k),A(_.$$.fragment,k),y=!0)},o(k){P(s.$$.fragment,k),P(o.$$.fragment,k),P(a.$$.fragment,k),P(h.$$.fragment,k),P(_.$$.fragment,k),y=!1},d(k){k&&w(e),k&&w(t),k&&w(i),H(s),H(o),H(a),k&&w(u),k&&w(f),k&&w(c),k&&w(d),k&&w(m),H(h,k),k&&w(g),H(_,k)}}}function GC(n,e,t){let i,s,l,o;Je(n,Ci,g=>t(4,o=g));let{collection:r=new bn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function c(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=ht(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,_,y,k;n.$$.dirty&1&&r.isAuth&&V.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!V.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!V.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.onlyEmailDomains)||!V.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!V.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,m,h]}class XC extends ye{constructor(e){super(),ve(this,e,GC,ZC,be,{collection:0})}}function bd(n,e,t){const i=n.slice();return i[14]=e[t],i}function vd(n,e,t){const i=n.slice();return i[14]=e[t],i}function yd(n){let e;return{c(){e=v("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 kd(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=v("li"),t=v("div"),i=B(`Renamed collection
`),s=v("strong"),o=B(l),r=D(),a=v("i"),u=D(),f=v("strong"),d=B(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(m,h){S(m,e,h),b(e,t),b(t,i),b(t,s),b(s,o),b(t,r),b(t,a),b(t,u),b(t,f),b(f,d)},p(m,h){h&2&&l!==(l=m[1].originalName+"")&&re(o,l),h&2&&c!==(c=m[1].name+"")&&re(d,c)},d(m){m&&w(e)}}}function wd(n){let e,t,i,s,l=n[14].originalName+"",o,r,a,u,f,c=n[14].name+"",d;return{c(){e=v("li"),t=v("div"),i=B(`Renamed field
`),s=v("strong"),o=B(l),r=D(),a=v("i"),u=D(),f=v("strong"),d=B(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(m,h){S(m,e,h),b(e,t),b(t,i),b(t,s),b(s,o),b(t,r),b(t,a),b(t,u),b(t,f),b(f,d)},p(m,h){h&16&&l!==(l=m[14].originalName+"")&&re(o,l),h&16&&c!==(c=m[14].name+"")&&re(d,c)},d(m){m&&w(e)}}}function Sd(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=v("li"),t=B("Removed field "),i=v("span"),l=B(s),o=D(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(r,a){S(r,e,a),b(e,t),b(e,i),b(i,l),b(e,o)},p(r,a){a&8&&s!==(s=r[14].name+"")&&re(l,s)},d(r){r&&w(e)}}}function QC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=n[3].length&&yd(),h=n[5]&&kd(n),g=n[4],_=[];for(let T=0;T<g.length;T+=1)_[T]=wd(vd(n,g,T));let y=n[3],k=[];for(let T=0;T<y.length;T+=1)k[T]=Sd(bd(n,y,T));return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=v("div"),l=v("p"),l.textContent=`If any of the following changes is part of another collection rule or filter, you'll have to
update it manually!`,o=D(),m&&m.c(),r=D(),a=v("h6"),a.textContent="Changes:",u=D(),f=v("ul"),h&&h.c(),c=D();for(let T=0;T<_.length;T+=1)_[T].c();d=D();for(let T=0;T<k.length;T+=1)k[T].c();p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning"),p(f,"class","changes-list svelte-1ghly2p")},m(T,C){S(T,e,C),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),m&&m.m(s,null),S(T,r,C),S(T,a,C),S(T,u,C),S(T,f,C),h&&h.m(f,null),b(f,c);for(let M=0;M<_.length;M+=1)_[M].m(f,null);b(f,d);for(let M=0;M<k.length;M+=1)k[M].m(f,null)},p(T,C){if(T[3].length?m||(m=yd(),m.c(),m.m(s,null)):m&&(m.d(1),m=null),T[5]?h?h.p(T,C):(h=kd(T),h.c(),h.m(f,c)):h&&(h.d(1),h=null),C&16){g=T[4];let M;for(M=0;M<g.length;M+=1){const $=vd(T,g,M);_[M]?_[M].p($,C):(_[M]=wd($),_[M].c(),_[M].m(f,d))}for(;M<_.length;M+=1)_[M].d(1);_.length=g.length}if(C&8){y=T[3];let M;for(M=0;M<y.length;M+=1){const $=bd(T,y,M);k[M]?k[M].p($,C):(k[M]=Sd($),k[M].c(),k[M].m(f,null))}for(;M<k.length;M+=1)k[M].d(1);k.length=y.length}},d(T){T&&w(e),m&&m.d(),T&&w(r),T&&w(a),T&&w(u),T&&w(f),h&&h.d(),bt(_,T),bt(k,T)}}}function xC(n){let e;return{c(){e=v("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function e$(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=v("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),e.focus(),s||(l=[K(e,"click",n[8]),K(i,"click",n[9])],s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Le(l)}}}function t$(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[e$],header:[xC],default:[QC]},$$scope:{ctx:n}};return e=new Bn({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){q(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&524346&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),H(e,s)}}}function n$(n,e,t){let i,s,l;const o=$t();let r,a;async function u(y){t(1,a=y),await cn(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),m=()=>c();function h(y){ie[y?"unshift":"push"](()=>{r=y,t(2,r)})}function g(y){We.call(this,n,y)}function _(y){We.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=(a==null?void 0:a.originalName)!=(a==null?void 0:a.name)),n.$$.dirty&2&&t(4,s=(a==null?void 0:a.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(y=>y.id&&y.toDelete))||[])},[f,a,r,l,s,i,c,u,d,m,h,g,_]}class i$ extends ye{constructor(e){super(),ve(this,e,n$,t$,be,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function Td(n,e,t){const i=n.slice();return i[46]=e[t][0],i[47]=e[t][1],i}function Cd(n){let e,t,i,s;function l(r){n[32](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new OC({props:o}),ie.push(()=>ke(t,"collection",l)),{c(){e=v("div"),q(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){S(r,e,a),j(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],we(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),H(t)}}}function $d(n){let e,t,i,s;function l(r){n[33](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new XC({props:o}),ie.push(()=>ke(t,"collection",l)),{c(){e=v("div"),q(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===Os)},m(r,a){S(r,e,a),j(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],we(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&Q(e,"active",r[3]===Os)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),H(t)}}}function s$(n){let e,t,i,s,l,o,r;function a(d){n[31](d)}let u={};n[2]!==void 0&&(u.collection=n[2]),i=new dC({props:u}),ie.push(()=>ke(i,"collection",a));let f=n[3]===bl&&Cd(n),c=n[2].isAuth&&$d(n);return{c(){e=v("div"),t=v("div"),q(i.$$.fragment),l=D(),f&&f.c(),o=D
<span class="txt">Duplicate</span>`,t=D(),i=v("button"),i.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger closable")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[K(e,"click",n[23]),K(i,"click",yn(pt(n[24])))],s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Le(l)}}}function Dd(n){let e,t,i,s;return i=new Qn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[o$]},$$scope:{ctx:n}}}),{c(){e=v("i"),t=D(),q(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),j(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&524288&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),H(i,l)}}}function Od(n){let e,t,i,s,l,o=n[47]+"",r,a,u,f,c;function d(){return n[26](n[46])}return{c(){e=v("button"),t=v("i"),s=D(),l=v("span"),r=B(o),a=B(" collection"),u=D(),p(t,"class",i=yi(V.getCollectionTypeIcon(n[46]))+" svelte-1yfp6mj"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),Q(e,"selected",n[46]==n[2].type)},m(m,h){S(m,e,h),b(e,t),b(e,s),b(e,l),b(l,r),b(l,a),b(e,u),f||(c=K(e,"click",d),f=!0)},p(m,h){n=m,h[0]&64&&i!==(i=yi(V.getCollectionTypeIcon(n[46]))+" svelte-1yfp6mj")&&p(t,"class",i),h[0]&64&&o!==(o=n[47]+"")&&re(r,o),h[0]&68&&Q(e,"selected",n[46]==n[2].type)},d(m){m&&w(e),f=!1,c()}}}function o$(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=Od(Td(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Ae()},m(s,l){for(let o=0;o<i.length;o+=1)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=Td(s,t,o);i[o]?i[o].p(r,l):(i[o]=Od(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){bt(i,s),s&&w(e)}}}function Ed(n){let e;return{c(){e=v("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function r$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,y=(n[6][n[2].type]||"N/A")+"",k,T,C,M,$,O,E,I,L,N=n[2].isNew&&Dd(n),F=n[2].system&&Ed();return{c(){e=v("label"),t=B("Name"),s=D(),l=v("input"),f=D(),c=v("div"),d=v("button"),m=v("span"),h=D(),g=v("span"),_=B("Type: "),k=B(y),T=D(),N&&N.c(),$=D(),F&&F.c(),O=Ae(),p(e,"for",i=n[45]),p(l,"type","text"),p(l,"id",o=n[45]),l.required=!0,l.disabled=n[12],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",a=n[2].isAuth?'eg. "users"':'eg. "posts"'),l.value=u=n[2].name,p(g,"class","txt"),p(d,"type","button"),p(d,"class",C="btn btn-sm p-r-10 p-l-10 "+(n[2].isNew?"btn-hint":"btn-transparent")),d.disabled=M=!n[2].isNew,p(c,"class","form-field-addon")},m(W,Z){S(W,e,Z),b(e,t),S(W,s,Z),S(W,l,Z),S(W,f,Z),S(W,c,Z),b(c,d),b(d,m),b(d,h),b(d,g),b(g,_),b(g,k),b(d,T),N&&N.m(d,null),S(W,$,Z),F&&F.m(W,Z),S(W,O,Z),E=!0,n[2].isNew&&l.focus(),I||(L=K(l,"input",n[25]),I=!0)},p(W,Z){(!E||Z[1]&16384&&i!==(i=W[45]))&&p(e,"for",i),(!E||Z[1]&16384&&o!==(o=W[45]))&&p(l,"id",o),(!E||Z[0]&4096)&&(l.disabled=W[12]),(!E||Z[0]&4&&r!==(r=W[2].isNew))&&(l.autofocus=r),(!E||Z[0]&4&&a!==(a=W[2].isAuth?'eg. "users"':'eg. "posts"'))&&p(l,"placeholder",a),(!E||Z[0]&4&&u!==(u=W[2].name)&&l.value!==u)&&(l.value=u),(!E||Z[0]&68)&&y!==(y=(W[6][W[2].type]||"N/A")+"")&&re(k,y),W[2].isNew?N?(N.p(W,Z),Z[0]&4&&A(N,1)):(N=Dd(W),N.c(),A(N,1),N.m(d,null)):N&&(pe(),P(N,1,1,()=>{N=null}),me()),(!E||Z[0]&4&&C!==(C="btn btn-sm p-r-10 p-l-10 "+(W[2].isNew?"btn-hint":"btn-transparent")))&&p(d,"class",C),(!E||Z[0]&4&&M!==(M=!W[2].isNew))&&(d.disabled=M),W[2].system?F||(F=Ed(),F.c(),F.m(O.parentNode,O)):F&&(F.d(1),F=null)},i(W){E||(A(N),E=!0)},o(W){P(N),E=!1},d(W){W&&w(e),W&&w(s),W&&w(l),W&&w(f),W&&w(c),N&&N.d(),W&&w($),F&&F.d(W),W&&w(O),I=!1,L()}}}function Ad(n){let e,t,i,s,l,o;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){S(r,e,a),s=!0,l||(o=Pe(t=Ye.call(null,e,n[13])),l=!0)},p(r,a){t&&zt(t.update)&&a[0]&8192&&t.update.call(null,r[13])},i(r){s||(r&&st(()=>{i||(i=Be(e,It,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=Be(e,It,{duration:150,sta
<span class="txt">New collection</span>`,p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){S(l,e,o),b(e,t),i||(s=K(t,"click",n[12]),i=!0)},p:G,d(l){l&&w(e),i=!1,s()}}}function p$(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],m=new Map,h,g,_,y,k,T,C=n[3];const M=I=>I[15].id;for(let I=0;I<C.length;I+=1){let L=Fd(n,C,I),N=M(L);m.set(N,d[I]=Hd(N,L))}let $=null;C.length||($=Rd(n));let O=!n[7]&&qd(n),E={};return _=new tu({props:E}),n[13](_),_.$on("save",n[14]),{c(){e=v("aside"),t=v("header"),i=v("div"),s=v("div"),l=v("button"),l.innerHTML='<i class="ri-close-line"></i>',o=D(),r=v("input"),a=D(),u=v("hr"),f=D(),c=v("div");for(let I=0;I<d.length;I+=1)d[I].c();$&&$.c(),h=D(),O&&O.c(),g=D(),q(_.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),Q(l,"hidden",!n[4]),p(s,"class","form-field-addon"),p(r,"type","text"),p(r,"placeholder","Search collections..."),p(i,"class","form-field search"),Q(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),Q(c,"fade",n[6]),Q(c,"sidebar-content-compact",n[3].length>20),p(e,"class","page-sidebar collection-sidebar")},m(I,L){S(I,e,L),b(e,t),b(t,i),b(i,s),b(s,l),b(i,o),b(i,r),de(r,n[0]),b(e,a),b(e,u),b(e,f),b(e,c);for(let N=0;N<d.length;N+=1)d[N].m(c,null);$&&$.m(c,null),b(e,h),O&&O.m(e,null),S(I,g,L),j(_,I,L),y=!0,k||(T=[K(l,"click",n[10]),K(r,"input",n[11])],k=!0)},p(I,[L]){(!y||L&16)&&Q(l,"hidden",!I[4]),L&1&&r.value!==I[0]&&de(r,I[0]),(!y||L&16)&&Q(i,"active",I[4]),L&42&&(C=I[3],d=wt(d,L,M,1,I,C,m,c,Xi,Hd,null,Fd),!C.length&&$?$.p(I,L):C.length?$&&($.d(1),$=null):($=Rd(I),$.c(),$.m(c,null))),(!y||L&64)&&Q(c,"fade",I[6]),(!y||L&8)&&Q(c,"sidebar-content-compact",I[3].length>20),I[7]?O&&(O.d(1),O=null):O?O.p(I,L):(O=qd(I),O.c(),O.m(e,null));const N={};_.$set(N)},i(I){y||(A(_.$$.fragment,I),y=!0)},o(I){P(_.$$.fragment,I),y=!1},d(I){I&&w(e);for(let L=0;L<d.length;L+=1)d[L].d();$&&$.d(),O&&O.d(),I&&w(g),n[13](null),H(_,I),k=!1,Le(T)}}}function m$(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function h$(n,e,t){let i,s,l,o,r,a,u;Je(n,Si,k=>t(5,o=k)),Je(n,es,k=>t(9,r=k)),Je(n,Po,k=>t(6,a=k)),Je(n,Cs,k=>t(7,u=k));let f,c="";function d(k){Yt(Si,o=k,o)}const m=()=>t(0,c="");function h(){c=this.value,t(0,c)}const g=()=>f==null?void 0:f.show();function _(k){ie[k?"unshift":"push"](()=>{f=k,t(2,f)})}const y=k=>{var T;(T=k.detail)!=null&&T.isNew&&k.detail.collection&&d(k.detail.collection)};return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=c.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=c!==""),n.$$.dirty&515&&t(3,l=r.filter(k=>k.id==c||k.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty&512&&r&&m$()},[c,i,f,l,s,o,a,u,d,r,m,h,g,_,y]}class g$ extends ye{constructor(e){super(),ve(this,e,h$,p$,be,{})}}function Vd(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function zd(n){n[18]=n[19].default}function Bd(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Ud(n){let e;return{c(){e=v("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Wd(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&Ud();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=Ae(),c&&c.c(),s=D(),l=v("button"),r=B(o),a=D(),p(l,"type","button"),p(l,"class","sidebar-item"),Q(l,"active",e[5]===e[14]),this.first=t},m(m,h){S(m,t,h),c&&c.m(m,h),S(m,s,h),S(m,l,h),b(l,r),b(l,a),u||(f=K(l,"click",d),u=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Ud(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&re(r,o),h&40&&Q(l,"active",e[5]===e[14])},d(m){m&&w(t),c&&c.d(m),m&&w(s),m&&w(l),u=!1,f()}}}function Yd(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:v$,then:b$,catch:_$,value:19,blocks:[,,,]};return su(t=n[15].component,s),{c(){e=Ae(),s.block.c()},m(l,o){S(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.anchor=e
<span class="txt">Upload new file</span>`,p(t,"type","file"),p(t,"class","hidden"),t.multiple=n[5],p(s,"type","button"),p(s,"class","btn btn-transparent btn-sm btn-block"),p(e,"class","list-item list-item-btn")},m(r,a){S(r,e,a),b(e,t),n[16](t),b(e,i),b(e,s),l||(o=[K(t,"change",n[17]),K(s,"click",n[18])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&w(e),n[16](null),l=!1,Le(o)}}}function N4(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,m,h,g,_=n[4];const y=$=>$[25]+$[2].id;for(let $=0;$<_.length;$+=1){let O=ep(n,_,$),E=y(O);d.set(E,c[$]=tp(E,O))}let k=n[0],T=[];for(let $=0;$<k.length;$+=1)T[$]=np(xd(n,k,$));const C=$=>P(T[$],1,1,()=>{T[$]=null});let M=!n[8]&&ip(n);return{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=B(o),u=D(),f=v("div");for(let $=0;$<c.length;$+=1)c[$].c();m=D();for(let $=0;$<T.length;$+=1)T[$].c();h=D(),M&&M.c(),p(t,"class",i=V.getFieldTypeIcon(n[3].type)),p(l,"class","txt"),p(e,"for",a=n[21]),p(f,"class","list")},m($,O){S($,e,O),b(e,t),b(e,s),b(e,l),b(l,r),S($,u,O),S($,f,O);for(let E=0;E<c.length;E+=1)c[E].m(f,null);b(f,m);for(let E=0;E<T.length;E+=1)T[E].m(f,null);b(f,h),M&&M.m(f,null),n[19](f),g=!0},p($,O){if((!g||O&8&&i!==(i=V.getFieldTypeIcon($[3].type)))&&p(t,"class",i),(!g||O&8)&&o!==(o=$[3].name+"")&&re(r,o),(!g||O&2097152&&a!==(a=$[21]))&&p(e,"for",a),O&1558&&(_=$[4],pe(),c=wt(c,O,y,1,$,_,d,f,tn,tp,m,ep),me()),O&2049){k=$[0];let E;for(E=0;E<k.length;E+=1){const I=xd($,k,E);T[E]?(T[E].p(I,O),A(T[E],1)):(T[E]=np(I),T[E].c(),A(T[E],1),T[E].m(f,h))}for(pe(),E=k.length;E<T.length;E+=1)C(E);me()}$[8]?M&&(M.d(1),M=null):M?M.p($,O):(M=ip($),M.c(),M.m(f,null))},i($){if(!g){for(let O=0;O<_.length;O+=1)A(c[O]);for(let O=0;O<k.length;O+=1)A(T[O]);g=!0}},o($){for(let O=0;O<c.length;O+=1)P(c[O]);T=T.filter(Boolean);for(let O=0;O<T.length;O+=1)P(T[O]);g=!1},d($){$&&w(e),$&&w(u),$&&w(f);for(let O=0;O<c.length;O+=1)c[O].d();bt(T,$),M&&M.d(),n[19](null)}}}function F4(n){let e,t;return e=new _e({props:{class:"form-field form-field-list form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[N4,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field form-field-list form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&270533119&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function R4(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new dn}=e,c,d;function m(E){V.removeByValue(u,E),t(1,u)}function h(E){V.pushUnique(u,E),t(1,u)}function g(E){V.isEmpty(a[E])||a.splice(E,1),t(0,a)}function _(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const y=E=>m(E),k=E=>h(E),T=E=>g(E);function C(E){ie[E?"unshift":"push"](()=>{c=E,t(6,c)})}const M=()=>{for(let E of c.files)a.push(E);t(0,a),t(6,c.value=null,c)},$=()=>c==null?void 0:c.click();function O(E){ie[E?"unshift":"push"](()=>{d=E,t(7,d)})}return n.$$set=E=>{"record"in E&&t(2,o=E.record),"value"in E&&t(12,r=E.value),"uploadedFiles"in E&&t(0,a=E.uploadedFiles),"deletedFileIndexes"in E&&t(1,u=E.deletedFileIndexes),"field"in E&&t(3,f=E.field)},n.$$.update=()=>{var E,I;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=V.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=V.toArray(u))),n.$$.dirty&8&&t(5,i=((E=f.options)==null?void 0:E.maxSelect)>1),n.$$.dirty&4128&&V.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=V.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((I=f.options)==null?void 0:I.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&_()},[a,u,o,f,s,i,c,d,l,m,h,g,r,y,k,T,C,M,$,O]}class j4 extends ye{constructor(e){super(),ve(this,e,R4,F4,be,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function sp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function H4(n,e){e=sp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.c
`),O&&O.c(),m=D(),g.c(),_=Ae(),p(s,"type","button"),p(s,"class","btn btn-transparent btn-hint p-l-sm p-r-sm"),p(e,"class","flex m-b-base flex-gap-10"),p(o,"class","list picker-list m-b-base svelte-1u8jhky"),p(c,"class","section-title")},m(N,F){S(N,e,F),j(t,e,null),b(e,i),b(e,s),S(N,l,F),S(N,o,F);for(let W=0;W<r.length;W+=1)r[W].m(o,null);$&&$.m(o,null),S(N,f,F),S(N,c,F),b(c,d),O&&O.m(c,null),S(N,m,F),I[h].m(N,F),S(N,_,F),y=!0,k||(T=[K(s,"click",n[30]),Pe(u=H4.call(null,o,n[35]))],k=!0)},p(N,F){const W={};F[0]&4&&(W.value=N[2]),F[0]&4096&&(W.autocompleteCollection=N[12]),t.$set(W),F[0]&76716&&(C=N[3],pe(),r=wt(r,F,M,1,N,C,a,o,tn,fp,null,rp),me(),!C.length&&$?$.p(N,F):C.length?$&&($.d(1),$=null):($=ap(N),$.c(),$.m(o,null))),u&&zt(u.update)&&F[0]&1040&&u.update.call(null,N[35]),N[5]>1?O?O.p(N,F):(O=cp(N),O.c(),O.m(c,null)):O&&(O.d(1),O=null);let Z=h;h=L(N),h===Z?I[h].p(N,F):(pe(),P(I[Z],1,1,()=>{I[Z]=null}),me(),g=I[h],g?g.p(N,F):(g=I[h]=E[h](N),g.c()),A(g,1),g.m(_.parentNode,_))},i(N){if(!y){A(t.$$.fragment,N);for(let F=0;F<C.length;F+=1)A(r[F]);A(g),y=!0}},o(N){P(t.$$.fragment,N);for(let F=0;F<r.length;F+=1)P(r[F]);P(g),y=!1},d(N){N&&w(e),H(t),N&&w(l),N&&w(o);for(let F=0;F<r.length;F+=1)r[F].d();$&&$.d(),N&&w(f),N&&w(c),O&&O.d(),N&&w(m),I[h].d(N),N&&w(_),k=!1,Le(T)}}}function eM(n){var r;let e,t,i,s=(((r=n[12])==null?void 0:r.name)||"")+"",l,o;return{c(){e=v("h4"),t=B("Select "),i=v("strong"),l=B(s),o=B(" records")},m(a,u){S(a,e,u),b(e,t),b(e,i),b(i,l),b(e,o)},p(a,u){var f;u[0]&4096&&s!==(s=(((f=a[12])==null?void 0:f.name)||"")+"")&&re(l,s)},d(a){a&&w(e)}}}function tM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=v("button"),i.innerHTML='<span class="txt">Save selection</span>',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[K(e,"click",n[27]),K(i,"click",n[28])],s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Le(l)}}}function nM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[18]];let o={$$slots:{footer:[tM],header:[eM],default:[x4]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=Xe(o,l[a]);e=new Bn({props:o}),n[38](e),e.$on("hide",n[39]),e.$on("show",n[40]);let r={collection:n[12]};return i=new rb({props:r}),n[41](i),i.$on("save",n[42]),i.$on("delete",n[43]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(a,u){j(e,a,u),S(a,t,u),j(i,a,u),s=!0},p(a,u){const f=u[0]&262144?sn(l,[l[0],l[1],Xn(a[18])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&4096&&(c.collection=a[12]),i.$set(c)},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[38](null),H(e,a),a&&w(t),n[41](null),H(i,a)}}}const Dr=100;function iM(n,e,t){let i,s,l,o,r,a,u,f;const c=["value","field","show","hide"];let d=At(e,c),m;Je(n,es,Te=>t(25,m=Te));const h=$t(),g="picker_"+V.randomString(5);let{value:_}=e,{field:y}=e,k,T,C="",M=[],$=[],O=1,E=0,I=!1,L=!1;function N(){return t(2,C=""),t(3,M=[]),t(6,$=[]),W(),Z(!0),k==null?void 0:k.show()}function F(){return k==null?void 0:k.hide()}async function W(){const Te=V.toArray(_);if(!s||!Te.length)return;t(23,L=!0);let ce=[];const $e=Te.slice(),Ze=[];for(;$e.length>0;){const nt=[];for(const Mt of $e.splice(0,Dr))nt.push(`id="${Mt}"`);Ze.push(he.collection(s).getFullList(Dr,{filter:nt.join("||"),$autoCancel:!1}))}try{await Promise.all(Ze).then(nt=>{ce=ce.concat(...nt)}),t(6,$=[]);for(const nt of Te){const Mt=V.findByKey(ce,"id",nt);Mt&&$.push(Mt)}C.trim()||t(3,M=V.filterDuplicatesByKey($.concat(M)))}catch(nt){he.errorResponseHandler(nt)}t(23,L=!1)}async function Z(Te=!1){if(s){t(4,I=!0),Te&&(C.trim()?t(3,M=[]):t(3,M=V.toArray($).slice()));try{const ce=Te?1:O+1,$e=await he.collection(s).getList(ce,Dr,{filter:C,sort:"-created",$cancelKey:g+"loadList"});t(3,M=V.filterDuplicatesByKey(M.concat($e.items))),O=$e.page,t(22,E=$e.totalItems)}catch(ce){he.errorResponseHandler(ce)}t(4,I=!1)}}function ne(Te){i==1?t(6,$=[Te]):u&&(V.pushUnique($,Te),t(6,$))}function J(Te){V.removeByKey($,
`,p(e,"class","list-item")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function bp(n){var d;let e,t,i,s,l,o,r,a,u,f;i=new Xo({props:{record:n[13],displayFields:(d=n[2].options)==null?void 0:d.displayFields}});function c(){return n[7](n[13])}return{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),o=v("button"),o.innerHTML='<i class="ri-close-line"></i>',r=D(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(l,"class","actions"),p(e,"class","list-item")},m(m,h){S(m,e,h),b(e,t),j(i,t,null),b(e,s),b(e,l),b(l,o),b(e,r),a=!0,u||(f=[Pe(Ye.call(null,o,"Remove")),K(o,"click",c)],u=!0)},p(m,h){var _;n=m;const g={};h&8&&(g.record=n[13]),h&4&&(g.displayFields=(_=n[2].options)==null?void 0:_.displayFields),i.$set(g)},i(m){a||(A(i.$$.fragment,m),a=!0)},o(m){P(i.$$.fragment,m),a=!1},d(m){m&&w(e),H(i),u=!1,Le(f)}}}function lM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,h,g,_,y,k=n[3],T=[];for(let $=0;$<k.length;$+=1)T[$]=bp(pp(n,k,$));const C=$=>P(T[$],1,1,()=>{T[$]=null});let M=null;return k.length||(M=hp(n)),{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=B(o),u=D(),f=v("div"),c=v("div");for(let $=0;$<T.length;$+=1)T[$].c();M&&M.c(),d=D(),m=v("div"),h=v("button"),h.innerHTML=`<i class="ri-magic-line"></i>
<span class="txt">Open picker</span>`,p(t,"class",i=yi(V.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",a=n[12]),p(c,"class","relations-list svelte-1ynw0pc"),p(h,"type","button"),p(h,"class","btn btn-transparent btn-sm btn-block"),p(m,"class","list-item list-item-btn"),p(f,"class","list")},m($,O){S($,e,O),b(e,t),b(e,s),b(e,l),b(l,r),S($,u,O),S($,f,O),b(f,c);for(let E=0;E<T.length;E+=1)T[E].m(c,null);M&&M.m(c,null),b(f,d),b(f,m),b(m,h),g=!0,_||(y=K(h,"click",n[8]),_=!0)},p($,O){if((!g||O&4&&i!==(i=yi(V.getFieldTypeIcon($[2].type))+" svelte-1ynw0pc"))&&p(t,"class",i),(!g||O&4)&&o!==(o=$[2].name+"")&&re(r,o),(!g||O&4096&&a!==(a=$[12]))&&p(e,"for",a),O&93){k=$[3];let E;for(E=0;E<k.length;E+=1){const I=pp($,k,E);T[E]?(T[E].p(I,O),A(T[E],1)):(T[E]=bp(I),T[E].c(),A(T[E],1),T[E].m(c,null))}for(pe(),E=k.length;E<T.length;E+=1)C(E);me(),!k.length&&M?M.p($,O):k.length?M&&(M.d(1),M=null):(M=hp($),M.c(),M.m(c,null))}},i($){if(!g){for(let O=0;O<k.length;O+=1)A(T[O]);g=!0}},o($){T=T.filter(Boolean);for(let O=0;O<T.length;O+=1)P(T[O]);g=!1},d($){$&&w(e),$&&w(u),$&&w(f),bt(T,$),M&&M.d(),_=!1,y()}}}function oM(n){let e,t,i,s;e=new _e({props:{class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[lM,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l={value:n[0],field:n[2]};return i=new sM({props:l}),n[9](i),i.$on("save",n[10]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(o,r){j(e,o,r),S(o,t,r),j(i,o,r),s=!0},p(o,[r]){const a={};r&4&&(a.class="form-field form-field-list "+(o[2].required?"required":"")),r&4&&(a.name=o[2].name),r&528415&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};r&1&&(u.value=o[0]),r&4&&(u.field=o[2]),i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){P(e.$$.fragment,o),P(i.$$.fragment,o),s=!1},d(o){H(e,o),o&&w(t),n[9](null),H(i,o)}}}const vp=100;function rM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new dn}=e,r=[],a=!1;u();async function u(){var k,T;const g=V.toArray(s);if(!((k=o==null?void 0:o.options)!=null&&k.collectionId)||!g.length){t(3,r=[]),t(4,a=!1);return}t(4,a=!0);const _=g.slice(),y=[];for(;_.length>0;){const C=[];for(const M of _.splice(0,vp))C.push(`id="${M}"`);y.push(he.collection((T=o==null?void 0:o.options)==null?void 0:T.collectionId).getFullList(vp,{filter:C.join("||"),$autoCancel:!1}))}try{let C=[];await Promise.all(y).then(M=>{C=C.concat(...M)});for(const M of g){const $=V.findByKey(C,"id",M);$&&r.push($)}t(3,r)}catch(C){he.errorResponseHandler(C)}t(4,a=!1)}function f(g){var _;V.removeByKey(r,"id",g.id),t(3,r),i?t(0,s=r.map(y=>y.id)):t(0,s=((_=r[0])==null?void 0:_.id)||"")}const c=g=>f(g),d=()=>l==null?void 0:l.show();function m(g){ie[g?"unshift":"push"](()=>{l=g,t(1,l)})}const h=g=>{t(3,r=g.detail||[]),t(0,s=i?r.map(_=>_.id):r[0].id||"")};return n.$$set=g=>{"value"in g&&t(0,s=g.value),"picker"in g&&t(1,l=g.picker),"field"in g&&t(2,o=g.field)},n.$$.update=()=>{var g;n.$$.dirty&4&&t(5,i=((g=o.options)==null?void 0:g.maxSelect)!=1)},[s,l,o,r,a,i,f,c,d,m,h]}class aM extends ye{constructor(e){super(),ve(this,e,rM,oM,be,{value:0,picker:1,field:2})}}const uM=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],fM=(n,e)=>{uM.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function cM(n){let e;return{c(){e=v("textarea"),p(e,"id",n[0]),Ar(e,"visibility","hidden")
Updated: ${n[2].updated}`,position:"left"})),_=!0)},p(k,T){T[1]&8388608&&r!==(r=k[54])&&p(e,"for",r),c&&zt(c.update)&&T[0]&4&&c.update.call(null,{text:`Created: ${k[2].created}
Updated: ${k[2].updated}`,position:"left"}),T[1]&8388608&&h!==(h=k[54])&&p(m,"id",h),T[0]&4&&g!==(g=k[2].id)&&m.value!==g&&(m.value=g)},d(k){k&&w(e),k&&w(a),k&&w(u),k&&w(d),k&&w(m),_=!1,y()}}}function Cp(n){var u,f;let e,t,i,s,l;function o(c){n[29](c)}let r={collection:n[0]};n[2]!==void 0&&(r.record=n[2]),e=new P$({props:r}),ie.push(()=>ke(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&$p();return{c(){q(e.$$.fragment),i=D(),a&&a.c(),s=Ae()},m(c,d){j(e,c,d),S(c,i,d),a&&a.m(c,d),S(c,s,d),l=!0},p(c,d){var h,g;const m={};d[0]&1&&(m.collection=c[0]),!t&&d[0]&4&&(t=!0,m.record=c[2],we(()=>t=!1)),e.$set(m),(g=(h=c[0])==null?void 0:h.schema)!=null&&g.length?a||(a=$p(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){P(e.$$.fragment,c),l=!1},d(c){H(e,c),c&&w(i),a&&a.d(c),c&&w(s)}}}function $p(n){let e;return{c(){e=v("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function WM(n){let e,t,i;function s(o){n[42](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new aM({props:l}),ie.push(()=>ke(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function YM(n){let e,t,i,s,l;function o(f){n[39](f,n[51])}function r(f){n[40](f,n[51])}function a(f){n[41](f,n[51])}let u={field:n[51],record:n[2]};return n[2][n[51].name]!==void 0&&(u.value=n[2][n[51].name]),n[3][n[51].name]!==void 0&&(u.uploadedFiles=n[3][n[51].name]),n[4][n[51].name]!==void 0&&(u.deletedFileIndexes=n[4][n[51].name]),e=new j4({props:u}),ie.push(()=>ke(e,"value",o)),ie.push(()=>ke(e,"uploadedFiles",r)),ie.push(()=>ke(e,"deletedFileIndexes",a)),{c(){q(e.$$.fragment)},m(f,c){j(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[51]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[51].name],we(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[51].name],we(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[51].name],we(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){H(e,f)}}}function KM(n){let e,t,i;function s(o){n[38](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new m4({props:l}),ie.push(()=>ke(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function JM(n){let e,t,i;function s(o){n[37](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new f4({props:l}),ie.push(()=>ke(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function ZM(n){let e,t,i;function s(o){n[36](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new o4({props:l}),ie.push(()=>ke(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function GM(n){let e,t,i;function s(o){n[35](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new kM({props:l}),ie.push(()=>ke(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function XM(n){let e,t,i;function s(o){n[34](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new n4({props:l}),ie.push(()=>ke(e,"value",s)),{c(){q(
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[23]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function Ap(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Send password reset email</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[24]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function i5(n){let e,t,i,s,l,o,r,a=n[0].isAuth&&!n[7].verified&&n[7].email&&Ep(n),u=n[0].isAuth&&n[7].email&&Ap(n);return{c(){a&&a.c(),e=D(),u&&u.c(),t=D(),i=v("button"),i.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,s=D(),l=v("button"),l.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item txt-danger closable")},m(f,c){a&&a.m(f,c),S(f,e,c),u&&u.m(f,c),S(f,t,c),S(f,i,c),S(f,s,c),S(f,l,c),o||(r=[K(i,"click",n[25]),K(l,"click",yn(pt(n[26])))],o=!0)},p(f,c){f[0].isAuth&&!f[7].verified&&f[7].email?a?a.p(f,c):(a=Ep(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].isAuth&&f[7].email?u?u.p(f,c):(u=Ap(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,Le(r)}}}function Ip(n){let e,t,i,s,l,o;return{c(){e=v("div"),t=v("button"),t.textContent="Account",i=D(),s=v("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),Q(t,"active",n[10]===Yi),p(s,"type","button"),p(s,"class","tab-item"),Q(s,"active",n[10]===yl),p(e,"class","tabs-header stretched")},m(r,a){S(r,e,a),b(e,t),b(e,i),b(e,s),l||(o=[K(t,"click",n[27]),K(s,"click",n[28])],l=!0)},p(r,a){a[0]&1024&&Q(t,"active",r[10]===Yi),a[0]&1024&&Q(s,"active",r[10]===yl)},d(r){r&&w(e),l=!1,Le(o)}}}function s5(n){var g;let e,t=n[2].isNew?"New":"Edit",i,s,l,o=((g=n[0])==null?void 0:g.name)+"",r,a,u,f,c,d,m=!n[2].isNew&&Op(n),h=n[0].isAuth&&!n[2].isNew&&Ip(n);return{c(){e=v("h4"),i=B(t),s=D(),l=v("strong"),r=B(o),a=B(" record"),u=D(),m&&m.c(),f=D(),h&&h.c(),c=Ae()},m(_,y){S(_,e,y),b(e,i),b(e,s),b(e,l),b(l,r),b(e,a),S(_,u,y),m&&m.m(_,y),S(_,f,y),h&&h.m(_,y),S(_,c,y),d=!0},p(_,y){var k;(!d||y[0]&4)&&t!==(t=_[2].isNew?"New":"Edit")&&re(i,t),(!d||y[0]&1)&&o!==(o=((k=_[0])==null?void 0:k.name)+"")&&re(r,o),_[2].isNew?m&&(pe(),P(m,1,1,()=>{m=null}),me()):m?(m.p(_,y),y[0]&4&&A(m,1)):(m=Op(_),m.c(),A(m,1),m.m(f.parentNode,f)),_[0].isAuth&&!_[2].isNew?h?h.p(_,y):(h=Ip(_),h.c(),h.m(c.parentNode,c)):h&&(h.d(1),h=null)},i(_){d||(A(m),d=!0)},o(_){P(m),d=!1},d(_){_&&w(e),_&&w(u),m&&m.d(_),_&&w(f),h&&h.d(_),_&&w(c)}}}function l5(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=D(),s=v("button"),l=v("span"),r=B(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[8],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[13]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[11]||n[8],Q(s,"btn-loading",n[8])},m(c,d){S(c,e,d),b(e,t),S(c,i,d),S(c,s,d),b(s,l),b(l,r),u||(f=K(e,"click",n[22]),u=!0)},p(c,d){d[0]&256&&(e.disabled=c[8]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&re(r,o),d[0]&2304&&a!==(a=!c[11]||c[8])&&(s.disabled=a),d[0]&256&&Q(s,"btn-loading",c[8])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function o5(n){var s;let e,t,i={class:`
record-panel
`+(n[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((s=n[0])!=null&&s.isAuth&&!n[2].isNew?"colored-header":"")+`
`,beforeHide:n[43],$$slots:{footer:[l5],header:[s5],default:[n5]},$$scope:{ctx:n}};return e=new Bn({props:i}),n[44](e),e.$on("hide",n[45]),e.$on("show",n[46]),{c(){q(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&4101&&(r.class=`
record-panel
`+(l[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((a=l[0])!=null&&a.isAuth&&!l[2].isNew?"colored-header":"")+`
`),o[0]&544&&(r.beforeHide=l[43]),o[0]&3485|o[1]&16777216&&(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[44](null),H(e,l)}}}const Yi="form",yl="providers";function Pp(n){return JSON.stringify(n)}function r5(n,e,t){let i,s,l,o;const r=$t(),a="record_"+V.randomString(5);let{collection:u}=e,f,c=null,d=new Ki,m=!1,h=!1,g={},_={},y="",k=Yi;function T(ce){return M(ce),t(9,h=!0),t(10,k=Yi),f==null?void 0:f.show()}function C(){return f==null?void 0:f.hide()}async function M(ce){Vn({}),t(7,c=ce||{}),ce!=null&&ce.clone?t(2,d=ce.clone()):t(2,d=new Ki),t(3,g={}),t(4,_={}),await cn(),t(20,y=Pp(d))}function $(){if(m||!o||!(u!=null&&u.id))return;t(8,m=!0);const ce=E();let $e;d.isNew?$e=he.collection(u.id).create(ce):$e=he.collection(u.id).update(d.id,ce),$e.then(Ze=>{Vt(d.isNew?"Successfully created record.":"Successfully updated record."),t(9,h=!1),C(),r("save",Ze)}).catch(Ze=>{he.errorResponseHandler(Ze)}).finally(()=>{t(8,m=!1)})}function O(){c!=null&&c.id&&un("Do you really want to delete the selected record?",()=>he.collection(c.collectionId).delete(c.id).then(()=>{C(),Vt("Successfully deleted record."),r("delete",c)}).catch(ce=>{he.errorResponseHandler(ce)}))}function E(){const ce=(d==null?void 0:d.export())||{},$e=new FormData,Ze={};for(const nt of(u==null?void 0:u.schema)||[])Ze[nt.name]=!0;u!=null&&u.isAuth&&(Ze.username=!0,Ze.email=!0,Ze.emailVisibility=!0,Ze.password=!0,Ze.passwordConfirm=!0,Ze.verified=!0);for(const nt in ce)Ze[nt]&&(typeof ce[nt]>"u"&&(ce[nt]=null),V.addValueToFormData($e,nt,ce[nt]));for(const nt in g){const Mt=V.toArray(g[nt]);for(const ot of Mt)$e.append(nt,ot)}for(const nt in _){const Mt=V.toArray(_[nt]);for(const ot of Mt)$e.append(nt+"."+ot,"")}return $e}function I(){!(u!=null&&u.id)||!(c!=null&&c.email)||un(`Do you really want to sent verification email to ${c.email}?`,()=>he.collection(u.id).requestVerification(c.email).then(()=>{Vt(`Successfully sent verification email to ${c.email}.`)}).catch(ce=>{he.errorResponseHandler(ce)}))}function L(){!(u!=null&&u.id)||!(c!=null&&c.email)||un(`Do you really want to sent password reset email to ${c.email}?`,()=>he.collection(u.id).requestPasswordReset(c.email).then(()=>{Vt(`Successfully sent password reset email to ${c.email}.`)}).catch(ce=>{he.errorResponseHandler(ce)}))}function N(){l?un("You have unsaved changes. Do you really want to discard them?",()=>{F()}):F()}async function F(){const ce=c==null?void 0:c.clone();if(ce){ce.id="",ce.created="",ce.updated="";const $e=(u==null?void 0:u.schema)||[];for(const Ze of $e)Ze.type==="file"&&delete ce[Ze.name]}T(ce),await cn(),t(20,y="")}const W=()=>C(),Z=()=>I(),ne=()=>L(),J=()=>N(),te=()=>O(),ee=()=>t(10,k=Yi),z=()=>t(10,k=yl);function X(ce){d=ce,t(2,d)}function Y(ce,$e){n.$$.not_equal(d[$e.name],ce)&&(d[$e.name]=ce,t(2,d))}function le(ce,$e){n.$$.not_equal(d[$e.name],ce)&&(d[$e.name]=ce,t(2,d))}function He(ce,$e){n.$$.not_equal(d[$e.name],ce)&&(d[$e.name]=ce,t(2,d))}function Re(ce,$e){n.$$.not_equal(d[$e.name],ce)&&(d[$e.name]=ce,t(2,d))}function Fe(ce,$e){n.$$.not_equal(d[$e.name],ce)&&(d[$e.name]=ce,t(2,d))}function qe(ce,$e){n.$$.not_equal(d[$e.name],ce)&&(d[$e.name]=ce,t(2,d))}function ge(ce,$e){n.$$.not_equal(d[$e.name],ce)&&(d[$e.name]=ce,t(2,d))}function Se(ce,$e){n.$$.not_equal(d[$e.name],ce)&&(d[$e.name]=ce,t(2,d))}function Ue(ce,$e){n.$$.not_equal(d[$e.name],ce)&&(d[$e.name]=ce,t(2,d))}function lt(ce,$e){n.$$.not_equal(d[$e.name],ce)&&(d[$e.name]=ce,t(2,d))}function ue(ce,$e){n.$$.not_equal(g[$e.name],ce)&&(g[$e.name]=ce,t(3,g))}function fe(ce,$e){n.$$.not_equal(_[$e.name],ce)&&(_[$e.name]=ce,t(4,_))}function ae(ce,$e){n.$$.not_equal(d[$e.name],ce)&&(d[$e.name]=ce,t(2,d))}const oe=()=>l&&h?(un("You have unsaved changes. Do you really want to close the panel?",()=>{t(9,h=!1),C()}),!1):(Vn({}),!0);function je(ce){ie[ce?"unshift":"push"](()=>{f=ce,t(6,f)})}function Me(ce){We.call(this,n,ce)}function Te(ce){We.call(this,n,ce)}return n.$$set=ce=>{"collection"in ce&&t(0,u=ce.collection)},n.$$.update=()=>{var ce;n.$$.dirty[0]&1&&t(12,i=!!(
`},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function R5(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[38]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function j5(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[37]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function tm(n){let e,t,i,s,l,o,r=n[53].id+"",a,u,f;s=new ab({props:{value:n[53].id}});let c=n[2].isAuth&&nm(n);return{c(){e=v("td"),t=v("div"),i=v("div"),q(s.$$.fragment),l=D(),o=v("div"),a=B(r),u=D(),c&&c.c(),p(o,"class","txt"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){S(d,e,m),b(e,t),b(t,i),j(s,i,null),b(i,l),b(i,o),b(o,a),b(t,u),c&&c.m(t,null),f=!0},p(d,m){const h={};m[0]&16&&(h.value=d[53].id),s.$set(h),(!f||m[0]&16)&&r!==(r=d[53].id+"")&&re(a,r),d[2].isAuth?c?c.p(d,m):(c=nm(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(s.$$.fragment,d),f=!0)},o(d){P(s.$$.fragment,d),f=!1},d(d){d&&w(e),H(s),c&&c.d()}}}function nm(n){let e;function t(l,o){return l[53].verified?q5:H5}let i=t(n),s=i(n);return{c(){s.c(),e=Ae()},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 H5(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=Pe(Ye.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function q5(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=Pe(Ye.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function im(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&sm(n),o=i&&lm(n);return{c(){l&&l.c(),t=D(),o&&o.c(),s=Ae()},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=sm(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=lm(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 sm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!V.isEmpty(o[53].username)),t?z5:V5}let s=i(n,[-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(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 V5(n){let e,t=n[53].username+"",i,s;return{c(){e=v("span"),i=B(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[53].username)},m(l,o){S(l,e,o),b(e,i)},p(l,o){o[0]&16&&t!==(t=l[53].username+"")&&re(i,t),o[0]&16&&s!==(s=l[53].username)&&p(e,"title",s)},d(l){l&&w(e)}}}function z5(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function lm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!V.isEmpty(o[53].email)),t?U5:B5}let s=i(n,[-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(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 B5(n){let e,t=n[53].email+"",i,s;return{c(){e=v("span"),i=B(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[53].email)},m(l,o){S(l,e,o),b(e,i)},p(l,o){o[0]&16&&t!==(t=l[53].email+"")&&re(i,t),o[0]&16&&s!==(s=l[53].email)&&p(e,"title",s)},d(l){l&&w(e)}}}function U5(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function om(n,e){let t,i,s;return i=new $5({props:{record:e[53],field:e[56]}}),{key:n,first:null,c(){t=Ae(),q(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),j(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&16&&(r.record=e[53]),o[0]&65536&&(r.field=e[56]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),H(i,l)}}}function rm(n){let e,t,i;return t=new Zi({props:{date:n[53].created}}),{c
<span class="txt">API Preview</span>`,g=D(),_=v("button"),_.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,y=D(),q(k.$$.fragment),T=D(),C=v("div"),M=D(),q($.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(_,"type","button"),p(_,"class","btn btn-expanded"),p(m,"class","btns-group"),p(e,"class","page-header"),p(C,"class","clearfix m-b-base")},m(J,te){S(J,e,te),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),b(e,u),F&&F.m(u,null),b(u,f),j(c,u,null),b(e,d),b(e,m),b(m,h),b(m,g),b(m,_),S(J,y,te),j(k,J,te),S(J,T,te),S(J,C,te),S(J,M,te),j($,J,te),I=!0,L||(N=[K(h,"click",n[16]),K(_,"click",n[17])],L=!0)},p(J,te){(!I||te[0]&4)&&o!==(o=J[2].name+"")&&re(r,o),J[9]?F&&(F.d(1),F=null):F?F.p(J,te):(F=mm(J),F.c(),F.m(u,f));const ee={};te[0]&1&&(ee.value=J[0]),te[0]&4&&(ee.autocompleteCollection=J[2]),k.$set(ee);const z={};te[0]&4&&(z.collection=J[2]),!O&&te[0]&1&&(O=!0,z.filter=J[0],we(()=>O=!1)),!E&&te[0]&2&&(E=!0,z.sort=J[1],we(()=>E=!1)),$.$set(z)},i(J){I||(A(c.$$.fragment,J),A(k.$$.fragment,J),A($.$$.fragment,J),I=!0)},o(J){P(c.$$.fragment,J),P(k.$$.fragment,J),P($.$$.fragment,J),I=!1},d(J){J&&w(e),F&&F.d(),H(c),J&&w(y),H(k,J),J&&w(T),J&&w(C),J&&w(M),n[19](null),H($,J),L=!1,Le(N)}}}function iD(n){let e,t,i,s,l;return{c(){e=v("h1"),e.textContent="Create your first collection to add records!",t=D(),i=v("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=K(i,"click",n[13]),s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function sD(n){let e;return{c(){e=v("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function lD(n){let e,t,i;function s(r,a){return r[9]?sD:iD}let l=s(n),o=l(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=D(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){S(r,e,a),b(e,t),b(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 oD(n){let e;return{c(){e=v("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function rD(n){let e,t,i,s,l,o,r,a,u;const f=[tD,eD,x5],c=[];function d(_,y){return _[3]&&!_[8].length?0:_[8].length?2:1}e=d(n),t=c[e]=f[e](n);let m={};s=new tu({props:m}),n[24](s);let h={};o=new T$({props:h}),n[25](o);let g={collection:n[2]};return a=new rb({props:g}),n[26](a),a.$on("save",n[27]),a.$on("delete",n[28]),{c(){t.c(),i=D(),q(s.$$.fragment),l=D(),q(o.$$.fragment),r=D(),q(a.$$.fragment)},m(_,y){c[e].m(_,y),S(_,i,y),j(s,_,y),S(_,l,y),j(o,_,y),S(_,r,y),j(a,_,y),u=!0},p(_,y){let k=e;e=d(_),e===k?c[e].p(_,y):(pe(),P(c[k],1,1,()=>{c[k]=null}),me(),t=c[e],t?t.p(_,y):(t=c[e]=f[e](_),t.c()),A(t,1),t.m(i.parentNode,i));const T={};s.$set(T);const C={};o.$set(C);const M={};y[0]&4&&(M.collection=_[2]),a.$set(M)},i(_){u||(A(t),A(s.$$.fragment,_),A(o.$$.fragment,_),A(a.$$.fragment,_),u=!0)},o(_){P(t),P(s.$$.fragment,_),P(o.$$.fragment,_),P(a.$$.fragment,_),u=!1},d(_){c[e].d(_),_&&w(i),n[24](null),H(s,_),_&&w(l),n[25](null),H(o,_),_&&w(r),n[26](null),H(a,_)}}}function aD(n,e,t){let i,s,l,o,r,a,u;Je(n,Si,z=>t(2,s=z)),Je(n,Po,z=>t(3,l=z)),Je(n,ma,z=>t(12,o=z)),Je(n,St,z=>t(29,r=z)),Je(n,es,z=>t(8,a=z)),Je(n,Cs,z=>t(9,u=z)),Yt(St,r="Collections",r);const f=new URLSearchParams(o);let c,d,m,h,g=f.get("filter")||"",_=f.get("sort")||"-created",y=f.get("collectionId")||(s==null?void 0:s.id);function k(){t(10,y=s.id),t(1,_="-created"),t(0,g="")}eb(y);const T=()=>c==null?void 0:c.show(),C=()=>c==null?void 0:c.show(s),M=()=>h==null?void 0:h.load(),$=()=>d==null?void 0:d.show(s),O=()=>m==null?void 0:m.show(),E=z=>t(0,g=z.detail);function I(z){ie[z?"unshift":"push"](()=>{h=z,t(7,h)})}function L(z){g=z,t(0,g)}function N(z){_=z,t(1,_)}const F=z=>m==null?void 0:m.show(z==null?void 0:z.detail),W=()=>m==null?void 0:m.show();function Z(z){ie[z?"unshift":"push"](()=>{c=z,t(4,c)})}function ne(z){ie[z?"unshift":"push"](()=>{d=z,t(5,d)})}function J(z){ie[z?"unshift":"push"](()=>{m=z,t(6,m)})}const te=()=>h==null?void 0:h.reloadLoadedPages(),ee=()=>h==null?void 0:h.reloadLoadedPages();return n.$$.update=()=>{if(n.$$.dirty[0]&4096&&t(11,i=new URLSearchParams(o)),n.$$.dirty[0]&3080&&!l&&i.get("collectionId")&&i.get("collectionId")!=y&&i3(i.get("collectionId")),n.$$.dirty[0]&1028&&s!=null&&s.id&&y!=s.id&&k(),n.$$.dirty[0]&7&&(_||g||s!=null&&s.id)){const z=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:g,sort:_}).toString();Ti("/collections?"+z)}},[g,_,s,l,c,d,m,h,a,u,y,i,o,T,C,M,$,O,E,I,L,N,F,W,Z,ne,J,te,ee]}class uD extends ye{constructor(e){super(),ve(this,e,aD,rD,be,{},null,[-1,-1])}}function fD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,y,k,T,C,M,$,O,E,I;return{c(){e=v("aside"),t=v("div"),i=v("div"),i.textContent="System",s=D(),l=v("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
<span class="txt">Application</span>`,o=D(),r=v("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=D(),u=v("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=D(),c=v("div"),c.innerHTML='<span class="txt">Sync</span>',d=D(),m=v("a"),m.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,h=D(),g=v("a"),g.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,_=D(),y=v("div"),y.textContent="Authentication",k=D(),T=v("a"),T.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,C=D(),M=v("a"),M.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,$=D(),O=v("a"),O.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"class","sidebar-title"),p(m,"href","/settings/export-collections"),p(m,"class","sidebar-list-item"),p(g,"href","/settings/import-collections"),p(g,"class","sidebar-list-item"),p(y,"class","sidebar-title"),p(T,"href","/settings/auth-providers"),p(T,"class","sidebar-list-item"),p(M,"href","/settings/tokens"),p(M,"class","sidebar-list-item"),p(O,"href","/settings/admins"),p(O,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(L,N){S(L,e,N),b(e,t),b(t,i),b(t,s),b(t,l),b(t,o),b(t,r),b(t,a),b(t,u),b(t,f),b(t,c),b(t,d),b(t,m),b(t,h),b(t,g),b(t,_),b(t,y),b(t,k),b(t,T),b(t,C),b(t,M),b(t,$),b(t,O),E||(I=[Pe(Fn.call(null,l,{path:"/settings"})),Pe(Xt.call(null,l)),Pe(Fn.call(null,r,{path:"/settings/mail/?.*"})),Pe(Xt.call(null,r)),Pe(Fn.call(null,u,{path:"/settings/storage/?.*"})),Pe(Xt.call(null,u)),Pe(Fn.call(null,m,{path:"/settings/export-collections/?.*"})),Pe(Xt.call(null,m)),Pe(Fn.call(null,g,{path:"/settings/import-collections/?.*"})),Pe(Xt.call(null,g)),Pe(Fn.call(null,T,{path:"/settings/auth-providers/?.*"})),Pe(Xt.call(null,T)),Pe(Fn.call(null,M,{path:"/settings/tokens/?.*"})),Pe(Xt.call(null,M)),Pe(Fn.call(null,O,{path:"/settings/admins/?.*"})),Pe(Xt.call(null,O))],E=!0)},p:G,i:G,o:G,d(L){L&&w(e),E=!1,Le(I)}}}class Di extends ye{constructor(e){super(),ve(this,e,null,fD,be,{})}}function hm(n,e,t){const i=n.slice();return i[30]=e[t],i}function gm(n){let e,t;return e=new _e({props:{class:"form-field disabled",name:"id",$$slots:{default:[cD,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&536870914|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function cD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="ID",o=D(),r=v("div"),a=v("i"),f=D(),c=v("input"),p(t,"class",V.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[29]),p(a,"class","ri-calendar-event-line txt-disabled"),p(r,"class","form-field-addon"),p(c,"type","text"),p(c,"id",d=n[29]),c.value=m=n[1].id,c.disabled=!0},m(_,y){S(_,e,y),b(e,t),b(e,i),b(e,s),S(_,o,y),S(_,r,y),b(r,a),S(_,f,y),S(_,c,y),h||(g=Pe(u=Ye.call(null,a,{text:`Created: ${n[1].created}
Updated: ${n[1].updated}`,position:"left"})),h=!0)},p(_,y){y[0]&536870912&&l!==(l=_[29])&&p(e,"for",l),u&&zt(u.update)&&y[0]&2&&u.update.call(null,{text:`Created: ${_[1].created}
Updated: ${_[1].updated}`,position:"left"}),y[0]&536870912&&d!==(d=_[29])&&p(c,"id",d),y[0]&2&&m!==(m=_[1].id)&&c.value!==m&&(c.value=m)},d(_){_&&w(e),_&&w(o),_&&w(r),_&&w(f),_&&w(c),h=!1,g()}}}function _m(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=v("button"),t=v("img"),s=D(),Hn(t.src,i="./images/avatars/avatar"+n[30]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[30]),p(e,"type","button"),p(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){S(u,e,f),b(e,t),b(e,s),o||(r=K(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))&&p(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=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Email",o=D(),r=v("input"),p(t,"class",V.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),S(c,o,d),S(c,r,d),de(r,n[3]),u||(f=K(r,"input",n[18]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&de(r,c[3])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function bm(n){let e,t;return e=new _e({props:{class:"form-field form-field-toggle",$$slots:{default:[pD,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&536870928|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function pD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[29]),p(s,"for",o=n[29])},m(u,f){S(u,e,f),e.checked=n[4],S(u,i,f),S(u,s,f),b(s,l),r||(a=K(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function vm(n){let e,t,i,s,l,o,r,a,u;return s=new _e({props:{class:"form-field required",name:"password",$$slots:{default:[mD,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new _e({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[hD,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),q(s.$$.fragment),l=D(),o=v("div"),q(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){S(f,e,c),b(e,t),b(t,i),j(s,i,null),b(t,l),b(t,o),j(r,o,null),u=!0},p(f,c){const d={};c[0]&536871168|c[1]&4&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c[0]&536871424|c[1]&4&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&st(()=>{a||(a=Be(t,Ht,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=Be(t,Ht,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),H(s),H(r),f&&a&&a.end()}}}function mD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Password",o=D(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),S(c,o,d),S(c,r,d),de(r,n[8]),u||(f=K(r,"input",n[20]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&256&&r.value!==c[8]&&de(r,c[8])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function hD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Password confirm",o=D(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),S(c,o,d),S(c,r,d),de(r,n[9]),u||(f=K(r,"input",n[21]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&5
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[15]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function vD(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,m=!n[1].isNew&&ym(n);return{c(){m&&m.c(),e=D(),t=v("button"),i=v("span"),i.textContent="Cancel",s=D(),l=v("button"),o=v("span"),a=B(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[6],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],Q(l,"btn-loading",n[6])},m(h,g){m&&m.m(h,g),S(h,e,g),S(h,t,g),b(t,i),S(h,s,g),S(h,l,g),b(l,o),b(o,a),f=!0,c||(d=K(t,"click",n[16]),c=!0)},p(h,g){h[1].isNew?m&&(pe(),P(m,1,1,()=>{m=null}),me()):m?(m.p(h,g),g[0]&2&&A(m,1)):(m=ym(h),m.c(),A(m,1),m.m(e.parentNode,e)),(!f||g[0]&64)&&(t.disabled=h[6]),(!f||g[0]&2)&&r!==(r=h[1].isNew?"Create":"Save changes")&&re(a,r),(!f||g[0]&1088&&u!==(u=!h[10]||h[6]))&&(l.disabled=u),(!f||g[0]&64)&&Q(l,"btn-loading",h[6])},i(h){f||(A(m),f=!0)},o(h){P(m),f=!1},d(h){m&&m.d(h),h&&w(e),h&&w(t),h&&w(s),h&&w(l),c=!1,d()}}}function yD(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[vD],header:[_D],default:[gD]},$$scope:{ctx:n}};return e=new Bn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){q(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[22]),l[0]&1886|l[1]&4&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[23](null),H(e,s)}}}function kD(n,e,t){let i;const s=$t(),l="admin_"+V.randomString(5);let o,r=new Ji,a=!1,u=!1,f=0,c="",d="",m="",h=!1;function g(J){return y(J),t(7,u=!0),o==null?void 0:o.show()}function _(){return o==null?void 0:o.hide()}function y(J){t(1,r=J!=null&&J.clone?J.clone():new Ji),k()}function k(){t(4,h=!1),t(3,c=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,d=""),t(9,m=""),Vn({})}function T(){if(a||!i)return;t(6,a=!0);const J={email:c,avatar:f};(r.isNew||h)&&(J.password=d,J.passwordConfirm=m);let te;r.isNew?te=he.admins.create(J):te=he.admins.update(r.id,J),te.then(async ee=>{var z;t(7,u=!1),_(),Vt(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ee),((z=he.authStore.model)==null?void 0:z.id)===ee.id&&he.authStore.save(he.authStore.token,ee)}).catch(ee=>{he.errorResponseHandler(ee)}).finally(()=>{t(6,a=!1)})}function C(){r!=null&&r.id&&un("Do you really want to delete the selected admin?",()=>he.admins.delete(r.id).then(()=>{t(7,u=!1),_(),Vt("Successfully deleted admin."),s("delete",r)}).catch(J=>{he.errorResponseHandler(J)}))}const M=()=>C(),$=()=>_(),O=J=>t(2,f=J);function E(){c=this.value,t(3,c)}function I(){h=this.checked,t(4,h)}function L(){d=this.value,t(8,d)}function N(){m=this.value,t(9,m)}const F=()=>i&&u?(un("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),_()}),!1):!0;function W(J){ie[J?"unshift":"push"](()=>{o=J,t(5,o)})}function Z(J){We.call(this,n,J)}function ne(J){We.call(this,n,J)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||h||c!==r.email||f!==r.avatar)},[_,r,f,c,h,o,a,u,d,m,i,l,T,C,g,M,$,O,E,I,L,N,F,W,Z,ne]}class wD extends ye{constructor(e){super(),ve(this,e,kD,yD,be,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function km(n,e,t){const i=n.slice();return i[24]=e[t],i}function SD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="id",p(t,"class",V.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:G,d(l){l&&w(e)}}}function TD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="email",p(t,"class",V.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:G,d(l){l&&w(e)}}}function CD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="created",p(t,"
`},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Sm(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[17]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function Tm(n){let e;return{c(){e=v("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Cm(n,e){let t,i,s,l,o,r,a,u,f,c,d,m=e[24].id+"",h,g,_,y,k,T=e[24].email+"",C,M,$,O,E,I,L,N,F,W,Z,ne,J,te;f=new ab({props:{value:e[24].id}});let ee=e[24].id===e[7].id&&Tm();E=new Zi({props:{date:e[24].created}}),N=new Zi({props:{date:e[24].updated}});function z(){return e[15](e[24])}function X(...Y){return e[16](e[24],...Y)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("figure"),l=v("img"),r=D(),a=v("td"),u=v("div"),q(f.$$.fragment),c=D(),d=v("span"),h=B(m),g=D(),ee&&ee.c(),_=D(),y=v("td"),k=v("span"),C=B(T),$=D(),O=v("td"),q(E.$$.fragment),I=D(),L=v("td"),q(N.$$.fragment),F=D(),W=v("td"),W.innerHTML='<i class="ri-arrow-right-line"></i>',Z=D(),Hn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(l,"src",o),p(l,"alt","Admin avatar"),p(s,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(u,"class","label"),p(a,"class","col-type-text col-field-id"),p(k,"class","txt txt-ellipsis"),p(k,"title",M=e[24].email),p(y,"class","col-type-email col-field-email"),p(O,"class","col-type-date col-field-created"),p(L,"class","col-type-date col-field-updated"),p(W,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Y,le){S(Y,t,le),b(t,i),b(i,s),b(s,l),b(t,r),b(t,a),b(a,u),j(f,u,null),b(u,c),b(u,d),b(d,h),b(a,g),ee&&ee.m(a,null),b(t,_),b(t,y),b(y,k),b(k,C),b(t,$),b(t,O),j(E,O,null),b(t,I),b(t,L),j(N,L,null),b(t,F),b(t,W),b(t,Z),ne=!0,J||(te=[K(t,"click",z),K(t,"keydown",X)],J=!0)},p(Y,le){e=Y,(!ne||le&16&&!Hn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const He={};le&16&&(He.value=e[24].id),f.$set(He),(!ne||le&16)&&m!==(m=e[24].id+"")&&re(h,m),e[24].id===e[7].id?ee||(ee=Tm(),ee.c(),ee.m(a,null)):ee&&(ee.d(1),ee=null),(!ne||le&16)&&T!==(T=e[24].email+"")&&re(C,T),(!ne||le&16&&M!==(M=e[24].email))&&p(k,"title",M);const Re={};le&16&&(Re.date=e[24].created),E.$set(Re);const Fe={};le&16&&(Fe.date=e[24].updated),N.$set(Fe)},i(Y){ne||(A(f.$$.fragment,Y),A(E.$$.fragment,Y),A(N.$$.fragment,Y),ne=!0)},o(Y){P(f.$$.fragment,Y),P(E.$$.fragment,Y),P(N.$$.fragment,Y),ne=!1},d(Y){Y&&w(t),H(f),ee&&ee.d(),H(E),H(N),J=!1,Le(te)}}}function OD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,y,k,T,C,M=[],$=new Map,O;function E(z){n[11](z)}let I={class:"col-type-text",name:"id",$$slots:{default:[SD]},$$scope:{ctx:n}};n[2]!==void 0&&(I.sort=n[2]),o=new Ut({props:I}),ie.push(()=>ke(o,"sort",E));function L(z){n[12](z)}let N={class:"col-type-email col-field-email",name:"email",$$slots:{default:[TD]},$$scope:{ctx:n}};n[2]!==void 0&&(N.sort=n[2]),u=new Ut({props:N}),ie.push(()=>ke(u,"sort",L));function F(z){n[13](z)}let W={class:"col-type-date col-field-created",name:"created",$$slots:{default:[CD]},$$scope:{ctx:n}};n[2]!==void 0&&(W.sort=n[2]),d=new Ut({props:W}),ie.push(()=>ke(d,"sort",F));function Z(z){n[14](z)}let ne={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[$D]},$$scope:{ctx:n}};n[2]!==void 0&&(ne.sort=n[2]),g=new Ut({props:ne}),ie.push(()=>ke(g,"sort",Z));let J=n[4];const te=z=>z[24].id;for(let z=0;z<J.length;z+=1){let X=km(n,J,z),Y=te(X);$.set(Y,M[z]=Cm(Y,X))}let ee=null;return J.length||(ee=wm(n)),{c(){e=v("table"),t=v("thead"),i=v("tr"),s=v("th"),l=D(),q(o.$$.fragment),a=D(),q(u.$$.fragment),c=D(),q(d.$$.fragment),h=D(),q(g.$$.fragment),y=D(),k=v("th"),T=D(),C=v("tbody");for(let z=0;z<M.length;z+=1)M[z].c();ee&&ee.c(),p(s,"class","min-width"),p(k,"class","col-type-action min-width"),p(e,"class","table"),Q(e,"table-loading",n[5])},m(z,X){S(z,e,X),b(e,t),b(t,i),b(i,s),b(i,l),j(o,i,null),b(i,a),j(u,i,null),b(i,c),j(d,i,null),b(i,h),j(g,i,null),b(i,y),b(i,k),b(e,T
<span class="txt">New admin</span>`,m=D(),q(h.$$.fragment),g=D(),_=v("div"),y=D(),q(k.$$.fragment),T=D(),E&&E.c(),C=Ae(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(d,"type","button"),p(d,"class","btn btn-expanded"),p(e,"class","page-header"),p(_,"class","clearfix m-b-base")},m(I,L){S(I,e,L),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(e,r),j(a,e,null),b(e,u),b(e,f),b(e,c),b(e,d),S(I,m,L),j(h,I,L),S(I,g,L),S(I,_,L),S(I,y,L),j(k,I,L),S(I,T,L),E&&E.m(I,L),S(I,C,L),M=!0,$||(O=K(d,"click",n[9]),$=!0)},p(I,L){(!M||L&64)&&re(o,I[6]);const N={};L&2&&(N.value=I[1]),h.$set(N);const F={};L&134217918&&(F.$$scope={dirty:L,ctx:I}),k.$set(F),I[4].length?E?E.p(I,L):(E=$m(I),E.c(),E.m(C.parentNode,C)):E&&(E.d(1),E=null)},i(I){M||(A(a.$$.fragment,I),A(h.$$.fragment,I),A(k.$$.fragment,I),M=!0)},o(I){P(a.$$.fragment,I),P(h.$$.fragment,I),P(k.$$.fragment,I),M=!1},d(I){I&&w(e),H(a),I&&w(m),H(h,I),I&&w(g),I&&w(_),I&&w(y),H(k,I),I&&w(T),E&&E.d(I),I&&w(C),$=!1,O()}}}function AD(n){let e,t,i,s,l,o;e=new Di({}),i=new kn({props:{$$slots:{default:[ED]},$$scope:{ctx:n}}});let r={};return l=new wD({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(a,u){j(e,a,u),S(a,t,u),j(i,a,u),S(a,s,u),j(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&w(t),H(i,a),a&&w(s),n[18](null),H(l,a)}}}function ID(n,e,t){let i,s,l;Je(n,ma,N=>t(21,i=N)),Je(n,St,N=>t(6,s=N)),Je(n,Ma,N=>t(7,l=N)),Yt(St,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){return t(5,u=!0),t(4,a=[]),he.admins.getFullList(100,{sort:c||"-created",filter:f}).then(N=>{t(4,a=N),t(5,u=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,u=!1),console.warn(N),m(),he.errorResponseHandler(N,!1))})}function m(){t(4,a=[])}const h=()=>d(),g=()=>r==null?void 0:r.show(),_=N=>t(1,f=N.detail);function y(N){c=N,t(2,c)}function k(N){c=N,t(2,c)}function T(N){c=N,t(2,c)}function C(N){c=N,t(2,c)}const M=N=>r==null?void 0:r.show(N),$=(N,F)=>{(F.code==="Enter"||F.code==="Space")&&(F.preventDefault(),r==null||r.show(N))},O=()=>t(1,f="");function E(N){ie[N?"unshift":"push"](()=>{r=N,t(3,r)})}const I=()=>d(),L=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const N=new URLSearchParams({filter:f,sort:c}).toString();Ti("/settings/admins?"+N),d()}},[d,f,c,r,a,u,s,l,h,g,_,y,k,T,C,M,$,O,E,I,L]}class PD extends ye{constructor(e){super(),ve(this,e,ID,AD,be,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function LD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Email"),s=D(),l=v("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),de(l,n[0]),l.focus(),r||(a=K(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&1&&l.value!==u[0]&&de(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function ND(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=B("Password"),s=D(),l=v("input"),r=D(),a=v("div"),u=v("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(l,"type","password"),p(l,"id",o=n[8]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){S(d,e,m),b(e,t),S(d,s,m),S(d,l,m),de(l,n[1]),S(d,r,m),S(d,a,m),b(a,u),f||(c=[K(l,"input",n[5]),Pe(Xt.call(null,u))],f=!0)},p(d,m){m&256&&i!==(i=d[8])&&p(e,"for",i),m&256&&o!==(o=d[8])&&p(l,"id",o),m&2&&l.value!==d[1]&&de(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),f=!1,Le(c)}}}function FD(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new _e({props:{class:"form-field required",name:"identity",$$slots:{default:[LD,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new _e({props:{class:"form-field required",name:"password",$$slots:
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){S(d,e,m),b(e,t),b(e,i),j(s,e,null),b(e,l),j(o,e,null),b(e,r),b(e,a),u=!0,f||(c=K(e,"submit",pt(n[3])),f=!0)},p(d,m){const h={};m&769&&(h.$$scope={dirty:m,ctx:d}),s.$set(h);const g={};m&770&&(g.$$scope={dirty:m,ctx:d}),o.$set(g),(!u||m&4)&&Q(a,"btn-disabled",d[2]),(!u||m&4)&&Q(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){P(s.$$.fragment,d),P(o.$$.fragment,d),u=!1},d(d){d&&w(e),H(s),H(o),f=!1,c()}}}function RD(n){let e,t;return e=new e_({props:{$$slots:{default:[FD]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function jD(n,e,t){let i;Je(n,ma,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),he.admins.authWithPassword(l,o).then(()=>{Ca(),Ti("/")}).catch(()=>{cl("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 HD extends ye{constructor(e){super(),ve(this,e,jD,RD,be,{})}}function qD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,y,k,T,C,M;i=new _e({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[zD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new _e({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[BD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),a=new _e({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[UD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),f=new _e({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[WD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}});let $=n[3]&&Mm(n);return{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),r=D(),q(a.$$.fragment),u=D(),q(f.$$.fragment),c=D(),d=v("div"),m=v("div"),h=D(),$&&$.c(),g=D(),_=v("button"),y=v("span"),y.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(m,"class","flex-fill"),p(y,"class","txt"),p(_,"type","submit"),p(_,"class","btn btn-expanded"),_.disabled=k=!n[3]||n[2],Q(_,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(O,E){S(O,e,E),b(e,t),j(i,t,null),b(e,s),b(e,l),j(o,l,null),b(e,r),j(a,e,null),b(e,u),j(f,e,null),b(e,c),b(e,d),b(d,m),b(d,h),$&&$.m(d,null),b(d,g),b(d,_),b(_,y),T=!0,C||(M=K(_,"click",n[13]),C=!0)},p(O,E){const I={};E&1572865&&(I.$$scope={dirty:E,ctx:O}),i.$set(I);const L={};E&1572865&&(L.$$scope={dirty:E,ctx:O}),o.$set(L);const N={};E&1572865&&(N.$$scope={dirty:E,ctx:O}),a.$set(N);const F={};E&1572865&&(F.$$scope={dirty:E,ctx:O}),f.$set(F),O[3]?$?$.p(O,E):($=Mm(O),$.c(),$.m(d,g)):$&&($.d(1),$=null),(!T||E&12&&k!==(k=!O[3]||O[2]))&&(_.disabled=k),(!T||E&4)&&Q(_,"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),H(i),H(o),H(a),H(f),$&&$.d(),C=!1,M()}}}function VD(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function zD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Application name"),s=D(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),de(l,n[0].meta.appName),r||(a=K(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appName&&de(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function BD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Application url"),s=D(),l=v("inpu
<div class="breadcrumb-item">Application</div></nav>`,t=D(),i=v("div"),s=v("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(m,h){S(m,e,h),S(m,t,h),S(m,i,h),b(i,s),c[l].m(s,null),r=!0,a||(u=K(s,"submit",pt(n[4])),a=!0)},p(m,h){let g=l;l=d(m),l===g?c[l].p(m,h):(pe(),P(c[g],1,1,()=>{c[g]=null}),me(),o=c[l],o?o.p(m,h):(o=c[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),c[l].d(),a=!1,u()}}}function KD(n){let e,t,i,s;return e=new Di({}),i=new kn({props:{$$slots:{default:[YD]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){j(e,l,o),S(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function JD(n,e,t){let i,s,l,o;Je(n,Cs,$=>t(14,s=$)),Je(n,vo,$=>t(15,l=$)),Je(n,St,$=>t(16,o=$)),Yt(St,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const $=await he.settings.getAll()||{};h($)}catch($){he.errorResponseHandler($)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const $=await he.settings.update(V.filterRedactedProps(a));h($),Vt("Successfully saved application settings.")}catch($){he.errorResponseHandler($)}t(2,f=!1)}}function h($={}){var O,E;Yt(vo,l=(O=$==null?void 0:$.meta)==null?void 0:O.appName,l),Yt(Cs,s=!!((E=$==null?void 0:$.meta)!=null&&E.hideControls),s),t(0,a={meta:($==null?void 0:$.meta)||{},logs:($==null?void 0:$.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function g(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function _(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function k(){a.logs.maxDays=ht(this.value),t(0,a)}function T(){a.meta.hideControls=this.checked,t(0,a)}const C=()=>g(),M=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,m,g,r,c,_,y,k,T,C,M]}class ZD extends ye{constructor(e){super(),ve(this,e,JD,KD,be,{})}}function GD(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=Xe(l,s[o]);return{c(){e=v("input"),Zn(e,l)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[7](e),de(e,n[0]),t||(i=K(e,"input",n[8]),t=!0)},p(o,r){Zn(e,l=sn(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&de(e,o[0])},d(o){o&&w(e),n[7](null),t=!1,i()}}}function XD(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=Xe(a,r[u]);return{c(){e=v("div"),t=v("button"),t.innerHTML='<i class="ri-key-line"></i>',i=D(),s=v("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),Zn(s,a)},m(u,f){S(u,e,f),b(e,t),S(u,i,f),S(u,s,f),s.autofocus&&s.focus(),l||(o=[Pe(Ye.call(null,t,{position:"left",text:"Set new value"})),K(t,"click",n[6])],l=!0)},p(u,f){Zn(s,a=sn(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,Le(o)}}}function QD(n){let e;function t(l,o){return l[3]?XD:GD}let i=t(n),s=i(n);return{c(){s.c(),e=Ae()},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:G,o:G,d(l){s.d(l),l&&w(e)}}}function xD(n,e,t){const i=["value","mask"];let s=At(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await cn(),r==null||r.focus()}const f=()=>u();function c(m){ie[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=m=>{e=Xe(Xe({},e),Gn(m)),t(5,s=At(e,i)),"value"in m&&t(0,l=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&l===o&&t(3,a=!0)},[l,o,r,a,u,s,f,c,d]}class nu extends ye{constructor(e){super(),ve(this,e,xD,QD,be,{value:0,mask:1})}}function eO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g;return{c(){e=v("label"),t=B("Subject"),s=D(),l=v("input"),r=D(),a=v("div"),u=B(`Available placeholder para
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=B(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,m=B("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(_,y){S(_,e,y),b(e,t),S(_,s,y),S(_,l,y),de(l,n[0].subject),S(_,r,y),S(_,a,y),b(a,u),b(a,f),b(a,c),b(a,d),b(a,m),h||(g=[K(l,"input",n[13]),K(f,"click",n[14]),K(d,"click",n[15])],h=!0)},p(_,y){y[1]&1&&i!==(i=_[31])&&p(e,"for",i),y[1]&1&&o!==(o=_[31])&&p(l,"id",o),y[0]&1&&l.value!==_[0].subject&&de(l,_[0].subject)},d(_){_&&w(e),_&&w(s),_&&w(l),_&&w(r),_&&w(a),h=!1,Le(g)}}}function tO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,y;return{c(){e=v("label"),t=B("Action URL"),s=D(),l=v("input"),r=D(),a=v("div"),u=B(`Available placeholder parameters:
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=B(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,m=B(`,
`),h=v("button"),h.textContent=`{TOKEN}
`,g=B("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(h,"title","Required parameter"),p(a,"class","help-block")},m(k,T){S(k,e,T),b(e,t),S(k,s,T),S(k,l,T),de(l,n[0].actionUrl),S(k,r,T),S(k,a,T),b(a,u),b(a,f),b(a,c),b(a,d),b(a,m),b(a,h),b(a,g),_||(y=[K(l,"input",n[16]),K(f,"click",n[17]),K(d,"click",n[18]),K(h,"click",n[19])],_=!0)},p(k,T){T[1]&1&&i!==(i=k[31])&&p(e,"for",i),T[1]&1&&o!==(o=k[31])&&p(l,"id",o),T[0]&1&&l.value!==k[0].actionUrl&&de(l,k[0].actionUrl)},d(k){k&&w(e),k&&w(s),k&&w(l),k&&w(r),k&&w(a),_=!1,Le(y)}}}function nO(n){let e,t,i,s;return{c(){e=v("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){S(l,e,o),de(e,n[0].body),i||(s=K(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&de(e,l[0].body)},i:G,o:G,d(l){l&&w(e),i=!1,s()}}}function iO(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=Kt(o,r(n)),ie.push(()=>ke(e,"value",l))),{c(){e&&q(e.$$.fragment),i=Ae()},m(a,u){e&&j(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,we(()=>t=!1)),o!==(o=a[4])){if(e){pe();const c=e;P(c.$$.fragment,1,0,()=>{H(c,1)}),me()}o?(e=Kt(o,r(a)),ie.push(()=>ke(e,"value",l)),q(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&H(e,a)}}}function sO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,y,k,T,C;const M=[iO,nO],$=[];function O(E,I){return E[4]&&!E[5]?0:1}return l=O(n),o=$[l]=M[l](n),{c(){e=v("label"),t=B("Body (HTML)"),s=D(),o.c(),r=D(),a=v("div"),u=B(`Available placeholder parameters:
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=B(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,m=B(`,
`),h=v("button"),h.textContent=`{TOKEN}
`,g=B(`,
`),_=v("button"),_.textContent=`{ACTION_URL}
`,y=B("."),p(e,"for",i=n[31]),p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(_,"type","button"),p(_,"class","label label-sm link-primary txt-mono"),p(_,"title","Required parameter"),p(a,"class","help-block")},m(E,I){S(E,e,I),b(e,t),S(E,s,I),$[l].m(E,I),S(E,r,I),S(E,a,I),b(a,u),b(a,f),b(a,c),b(a,d),b(a,m),b(a,h),b(a,g),b(a,_),b(a,y),k=!0,T||(C=[K(f,"click",n[22]),K(d,"click",n[23]),K(h,"click",n[24]),K(_,"click",n[25])],T=!0)},p(E,I){(!k||I[1]&1&&i!==(i=E[31]))&&p(e,"for",i);let L=l;l=O(E),l===L?$[l].p(E,I):(pe(),P($[L],1,1,()=>{$[L]=null}),me(),o=$[l],o?o.p(E,I):(o=$[l]=M[l](E),o.c()),A(o,1),o.m(r.parentNode,r))},i(E){k||(A(o),k=!0)},o(E){P(o),k=!1},d(E){E&&w(e),E&&w(s),$[l].d(E),E&&w(r),E&&w(a),T=!1,Le(C)}}}function lO(n){let e,t,i,s,l,o;return e=new _e({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[eO,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new _e({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[tO,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new _e({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[sO,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(r,a){j(e,r,a),S(r,t,a),j(i,r,a),S(r,s,a),j(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){H(e,r),r&&w(t),H(i,r),r&&w(s),H(l,r)}}}function Dm(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Pe(Ye.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&st(()=>{t||(t=Be(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=Be(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function oO(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Dm();return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),l=B(n[2]),o=D(),r=v("div"),a=D(),f&&f.c(),u=Ae(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),S(c,o,d),S(c,r,d),S(c,a,d),f&&f.m(c,d),S(c,u,d)},p(c,d){d[0]&4&&re(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=Dm(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(pe(),P(f,1,1,()=>{f=null}),me())},d(c){c&&w(e),c&&w(o),c&&w(r),c&&w(a),f&&f.d(c),c&&w(u)}}}function rO(n){let e,t;const i=[n[8]];let s={$$slots:{header:[oO],default:[lO]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Xe(s,i[l]);return e=new ys({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){q(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,o){const r=o[0]&256?sn(i,[Xn(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[26](null),H(e,l)}}}let Om;function aO(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=At(e,s),o;Je(n,Ci,z=>t(12,o=z));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=Om,d=!1;function m(){f==null||f.expand()}function h(){f==null||f.collapse()}function g(){f==null||f.collapseSiblings()}async function _(){c||d||(t(5,d=!0),t(4,c=(await ft(()=>import("./CodeEditor-a70b05e8.js"),["./CodeEditor-a70b05e8.js","./index-0935db40.js"],import.meta.url)).default),Om=c,t(5,d=!1))}function y(z){V.copyToClipboard(z),Qg(`Copied ${z} to clipboard`,2e3)}_();function k(){u.subject=this.value,t(0,u)}const T=()=>y("{APP_NAME}"),C=()=>y("{APP_URL}");function M(){u.actionUrl=t
<span class="txt">Send test email</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[26]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function OO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=D(),s=v("button"),l=v("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],Q(s,"btn-loading",n[3])},m(u,f){S(u,e,f),b(e,t),S(u,i,f),S(u,s,f),b(s,l),r||(a=[K(e,"click",n[24]),K(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&Q(s,"btn-loading",u[3])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Le(a)}}}function EO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_;const y=[bO,_O],k=[];function T(C,M){return C[2]?0:1}return d=T(n),m=k[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=B(n[5]),r=D(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=D(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,M){S(C,e,M),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S(C,r,M),S(C,a,M),b(a,u),b(u,f),b(u,c),k[d].m(u,null),h=!0,g||(_=K(u,"submit",pt(n[27])),g=!0)},p(C,M){(!h||M[0]&32)&&re(o,C[5]);let $=d;d=T(C),d===$?k[d].p(C,M):(pe(),P(k[$],1,1,()=>{k[$]=null}),me(),m=k[d],m?m.p(C,M):(m=k[d]=y[d](C),m.c()),A(m,1),m.m(u,null))},i(C){h||(A(m),h=!0)},o(C){P(m),h=!1},d(C){C&&w(e),C&&w(r),C&&w(a),k[d].d(),g=!1,_()}}}function AO(n){let e,t,i,s,l,o;e=new Di({}),i=new kn({props:{$$slots:{default:[EO]},$$scope:{ctx:n}}});let r={};return l=new gO({props:r}),n[28](l),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(a,u){j(e,a,u),S(a,t,u),j(i,a,u),S(a,s,u),j(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&w(t),H(i,a),a&&w(s),n[28](null),H(l,a)}}}function IO(n,e,t){let i,s,l;Je(n,St,ee=>t(5,l=ee));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Yt(St,l="Mail settings",l);let a,u={},f={},c=!1,d=!1;m();async function m(){t(2,c=!0);try{const ee=await he.settings.getAll()||{};g(ee)}catch(ee){he.errorResponseHandler(ee)}t(2,c=!1)}async function h(){if(!(d||!s)){t(3,d=!0);try{const ee=await he.settings.update(V.filterRedactedProps(f));g(ee),Vn({}),Vt("Successfully saved mail settings.")}catch(ee){he.errorResponseHandler(ee)}t(3,d=!1)}}function g(ee={}){t(0,f={meta:(ee==null?void 0:ee.meta)||{},smtp:(ee==null?void 0:ee.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function _(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function y(){f.meta.senderName=this.value,t(0,f)}function k(){f.meta.senderAddress=this.value,t(0,f)}function T(ee){n.$$.not_equal(f.meta.verificationTemplate,ee)&&(f.meta.verificationTemplate=ee,t(0,f))}function C(ee){n.$$.not_equal(f.meta.resetPasswordTemplate,ee)&&(f.meta.resetPasswordTemplate=ee,t(0,f))}function M(ee){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ee)&&(f.meta.confirmEmailChangeTemplate=ee,t(0,f))}function $(){f.smtp.enabled=this.checked,t(0,f)}function O(){f.smtp.host=this.value,t(0,f)}function E(){f.smtp.port=ht(this.value),t(0,f)}function I(ee){n.$$.not_equal(f.smtp.tls,ee)&&(f.smtp.tls=ee,t(0,f))}function L(ee){n.$$.not_equal(f.smtp.authMethod,ee)&&(f.smtp.authMethod=ee,t(0,f))}function N(){f.smtp.username=this.value,t(0,f)}function F(ee){n.$$.not_equal(f.smtp.password,ee)&&(f.smtp.password=ee,t(0,f))}const W=()=>_(),Z=()=>h(),ne=()=>a==null?
the
`),r=v("strong"),u=B(a),f=B(`
to the
`),c=v("strong"),m=B(d),h=B(`.
`),g=v("br"),_=B(`
There are numerous command line tools that can help you, such as:
`),y=v("a"),y.textContent=`rclone
`,k=B(`,
`),T=v("a"),T.textContent=`s5cmd
`,C=B(", etc."),M=D(),$=v("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener noreferrer"),p(y,"class","txt-bold"),p(T,"href","https://github.com/peak/s5cmd"),p(T,"target","_blank"),p(T,"rel","noopener noreferrer"),p(T,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p($,"class","clearfix m-t-base")},m(L,N){S(L,e,N),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(r,u),b(l,f),b(l,c),b(c,m),b(l,h),b(l,g),b(l,_),b(l,y),b(l,k),b(l,T),b(l,C),b(e,M),b(e,$),E=!0},p(L,N){var F;(!E||N&1)&&a!==(a=(F=L[0].s3)!=null&&F.enabled?"S3 storage":"local file system")&&re(u,a),(!E||N&2)&&d!==(d=L[1].s3.enabled?"S3 storage":"local file system")&&re(m,d)},i(L){E||(L&&st(()=>{O||(O=Be(e,Ht,{duration:150},!0)),O.run(1)}),E=!0)},o(L){L&&(O||(O=Be(e,Ht,{duration:150},!1)),O.run(0)),E=!1},d(L){L&&w(e),L&&O&&O.end()}}}function Nm(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,y,k,T,C,M,$;return i=new _e({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[RO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),o=new _e({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[jO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),u=new _e({props:{class:"form-field required",name:"s3.region",$$slots:{default:[HO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),d=new _e({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[qO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),g=new _e({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[VO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),k=new _e({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[zO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),r=D(),a=v("div"),q(u.$$.fragment),f=D(),c=v("div"),q(d.$$.fragment),m=D(),h=v("div"),q(g.$$.fragment),_=D(),y=v("div"),q(k.$$.fragment),T=D(),C=v("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(y,"class","col-lg-12"),p(C,"class","col-lg-12"),p(e,"class","grid")},m(O,E){S(O,e,E),b(e,t),j(i,t,null),b(e,s),b(e,l),j(o,l,null),b(e,r),b(e,a),j(u,a,null),b(e,f),b(e,c),j(d,c,null),b(e,m),b(e,h),j(g,h,null),b(e,_),b(e,y),j(k,y,null),b(e,T),b(e,C),$=!0},p(O,E){const I={};E&100663298&&(I.$$scope={dirty:E,ctx:O}),i.$set(I);const L={};E&100663298&&(L.$$scope={dirty:E,ctx:O}),o.$set(L);const N={};E&100663298&&(N.$$scope={dirty:E,ctx:O}),u.$set(N);const F={};E&100663298&&(F.$$scope={dirty:E,ctx:O}),d.$set(F);const W={};E&100663298&&(W.$$scope={dirty:E,ctx:O}),g.$set(W);const Z={};E&100663298&&(Z.$$scope={dirty:E,ctx:O}),k.$set(Z)},i(O){$||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(d.$$.fragment,O),A(g.$$.fragment,O),A(k.$$.fragment,O),O&&st(()=>{M||(M=Be(e,Ht,{duration:150},!0)),M.run(1)}),$=!0)},o(O){P(i.$$.fragment,O),P(o.$$.fragment,O),P(u.$$.fragment,O),P(d.$$.fragment,O),P(g.$$.fragment,O),P(k.$$.fragment,O),O&&(M||(M=Be(e,Ht,{duration:150},!1)),M.run(0)),$=!1},d(O){O&&w(e),H(i),H(o),H(u),H(d),H(g),H(k),O&&M&&M.end()}}}function RO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Endpoint"),s=D(),l=v("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),de(l,n[1].s3.endpoint),r||(a=K(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&de(l,u[1].s3.endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function jO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Bucket"),s=D(),l=v("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),de(l,n[1].s3.bucket),r||(a=K(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"
<span class="txt">S3 connected successfully</span>`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function UO(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=Pe(t=Ye.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&zt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&w(e),i=!1,s()}}}function WO(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Rm(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),b(e,t),i||(s=K(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function YO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_;const y=[NO,LO],k=[];function T(C,M){return C[2]?0:1}return d=T(n),m=k[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=B(n[7]),r=D(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,c=D(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,M){S(C,e,M),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S(C,r,M),S(C,a,M),b(a,u),b(u,f),b(u,c),k[d].m(u,null),h=!0,g||(_=K(u,"submit",pt(n[20])),g=!0)},p(C,M){(!h||M&128)&&re(o,C[7]);let $=d;d=T(C),d===$?k[d].p(C,M):(pe(),P(k[$],1,1,()=>{k[$]=null}),me(),m=k[d],m?m.p(C,M):(m=k[d]=y[d](C),m.c()),A(m,1),m.m(u,null))},i(C){h||(A(m),h=!0)},o(C){P(m),h=!1},d(C){C&&w(e),C&&w(r),C&&w(a),k[d].d(),g=!1,_()}}}function KO(n){let e,t,i,s;return e=new Di({}),i=new kn({props:{$$slots:{default:[YO]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){j(e,l,o),S(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}const lo="s3_test_request";function JO(n,e,t){let i,s,l;Je(n,St,F=>t(7,l=F)),Yt(St,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null,d=null;m();async function m(){t(2,a=!0);try{const F=await he.settings.getAll()||{};g(F)}catch(F){he.errorResponseHandler(F)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{he.cancelRequest(lo);const F=await he.settings.update(V.filterRedactedProps(r));Vn({}),await g(F),Ca(),c?nv("Successfully saved but failed to establish S3 connection."):Vt("Successfully saved files storage settings.")}catch(F){he.errorResponseHandler(F)}t(3,u=!1)}}async function g(F={}){t(1,r={s3:(F==null?void 0:F.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await y()}async function _(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await y()}async function y(){if(t(5,c=null),!!r.s3.enabled){he.cancelRequest(lo),clearTimeout(d),d=setTimeout(()=>{he.cancelRequest(lo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await he.settings.testS3({$cancelKey:lo})}catch(F){t(5,c=F)}t(4,f=!1),clearTimeout(d)}}nn(()=>()=>{clearTimeout(d)});function k(){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 M(){r.s3.region=this.value,t(1,r)}function $(){r.s3.accessKey=this.value,t(1,r)}function O(F){n.$$.not_equal(r.s3.secret,F)&&(r.s3.secret=F,t(1,r))}function E(){r.s3.forcePathStyle=this.checked,t(1,r)}const I=()=>_(),L=()=>h(),N=()=>h();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,h,_,i,k,T,C,M,$,O,E,I,L,N]}class ZO extends ye{constructor(e){super(),ve(this,e,JO,KO,be,{})}}function GO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"for",o=n[20])},m(u,f){S(u,e,f),e.checked=n[0].enabled,S(u,i,f),S(u,s,f),b(s,l),r||(a=K(e,"change",n[12]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&1048576&&o!==(o=u[20])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function XO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Client ID"),s=D(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),de(l,n[0].clientId),r||(a=K(l,"input",n[13]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].clientId&&de(l,u[0].clientId)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function QO(n){let e,t,i,s,l,o,r;function a(f){n[14](f)}let u={id:n[20],required:!0};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new nu({props:u}),ie.push(()=>ke(l,"value",a)),{c(){e=v("label"),t=B("Client Secret"),s=D(),q(l.$$.fragment),p(e,"for",i=n[20])},m(f,c){S(f,e,c),b(e,t),S(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),!o&&c&1&&(o=!0,d.value=f[0]
another PocketBase environment.</p>`,t=D(),i=v("div"),s=v("button"),s.innerHTML='<span class="txt">Copy</span>',l=D(),q(o.$$.fragment),r=D(),a=v("div"),u=v("div"),f=D(),c=v("button"),c.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(g,_){S(g,e,_),S(g,t,_),S(g,i,_),b(i,s),b(i,l),j(o,i,null),n[8](i),S(g,r,_),S(g,a,_),b(a,u),b(a,f),b(a,c),d=!0,m||(h=[K(s,"click",n[7]),K(i,"keydown",n[9]),K(c,"click",n[10])],m=!0)},p(g,_){const y={};_&4&&(y.content=g[2]),o.$set(y)},i(g){d||(A(o.$$.fragment,g),d=!0)},o(g){P(o.$$.fragment,g),d=!1},d(g){g&&w(e),g&&w(t),g&&w(i),H(o),n[8](null),g&&w(r),g&&w(a),m=!1,Le(h)}}}function yE(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function kE(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[yE,vE],h=[];function g(_,y){return _[1]?0:1}return f=g(n),c=h[f]=m[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=B(n[3]),r=D(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,y){S(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S(_,r,y),S(_,a,y),b(a,u),h[f].m(u,null),d=!0},p(_,y){(!d||y&8)&&re(o,_[3]);let k=f;f=g(_),f===k?h[f].p(_,y):(pe(),P(h[k],1,1,()=>{h[k]=null}),me(),c=h[f],c?c.p(_,y):(c=h[f]=m[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){P(c),d=!1},d(_){_&&w(e),_&&w(r),_&&w(a),h[f].d()}}}function wE(n){let e,t,i,s;return e=new Di({}),i=new kn({props:{$$slots:{default:[kE]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){j(e,l,o),S(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function SE(n,e,t){let i,s;Je(n,St,_=>t(3,s=_)),Yt(St,s="Export collections",s);const l="export_"+V.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await he.collections.getFullList(100,{$cancelKey:l}));for(let _ of r)delete _.created,delete _.updated}catch(_){he.errorResponseHandler(_)}t(1,a=!1)}function f(){V.downloadJson(r,"pb_schema")}function c(){V.copyToClipboard(i),Qg("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(_){ie[_?"unshift":"push"](()=>{o=_,t(0,o)})}const h=_=>{if(_.ctrlKey&&_.code==="KeyA"){_.preventDefault();const y=window.getSelection(),k=document.createRange();k.selectNodeContents(o),y.removeAllRanges(),y.addRange(k)}},g=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,m,h,g]}class TE extends ye{constructor(e){super(),ve(this,e,SE,wE,be,{})}}function Km(n,e,t){const i=n.slice();return i[14]=e[t],i}function Jm(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Zm(n,e,t){const i=n.slice();return i[14]=e[t],i}function Gm(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Xm(n,e,t){const i=n.slice();return i[14]=e[t],i}function Qm(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function xm(n,e,t){const i=n.slice();return i[30]=e[t],i}function CE(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&eh(),a=n[0].name!==n[1].name&&th(n);return{c(){e=v("div"),r&&r.c(),t=D(),a&&a.c(),i=D(),s=v("strong"),o=B(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){S(u,e,f),r&&r.m(e,null),b(e,t),a&&a.m(e,null),b(e,i),b(e,s),b(s,o)},p(u,f){u[9]?r||(r=eh(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=th(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&re(o,l)},d(u){u&&w(e),r&&r.d(),a&&a.d()}}}function $E(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Deleted",t=D(),i=v("strong"),l=B(s),p(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),b(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?voi
<th width="10%" class="svelte-lmkr38">Old</th>
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=D(),o=v("tbody");for(let C=0;C<h.length;C+=1)h[C].c();r=D(),g&&g.c(),a=D();for(let C=0;C<y.length;C+=1)y[C].c();u=D();for(let C=0;C<T.length;C+=1)T[C].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(C,M){S(C,e,M),d.m(e,null),S(C,t,M),S(C,i,M),b(i,s),b(i,l),b(i,o);for(let $=0;$<h.length;$+=1)h[$].m(o,null);b(o,r),g&&g.m(o,null),b(o,a);for(let $=0;$<y.length;$+=1)y[$].m(o,null);b(o,u);for(let $=0;$<T.length;$+=1)T[$].m(o,null)},p(C,M){if(c===(c=f(C))&&d?d.p(C,M):(d.d(1),d=c(C),d&&(d.c(),d.m(e,null))),M[0]&7203){m=C[11];let $;for($=0;$<m.length;$+=1){const O=xm(C,m,$);h[$]?h[$].p(O,M):(h[$]=nh(O),h[$].c(),h[$].m(o,r))}for(;$<h.length;$+=1)h[$].d(1);h.length=m.length}if(C[2]||C[5]?g?g.p(C,M):(g=ih(C),g.c(),g.m(o,a)):g&&(g.d(1),g=null),M[0]&4248){_=C[7];let $;for($=0;$<_.length;$+=1){const O=Zm(C,_,$);y[$]?y[$].p(O,M):(y[$]=ah(O),y[$].c(),y[$].m(o,u))}for(;$<y.length;$+=1)y[$].d(1);y.length=_.length}if(M[0]&4352){k=C[8];let $;for($=0;$<k.length;$+=1){const O=Km(C,k,$);T[$]?T[$].p(O,M):(T[$]=fh(O),T[$].c(),T[$].m(o,null))}for(;$<T.length;$+=1)T[$].d(1);T.length=k.length}},i:G,o:G,d(C){C&&w(e),d.d(),C&&w(t),C&&w(i),bt(h,C),g&&g.d(),bt(y,C),bt(T,C)}}}function $n(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function rn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function OE(n,e,t){let i,s,l,{collectionA:o=new bn}=e,{collectionB:r=new bn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],m=[];const h=Object.keys(new bn().export()).filter(y=>!["schema","created","updated"].includes(y));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(y=>!f.find(k=>y.id==k.id))))}function _(y){return typeof y>"u"?"":V.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&g(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find(k=>y.id==k.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find(k=>k.id==y.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(y=>!u.find(k=>k.id==y.id))),n.$$.dirty[0]&7&&t(9,l=V.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,m,l,s,h,_]}class EE extends ye{constructor(e){super(),ve(this,e,OE,DE,be,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function ch(n,e,t){const i=n.slice();return i[17]=e[t],i}function dh(n){let e,t;return e=new EE({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){q(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function AE(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=dh(ch(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=Ae()},m(o,r){for(let a=0;a<s.length;a+=1)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=ch(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=dh(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(pe(),a=i.length;a<s.length;a+=1)l(a);me()}},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){bt(s,o),o&&w(e)}}}function IE(n){let e;return{c(){e=v("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function PE(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=B("Close"),i=D(),s=v("button"),l=v("span"),l.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n
- ${C.join(`
- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await he.collections.import(o,a),Vt("Successfully imported collections configuration."),i("submit")}catch(C){he.errorResponseHandler(C)}t(4,u=!1),c()}}const g=()=>m(),_=()=>!u;function y(C){ie[C?"unshift":"push"](()=>{s=C,t(1,s)})}function k(C){We.call(this,n,C)}function T(C){We.call(this,n,C)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,m,f,l,o,g,_,y,k,T]}class FE extends ye{constructor(e){super(),ve(this,e,NE,LE,be,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function ph(n,e,t){const i=n.slice();return i[32]=e[t],i}function mh(n,e,t){const i=n.slice();return i[35]=e[t],i}function hh(n,e,t){const i=n.slice();return i[32]=e[t],i}function RE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,y,k,T,C,M,$,O;a=new _e({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[HE,({uniqueId:W})=>({40:W}),({uniqueId:W})=>[0,W?512:0]]},$$scope:{ctx:n}}});let E=!1,I=n[6]&&n[1].length&&!n[7]&&_h(),L=n[6]&&n[1].length&&n[7]&&bh(n),N=n[13].length&&Oh(n),F=!!n[0]&&Eh(n);return{c(){e=v("input"),t=D(),i=v("div"),s=v("p"),l=B(`Paste below the collections configuration you want to import or
`),o=v("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=D(),q(a.$$.fragment),u=D(),f=D(),I&&I.c(),c=D(),L&&L.c(),d=D(),N&&N.c(),m=D(),h=v("div"),F&&F.c(),g=D(),_=v("div"),y=D(),k=v("button"),T=v("span"),T.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),Q(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(_,"class","flex-fill"),p(T,"class","txt"),p(k,"type","button"),p(k,"class","btn btn-expanded btn-warning m-l-auto"),k.disabled=C=!n[14],p(h,"class","flex m-t-base")},m(W,Z){S(W,e,Z),n[19](e),S(W,t,Z),S(W,i,Z),b(i,s),b(s,l),b(s,o),S(W,r,Z),j(a,W,Z),S(W,u,Z),S(W,f,Z),I&&I.m(W,Z),S(W,c,Z),L&&L.m(W,Z),S(W,d,Z),N&&N.m(W,Z),S(W,m,Z),S(W,h,Z),F&&F.m(h,null),b(h,g),b(h,_),b(h,y),b(h,k),b(k,T),M=!0,$||(O=[K(e,"change",n[20]),K(o,"click",n[21]),K(k,"click",n[26])],$=!0)},p(W,Z){(!M||Z[0]&4096)&&Q(o,"btn-loading",W[12]);const ne={};Z[0]&64&&(ne.class="form-field "+(W[6]?"":"field-error")),Z[0]&65|Z[1]&1536&&(ne.$$scope={dirty:Z,ctx:W}),a.$set(ne),W[6]&&W[1].length&&!W[7]?I||(I=_h(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),W[6]&&W[1].length&&W[7]?L?L.p(W,Z):(L=bh(W),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),W[13].length?N?N.p(W,Z):(N=Oh(W),N.c(),N.m(m.parentNode,m)):N&&(N.d(1),N=null),W[0]?F?F.p(W,Z):(F=Eh(W),F.c(),F.m(h,g)):F&&(F.d(1),F=null),(!M||Z[0]&16384&&C!==(C=!W[14]))&&(k.disabled=C)},i(W){M||(A(a.$$.fragment,W),A(E),M=!0)},o(W){P(a.$$.fragment,W),P(E),M=!1},d(W){W&&w(e),n[19](null),W&&w(t),W&&w(i),W&&w(r),H(a,W),W&&w(u),W&&w(f),I&&I.d(W),W&&w(c),L&&L.d(W),W&&w(d),N&&N.d(W),W&&w(m),W&&w(h),F&&F.d(),$=!1,Le(O)}}}function jE(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function gh(n){let e;return{c(){e=v("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function HE(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&gh();return{c(){e=v("label"),t=B("Collections"),s=D(),l=v("textarea"),r=D(),c&&c.c(),a=Ae(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,m){S(d,e,m),b(e,t),S(d,s,m),S(d,l,m),de(l,n[0]),S(d,r,m),c&&c.m(d,m),S(d,a,m),u||(f=K(l,"input",n[22]),u=!0)},p(d,m){m[1]&512&&i!==(i=d[40])&&p(e,"for",i),m[1]&512&&o!==(o=d[40])&&p(l,"id",o),m[0]&1&&de(l,d[0]),d[0]&&!d[6]?c||(c=gh(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),c&&c.d(d),d&&w(a),u=!1,f()}}}function _h(n){let e;return{c(){e=v("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,p(e,"class","alert alert-info")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function bh(n){let e,t,i,s,l,o=n[9].length&&vh(n),r=n[4].length&&wh(n),a=n[8].length&&$h(n);return{c(){e=v("h5"),e.textContent="Detected changes",t=D(),i=v("div"),o&&o.c(),s=D(),r&&r.c(),l=D(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),o&&o.m(i,null),b(i,s),r&&r.m(i,null),b(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=vh(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=wh(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=$h(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 vh(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=hh(n,s,o),a=l(r);t.set(a,e[o]=kh(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ae()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=wt(e,r,l,1,o,s,t,i.parentNode,Xi,kh,i,hh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function yh(n){let e,t,i=n[32].id+"",s,l;return{c(){e=v("small"),t=B("("),s=B(i),l=B(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&re(s,i)},d(o){o&&w(e)}}}function kh(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&yh(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Deleted",s=D(),l=v("strong"),r=B(o),a=D(),f&&f.c(),u=D(),p(i,"class","label label-danger list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){S(c,t,d),b(t,i),b(t,s),b(t,l),b(l,r),b(t,a),f&&f.m(t,null),b(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&re(r,o),e[32].id?f?f.p(e,d):(f=yh(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function wh(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=mh(n,s,o),a=l(r);t.set(a,e[o]=Ch(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ae()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=wt(e,r,l,1,o,s,t,i.parentNode,Xi,Ch,i,mh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function Sh(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=v("strong"),i=B(t),s=D(),l=v("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),b(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&re(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function Th(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=v("small"),t=B("("),s=B(i),l=B(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&re(s,i)},d(o){o&&w(e)}}}function Ch(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,c,d=e[35].old.name!==e[35].new.name&&Sh(e),m=e[35].new.id&&Th(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Changed",s=D(),l=v("div"),d&&d.c(),o=D(),r=v("strong"),u=B(a),f=D(),m&&m.c(),c=D(),p(i,"class","label label-warning list-label svelte-1jx20fl"),p(l,"class","inline-flex flex-gap-5"),p(t,"class","list-item"),this.first=t},m(h,g){S(h,t,g),b(t,i),b(t,s),b(t,l),d&&d.m(l,null),b(l,o),b(l,r),b(r,u),b(l,f),m&&m.m(l,null),b(t,c)},p(h,g){e=h,e[35].old.name!==e[35].new.name?d?d.p(e,g):(d=Sh(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),g[0]&16&&a!==(a=e[35].new.name+"")&&re(u,a),e[35].new.id?m?m.p(e,g):(m=Th(e),m.c(),m.m(l,null)):m&&(m.d(1),m=null)},d(h){h&&w(t),d&&d.d(),m&&m.d()}}}function $h(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=ph(n,s,o),a=l(r);t.set(a,e[o]=Dh(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ae()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=wt(e,r,l,1,o,s,t,i.parentNode,Xi,Dh,i,ph))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function Mh(n){let e,t,i=n[32].id+"",s,l;return{c(){e=v("small"),t=B("("),s=B(i),l=B(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),b(e,t),b(e,s),b(
imported with different IDs. You can replace them in the import if you want
to.</string>`,l=D(),o=v("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){S(u,e,f),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),r||(a=K(o,"click",n[24]),r=!0)},p:G,d(u){u&&w(e),r=!1,a()}}}function Eh(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[25]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function qE(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[jE,RE],h=[];function g(_,y){return _[5]?0:1}return f=g(n),c=h[f]=m[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=B(n[15]),r=D(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,y){S(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S(_,r,y),S(_,a,y),b(a,u),h[f].m(u,null),d=!0},p(_,y){(!d||y[0]&32768)&&re(o,_[15]);let k=f;f=g(_),f===k?h[f].p(_,y):(pe(),P(h[k],1,1,()=>{h[k]=null}),me(),c=h[f],c?c.p(_,y):(c=h[f]=m[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){P(c),d=!1},d(_){_&&w(e),_&&w(r),_&&w(a),h[f].d()}}}function VE(n){let e,t,i,s,l,o;e=new Di({}),i=new kn({props:{$$slots:{default:[qE]},$$scope:{ctx:n}}});let r={};return l=new FE({props:r}),n[27](l),l.$on("submit",n[28]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(a,u){j(e,a,u),S(a,t,u),j(i,a,u),S(a,s,u),j(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&w(t),H(i,a),a&&w(s),n[27](null),H(l,a)}}}function zE(n,e,t){let i,s,l,o,r,a,u;Je(n,St,z=>t(15,u=z)),Yt(St,u="Import collections",u);let f,c,d="",m=!1,h=[],g=[],_=!0,y=[],k=!1;T();async function T(){t(5,k=!0);try{t(2,g=await he.collections.getFullList(200));for(let z of g)delete z.created,delete z.updated}catch(z){he.errorResponseHandler(z)}t(5,k=!1)}function C(){if(t(4,y=[]),!!i)for(let z of h){const X=V.findByKey(g,"id",z.id);!(X!=null&&X.id)||!V.hasCollectionChanges(X,z,_)||y.push({new:z,old:X})}}function M(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=V.filterDuplicatesByKey(h)):t(1,h=[]);for(let z of h)delete z.created,delete z.updated,z.schema=V.filterDuplicatesByKey(z.schema)}function $(){var z,X;for(let Y of h){const le=V.findByKey(g,"name",Y.name)||V.findByKey(g,"id",Y.id);if(!le)continue;const He=Y.id,Re=le.id;Y.id=Re;const Fe=Array.isArray(le.schema)?le.schema:[],qe=Array.isArray(Y.schema)?Y.schema:[];for(const ge of qe){const Se=V.findByKey(Fe,"name",ge.name);Se&&Se.id&&(ge.id=Se.id)}for(let ge of h)if(Array.isArray(ge.schema))for(let Se of ge.schema)(z=Se.options)!=null&&z.collectionId&&((X=Se.options)==null?void 0:X.collectionId)===He&&(Se.options.collectionId=Re)}t(0,d=JSON.stringify(h,null,4))}function O(z){t(12,m=!0);const X=new FileReader;X.onload=async Y=>{t(12,m=!1),t(10,f.value="",f),t(0,d=Y.target.result),await cn(),h.length||(cl("Invalid collections configuration."),E())},X.onerror=Y=>{console.warn(Y),cl("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},X.readAsText(z)}function E(){t(0,d=""),t(10,f.value="",f),Vn({})}function I(z){ie[z?"unshift":"push"](()=>{f=z,t(10,f)})}const L=()=>{f.files.length&&O(f.files[0])},N=()=>{f.click()};function F(){d=this.value,t(0,d)}function W(){_=this.checked,t(3,_)}const Z=()=>$(),ne=()=>E(),J=()=>c==null?void 0:c.show(g,h,_);function te(z){ie[z?"unshift":"push"](()=>{c=z,t(11,c)})}const ee=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(z=>!!z.id&&!!z.name).length),n.$$.dirty[0]&78&&t(9,s=g.filter(z=>i&&_&&!V.findByKey(h,"id",z.id))),n.
<span class="txt">Manage admins</span>`,t=D(),i=v("hr"),s=D(),l=v("button"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"type","button"),p(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=[Pe(Xt.call(null,e)),K(l,"click",n[6])],o=!0)},p:G,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,Le(r)}}}function lA(n){var m;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=V.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((m=n[0])==null?void 0:m.id)&&n[1]&&Ph(n);return o=new Hb({props:{routes:UE}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new QE({}),f=new iA({}),{c(){t=D(),i=v("div"),d&&d.c(),s=D(),l=v("div"),q(o.$$.fragment),r=D(),q(a.$$.fragment),u=D(),q(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(h,g){S(h,t,g),S(h,i,g),d&&d.m(i,null),b(i,s),b(i,l),j(o,l,null),b(l,r),j(a,l,null),S(h,u,g),j(f,h,g),c=!0},p(h,[g]){var _;(!c||g&12)&&e!==(e=V.joinNonEmpty([h[3],h[2],"PocketBase"]," - "))&&(document.title=e),(_=h[0])!=null&&_.id&&h[1]?d?(d.p(h,g),g&3&&A(d,1)):(d=Ph(h),d.c(),A(d,1),d.m(i,s)):d&&(pe(),P(d,1,1,()=>{d=null}),me())},i(h){c||(A(d),A(o.$$.fragment,h),A(a.$$.fragment,h),A(f.$$.fragment,h),c=!0)},o(h){P(d),P(o.$$.fragment,h),P(a.$$.fragment,h),P(f.$$.fragment,h),c=!1},d(h){h&&w(t),h&&w(i),d&&d.d(),H(o),H(a),h&&w(u),H(f,h)}}}function oA(n,e,t){let i,s,l,o;Je(n,Cs,m=>t(8,i=m)),Je(n,vo,m=>t(2,s=m)),Je(n,Ma,m=>t(0,l=m)),Je(n,St,m=>t(3,o=m));let r,a=!1;function u(m){var h,g,_,y;((h=m==null?void 0:m.detail)==null?void 0:h.location)!==r&&(t(1,a=!!((_=(g=m==null?void 0:m.detail)==null?void 0:g.userData)!=null&&_.showAppSidebar)),r=(y=m==null?void 0:m.detail)==null?void 0:y.location,Yt(St,o="",o),Vn({}),tb())}function f(){Ti("/")}async function c(){var m,h;if(l!=null&&l.id)try{const g=await he.settings.getAll({$cancelKey:"initialAppSettings"});Yt(vo,s=((m=g==null?void 0:g.meta)==null?void 0:m.appName)||"",s),Yt(Cs,i=!!((h=g==null?void 0:g.meta)!=null&&h.hideControls),i)}catch(g){g!=null&&g.isAbort||console.warn("Failed to load app settings.",g)}}function d(){he.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class rA extends ye{constructor(e){super(),ve(this,e,oA,lA,be,{})}}new rA({target:document.getElementById("app")});export{Le as A,Vt as B,V as C,Ti as D,Ae as E,e_ as F,ga as G,du as H,Je as I,es as J,$t as K,nn as L,ie as M,x_ as N,wt as O,Xi as P,tn as Q,bn as R,ye as S,Ar as T,P as a,D as b,q as c,H as d,v as e,p as f,S as g,b as h,ve as i,Pe as j,pe as k,Xt as l,j as m,me as n,w as o,he as p,_e as q,Q as r,be as s,A as t,K as u,pt as v,B as w,re as x,G as y,de as z};