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

659 lines
828 KiB
JavaScript
Raw Normal View History

2022-08-19 01:28:20 +08:00
(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 le(){}const _l=n=>n;function ut(n,e){for(const t in e)n[t]=e[t];return n}function _m(n){return n()}function Xa(){return Object.create(null)}function Ge(n){n.forEach(_m)}function Kn(n){return typeof n=="function"}function De(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Il;function ei(n,e){return Il||(Il=document.createElement("a")),Il.href=e,n===Il.href}function Z_(n){return Object.keys(n).length===0}function bm(n,...e){if(n==null)return le;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function at(n,e,t){n.$$.on_destroy.push(bm(e,t))}function wn(n,e,t,i){if(n){const s=vm(n,e,t,i);return n[0](s)}}function vm(n,e,t,i){return n[1]&&i?ut(t.ctx.slice(),n[1](i(e))):t.ctx}function $n(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 Sn(n,e,t,i,s,l){if(s){const o=vm(e,t,i,l);n.p(o,s)}}function Cn(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 ii(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Bt(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function Qa(n){return n==null?"":n}function tn(n,e,t){return n.set(t),e}function We(n){return n&&Kn(n.destroy)?n.destroy:le}const ym=typeof window<"u";let Io=ym?()=>window.performance.now():()=>Date.now(),aa=ym?n=>requestAnimationFrame(n):le;const vs=new Set;function km(n){vs.forEach(e=>{e.c(n)||(vs.delete(e),e.f())}),vs.size!==0&&aa(km)}function Fo(n){let e;return vs.size===0&&aa(km),{promise:new Promise(t=>{vs.add(e={c:n,f:t})}),abort(){vs.delete(e)}}}function m(n,e){n.appendChild(e)}function wm(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function G_(n){const e=_("style");return X_(wm(n),e),e.sheet}function X_(n,e){m(n.head||n,e)}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function Qt(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function _(n){return document.createElement(n)}function F(n){return document.createTextNode(n)}function D(){return F(" ")}function Ke(){return F("")}function X(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Yt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function ti(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function $m(n){return function(e){e.target===this&&n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function di(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:p(n,i,e[i])}function Pt(n){return n===""?null:+n}function Q_(n){return Array.from(n.childNodes)}function ue(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Te(n,e){n.value=e==null?"":e}function xa(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function ne(n,e,t){n.classList[t?"add":"remove"](e)}function Sm(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEve
`;for(let b=0;b<=1;b+=a){const y=e+(t-e)*l(b);u+=b*100+`%{${o(y,1-y)}}
`}const f=u+`100% {${o(t,1-t)}}
2022-08-19 01:32:07 +08:00
}`,c=`__svelte_${x_(f)}_${r}`,d=wm(n),{stylesheet:h,rules:g}=uo.get(d)||eb(d,n);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${c} ${i}ms linear ${s}ms 1 both`,fo+=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(", "),fo-=s,fo||tb())}function tb(){aa(()=>{fo||(uo.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),uo.clear())})}function nb(n,e,t,i){if(!e)return le;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return le;const{delay:l=0,duration:o=300,easing:r=_l,start:a=Io()+l,end:u=a+o,tick:f=le,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,g;function v(){c&&(g=rl(n,0,1,o,l,r,c)),l||(h=!0)}function b(){c&&al(n,g),d=!1}return Fo(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),b()),!d)return!1;if(h){const C=y-a,S=0+1*r(C/o);f(S,1-S)}return!0}),v(),f(0,1),b}function ib(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,Cm(n,s)}}function Cm(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 Qs(n){ul=n}function No(){if(!ul)throw new Error("Function called outside component initialization");return ul}function Jn(n){No().$$.on_mount.push(n)}function sb(n){No().$$.after_update.push(n)}function lb(n){No().$$.on_destroy.push(n)}function rn(){const n=No();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=Sm(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function st(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Ks=[],pe=[],io=[],Er=[],Mm=Promise.resolve();let Ar=!1;function Tm(){Ar||(Ar=!0,Mm.then(Dm))}function si(){return Tm(),Mm}function Tt(n){io.push(n)}function je(n){Er.push(n)}const er=new Set;let Fl=0;function Dm(){const n=ul;do{for(;Fl<Ks.length;){const e=Ks[Fl];Fl++,Qs(e),ob(e.$$)}for(Qs(null),Ks.length=0,Fl=0;pe.length;)pe.pop()();for(let e=0;e<io.length;e+=1){const t=io[e];er.has(t)||(er.add(t),t())}io.length=0}while(Ks.length);for(;Er.length;)Er.pop()();Ar=!1,er.clear(),Qs(n)}function ob(n){if(n.fragment!==null){n.update(),Ge(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Tt)}}let Fs;function ua(){return Fs||(Fs=Promise.resolve(),Fs.then(()=>{Fs=null})),Fs}function ts(n,e,t){n.dispatchEvent(Sm(`${e?"intro":"outro"}${t}`))}const so=new Set;let ai;function Pe(){ai={r:0,c:[],p:ai}}function Le(){ai.r||Ge(ai.c),ai=ai.p}function A(n,e){n&&n.i&&(so.delete(n),n.i(e))}function L(n,e,t,i){if(n&&n.o){if(so.has(n))return;so.add(n),ai.c.push(()=>{so.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const fa={duration:0};function Om(n,e,t){let i=e(n,t),s=!1,l,o,r=0;function a(){l&&al(n,l)}function u(){const{delay:c=0,duration:d=300,easing:h=_l,tick:g=le,css:v}=i||fa;v&&(l=rl(n,0,1,d,c,h,v,r++)),g(0,1);const b=Io()+c,y=b+d;o&&o.abort(),s=!0,Tt(()=>ts(n,!0,"start")),o=Fo(C=>{if(s){if(C>=y)return g(1,0),ts(n,!0,"end"),a(),s=!1;if(C>=b){const S=h((C-b)/d);g(S,1-S)}}return s})}let f=!1;return{start(){f||(f=!0,al(n),Kn(i)?(i=i(),ua().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function Em(n,e,t){let i=e(n,t),s=!0,l;const o=ai;o.r+=1;function r(){const{delay:a=0,duration:u=300,easing:f=_l,tick:c=le,css:d}=i||fa;d&&(l=rl(n,1,0,u,a,f,d));const h=Io()+a,g=h+u;Tt(()=>ts(n,!1,"start")),Fo(v=>{if(s){if(v>=g)return c(0,1),ts(n,!1,"end"),--o.r||Ge(o.c),!1;if(v>=h){const b=f((v-h)/u);c(1-b,b)}}return s})}return Kn(i)?ua().then(()=>{i=i(),r()}):r(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&al(n,l),s=!1)}}}function it(n,e,t,i){let s=e(n,t),l=i?0:1,o=nu
2022-08-19 01:28:20 +08:00
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=D(),i=_("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function O0(n){let e,t,i,s=!n[0]&&Au();const l=n[1].default,o=wn(l,n,n[2],null);return{c(){e=_("div"),s&&s.c(),t=D(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),s&&s.m(e,null),m(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Au(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Sn(o,l,r,r[2],i?$n(l,r[2],a,null):Cn(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){L(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function E0(n){let e,t;return e=new On({props:{class:"full-page",center:!0,$$slots:{default:[O0]},$$scope:{ctx:n}}}),{c(){V(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){L(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function A0(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 qg extends Ee{constructor(e){super(),Oe(this,e,A0,E0,De,{nobranding:0})}}function Pu(n,e,t){const i=n.slice();return i[11]=e[t],i}const P0=n=>({}),Lu=n=>({uniqueId:n[3]});function L0(n){let e=(n[11]||bo)+"",t;return{c(){t=F(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||bo)+"")&&ue(t,e)},d(i){i&&k(t)}}}function I0(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=_("pre"),i=F(t)},m(o,r){w(o,e,r),m(e,i)},p(o,r){var a,u;r&4&&t!==(t=(((a=o[11])==null?void 0:a.message)||((u=o[11])==null?void 0:u.code)||bo)+"")&&ue(i,t)},d(o){o&&k(e)}}}function Iu(n){let e,t;function i(o,r){return typeof o[11]=="object"?I0:L0}let s=i(n),l=s(n);return{c(){e=_("div"),l.c(),t=D(),p(e,"class","help-block help-block-error")},m(o,r){w(o,e,r),l.m(e,null),m(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&k(e),l.d()}}}function F0(n){let e,t,i,s,l;const o=n[7].default,r=wn(o,n,n[6],Lu);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=Iu(Pu(n,a,f));return{c(){e=_("div"),r&&r.c(),t=D();for(let f=0;f<u.length;f+=1)u[f].c();p(e,"class",n[0]),ne(e,"error",n[2].length)},m(f,c){w(f,e,c),r&&r.m(e,null),m(e,t);for(let d=0;d<u.length;d+=1)u[d].m(e,null);n[9](e),i=!0,s||(l=X(e,"click",n[8]),s=!0)},p(f,[c]){if(r&&r.p&&(!i||c&64)&&Sn(r,o,f,f[6],i?$n(o,f[6],c,P0):Cn(f[6]),Lu),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const h=Pu(f,a,d);u[d]?u[d].p(h,c):(u[d]=Iu(h),u[d].c(),u[d].m(e,null))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}(!i||c&1)&&p(e,"class",f[0]),c&5&&ne(e,"error",f[2].length)},i(f){i||(A(r,f),i=!0)},o(f){L(r,f),i=!1},d(f){f&&k(e),r&&r.d(f),Qt(u,f),n[9](null),s=!1,l()}}}const bo="Invalid value";function N0(n,e,t){let i;at(n,qi,g=>t(5,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+W.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){$a(r)}Jn(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(g){st.call(this,n,g)}function h(g){pe[g?"unshift":"push"](()=>{u=g,t(1,u)})}return n.$$set=g=>{"name"in g&&t(4,r=g.name),"class"in g&&t(0,a=g.class),"$$scope"in g&&t(6,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=W.toArray(W.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,h]}class Re extends Ee{constructor(e){super(),Oe(this,e,N0,F0,De,{name:4,class:0})}}function R0(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Email"),s=D(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0]),l.focus(),r||(a=X(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]&&Te(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function H0(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=F("Password"),s=D(),l=_("input"),r=D(),a=_("div
<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"),ne(f,"btn-disabled",n[3]),ne(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(g,v){w(g,e,v),m(e,t),m(e,i),j(s,e,null),m(e,l),j(o,e,null),m(e,r),j(a,e,null),m(e,u),m(e,f),c=!0,d||(h=X(e,"submit",Yt(n[4])),d=!0)},p(g,[v]){const b={};v&1537&&(b.$$scope={dirty:v,ctx:g}),s.$set(b);const y={};v&1538&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const C={};v&1540&&(C.$$scope={dirty:v,ctx:g}),a.$set(C),v&8&&ne(f,"btn-disabled",g[3]),v&8&&ne(f,"btn-loading",g[3])},i(g){c||(A(s.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){L(s.$$.fragment,g),L(o.$$.fragment,g),L(a.$$.fragment,g),c=!1},d(g){g&&k(e),q(s),q(o),q(a),d=!1,h()}}}function V0(n,e,t){const i=rn();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await $e.admins.create({email:s,password:l,passwordConfirm:o}),await $e.admins.authViaEmail(s,l),i("submit")}catch(d){$e.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 z0 extends Ee{constructor(e){super(),Oe(this,e,V0,q0,De,{})}}function Fu(n){let e,t;return e=new qg({props:{$$slots:{default:[B0]},$$scope:{ctx:n}}}),{c(){V(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){L(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function B0(n){let e,t;return e=new z0({}),e.$on("submit",n[1]),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p:le,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function U0(n){let e,t,i=n[0]&&Fu(n);return{c(){i&&i.c(),e=Ke()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Fu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(Pe(),L(i,1,1,()=>{i=null}),Le())},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function W0(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){$e.logout(!1),t(0,i=!0);return}$e.authStore.isValid?Si("/collections"):$e.logout()}return[i,async()=>{t(0,i=!1),await si(),window.location.search=""}]}class Y0 extends Ee{constructor(e){super(),Oe(this,e,W0,U0,De,{})}}const Ft=Zn(""),vo=Zn(""),rs=Zn(!1);function Bo(n){const e=n-1;return e*e*e+1}function yo(n,{delay:e=0,duration:t=400,easing:i=_l}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function Un(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 nn(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:h=>`overflow: hidden;opacity: ${Math.min(h*20,1)*l};height: ${h*o}px;padding-top: ${h*r}px;padding-bottom: ${h*a}px;margin-top: ${h*u}px;margin-bottom: ${h*f}px;border-top-width: ${h*c}px;border-bottom-width: ${h*d}px;`}}function Tn(n,{delay:e=0,duration:t=400,easing:i=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}
2022-08-19 01:32:07 +08:00
`}}function K0(n){let e,t,i,s;return{c(){e=_("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),Te(e,n[7]),i||(s=X(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]&&Te(e,l[7])},i:le,o:le,d(l){l&&k(e),n[13](null),i=!1,s()}}}function J0(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=new o(r(n)),pe.push(()=>Fe(e,"value",l)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=Ke()},m(a,u){e&&j(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],je(()=>t=!1)),o!==(o=a[4])){if(e){Pe();const c=e;L(c.$$.fragment,1,0,()=>{q(c,1)}),Le()}o?(e=new o(r(a)),pe.push(()=>Fe(e,"value",l)),e.$on("submit",a[10]),V(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&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&q(e,a)}}}function Nu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Ru();return{c(){r&&r.c(),e=D(),t=_("button"),t.innerHTML='<span class="txt">Clear</span>',p(t,"type","button"),p(t,"class","btn btn-secondary btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),s=!0,l||(o=X(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&A(r,1):(r=Ru(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(Pe(),L(r,1,1,()=>{r=null}),Le())},i(a){s||(A(r),a&&Tt(()=>{i||(i=it(t,Un,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){L(r),a&&(i||(i=it(t,Un,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),l=!1,o()}}}function Ru(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Tt(()=>{t||(t=it(e,Un,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=it(e,Un,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function Z0(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[J0,K0],h=[];function g(b,y){return b[4]&&!b[5]?0:1}o=g(n),r=h[o]=d[o](n);let v=(n[0].length||n[7].length)&&Nu(n);return{c(){e=_("div"),t=_("form"),i=_("label"),s=_("i"),l=D(),r.c(),a=D(),v&&v.c(),p(s,"class","ri-search-line"),p(i,"for",n[8]),p(i,"class","m-l-10 txt-xl"),p(t,"class","searchbar"),p(e,"class","searchbar-wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(i,s),m(t,l),h[o].m(t,null),m(t,a),v&&v.m(t,null),u=!0,f||(c=[X(t,"submit",Yt(n[10])),X(e,"click",ti(n[11]))],f=!0)},p(b,[y]){let C=o;o=g(b),o===C?h[o].p(b,y):(Pe(),L(h[C],1,1,()=>{h[C]=null}),Le(),r=h[o],r?r.p(b,y):(r=h[o]=d[o](b),r.c()),A(r,1),r.m(t,a)),b[0].length||b[7].length?v?(v.p(b,y),y&129&&A(v,1)):(v=Nu(b),v.c(),A(v,1),v.m(t,null)):v&&(Pe(),L(v,1,1,()=>{v=null}),Le())},i(b){u||(A(r),A(v),u=!0)},o(b){L(r),L(v),u=!1},d(b){b&&k(e),h[o].d(),v&&v.d(),f=!1,Ge(c)}}}function G0(n,e,t){const i=rn(),s="search_"+W.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new cn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function v(){u||f||(t(5,f=!0),t(4,u=(await Ai(()=>import("./FilterAutocompleteInput.7854778d.js"),["FilterAutocompleteInput.7854778d.js","index.90bde420.js"],import.meta.url)).default),t(5,f=!1))}Jn(()=>{v()});function b(M){st.call(this,n,M)}function y(M){d=M,t(7,d),t(0,l)}function C(M){pe[M?"unshift":"push"](()=>{c=M,t(6,c)})}function S(){d=this.value,t(7,d),t(0,l)}const $=()=>{h(!1),g()};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,
2022-08-19 01:28:20 +08:00
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function rv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="url",p(t,"class",W.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&k(e)}}}function av(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="referer",p(t,"class",W.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&k(e)}}}function uv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="status",p(t,"class",W.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&k(e)}}}function fv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="created",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&k(e)}}}function qu(n){let e;function t(l,o){return l[6]?dv:cv}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function cv(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Vu(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No logs found.",s=D(),o&&o.c(),l=D(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Vu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function dv(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Vu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[18]),t=!0)},p:le,d(s){s&&k(e),t=!1,i()}}}function zu(n){let e;return{c(){e=_("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Bu(n,e){var x,ae,ke;let t,i,s,l=((x=e[21].method)==null?void 0:x.toUpperCase())+"",o,r,a,u,f,c=e[21].url+"",d,h,g,v,b,y,C=(e[21].referer||"N/A")+"",S,$,M,T,O,E=e[21].status+"",P,I,N,B,U,ee,J,ie,Q,Y,G=(((ae=e[21].meta)==null?void 0:ae.errorMessage)||((ke=e[21].meta)==null?void 0:ke.errorData))&&zu();B=new $i({props:{date:e[21].created}});function ge(){return e[16](e[21])}function _e(...H){return e[17](e[21],...H)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),o=F(l),a=D(),u=_("td"),f=_("span"),d=F(c),g=D(),G&&G.c(),v=D(),b=_("td"),y=_("span"),S=F(C),M=D(),T=_("td"),O=_("span"),P=F(E),I=D(),N=_("td"),V(B.$$.fragment),U=D(),ee=_("td"),ee.innerHTML='<i class="ri-arrow-right-line"></i>',J=D(),p(s,"class",r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",h=e[21].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",$=e[21].referer),ne(y,"txt-hint",!e[21].referer),p(b,"class","col-type-text col-field-referer"),p(O,"class","label"),ne(O,"label-danger",e[21].status>=400),p(T,"class","col-type-number col-field-status"),p(N,"class","col-type-date col-field-created"),p(ee,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(H,me){w(H,t,me),m(t,i),m(i,s),m(s,o),m(t,a),m(t,u),m(u,f),m(f,d),m(u,g),G&&G.m(u,null),m(t,v),m(t,b),m(b,y),m(y,S),m(t,M),m(t,T),m(T,O),m(O,P),m(t,I),m(t,N),j(B,N,null),m(t,U),m(t,ee),m(t,J),ie=!0,Q||(Y=[X(t,"click",ge),X(t,"keydown",_e)],Q=!0)},p(H,me){var K,be,He;e=H,(!ie||me&8)&&l!==(l=((K=e[21].method)==null?void 0:K.toUpperCase())+"")&&ue(o,l),(!ie||me&8&&r!==(r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(s,"class",r),(!ie||me&8)&&c!==(c=e[21].url+"")&&ue(d,c),(!ie||me&8&&h!==(h=e[21].url))&&p(f,"title",h),((be=e[21].meta)==null?void 0:be.errorMessage)||((He=e[21].meta)==null?void 0:He.errorData)?G||(G=zu(),G.c(),G.m(u,null)):G&&(G.d(1),G=null),(!ie||me&8)&&C!==(C=(e[21].referer||"N/A")+"")&&ue(S,C),(!ie||me&8&&$!==($=e[21].referer))&&p(y,"title",$),me&8&&ne(y,"txt-hint",!e[21].referer),(!ie||me&8)&&E!==(E=e[21].status+"")&&ue(P,E),me&8&&ne(O,"label-danger",e[21].status>=400);const oe={};me&8&&(oe.date=e[21].created),B.$set(oe)},i(H){ie||(A(B.$$.fragment,H),ie=!0)},o(H){L(B.$$.fragment,H),ie=!1},d(H){H&&k(t),G&&G.d(),q(B),Q=!1,Ge(Y)}}}function Uu(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=F("Showing "),s=F(i),l=F(" of "),o=F(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a&8&&i!==(i=r[3].length+"")&&ue(s,i),a&16&&ue(o,r[4])},d(r){r&&k(e)}}}function Wu(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=F("Load more ("),o=F(l),r=F(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ne(t,"btn-loading",n[6]),ne(t,"btn-disabled",n[6]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=X(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&ue(o,l),c&64&&ne(t,"btn-loading",f[6]),c&64&&ne(t,"btn-disabled",f[6])},d(f){f&&k(e),a=!1,u()}}}function pv(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,T,O=[],E=new Map,P,I,N,B;function U(K){n[11](K)}let ee={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[ov]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),l=new ln({props:ee}),pe.push(()=>Fe(l,"sort",U));function J(K){n[12](K)}let ie={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/function _i(){}const gv=function(){let n=0;return function(){return n++}}();function Mt(n){return n===null||typeof n>"u"}function It(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function ht(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Wt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Rn(n,e){return Wt(n)?n:e}function bt(n,e){return typeof n>"u"?e:n}const _v=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,zg=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Vt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function Et(n,e,t,i){let s,l,o;if(It(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(ht(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function 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(It(n))return n.map(wo);if(ht(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=wo(n[t[s]]);return e}return n}function Bg(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function bv(n,e,t,i){if(!Bg(n))return;const s=e[n],l=t[n];ht(s)&&ht(l)?fl(s,l,i):e[n]=wo(l)}function fl(n,e,t){const i=It(e)?e:[e],s=i.length;if(!ht(n))return n;t=t||{};const l=t.merger||bv;for(let o=0;o<s;++o){if(e=i[o],!ht(e))continue;const r=Object.keys(e);for(let a=0,u=r.length;a<u;++a)l(r[a],n,e,t)}return n}function tl(n,e){return fl(n,e,{merger:vv})}function vv(n,e,t){if(!Bg(n))return;const i=e[n],s=t[n];ht(i)&&ht(s)?tl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=wo(s))}const Yu={"":n=>n,x:n=>n.x,y:n=>n.y};function Hi(n,e){return(Yu[e]||(Yu[e]=yv(e)))(n)}function yv(n){const e=kv(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function kv(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 Ca(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Wn=n=>typeof n<"u",ji=n=>typeof n=="function",Ku=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function wv(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Ut=Math.PI,At=2*Ut,$v=At+Ut,$o=Number.POSITIVE_INFINITY,Sv=Ut/180,zt=Ut/2,qs=Ut/4,Ju=Ut*2/3,zn=Math.log10,fi=Math.sign;function Zu(n){const e=Math.round(n);n=nl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(zn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Cv(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 Ms(n){return!isNaN(parseFloat(n))&&isFinite(n)}function nl(n,e,t){return Math.abs(n-e)<t}function Mv(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function Ug(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 xn(n){return n*(Ut/180)}function Ma(n){return n*(180/Ut)}function Gu(n){if(!Wt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function Wg(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*Ut&&(l+=At),{angle:l,distance:s}}function Yr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Tv(n,e){return(n-e+$v)%At-Ut}function Pn(n){return(n%At+At)%At}function cl(n,e,t,i){const s=Pn(n),l=Pn(e),o=Pn(t),r=Pn(l-s),a=Pn(o-s),u=Pn(s-l),f=Pn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function fn(n,e,t){return Math.max(e,Math.min(t,n))}function Dv(n){return fn(n,-32768,32767)}function dl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ta(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 es=(n,e,t,i)=>Ta(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),Ov=(n,e,t)=>Ta(n,t,i=>n[i][e]>=t);function Ev(n,e,
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function $l(n){return n+.5|0}const Ii=(n,e,t)=>Math.max(Math.min(n,t),e);function Gs(n){return Ii($l(n*2.55),0,255)}function Ri(n){return Ii($l(n*255),0,255)}function yi(n){return Ii($l(n/2.55)/100,0,1)}function tf(n){return Ii($l(n*100),0,100)}const Nn={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},Kr=[..."0123456789ABCDEF"],Iv=n=>Kr[n&15],Fv=n=>Kr[(n&240)>>4]+Kr[n&15],zl=n=>(n&240)>>4===(n&15),Nv=n=>zl(n.r)&&zl(n.g)&&zl(n.b)&&zl(n.a);function Rv(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Nn[n[1]]*17,g:255&Nn[n[2]]*17,b:255&Nn[n[3]]*17,a:e===5?Nn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Nn[n[1]]<<4|Nn[n[2]],g:Nn[n[3]]<<4|Nn[n[4]],b:Nn[n[5]]<<4|Nn[n[6]],a:e===9?Nn[n[7]]<<4|Nn[n[8]]:255})),t}const Hv=(n,e)=>n<255?e(n):"";function jv(n){var e=Nv(n)?Iv:Fv;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Hv(n.a,e):void 0}const qv=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Qg(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 Vv(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 zv(n,e,t){const i=Qg(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 Bv(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 Da(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=Bv(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Oa(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ri)}function Ea(n,e,t){return Oa(Qg,n,e,t)}function Uv(n,e,t){return Oa(zv,n,e,t)}function Wv(n,e,t){return Oa(Vv,n,e,t)}function xg(n){return(n%360+360)%360}function Yv(n){const e=qv.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Gs(+e[5]):Ri(+e[5]));const s=xg(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=Uv(s,l,o):e[1]==="hsv"?i=Wv(s,l,o):i=Ea(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function Kv(n,e){var t=Da(n);t[0]=xg(t[0]+e),t=Ea(t),n.r=t[0],n.g=t[1],n.b=t[2]}function Jv(n){if(!n)return;const e=Da(n),t=e[0],i=tf(e[1]),s=tf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${yi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const nf={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"},sf={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 Xy{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=Jg.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);!t||(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var bi=new Xy;const gf="transparent",Qy={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=of(n||gf),s=i.valid&&of(e||gf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class xy{constructor(e,t,i,s){const l=t[i];s=Wl([e.to,s,l,e.from]);const o=Wl([e.from,l,s]);this._active=!0,this._fn=e.fn||Qy[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=Wl([e.to,t,s,e.from]),this._from=Wl([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 ek=["x","y","borderWidth","radius","tension"],tk=["color","borderColor","backgroundColor"];yt.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 nk=Object.keys(yt.animation);yt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});yt.set("animations",{colors:{type:"color",properties:tk},numbers:{type:"number",properties:ek}});yt.describe("animations",{_fallback:"animation"});yt.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 h_{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!ht(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!ht(s))return;const l={};for(co
`)>-1?n.split(`
`):n}function bw(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 Kf(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Ln(e.bodyFont),u=Ln(e.titleFont),f=Ln(e.footerFont),c=l.length,d=s.length,h=i.length,g=Yn(e.padding);let v=g.height,b=0,y=i.reduce(($,M)=>$+M.before.length+M.lines.length+M.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(v+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;v+=h*$+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let C=0;const S=function($){b=Math.max(b,t.measureText($).width+C)};return t.save(),t.font=u.string,Et(n.title,S),t.font=a.string,Et(n.beforeBody.concat(n.afterBody),S),C=e.displayColors?o+2+e.boxPadding:0,Et(i,$=>{Et($.before,S),Et($.lines,S),Et($.after,S)}),C=0,t.font=f.string,Et(n.footer,S),t.restore(),b+=g.width,{width:b,height:v}}function vw(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function yw(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 kw(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"),yw(u,n,e,t)&&(u="center"),u}function Jf(n,e,t){const i=t.yAlign||e.yAlign||vw(n,t);return{xAlign:t.xAlign||e.xAlign||kw(n,e,t,i),yAlign:i}}function ww(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function $w(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function Zf(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:h}=ks(o);let g=ww(e,r);const v=$w(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+s:r==="right"&&(g+=Math.max(c,h)+s),{x:fn(g,0,i.width-e.width),y:fn(v,0,i.height-e.height)}}function Ql(n,e,t){const i=Yn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Gf(n){return ri([],vi(n))}function Sw(n,e,t){return Vi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Xf(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class na extends Ci{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 h_(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=Sw(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=ri(r,vi(s)),r=ri(r,vi(l)),r=ri(r,vi(o)),r}getBeforeBody(e,t){return Gf(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return Et(e,l=>{const o={before:[],lines:[],after:[]},r=Xf(i,l);ri(o.before,vi(r.beforeLabel.call(this,l))
* chartjs-adapter-luxon v1.2.0
* https://www.chartjs.org
* (c) 2022 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const Ww={datetime:Qe.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Qe.TIME_WITH_SECONDS,minute:Qe.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};v_._date.override({_id:"luxon",_create:function(n){return Qe.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return Ww},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Qe.fromFormat(n,e,t):n=Qe.fromISO(n,t):n instanceof Date?n=Qe.fromJSDate(n,t):i==="object"&&!(n instanceof Qe)&&(n=Qe.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function lc(n){let e,t,i;return{c(){e=_("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Tt(()=>{t||(t=it(e,Tn,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=it(e,Tn,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function Yw(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=F(n[1]),t=D(),s=F(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&ue(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&ue(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function Kw(n){let e;return{c(){e=F("Loading...")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Jw(n){let e,t,i,s,l,o=n[2]&&lc();function r(f,c){return f[2]?Kw:Yw}let a=r(n),u=a(n);return{c(){e=_("div"),o&&o.c(),t=D(),i=_("canvas"),s=D(),l=_("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),xa(i,"height","250px"),xa(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),ne(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){w(f,e,c),o&&o.m(e,null),m(e,t),m(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=lc(),o.c(),A(o,1),o.m(e,t)):o&&(Pe(),L(o,1,1,()=>{o=null}),Le()),c&4&&ne(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){L(o)},d(f){f&&k(e),o&&o.d(),n[8](null),f&&k(s),f&&k(l),u.d()}}}function Zw(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),$e.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let g of h)r.push({x:W.getDateTime(g.date).toLocal().toJSDate(),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),$e.errorResponseHandler(h,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Jn(()=>(Ao.register(zi,Zo,Ko,Ya,Tl,_w,Cw),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:h=>h.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>h.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(h){pe[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function C(S){return S instanceof a?new a(S.type,C(S.content),S.alias):Array.isArray(S)?S.map(C):S.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(C){return Object.prototype.toString.call(C).slice(8,-1)},objId:function(C){return C.__id||Object.defineProperty(C,"__id",{value:++l}),C.__id},clone:function C(S,$){$=$||{};var M,T;switch(r.util.type(S)){case"Object":if(T=r.util.objId(S),$[T])return $[T];M={},$[T]=M;for(var O in S)S.hasOwnProperty(O)&&(M[O]=C(S[O],$));return M;case"Array":return T=r.util.objId(S),$[T]?$[T]:(M=[],$[T]=M,S.forEach(function(E,P){M[P]=C(E,$)}),M);default:return S}},getLanguage:function(C){for(;C;){var S=s.exec(C.className);if(S)return S[1].toLowerCase();C=C.parentElement}return"none"},setLanguage:function(C,S){C.className=C.className.replace(RegExp(s,"gi"),""),C.classList.add("language-"+S)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var C=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(C){var S=document.getElementsByTagName("script");for(var $ in S)if(S[$].src==C)return S[$]}return null}},isActive:function(C,S,$){for(var M="no-"+S;C;){var T=C.classList;if(T.contains(S))return!0;if(T.contains(M))return!1;C=C.parentElement}return!!$}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(C,S){var $=r.util.clone(r.languages[C]);for(var M in S)$[M]=S[M];return $},insertBefore:function(C,S,$,M){M=M||r.languages;var T=M[C],O={};for(var E in T)if(T.hasOwnProperty(E)){if(E==S)for(var P in $)$.hasOwnProperty(P)&&(O[P]=$[P]);$.hasOwnProperty(E)||(O[E]=T[E])}var I=M[C];return M[C]=O,r.languages.DFS(r.languages,function(N,B){B===I&&N!=C&&(this[N]=O)}),O},DFS:function C(S,$,M,T){T=T||{};var O=r.util.objId;for(var E in S)if(S.hasOwnProperty(E)){$.call(S,E,S[E],M||E);var P=S[E],I=r.util.type(P);I==="Object"&&!T[O(P)]?(T[O(P)]=!0,C(P,$,null,T)):I==="Array"&&!T[O(P)]&&(T[O(P)]=!0,C(P,$,E,T))}}},plugins:{},highlightAll:function(C,S){r.highlightAllUnder(document,C,S)},highlightAllUnder:function(C,S,$){var M={callback:$,container:C,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 T=0,O;O=M.elements[T++];)r.highlightElement(O,S===!0,M.callback)},highlightElement:function(C,S,$){var M=r.util.getLanguage(C),T=r.languages[M];r.util.setLanguage(C,M);var O=C.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,M);var E=C.textContent,P={element:C,language:M,grammar:T,code:E};function I(B){P.highlightedCode=B,r.hooks.run("before-insert",P),P.element.innerHTML=P.highlightedCode,r.hooks.run("after-highlight",P),r.hooks.run("complete",P),$&&$.call(P.element)}if(r.hooks.run("before-sanity-check",P),O=P.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!P.code){r.hooks.run("complete",P),$&&$.call(P.element);return}if(r.hooks.run("before-highlight",P),!P.grammar){I(r.util.encode(P.code));return}if(S&&i.Worker){var N=new Worker(r.filename);N.onmessage=function(B){I(B.data)},N.postMessage(JSON.stringify({language:P.language,code:P.code,immediateClose:!0}))}else I(r.highlight(P.code,P.grammar,P.language))},highlight:function(C,S,$){var M={code:C,grammar:S,language:$};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(C,S){var $=S.rest;if($){for(var M in $)S[M]=$[M];delete S.rest}var T=new c;return d(T,T.head,C),f(C,T,S,T.head,0),g(T)},hooks:{all:{},add:function
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(P+1))}y.textContent=T,t.highlightElement(y)},function(T){b.setAttribute(r,f),y.textContent=T})}}),t.plugins.fileHighlight={highlight:function(b){for(var y=(b||document).querySelectorAll(c),C=0,S;S=y[C++];)t.highlightElement(S)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(j_);const Ys=j_.exports;var Xw={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(l,o){for(var r in o)o.hasOwnProperty(r)&&(l[r]=o[r]);return l};function t(l){this.defaults=e({},l)}function i(l){return l.replace(/-(\w)/g,function(o,r){return r.toUpperCase()})}function s(l){for(var o=0,r=0;r<l.length;++r)l.charCodeAt(r)==" ".charCodeAt(0)&&(o+=3);return l.length+o}t.prototype={setDefaults:function(l){this.defaults=e(this.defaults,l)},normalize:function(l,o){o=e(this.defaults,o);for(var r in o){var a=i(r);r!=="normalize"&&a!=="setDefaults"&&o[r]&&this[a]&&(l=this[a].call(this,l,o[r]))}return l},leftTrim:function(l){return l.replace(/^\s+/,"")},rightTrim:function(l){return l.replace(/\s+$/,"")},tabsToSpaces:function(l,o){return o=o|0||4,l.replace(/\t/g,new Array(++o).join(" "))},spacesToTabs:function(l,o){return o=o|0||4,l.replace(RegExp(" {"+o+"}","g")," ")},removeTrailing:function(l){return l.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(l){return l.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(l){var o=l.match(/^[^\S\n\r]*(?=\S)/gm);return!o||!o[0].length||(o.sort(function(r,a){return r.length-a.length}),!o[0].length)?l:l.replace(RegExp("^"+o[0],"gm"),"")},indent:function(l,o){return l.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++o).join(" ")+"$&")},breakLines:function(l,o){o=o===!0?80:o|0||80;for(var r=l.split(`
`),a=0;a<r.length;++a)if(!(s(r[a])<=o)){for(var u=r[a].split(/(\s+)/g),f=0,c=0;c<u.length;++c){var d=s(u[c]);f+=d,f>o&&(u[c]=`
`+u[c],f=d)}r[a]=u.join("")}return r.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(l){var o=Prism.plugins.NormalizeWhitespace;if(!(l.settings&&l.settings["whitespace-normalization"]===!1)&&!!Prism.util.isActive(l.element,"whitespace-normalization",!0)){if((!l.element||!l.element.parentNode)&&l.code){l.code=o.normalize(l.code,l.settings);return}var r=l.element.parentNode;if(!(!l.code||!r||r.nodeName.toLowerCase()!=="pre")){for(var a=r.childNodes,u="",f="",c=!1,d=0;d<a.length;++d){var h=a[d];h==l.element?c=!0:h.nodeName==="#text"&&(c?f+=h.nodeValue:u+=h.nodeValue,r.removeChild(h),--d)}if(!l.element.children.length||!Prism.plugins.KeepMarkup)l.code=u+l.code+f,l.code=o.normalize(l.code,l.settings);else{var g=u+l.element.innerHTML+f;l.element.innerHTML=o.normalize(g,l.settings),l.code=l.element.textContent}}}})})()})(Xw);(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 Qw(n){let e,t,i;return{c(){e=_("div"),t=_("code"),p(t,"class","svelte-1ua9m3i"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-1ua9m3i")},m(s,l){w(s,e,l),m(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-1ua9m3i")&&p(e,"class",i)},i:le,o:le,d(s){s&&k(e)}}}function xw(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=Ys.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Ys.highlight(a,Ys.languages[l]||Ys.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 Ys<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class _n extends Ee{constructor(e){super(),Oe(this,e,xw,Qw,De,{class:0,content:2,language:3})}}const e$=n=>({}),rc=n=>({}),t$=n=>({}),ac=n=>({});function uc(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S=n[4]&&!n[2]&&fc(n);const $=n[18].header,M=wn($,n,n[17],ac);let T=n[4]&&n[2]&&cc(n);const O=n[18].default,E=wn(O,n,n[17],null),P=n[18].footer,I=wn(P,n,n[17],rc);return{c(){e=_("div"),t=_("div"),s=D(),l=_("div"),o=_("div"),S&&S.c(),r=D(),M&&M.c(),a=D(),T&&T.c(),u=D(),f=_("div"),E&&E.c(),c=D(),d=_("div"),I&&I.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",h="overlay-panel "+n[1]+" "+n[8]),n
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]))&&p(e,"for",l);const C={};y&16&&(C.id=b[4]),y&1&&(C.disabled=!W.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,C.value=b[0].exceptDomains,je(()=>a=!1)),r.$set(C)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function aS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[3](b)}let v={id:n[4]+".options.onlyDomains",disabled:!W.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new ds({props:v}),pe.push(()=>Fe(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=D(),s=_("i"),o=D(),V(r.$$.fragment),u=D(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]+".options.onlyDomains"),p(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=We(vt.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]+".options.onlyDomains"))&&p(e,"for",l);const C={};y&16&&(C.id=b[4]+".options.onlyDomains"),y&1&&(C.disabled=!W.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,C.value=b[0].onlyDomains,je(()=>a=!1)),r.$set(C)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function uS(n){let e,t,i,s,l,o,r;return i=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[rS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[aS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=D(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),j(i,t,null),m(e,s),m(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){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function fS(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 B_ extends Ee{constructor(e){super(),Oe(this,e,fS,uS,De,{key:1,options:0})}}function cS(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 B_({props:r}),pe.push(()=>Fe(e,"key",l)),pe.push(()=>Fe(e,"options",o)),{c(){V(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],je(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],je(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){L(e.$$.fragment,a),s=!1},d(a){q(e,a)}}}function dS(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 pS extends Ee{constructor(e){super(),Oe(this,e,dS,cS,De,{key:0,options:1})}}var $r=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ws={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/x
<span class='flatpickr-weekday'>
`+z.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function ge(){t.calendarContainer.classList.add("hasWeeks");var R=St("div","flatpickr-weekwrapper");R.appendChild(St("span","flatpickr-weekday",t.l10n.weekAbbreviation));var z=St("div","flatpickr-weeks");return R.appendChild(z),{weekWrapper:R,weekNumbers:z}}function _e(R,z){z===void 0&&(z=!0);var te=z?R:R-t.currentMonth;te<0&&t._hidePrevMonthArrow===!0||te>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=te,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Je("onYearChange"),U()),B(),Je("onMonthChange"),rt())}function x(R,z){if(R===void 0&&(R=!0),z===void 0&&(z=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,z===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var te=Tr(t.config),re=te.hours,Ae=te.minutes,se=te.seconds;h(re,Ae,se)}t.redraw(),R&&Je("onChange")}function ae(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Je("onClose")}function ke(){t.config!==void 0&&Je("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 z=t.calendarContainer.parentNode;if(z.lastChild&&z.removeChild(z.lastChild),z.parentNode){for(;z.firstChild;)z.parentNode.insertBefore(z.firstChild,z);z.parentNode.removeChild(z)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(te){try{delete t[te]}catch{}})}function H(R){return t.calendarContainer.contains(R)}function me(R){if(t.isOpen&&!t.config.inline){var z=En(R),te=H(z),re=z===t.input||z===t.altInput||t.element.contains(z)||R.path&&R.path.indexOf&&(~R.path.indexOf(t.input)||~R.path.indexOf(t.altInput)),Ae=!re&&!te&&!H(R.relatedTarget),se=!t.config.ignoredFocusElements.some(function(de){return de.contains(z)});Ae&&se&&(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 oe(R){if(!(!R||t.config.minDate&&R<t.config.minDate.getFullYear()||t.config.maxDate&&R>t.config.maxDate.getFullYear())){var z=R,te=t.currentYear!==z;t.currentYear=z||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),te&&(t.redraw(),Je("onYearChange"),U())}}function K(R,z){var te;z===void 0&&(z=!0);var re=t.parseDate(R,void 0,z);if(t.config.minDate&&re&&An(re,t.config.minDate,z!==void 0?z:!t.minDateHasTime)<0||t.config.maxDate&&re&&An(re,t.config.maxDate,z!==void 0?z:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0
Leave empty for no restriction.`,position:"top"})),$=!0)},p(E,P){(!S||P&1024&&l!==(l=E[10]))&&p(e,"for",l);const I={};P&1024&&(I.id=E[10]),!a&&P&1&&(a=!0,I.value=E[0].mimeTypes,je(()=>a=!1)),r.$set(I);const N={};P&2049&&(N.$$scope={dirty:P,ctx:E}),C.$set(N)},i(E){S||(A(r.$$.fragment,E),A(C.$$.fragment,E),S=!0)},o(E){L(r.$$.fragment,E),L(C.$$.fragment,E),S=!1},d(E){E&&k(e),E&&k(o),q(r,E),E&&k(u),E&&k(f),q(C),$=!1,M()}}}function qS(n){let e;return{c(){e=_("ul"),e.innerHTML=`<li><strong>WxH</strong>
(eg. 100x50) - crop to WxH viewbox (from center)</li>
<li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li>
<li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li>
<li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li>
<li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li>
<li><strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function VS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M;function T(E){n[9](E)}let O={id:n[10],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(O.value=n[0].thumbs),r=new ds({props:O}),pe.push(()=>Fe(r,"value",T)),C=new Mi({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[qS]},$$scope:{ctx:n}}}),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=D(),s=_("i"),o=D(),V(r.$$.fragment),u=D(),f=_("div"),c=_("span"),c.textContent="Use comma as separator.",d=D(),h=_("button"),g=_("span"),g.textContent="Supported formats",v=D(),b=_("i"),y=D(),V(C.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(b,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,P){w(E,e,P),m(e,t),m(e,i),m(e,s),w(E,o,P),j(r,E,P),w(E,u,P),w(E,f,P),m(f,c),m(f,d),m(f,h),m(h,g),m(h,v),m(h,b),m(h,y),j(C,h,null),S=!0,$||(M=We(vt.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"})),$=!0)},p(E,P){(!S||P&1024&&l!==(l=E[10]))&&p(e,"for",l);const I={};P&1024&&(I.id=E[10]),!a&&P&1&&(a=!0,I.value=E[0].thumbs,je(()=>a=!1)),r.$set(I);const N={};P&2048&&(N.$$scope={dirty:P,ctx:E}),C.$set(N)},i(E){S||(A(r.$$.fragment,E),A(C.$$.fragment,E),S=!0)},o(E){L(r.$$.fragment,E),L(C.$$.fragment,E),S=!1},d(E){E&&k(e),E&&k(o),q(r,E),E&&k(u),E&&k(f),q(C),$=!1,M()}}}function zS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return i=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[NS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[RS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[jS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),d=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[VS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=D(),l=_("div"),V(o.$$.fragment),r=D(),a=_("div"),V(u.$$.fragment),f=D(),c=_("div"),V(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(c,"class","col-sm-12"),p(e,"class","grid")},m(g,v){w(g,e,v),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),m(e,f),m(e,c),j(d,c,null),h=!0},p(g,[v]){const b={};v&2&&(b.name="schema."+g[1]+".options.maxSize"),v&3073&&(b.$$scope={dirty:v,ctx:g}),i.$set(b);const y={};v&2&&(y.name="schema."+g[1]+".options.maxSelect"),v&3073&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const C={};v&2&&(C.name="schema."+g[1]+".options.mimeTypes"),v&3073&&(C.$$scope={dirty:v,ctx:g}),u.$set(C);const S={};v&2&&(S.name="schema."+g[1]+".options.thumbs"),v&3073&&(S.$$scope={dirty:v,ctx:g}),d.$set(S)},i(g){h||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),h=!0)},o(g){L(i.$$.fragment,g),L(o.$$.fragment,g),L(u.$$.fragment,g),L(d.$$.fragment,g),h=!1},d(g){g&&k(e),q(i),q(o),q(u),q(d)}}}function BS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=Pt(this.value),t(0,s)}function o(){s.maxSelect=Pt(this.value),t(0,s)}function r(h){n.$$.not_equal(s.mimeTypes,h)&&(s.mimeTypes=h,t(0,s))}const a=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},u=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],s)},f=()=>{t(0,s.mimeTypes=["video/
form-field
required
`+(n[5]?"":"invalid")+`
`+(n[0].id&&n[0].system?"disabled":"")+`
`,name:"schema."+n[1]+".name",$$slots:{default:[i3,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}});const O=[h3,p3,d3,c3,f3,u3,a3,r3,o3,l3,s3],E=[];function P(B,U){return B[0].type==="text"?0:B[0].type==="number"?1:B[0].type==="bool"?2:B[0].type==="email"?3:B[0].type==="url"?4:B[0].type==="date"?5:B[0].type==="select"?6:B[0].type==="json"?7:B[0].type==="file"?8:B[0].type==="relation"?9:B[0].type==="user"?10:-1}~(f=P(n))&&(c=E[f]=O[f](n)),g=new Re({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[m3,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}});let I=n[0].type!=="file"&&Hc(n),N=!n[0].toDelete&&jc(n);return{c(){e=_("form"),t=_("div"),i=_("div"),V(s.$$.fragment),l=D(),o=_("div"),V(r.$$.fragment),a=D(),u=_("div"),c&&c.c(),d=D(),h=_("div"),V(g.$$.fragment),v=D(),b=_("div"),I&&I.c(),y=D(),N&&N.c(),C=D(),S=_("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(h,"class","col-sm-4 flex"),p(b,"class","col-sm-4 flex"),p(t,"class","grid"),p(S,"type","submit"),p(S,"class","hidden"),p(S,"tabindex","-1"),p(e,"class","field-form")},m(B,U){w(B,e,U),m(e,t),m(t,i),j(s,i,null),m(t,l),m(t,o),j(r,o,null),m(t,a),m(t,u),~f&&E[f].m(u,null),m(t,d),m(t,h),j(g,h,null),m(t,v),m(t,b),I&&I.m(b,null),m(t,y),N&&N.m(t,null),m(e,C),m(e,S),$=!0,M||(T=X(e,"submit",Yt(n[31])),M=!0)},p(B,U){const ee={};U[0]&1&&(ee.class="form-field required "+(B[0].id?"disabled":"")),U[0]&2&&(ee.name="schema."+B[1]+".type"),U[0]&1|U[1]&384&&(ee.$$scope={dirty:U,ctx:B}),s.$set(ee);const J={};U[0]&33&&(J.class=`
form-field
required
`+(B[5]?"":"invalid")+`
`+(B[0].id&&B[0].system?"disabled":"")+`
`),U[0]&2&&(J.name="schema."+B[1]+".name"),U[0]&33|U[1]&384&&(J.$$scope={dirty:U,ctx:B}),r.$set(J);let ie=f;f=P(B),f===ie?~f&&E[f].p(B,U):(c&&(Pe(),L(E[ie],1,1,()=>{E[ie]=null}),Le()),~f?(c=E[f],c?c.p(B,U):(c=E[f]=O[f](B),c.c()),A(c,1),c.m(u,null)):c=null);const Q={};U[0]&1|U[1]&384&&(Q.$$scope={dirty:U,ctx:B}),g.$set(Q),B[0].type!=="file"?I?(I.p(B,U),U[0]&1&&A(I,1)):(I=Hc(B),I.c(),A(I,1),I.m(b,null)):I&&(Pe(),L(I,1,1,()=>{I=null}),Le()),B[0].toDelete?N&&(Pe(),L(N,1,1,()=>{N=null}),Le()):N?(N.p(B,U),U[0]&1&&A(N,1)):(N=jc(B),N.c(),A(N,1),N.m(t,null))},i(B){$||(A(s.$$.fragment,B),A(r.$$.fragment,B),A(c),A(g.$$.fragment,B),A(I),A(N),$=!0)},o(B){L(s.$$.fragment,B),L(r.$$.fragment,B),L(c),L(g.$$.fragment,B),L(I),L(N),$=!1},d(B){B&&k(e),q(s),q(r),~f&&E[f].d(),q(g),I&&I.d(),N&&N.d(),M=!1,T()}}}function Vc(n){let e,t,i,s,l=n[0].system&&zc(),o=!n[0].id&&Bc(n),r=n[0].required&&Uc(),a=n[0].unique&&Wc();return{c(){e=_("div"),l&&l.c(),t=D(),o&&o.c(),i=D(),r&&r.c(),s=D(),a&&a.c(),p(e,"class","inline-flex")},m(u,f){w(u,e,f),l&&l.m(e,null),m(e,t),o&&o.m(e,null),m(e,i),r&&r.m(e,null),m(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=zc(),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=Bc(u),o.c(),o.m(e,i)),u[0].required?r||(r=Uc(),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=Wc(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function zc(n){let e;return{c(){e=_("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Bc(n){let e;return{c(){e=_("span"),e.textContent="New",p(e,"class","label"),ne(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){w(t,e,i)},p(t,i){i[0]&257&&ne(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&k(e)}}}function Uc(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Wc(n){let e;return{c(){e=_("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Yc(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=We(vt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=it(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=it(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function Kc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-secondary")},m(s,l){w(s,e,l),t||(i=X(e,"click",ti(n[15])),t=!0)},p:le,d(s){s&&k(e),t=!1,i()}}}function v3(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,h,g,v,b,y=!n[0].toDelete&&Vc(n),C=n[7]&&!n[0].system&&Yc(),S=n[0].toDelete&&Kc(n);return{c(){e=_("div"),t=_("span"),i=_("i"),l=D(),o=_("strong"),a=F(r),f=D(),y&&y.c(),c=D(),d=_("div"),h=D(),C&&C.c(),g=D(),S&&S.c(),v=Ke(),p(i,"class",s=Qa(W.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),ne(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m($,M){w($,e,M),m(e,t),m(t,i),m(e,l),m(e,o),m(o,a),w($,f,M),y&&y.m($,M),w($,c,M),w($,d,M),w($,h,M),C&&C.m($,M),w($,g,M),S&&S.m($,M),w($,v,M),b=!0},p($,M){(!b||M[0]&1&&s!==(s=Qa(W.getFieldTypeIcon($[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!b||M[0]&1)&&r!==(r=($[0].name||"-")+"")&&ue(a,r),(!b||M[0]&1&&u!==(u=$[0].name))&&p(o,"title",u),M[0]&1&&ne(o,"txt-strikethrough",$[0].toDelete),$[0].toDelete?y&&(y.d(1),y=null):y?y.p($,M):(y=Vc($),y.c(),y.m(c.parentNode,c)),$[7]&&!$[0].system?C?M[0]&129&&A(C,1):(C=Yc(),C.c(),A(C,1),C.m(g.parentNode,g)):C&&(Pe(),L(C,1,1,()=>{C=null}),Le()),$[0].toDelete?S?S.p($,M):(S=Kc($),S.c(),S.m(v.parentNode,v)):S&&(S.d(1),S=null)},i($){b||(A(C),b=!0)},o($){L(C),b=!1},d($){$&&k(e),$&&k(f),y&&y.d($),$&&k(c),$&&k(d),$&&k(h),C&&C.d($),$&&k(g),S&&S.d($),$&&k(v)}}}function y3(n){let e,t,i={single:!0,interactive:n[8],class:n[2]||n[0].toDel
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.user.*</code>`,S=D(),$=_("hr"),M=D(),T=_("p"),T.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",O=D(),E=_("div"),E.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",P=D(),I=_("hr"),N=D(),B=_("p"),B.innerHTML=`Example rule:
<br/>
<code>@request.user.id!=&quot;&quot; &amp;&amp; created&gt;&quot;2022-01-01 00:00:00&quot;</code>`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p(C,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(T,"class","m-b-0"),p(E,"class","inline-flex flex-gap-5"),p(I,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(Q,Y){w(Q,e,Y),m(e,t),m(t,i),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(o,d);for(let G=0;G<ie.length;G+=1)ie[G].m(o,null);m(i,h),m(i,g),m(i,v),m(i,b),m(i,y),m(i,C),m(i,S),m(i,$),m(i,M),m(i,T),m(i,O),m(i,E),m(i,P),m(i,I),m(i,N),m(i,B),ee=!0},p(Q,Y){if(Y&1){J=Q[0].schema;let G;for(G=0;G<J.length;G+=1){const ge=Xc(Q,J,G);ie[G]?ie[G].p(ge,Y):(ie[G]=xc(ge),ie[G].c(),ie[G].m(o,null))}for(;G<ie.length;G+=1)ie[G].d(1);ie.length=J.length}},i(Q){ee||(Q&&Tt(()=>{U||(U=it(e,nn,{duration:150},!0)),U.run(1)}),ee=!0)},o(Q){Q&&(U||(U=it(e,nn,{duration:150},!1)),U.run(0)),ee=!1},d(Q){Q&&k(e),Qt(ie,Q),Q&&U&&U.end()}}}function M3(n){let e,t=n[18].name+"",i;return{c(){e=_("code"),i=F(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[18].name+"")&&ue(i,t)},d(s){s&&k(e)}}}function T3(n){let e,t=n[18].name+"",i,s;return{c(){e=_("code"),i=F(t),s=F(".*")},m(l,o){w(l,e,o),m(e,i),m(e,s)},p(l,o){o&1&&t!==(t=l[18].name+"")&&ue(i,t)},d(l){l&&k(e)}}}function xc(n){let e;function t(l,o){return l[18].type==="relation"||l[18].type==="user"?T3:M3}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function D3(n){let e=[],t=new Map,i,s,l=Object.entries(n[6]);const o=r=>r[13];for(let r=0;r<l.length;r+=1){let a=Gc(n,l,r),u=o(a);t.set(u,e[r]=ed(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=Ke()},m(r,a){for(let u=0;u<e.length;u+=1)e[u].m(r,a);w(r,i,a),s=!0},p(r,a){a&131163&&(l=Object.entries(r[6]),Pe(),e=kt(e,a,o,1,r,l,t,i.parentNode,Zt,ed,i,Gc),Le())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(e[a]);s=!0}},o(r){for(let a=0;a<e.length;a+=1)L(e[a]);s=!1},d(r){for(let a=0;a<e.length;a+=1)e[a].d(r);r&&k(i)}}}function O3(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function E3(n){let e,t,i;function s(){return n[9](n[13])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[We(vt.call(null,e,"Lock and set to Admins only")),X(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ge(i)}}}function A3(n){let e,t,i;function s(){return n[8](n[13])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-unlock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[We(vt.call(null,e,"Unlock and set custom rule")),X(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ge(i)}}}function P3(n){let e;return{c(){e=F("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function L3(n){let e;return{c(){e=F("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function I3(n){let e,t=n[14]+"",i,s,l=Li(n[0][n[13]])?"Admins only":"Custom rule",o,r,a,u,f=n[13],c,d,h,g,v;const b=()=>n[10](u,f),y=()=>n[10](null,f);function C(E){n[11](E,n[13])}var S=n[4];function $(E){let P={id:E[17],baseCollection:E[0],disabled:Li(E[0][E[13]])};return E[0][E[13]]!==void 0&&(P.value=E[0][E[13]]),{props:P}}S&&(u=new S($(n)),b(),pe.push(()=>Fe(u,"value",C)));function M(E,P){return P&1&&(g=null),g==null&&(g=!!Li(E[0][E[13]])),g?L3:P3}let T=M(n,-1),O=T(n);return{c(){e=_("label"),i=F(t),s=F(" - "),o=F(l),a=D(),u&&V(u.$$.fragment),d=D(),h=_("div"),O.c(),p(e,"for",r=n[17]),p(h,"class","help-block")},m(E,P){w(E,e,P),m(e,i),m(e,s),m(e,o),w(E,a,P),u&&j(u,E,P),w(E,d,P),w(E,h,P),O.m(h,null),v=!0},p(E,P){n=E,(!v||P&1)&&l!==(l=Li(n[0][n[13]])?"Admins only":"Custom rule")&&ue(
<a href="https://pocketbase.io/docs/manage-collections#rules-filters-syntax" target="_blank" rel="noopener">PocketBase filter syntax and operators
2022-08-19 01:32:07 +08:00
</a>.`,s=D(),l=_("span"),r=F(o),a=D(),b&&b.c(),u=D(),c.c(),d=Ke(),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex"),p(e,"class","block m-b-base")},m($,M){w($,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),b&&b.m(e,null),w($,u,M),C[f].m($,M),w($,d,M),h=!0,g||(v=X(l,"click",n[7]),g=!0)},p($,[M]){(!h||M&4)&&o!==(o=$[2]?"Hide available fields":"Show available fields")&&ue(r,o),$[2]?b?(b.p($,M),M&4&&A(b,1)):(b=Qc($),b.c(),A(b,1),b.m(e,null)):b&&(Pe(),L(b,1,1,()=>{b=null}),Le());let T=f;f=S($),f===T?C[f].p($,M):(Pe(),L(C[T],1,1,()=>{C[T]=null}),Le(),c=C[f],c?c.p($,M):(c=C[f]=y[f]($),c.c()),A(c,1),c.m(d.parentNode,d))},i($){h||(A(b),A(c),h=!0)},o($){L(b),L(c),h=!1},d($){$&&k(e),b&&b.d(),$&&k(u),C[f].d($),$&&k(d),g=!1,v()}}}function Li(n){return n===null}function N3(n,e,t){let{collection:i=new cn}=e,s={},l=!1,o={},r,a=!1;const u={listRule:"List Action",viewRule:"View Action",createRule:"Create Action",updateRule:"Update Action",deleteRule:"Delete Action"};async function f(){t(5,a=!0);try{t(4,r=(await Ai(()=>import("./FilterAutocompleteInput.7854778d.js"),["FilterAutocompleteInput.7854778d.js","index.90bde420.js"],import.meta.url)).default)}catch(b){console.warn(b),t(4,r=null)}t(5,a=!1)}Jn(()=>{f()});const c=()=>t(2,l=!l),d=async b=>{var y;t(0,i[b]=s[b]||"",i),await si(),(y=o[b])==null||y.focus()},h=b=>{t(1,s[b]=i[b],s),t(0,i[b]=null,i)};function g(b,y){pe[b?"unshift":"push"](()=>{o[y]=b,t(3,o)})}function v(b,y){n.$$.not_equal(i[y],b)&&(i[y]=b,t(0,i))}return n.$$set=b=>{"collection"in b&&t(0,i=b.collection)},[i,s,l,o,r,a,u,c,d,h,g,v]}class R3 extends Ee{constructor(e){super(),Oe(this,e,N3,F3,De,{collection:0})}}function td(n,e,t){const i=n.slice();return i[14]=e[t],i}function nd(n,e,t){const i=n.slice();return i[14]=e[t],i}function id(n){let e;return{c(){e=_("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function sd(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=_("li"),t=_("div"),i=F(`Renamed collection
2022-08-19 01:28:20 +08:00
`),s=_("strong"),o=F(l),r=D(),a=_("i"),u=D(),f=_("strong"),d=F(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,g){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&2&&l!==(l=h[1].originalName+"")&&ue(o,l),g&2&&c!==(c=h[1].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function ld(n){let e,t,i,s,l=n[14].originalName+"",o,r,a,u,f,c=n[14].name+"",d;return{c(){e=_("li"),t=_("div"),i=F(`Renamed field
`),s=_("strong"),o=F(l),r=D(),a=_("i"),u=D(),f=_("strong"),d=F(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,g){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&16&&l!==(l=h[14].originalName+"")&&ue(o,l),g&16&&c!==(c=h[14].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function od(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=_("li"),t=F("Removed field "),i=_("span"),l=F(s),o=D(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(r,a){w(r,e,a),m(e,t),m(e,i),m(i,l),m(e,o)},p(r,a){a&8&&s!==(s=r[14].name+"")&&ue(l,s)},d(r){r&&k(e)}}}function H3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[3].length&&id(),g=n[5]&&sd(n),v=n[4],b=[];for(let S=0;S<v.length;S+=1)b[S]=ld(nd(n,v,S));let y=n[3],C=[];for(let S=0;S<y.length;S+=1)C[S]=od(td(n,y,S));return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=_("div"),l=_("p"),l.textContent=`If any of the following changes is part of another collection rule or filter, you'll have to
update it manually!`,o=D(),h&&h.c(),r=D(),a=_("h6"),a.textContent="Changes:",u=D(),f=_("ul"),g&&g.c(),c=D();for(let S=0;S<b.length;S+=1)b[S].c();d=D();for(let S=0;S<C.length;S+=1)C[S].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(S,$){w(S,e,$),m(e,t),m(e,i),m(e,s),m(s,l),m(s,o),h&&h.m(s,null),w(S,r,$),w(S,a,$),w(S,u,$),w(S,f,$),g&&g.m(f,null),m(f,c);for(let M=0;M<b.length;M+=1)b[M].m(f,null);m(f,d);for(let M=0;M<C.length;M+=1)C[M].m(f,null)},p(S,$){if(S[3].length?h||(h=id(),h.c(),h.m(s,null)):h&&(h.d(1),h=null),S[5]?g?g.p(S,$):(g=sd(S),g.c(),g.m(f,c)):g&&(g.d(1),g=null),$&16){v=S[4];let M;for(M=0;M<v.length;M+=1){const T=nd(S,v,M);b[M]?b[M].p(T,$):(b[M]=ld(T),b[M].c(),b[M].m(f,d))}for(;M<b.length;M+=1)b[M].d(1);b.length=v.length}if($&8){y=S[3];let M;for(M=0;M<y.length;M+=1){const T=td(S,y,M);C[M]?C[M].p(T,$):(C[M]=od(T),C[M].c(),C[M].m(f,null))}for(;M<C.length;M+=1)C[M].d(1);C.length=y.length}},d(S){S&&k(e),h&&h.d(),S&&k(r),S&&k(a),S&&k(u),S&&k(f),g&&g.d(),Qt(b,S),Qt(C,S)}}}function j3(n){let e;return{c(){e=_("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function q3(n){let e,t,i,s,l;return{c(){e=_("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=_("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-secondary"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[X(e,"click",n[8]),X(i,"click",n[9])],s=!0)},p:le,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Ge(l)}}}function V3(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[q3],header:[j3],default:[H3]},$$scope:{ctx:n}};return e=new mi({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){V(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){L(e.$$.fragment,s),t=!1},d(s){n[10](null),q(e,s)}}}function z3(n,e,t){let i,s,l;const o=rn();let r,a;async function u(y){t(1,a=y),await si(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),h=()=>c();function g(y){pe[y?"unshift":"push"](()=>{r=y,t(2,r)})}function v(y){st.call(this,n,y)}function b(y){st.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=(a==null?void 0:a.originalName)!=(a==null?void 0:a.name)),n.$$.dirty&2&&t(4,s=(a==null?void 0:a.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(y=>y.id&&y.toDelete))||[])},[f,a,r,l,s,i,c,u,d,h,g,v,b]}class B3 extends Ee{constructor(e){super(),Oe(this,e,z3,V3,De,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function rd(n){let e,t,i,s;function l(r){n[26](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new R3({props:o}),pe.push(()=>Fe(t,"collection",l)),{c(){e=_("div"),V(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),j(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],je(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&k(e),q(t)}}}function U3(n){let e,t,i,s,l,o;function r(f){n[25](f)}let a={};n[2]!==void 0&&(a.collection=n[2]),i=new C3({props:a}),pe.push(()=>Fe(i,"collection",r));let u=n[9]===gl&&rd(n);return{c(){e=_("div"),t=_("div"),V(i.$$.fragment),l=D(),u&&u.c(),p(t,"class","tab-item"),ne(t,"active",n[9]===os),p(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),m(e,t),j(i,t,null),m(e,l),u&&u.m(e,null),o=!0},p(f,c){const d={};!s&&c[0]&4&&(s=!0,d.collection=f[2],je(()=>s=!1)),i.$set(d),c[0]&512&&ne(t,"active",f[9]===os),f[9]===gl?u?(u.p(f,c),c[0]&512&&A(u,1)):(u=rd(f),u.c(),A(u,1),u.m(e,null)):u&&(Pe(),L(u,1,1,()=>{u=null}),Le())},i(f){o||(A(i.$$.fragment,f),A(u),o=!0)},o(f){L(i.$$.fragment,f),L(u),o=!1},d(f){f&&k(e),q(i),u&&u.d()}}}function ad(n){let e,t,i,s,l,o,r;return o=new Mi({props:{class:"dropdown dropdown-right m
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[20]),t=!0)},p:le,d(s){s&&k(e),t=!1,i()}}}function ud(n){let e;return{c(){e=_("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Y3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[2].system&&ud();return{c(){e=_("label"),t=F("Name"),s=D(),l=_("input"),u=D(),h&&h.c(),f=Ke(),p(e,"for",i=n[38]),p(l,"type","text"),p(l,"id",o=n[38]),l.required=!0,l.disabled=n[11],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",'eg. "posts"'),l.value=a=n[2].name},m(g,v){w(g,e,v),m(e,t),w(g,s,v),w(g,l,v),w(g,u,v),h&&h.m(g,v),w(g,f,v),n[2].isNew&&l.focus(),c||(d=X(l,"input",n[21]),c=!0)},p(g,v){v[1]&128&&i!==(i=g[38])&&p(e,"for",i),v[1]&128&&o!==(o=g[38])&&p(l,"id",o),v[0]&2048&&(l.disabled=g[11]),v[0]&4&&r!==(r=g[2].isNew)&&(l.autofocus=r),v[0]&4&&a!==(a=g[2].name)&&l.value!==a&&(l.value=a),g[2].system?h||(h=ud(),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},d(g){g&&k(e),g&&k(s),g&&k(l),g&&k(u),h&&h.d(g),g&&k(f),c=!1,d()}}}function fd(n){let e,t,i,s,l,o;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=We(t=vt.call(null,e,n[12])),l=!0)},p(r,a){t&&Kn(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&Tt(()=>{i||(i=it(e,Tn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=it(e,Tn,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function cd(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=We(vt.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Tt(()=>{t||(t=it(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=it(e,Tn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function K3(n){var N,B,U,ee,J,ie;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,h,g,v=!W.isEmpty((N=n[4])==null?void 0:N.schema),b,y,C,S,$=!W.isEmpty((B=n[4])==null?void 0:B.listRule)||!W.isEmpty((U=n[4])==null?void 0:U.viewRule)||!W.isEmpty((ee=n[4])==null?void 0:ee.createRule)||!W.isEmpty((J=n[4])==null?void 0:J.updateRule)||!W.isEmpty((ie=n[4])==null?void 0:ie.deleteRule),M,T,O,E=!n[2].isNew&&!n[2].system&&ad(n);r=new Re({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[Y3,({uniqueId:Q})=>({38:Q}),({uniqueId:Q})=>[0,Q?128:0]]},$$scope:{ctx:n}}});let P=v&&fd(n),I=$&&cd();return{c(){e=_("h4"),i=F(t),s=D(),E&&E.c(),l=D(),o=_("form"),V(r.$$.fragment),a=D(),u=_("input"),f=D(),c=_("div"),d=_("button"),h=_("span"),h.textContent="Fields",g=D(),P&&P.c(),b=D(),y=_("button"),C=_("span"),C.textContent="API Rules",S=D(),I&&I.c(),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ne(d,"active",n[9]===os),p(C,"class","txt"),p(y,"type","button"),p(y,"class","tab-item"),ne(y,"active",n[9]===gl),p(c,"class","tabs-header stretched")},m(Q,Y){w(Q,e,Y),m(e,i),w(Q,s,Y),E&&E.m(Q,Y),w(Q,l,Y),w(Q,o,Y),j(r,o,null),m(o,a),m(o,u),w(Q,f,Y),w(Q,c,Y),m(c,d),m(d,h),m(d,g),P&&P.m(d,null),m(c,b),m(c,y),m(y,C),m(y,S),I&&I.m(y,null),M=!0,T||(O=[X(o,"submit",Yt(n[22])),X(d,"click",n[23]),X(y,"click",n[24])],T=!0)},p(Q,Y){var ge,_e,x,ae,ke,H;(!M||Y[0]&4)&&t!==(t=Q[2].isNew?"New collection":"Edit collection")&&ue(i,t),!Q[2].isNew&&!Q[2].system?E?(E.p(Q,Y),Y[0]&4&&A(E,1)):(E=ad(Q),E.c(),A(E,1),E.m(l.parentNode,l)):E&&(Pe(),L(E,1,1,()=>{E=null}),Le());const G={};Y[0]&2048&&(G.class="form-field required m-b-0 "+(Q[11]?"disabled":"")),Y[0]&2052|Y[1]&384&&(G.$$scope={dirty:Y,ctx:Q}),r.$set(G),Y[0]&16&&(v=!W.isEmpty((ge=Q[4])==null?void 0:ge.schema)),v?P?(P.p(Q,Y),Y[0]&16&&A(P,1)):(P=fd(Q),P.c(),A(P,1),P.m(d,null)):P&&(Pe(),L(P,1,1,()=>{P=null}),Le()),Y[0]&512&&ne(d,"active",Q[9]===os),Y[0]&16&&($=!W.isEmpty((_e=Q[4])==null?void 0:_e.listRule)||!W.isEmpty((x=Q[4])==null?void 0:x.viewRule)||!W.isEmpty((ae=Q[4])==null?void 0:ae.createRule)|
<span class="txt">New collection</span>`,p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){w(l,e,o),m(e,t),i||(s=X(t,"click",n[12]),i=!0)},p:le,d(l){l&&k(e),i=!1,s()}}}function x3(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],h=new Map,g,v,b,y,C,S,$=n[3];const M=P=>P[14].id;for(let P=0;P<$.length;P+=1){let I=dd(n,$,P),N=M(I);h.set(N,d[P]=md(N,I))}let T=null;$.length||(T=pd(n));let O=!n[6]&&gd(n),E={};return b=new Za({props:E}),n[13](b),{c(){e=_("aside"),t=_("header"),i=_("div"),s=_("div"),l=_("button"),l.innerHTML='<i class="ri-close-line"></i>',o=D(),r=_("input"),a=D(),u=_("hr"),f=D(),c=_("div");for(let P=0;P<d.length;P+=1)d[P].c();T&&T.c(),g=D(),O&&O.c(),v=D(),V(b.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-secondary btn-circle btn-clear"),ne(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"),ne(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),p(e,"class","page-sidebar collection-sidebar")},m(P,I){w(P,e,I),m(e,t),m(t,i),m(i,s),m(s,l),m(i,o),m(i,r),Te(r,n[0]),m(e,a),m(e,u),m(e,f),m(e,c);for(let N=0;N<d.length;N+=1)d[N].m(c,null);T&&T.m(c,null),m(e,g),O&&O.m(e,null),w(P,v,I),j(b,P,I),y=!0,C||(S=[X(l,"click",n[9]),X(r,"input",n[10])],C=!0)},p(P,[I]){I&16&&ne(l,"hidden",!P[4]),I&1&&r.value!==P[0]&&Te(r,P[0]),I&16&&ne(i,"active",P[4]),I&170&&($=P[3],d=kt(d,I,M,1,P,$,h,c,Mn,md,null,dd),!$.length&&T?T.p(P,I):$.length?T&&(T.d(1),T=null):(T=pd(P),T.c(),T.m(c,null))),P[6]?O&&(O.d(1),O=null):O?O.p(P,I):(O=gd(P),O.c(),O.m(e,null));const N={};b.$set(N)},i(P){y||(A(b.$$.fragment,P),y=!0)},o(P){L(b.$$.fragment,P),y=!1},d(P){P&&k(e);for(let I=0;I<d.length;I+=1)d[I].d();T&&T.d(),O&&O.d(),P&&k(v),n[13](null),q(b,P),C=!1,Ge(S)}}}function eC(n,e,t){let i,s,l,o,r,a;at(n,ci,y=>t(5,o=y)),at(n,Os,y=>t(8,r=y)),at(n,rs,y=>t(6,a=y));let u,f="";function c(y){tn(ci,o=y,o)}const d=()=>t(0,f="");function h(){f=this.value,t(0,f)}const g=y=>c(y),v=()=>u==null?void 0:u.show();function b(y){pe[y?"unshift":"push"](()=>{u=y,t(2,u)})}return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=f.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=f!==""),n.$$.dirty&259&&t(3,l=r.filter(y=>y.name!="profiles"&&(y.id==f||y.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[f,i,u,l,s,o,a,c,r,d,h,g,v,b]}class tC extends Ee{constructor(e){super(),Oe(this,e,eC,x3,De,{})}}function nC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,T,O,E,P,I,N,B,U,ee,J,ie,Q,Y,G,ge,_e,x,ae,ke,H,me,oe,K,be,He,Ue,Z,ve,ce,Se,Ze;return{c(){e=_("p"),e.innerHTML=`The syntax basically follows the format
<code><span class="txt-success">OPERAND</span>
<span class="txt-danger">OPERATOR</span>
<span class="txt-success">OPERAND</span></code>, where:`,t=D(),i=_("ul"),s=_("li"),s.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single or double
quoted), number, null, true, false`,l=D(),o=_("li"),r=_("code"),r.textContent="OPERATOR",a=F(` - is one of:
`),u=_("br"),f=D(),c=_("ul"),d=_("li"),h=_("code"),h.textContent="=",g=D(),v=_("span"),v.textContent="Equal",b=D(),y=_("li"),C=_("code"),C.textContent="!=",S=D(),$=_("span"),$.textContent="NOT equal",M=D(),T=_("li"),O=_("code"),O.textContent=">",E=D(),P=_("span"),P.textContent="Greater than",I=D(),N=_("li"),B=_("code"),B.textContent=">=",U=D(),ee=_("span"),ee.textContent="Greater than or equal",J=D(),ie=_("li"),Q=_("code"),Q.textContent="<",Y=D(),G=_("span"),G.textContent="Less than or equal",ge=D(),_e=_("li"),x=_("code"),x.textContent="<=",ae=D(),ke=_("span"),ke.textContent="Less than or equal",H=D(),me=_("li"),oe=_("code"),oe.textContent="~",K=D(),be=_("span"),be.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
match)`,He=D(),Ue=_("li"),Z=_("code"),Z.textContent="!~",ve=D(),ce=_("span"),ce.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,Se=D(),Ze=_("p"),Ze.innerHTML=`To group and combine several expressions you could use brackets
<code>(...)</code>, <code>&amp;&amp;</code> (AND) and <code>||</code> (OR) tokens.`,p(r,"class","txt-danger"),p(h,"class","filter-op svelte-1w7s5nw"),p(v,"class","txt-hint"),p(C,"class","filter-op svelte-1w7s5nw"),p($,"class","txt-hint"),p(O,"class","filter-op svelte-1w7s5nw"),p(P,"class","txt-hint"),p(B,"class","filter-op svelte-1w7s5nw"),p(ee,"class","txt-hint"),p(Q,"class","filter-op svelte-1w7s5nw"),p(G,"class","txt-hint"),p(x,"class","filter-op svelte-1w7s5nw"),p(ke,"class","txt-hint"),p(oe,"class","filter-op svelte-1w7s5nw"),p(be,"class","txt-hint"),p(Z,"class","filter-op svelte-1w7s5nw"),p(ce,"class","txt-hint")},m(et,Ye){w(et,e,Ye),w(et,t,Ye),w(et,i,Ye),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(c,d),m(d,h),m(d,g),m(d,v),m(c,b),m(c,y),m(y,C),m(y,S),m(y,$),m(c,M),m(c,T),m(T,O),m(T,E),m(T,P),m(c,I),m(c,N),m(N,B),m(N,U),m(N,ee),m(c,J),m(c,ie),m(ie,Q),m(ie,Y),m(ie,G),m(c,ge),m(c,_e),m(_e,x),m(_e,ae),m(_e,ke),m(c,H),m(c,me),m(me,oe),m(me,K),m(me,be),m(c,He),m(c,Ue),m(Ue,Z),m(Ue,ve),m(Ue,ce),w(et,Se,Ye),w(et,Ze,Ye)},p:le,i:le,o:le,d(et){et&&k(e),et&&k(t),et&&k(i),et&&k(Se),et&&k(Ze)}}}class iC extends Ee{constructor(e){super(),Oe(this,e,null,nC,De,{})}}function _d(n,e,t){const i=n.slice();return i[5]=e[t],i}function bd(n,e,t){const i=n.slice();return i[5]=e[t],i}function vd(n,e){let t,i,s=e[5].title+"",l,o,r,a;function u(){return e[4](e[5])}return{key:n,first:null,c(){t=_("button"),i=_("div"),l=F(s),o=D(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),ne(t,"active",e[0]===e[5].language),this.first=t},m(f,c){w(f,t,c),m(t,i),m(i,l),m(t,o),r||(a=X(t,"click",u),r=!0)},p(f,c){e=f,c&2&&s!==(s=e[5].title+"")&&ue(l,s),c&3&&ne(t,"active",e[0]===e[5].language)},d(f){f&&k(t),r=!1,a()}}}function yd(n,e){let t,i,s,l;return i=new _n({props:{language:e[5].language,content:e[5].content}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=D(),p(t,"class","tab-item svelte-1maocj6"),ne(t,"active",e[0]===e[5].language),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&2&&(a.language=e[5].language),r&2&&(a.content=e[5].content),i.$set(a),r&3&&ne(t,"active",e[0]===e[5].language)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function sC(n){let e,t,i=[],s=new Map,l,o,r=[],a=new Map,u,f=n[1];const c=g=>g[5].language;for(let g=0;g<f.length;g+=1){let v=bd(n,f,g),b=c(v);s.set(b,i[g]=vd(b,v))}let d=n[1];const h=g=>g[5].language;for(let g=0;g<d.length;g+=1){let v=_d(n,d,g),b=h(v);a.set(b,r[g]=yd(b,v))}return{c(){e=_("div"),t=_("div");for(let g=0;g<i.length;g+=1)i[g].c();l=D(),o=_("div");for(let g=0;g<r.length;g+=1)r[g].c();p(t,"class","tabs-header compact left"),p(o,"class","tabs-content"),p(e,"class","tabs sdk-tabs m-b-lg svelte-1maocj6")},m(g,v){w(g,e,v),m(e,t);for(let b=0;b<i.length;b+=1)i[b].m(t,null);m(e,l),m(e,o);for(let b=0;b<r.length;b+=1)r[b].m(o,null);u=!0},p(g,[v]){v&3&&(f=g[1],i=kt(i,v,c,1,g,f,s,t,Mn,vd,null,bd)),v&3&&(d=g[1],Pe(),r=kt(r,v,h,1,g,d,a,o,Zt,yd,null,_d),Le())},i(g){if(!u){for(let v=0;v<d.length;v+=1)A(r[v]);u=!0}},o(g){for(let v=0;v<r.length;v+=1)L(r[v]);u=!1},d(g){g&&k(e);for(let v=0;v<i.length;v+=1)i[v].d();for(let v=0;v<r.length;v+=1)r[v].d()}}}const kd="pb_sdk_preference";function lC(n,e,t){let i,{js:s=""}=e,{dart:l=""}=e,o=localStorage.getItem(kd)||"javascript";const r=a=>t(0,o=a.language);return n.$$set=a=>{"js"in a&&t(2,s=a.js),"dart"in a&&t(3,l=a.dart)},n.$$.update=()=>{n.$$.dirty&1&&o&&localStorage.setItem(kd,o),n.$$.dirty&12&&t(1,i=[{title:"JavaScript",language:"javascript",content:s},{title:"Dart",language:"dart",content:l}])},[o,i,s,l,r]}class Is extends Ee{constructor(e){super(),Oe(this,e,lC,sC,De,{js:2,dart:3})}}function wd(n,e,t){const i=n.slice();return i[6]=e[t],i}function $d(n,e,t){const i=n.slice();return i[6]=e[t],i}function Sd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Cd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
// fetch a paginated records list
const resultList = await client.records.getList('${(gi=n[0])==null?void 0:gi.name}', 1, 50, {
filter: 'created >= "2022-01-01 00:00:00"',
});
// alternatively you can also fetch all records at once via getFullList:
const records = await client.records.getFullList('${(Dl=n[0])==null?void 0:Dl.name}', 200 /* batch size */, {
sort: '-created',
});
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
// fetch a paginated records list
final result = await client.records.getList(
'${(ps=n[0])==null?void 0:ps.name}',
page: 1,
perPage: 50,
filter: 'created >= "2022-01-01 00:00:00"',
);
// alternatively you can also fetch all records at once via getFullList:
final records = await client.records.getFullList('${(Ol=n[0])==null?void 0:Ol.name}', batch: 200, sort: '-created');
`}}),Z=new _n({props:{content:`
// DESC by created and ASC by id
?sort=-created,id
`}}),ze=new _n({props:{content:`
?filter=(id='abc' && created>'2022-01-01')
`}}),nt=new iC({}),gt=new _n({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let mt=n[4];const an=qe=>qe[6].code;for(let qe=0;qe<mt.length;qe+=1){let xe=$d(n,mt,qe),Gt=an(xe);Ae.set(Gt,re[qe]=Cd(Gt,xe))}let jt=n[4];const Ti=qe=>qe[6].code;for(let qe=0;qe<jt.length;qe+=1){let xe=wd(n,jt,qe),Gt=Ti(xe);fe.set(Gt,we[qe]=Md(Gt,xe))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=D(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records"),c=D(),Ie&&Ie.c(),d=D(),h=_("div"),g=_("p"),v=F("Fetch a paginated "),b=_("strong"),C=F(y),S=F(" records list."),$=D(),M=_("div"),M.textContent="Client SDKs example",T=D(),V(O.$$.fragment),E=D(),P=_("div"),P.textContent="Query parameters",I=D(),N=_("table"),B=_("thead"),B.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,U=D(),ee=_("tbody"),J=_("tr"),J.innerHTML=`<td>page</td>
<td><span class="label">Number</span></td>
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,ie=D(),Q=_("tr"),Q.innerHTML=`<td>perPage</td>
<td><span class="label">Number</span></td>
<td>Specify the max returned records per page (default to 30).</td>`,Y=D(),G=_("tr"),ge=_("td"),ge.textContent="sort",_e=D(),x=_("td"),x.innerHTML='<span class="label">String</span>',ae=D(),ke=_("td"),H=F("Specify the records order attribute(s). "),me=_("br"),oe=F(`
Add `),K=_("code"),K.textContent="-",be=F(" / "),He=_("code"),He.textContent="+",Ue=F(` (default) in front of the attribute for DESC / ASC order.
Ex.:
`),V(Z.$$.fragment),ve=D(),ce=_("tr"),Se=_("td"),Se.textContent="filter",Ze=D(),et=_("td"),et.innerHTML='<span class="label">String</span>',Ye=D(),tt=_("td"),Me=F(`Filter the returned records. Ex.:
`),V(ze.$$.fragment),Xe=D(),V(nt.$$.fragment),ft=D(),ye=_("tr"),Ne=_("td"),Ne.textContent="expand",dt=D(),Dt=_("td"),Dt.innerHTML='<span class="label">String</span>',pt=D(),lt=_("td"),Lt=F(`Auto expand record relations. Ex.:
`),V(gt.$$.fragment),Nt=F(`
Supports up to 6-levels depth nested relations expansion. `),Ot=_("br"),Je=F(`
The expanded relations will be appended to each individual record under the
`),Ce=_("code"),Ce.textContent="@expand",Be=F(" property (eg. "),ot=_("code"),ot.textContent='"@expand": {"rel1": {...}, ...}',rt=F(`). Only the
relations that the user has permissions to `),Ht=_("strong"),Ht.textContent="view",Ct=F(" will be expanded."),ct=D(),xt=_("div"),xt.textContent="Responses",R=D(),z=_("div"),te=_("div");for(let qe=0;qe<re.length;qe+=1)re[qe].c();se=D(),de=_("div");for(let qe=0;qe<we.length;qe+=1)we[qe].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(h,"class","content m-b-base"),p(M,"class","section-title"),p(P,"class","section-title"),p(N,"class","table-compact table-border m-b-lg"),p(xt,"class","section-title"),p(te,"class","tabs-header compact left"),p(de,"class","tabs-content"),p(z,"class","tabs")},m(qe,xe){w(qe,e,xe),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),Ie&&Ie.m(e,null),w(qe,d,xe),w(qe,h,xe),m(h,g),m(g,v),m(g,b),m(b,C),m(g,S),w(qe,$,xe),w(qe,M,xe),w(qe,T,xe),j(O,qe,xe),w(qe,E,xe),w(qe,P,xe),w(qe,I,xe),w(qe,N,xe),m(N,B),m(N,U),m(N,ee),m(ee,J),m(ee,ie),m(ee,Q),m(ee,Y),m(ee,G),m(G,ge),m(G,_e),m(G,x),m(G,ae),m(G,ke),m(ke,H),m(ke,me),m(ke,oe),m(ke,K),m(ke,be),m(ke,He),m(ke,Ue),j(Z,ke,null),m(ee,ve),m(ee,ce),m(ce,Se),m(ce,Ze),m(ce,et),m(ce,Ye),m(ce,tt),m(tt,Me),j(ze,tt,null),m(tt,Xe),j(nt,tt,null),m(ee,ft),m(ee,ye),m(ye,Ne),m(ye,dt),m(ye,Dt),m(ye,pt),m(ye,lt),m(lt,Lt),j(gt,lt,null),m(lt,Nt),m(lt,Ot),m(lt,Je),m(lt,Ce),m(lt,Be),m(lt,ot),m(lt,rt),m(lt,Ht),m(lt,Ct),w(qe,ct,xe),w(qe,xt,xe),w(qe,R,xe),w(qe,z,xe),m(z,te);for(let Gt=0;Gt<re.length;Gt+=1)re[Gt].m(te,null);m(z,se),m(z,de);for(let Gt=0;Gt<we.length;Gt+=1)we[Gt].m(de,null);he=!0},p(qe,[xe]){var El,Al,Pl,Ll;(!he||xe&1)&&a!==(a=qe[0].name+"")&&ue(u,a),qe[1]?Ie||(Ie=Sd(),Ie.c(),Ie.m(e,null)):Ie&&(Ie.d(1),Ie=null),(!he||xe&1)&&y!==(y=qe[0].name+"")&&ue(C,y);const Gt={};xe&9&&(Gt.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${qe[3]}');
...
// fetch a paginated records list
const resultList = await client.records.getList('${(El=qe[0])==null?void 0:El.name}', 1, 50, {
filter: 'created >= "2022-01-01 00:00:00"',
});
// alternatively you can also fetch all records at once via getFullList:
const records = await client.records.getFullList('${(Al=qe[0])==null?void 0:Al.name}', 200 /* batch size */, {
sort: '-created',
});
`),xe&9&&(Gt.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${qe[3]}');
...
// fetch a paginated records list
final result = await client.records.getList(
'${(Pl=qe[0])==null?void 0:Pl.name}',
page: 1,
perPage: 50,
filter: 'created >= "2022-01-01 00:00:00"',
);
// alternatively you can also fetch all records at once via getFullList:
final records = await client.records.getFullList('${(Ll=qe[0])==null?void 0:Ll.name}', batch: 200, sort: '-created');
`),O.$set(Gt),xe&20&&(mt=qe[4],re=kt(re,xe,an,1,qe,mt,Ae,te,Mn,Cd,null,$d)),xe&20&&(jt=qe[4],Pe(),we=kt(we,xe,Ti,1,qe,jt,fe,de,Zt,Md,null,wd),Le())},i(qe){if(!he){A(O.$$.fragment,qe),A(Z.$$.fragment,qe),A(ze.$$.fragment,qe),A(nt.$$.fragment,qe),A(gt.$$.fragment,qe);for(let xe=0;xe<jt.length;xe+=1)A(we[xe]);he=!0}},o(qe){L(O.$$.fragment,qe),L(Z.$$.fragment,qe),L(ze.$$.fragment,qe),L(nt.$$.fragment,qe),L(gt.$$.fragment,qe);for(let xe=0;xe<we.length;xe+=1)L(we[xe]);he=!1},d(qe){qe&&k(e),Ie&&Ie.d(),qe&&k(d),qe&&k(h),qe&&k($),qe&&k(M),qe&&k(T),q(O,qe),qe&&k(E),qe&&k(P),qe&&k(I),qe&&k(N),q(Z),q(ze),q(nt),q(gt),qe&&k(ct),qe&&k(xt),qe&&k(R),qe&&k(z);for(let xe=0;xe<re.length;xe+=1)re[xe].d();for(let xe=0;xe<we.length;xe+=1)we[xe].d()}}}function rC(n,e,t){let i,s,{collection:l=new cn}=e,o=200,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.listRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[W.dummyCollectionRecord(l),W.dummyCollectionRecord(l)]},null,2)}),r.push({code:400,body:`
{
"code": 400,
"message": "Something went wrong while processing your request. Invalid filter.",
"data": {}
}
`}),i&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},t(3,s=W.getApiExampleUrl($e.baseUrl)),[l,i,o,s,r,a]}class aC extends Ee{constructor(e){super(),Oe(this,e,rC,oC,De,{collection:0})}}function Td(n,e,t){const i=n.slice();return i[6]=e[t],i}function Dd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Od(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ed(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=D(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ne(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Ad(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=D(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&20&&ne(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function uC(n){var Ot,Je;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,C=n[0].name+"",S,$,M,T,O,E,P,I,N,B,U,ee,J,ie,Q,Y,G,ge,_e,x,ae,ke,H,me,oe,K,be,He,Ue,Z,ve,ce,Se,Ze,et,Ye,tt,Me,ze,Xe=[],nt=new Map,ft,ye,Ne=[],dt=new Map,Dt,pt=n[1]&&Od();E=new Is({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
const record = await client.records.getOne('${(Ot=n[0])==null?void 0:Ot.name}', 'RECORD_ID', {
expand: 'some_relation'
});
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
final record = await client.records.getOne('${(Je=n[0])==null?void 0:Je.name}', 'RECORD_ID', query: {
'expand': 'some_relation',
});
`}}),oe=new _n({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let lt=n[4];const Lt=Ce=>Ce[6].code;for(let Ce=0;Ce<lt.length;Ce+=1){let Be=Dd(n,lt,Ce),ot=Lt(Be);nt.set(ot,Xe[Ce]=Ed(ot,Be))}let gt=n[4];const Nt=Ce=>Ce[6].code;for(let Ce=0;Ce<gt.length;Ce+=1){let Be=Td(n,gt,Ce),ot=Nt(Be);dt.set(ot,Ne[Ce]=Ad(ot,Be))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=D(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records/"),c=_("strong"),c.textContent=":id",d=D(),pt&&pt.c(),h=D(),g=_("div"),v=_("p"),b=F("Fetch a single "),y=_("strong"),S=F(C),$=F(" record."),M=D(),T=_("div"),T.textContent="Client SDKs example",O=D(),V(E.$$.fragment),P=D(),I=_("div"),I.textContent="Path Parameters",N=D(),B=_("table"),B.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to view.</td></tr></tbody>`,U=D(),ee=_("div"),ee.textContent="Query parameters",J=D(),ie=_("table"),Q=_("thead"),Q.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,Y=D(),G=_("tbody"),ge=_("tr"),_e=_("td"),_e.textContent="expand",x=D(),ae=_("td"),ae.innerHTML='<span class="label">String</span>',ke=D(),H=_("td"),me=F(`Auto expand record relations. Ex.:
`),V(oe.$$.fragment),K=F(`
Supports up to 6-levels depth nested relations expansion. `),be=_("br"),He=F(`
The expanded relations will be appended to the record under the
`),Ue=_("code"),Ue.textContent="@expand",Z=F(" property (eg. "),ve=_("code"),ve.textContent='"@expand": {"rel1": {...}, ...}',ce=F(`). Only the
relations that the user has permissions to `),Se=_("strong"),Se.textContent="view",Ze=F(" will be expanded."),et=D(),Ye=_("div"),Ye.textContent="Responses",tt=D(),Me=_("div"),ze=_("div");for(let Ce=0;Ce<Xe.length;Ce+=1)Xe[Ce].c();ft=D(),ye=_("div");for(let Ce=0;Ce<Ne.length;Ce+=1)Ne[Ce].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(g,"class","content m-b-base"),p(T,"class","section-title"),p(I,"class","section-title"),p(B,"class","table-compact table-border m-b-lg"),p(ee,"class","section-title"),p(ie,"class","table-compact table-border m-b-lg"),p(Ye,"class","section-title"),p(ze,"class","tabs-header compact left"),p(ye,"class","tabs-content"),p(Me,"class","tabs")},m(Ce,Be){w(Ce,e,Be),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),pt&&pt.m(e,null),w(Ce,h,Be),w(Ce,g,Be),m(g,v),m(v,b),m(v,y),m(y,S),m(v,$),w(Ce,M,Be),w(Ce,T,Be),w(Ce,O,Be),j(E,Ce,Be),w(Ce,P,Be),w(Ce,I,Be),w(Ce,N,Be),w(Ce,B,Be),w(Ce,U,Be),w(Ce,ee,Be),w(Ce,J,Be),w(Ce,ie,Be),m(ie,Q),m(ie,Y),m(ie,G),m(G,ge),m(ge,_e),m(ge,x),m(ge,ae),m(ge,ke),m(ge,H),m(H,me),j(oe,H,null),m(H,K),m(H,be),m(H,He),m(H,Ue),m(H,Z),m(H,ve),m(H,ce),m(H,Se),m(H,Ze),w(Ce,et,Be),w(Ce,Ye,Be),w(Ce,tt,Be),w(Ce,Me,Be),m(Me,ze);for(let ot=0;ot<Xe.length;ot+=1)Xe[ot].m(ze,null);m(Me,ft),m(Me,ye);for(let ot=0;ot<Ne.length;ot+=1)Ne[ot].m(ye,null);Dt=!0},p(Ce,[Be]){var rt,Ht;(!Dt||Be&1)&&a!==(a=Ce[0].name+"")&&ue(u,a),Ce[1]?pt||(pt=Od(),pt.c(),pt.m(e,null)):pt&&(pt.d(1),pt=null),(!Dt||Be&1)&&C!==(C=Ce[0].name+"")&&ue(S,C);const ot={};Be&9&&(ot.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${Ce[3]}');
...
const record = await client.records.getOne('${(rt=Ce[0])==null?void 0:rt.name}', 'RECORD_ID', {
expand: 'some_relation'
});
`),Be&9&&(ot.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${Ce[3]}');
...
final record = await client.records.getOne('${(Ht=Ce[0])==null?void 0:Ht.name}', 'RECORD_ID', query: {
'expand': 'some_relation',
});
`),E.$set(ot),Be&20&&(lt=Ce[4],Xe=kt(Xe,Be,Lt,1,Ce,lt,nt,ze,Mn,Ed,null,Dd)),Be&20&&(gt=Ce[4],Pe(),Ne=kt(Ne,Be,Nt,1,Ce,gt,dt,ye,Zt,Ad,null,Td),Le())},i(Ce){if(!Dt){A(E.$$.fragment,Ce),A(oe.$$.fragment,Ce);for(let Be=0;Be<gt.length;Be+=1)A(Ne[Be]);Dt=!0}},o(Ce){L(E.$$.fragment,Ce),L(oe.$$.fragment,Ce);for(let Be=0;Be<Ne.length;Be+=1)L(Ne[Be]);Dt=!1},d(Ce){Ce&&k(e),pt&&pt.d(),Ce&&k(h),Ce&&k(g),Ce&&k(M),Ce&&k(T),Ce&&k(O),q(E,Ce),Ce&&k(P),Ce&&k(I),Ce&&k(N),Ce&&k(B),Ce&&k(U),Ce&&k(ee),Ce&&k(J),Ce&&k(ie),q(oe),Ce&&k(et),Ce&&k(Ye),Ce&&k(tt),Ce&&k(Me);for(let Be=0;Be<Xe.length;Be+=1)Xe[Be].d();for(let Be=0;Be<Ne.length;Be+=1)Ne[Be].d()}}}function fC(n,e,t){let i,s,{collection:l=new cn}=e,o=200,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.viewRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify(W.dummyCollectionRecord(l),null,2)}),i&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},t(3,s=W.getApiExampleUrl($e.baseUrl)),[l,i,o,s,r,a]}class cC extends Ee{constructor(e){super(),Oe(this,e,fC,uC,De,{collection:0})}}function Pd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Ld(n,e,t){const i=n.slice();return i[6]=e[t],i}function Id(n,e,t){const i=n.slice();return i[11]=e[t],i}function Fd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function dC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function pC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function hC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("User "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function mC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("Relation record "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function gC(n){let e,t,i,s,l;return{c(){e=F("FormData object."),t=_("br"),i=F(`
Set to `),s=_("code"),s.textContent="null",l=F(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:le,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function _C(n){let e;return{c(){e=F("URL address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function bC(n){let e;return{c(){e=F("Email address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function vC(n){let e;return{c(){e=F("JSON array or object.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function yC(n){let e;return{c(){e=F("Number value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function kC(n){let e;return{c(){e=F("Plain text value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Nd(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=W.getFieldValueType(e[11])+"",h,g,v,b;function y(O,E){return O[11].required?pC:dC}let C=y(e),S=C(e);function $(O,E){if(O[11].type==="text")return kC;if(O[11].type==="number")return yC;if(O[11].type==="json")return vC;if(O[11].type==="email")return bC;if(O[11].type==="url")return _C;if(O[11].type==="file")return gC;if(O[11].type==="relation")return mC;if(O[11].type==="user")return hC}let M=$(e),T=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),S.c(),l=D(),o=_("span"),a=F(r),u=D(),f=_("td"),c=_("span"),h=F(d),g=D(),v=_("td"),T&&T.c(),b=D(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(O,E){w(O,t,E),m(t,i),m(i,s),S.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,v),T&&T.m(v,null),m(t,b)},p(O,E){e=O,C!==(C=y(e))&&(S.d(1),S=C(e),S&&(S.c(),S.m(s,l))),E&1&&r!==(r=e[11].name+"")&&ue(a,r),E&1&&d!==(d=W.getFieldValueType(e[11])+"")&&ue(h,d),M===(M=$(e))&&T?T.p(e,E):(T&&T.d(1),T=M&&M(e),T&&(T.c(),T.m(v,null)))},d(O){O&&k(t),S.d(),T&&T.d()}}}function Rd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=D(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&ne(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Hd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=D(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),r&6&&ne(t,"active",e[1]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function wC(n){var te,re,Ae;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y=n[0].name+"",C,S,$,M,T,O,E,P,I,N,B,U,ee,J,ie,Q,Y,G,ge,_e=[],x=new Map,ae,ke,H,me,oe,K,be,He,Ue,Z,ve,ce,Se,Ze,et,Ye,tt,Me,ze,Xe,nt,ft,ye,Ne,dt,Dt,pt,lt,Lt,gt=[],Nt=new Map,Ot,Je,Ce=[],Be=new Map,ot,rt=n[4]&&Fd();N=new Is({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
const data = { ... };
const record = await client.records.create('${(te=n[0])==null?void 0:te.name}', data);
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
final body = <String, dynamic>{ ... };
final record = await client.records.create('${(re=n[0])==null?void 0:re.name}', body: body);
`}});let Ht=(Ae=n[0])==null?void 0:Ae.schema;const Ct=se=>se[11].name;for(let se=0;se<Ht.length;se+=1){let de=Id(n,Ht,se),we=Ct(de);x.set(we,_e[se]=Nd(we,de))}et=new _n({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let ct=n[2];const xt=se=>se[6].code;for(let se=0;se<ct.length;se+=1){let de=Ld(n,ct,se),we=xt(de);Nt.set(we,gt[se]=Rd(we,de))}let R=n[2];const z=se=>se[6].code;for(let se=0;se<R.length;se+=1){let de=Pd(n,R,se),we=z(de);Be.set(we,Ce[se]=Hd(we,de))}return{c(){e=_("div"),t=_("strong"),t.textContent="POST",i=D(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records"),c=D(),rt&&rt.c(),d=D(),h=_("div"),g=_("p"),v=F("Create a new "),b=_("strong"),C=F(y),S=F(" record."),$=D(),M=_("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,T=D(),O=_("p"),O.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",E=D(),P=_("div"),P.textContent="Client SDKs example",I=D(),V(N.$$.fragment),B=D(),U=_("div"),U.textContent="Body Parameters",ee=D(),J=_("table"),ie=_("thead"),ie.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,Q=D(),Y=_("tbody"),G=_("tr"),G.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>id</span></div></td>
<td><span class="label">String</span></td>
<td><strong>15 characters string</strong> to store as record ID.
<br/>
If not set, it will be auto generated.</td>`,ge=D();for(let se=0;se<_e.length;se+=1)_e[se].c();ae=D(),ke=_("div"),ke.textContent="Query parameters",H=D(),me=_("table"),oe=_("thead"),oe.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,K=D(),be=_("tbody"),He=_("tr"),Ue=_("td"),Ue.textContent="expand",Z=D(),ve=_("td"),ve.innerHTML='<span class="label">String</span>',ce=D(),Se=_("td"),Ze=F(`Auto expand relations when returning the created record. Ex.:
`),V(et.$$.fragment),Ye=F(`
Supports up to 6-levels depth nested relations expansion. `),tt=_("br"),Me=F(`
The expanded relations will be appended to the record under the
`),ze=_("code"),ze.textContent="@expand",Xe=F(" property (eg. "),nt=_("code"),nt.textContent='"@expand": {"rel1": {...}, ...}',ft=F(`). Only the
relations that the user has permissions to `),ye=_("strong"),ye.textContent="view",Ne=F(" will be expanded."),dt=D(),Dt=_("div"),Dt.textContent="Responses",pt=D(),lt=_("div"),Lt=_("div");for(let se=0;se<gt.length;se+=1)gt[se].c();Ot=D(),Je=_("div");for(let se=0;se<Ce.length;se+=1)Ce[se].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-success"),p(h,"class","content m-b-base"),p(P,"class","section-title"),p(U,"class","section-title"),p(J,"class","table-compact table-border m-b-lg"),p(ke,"class","section-title"),p(me,"class","table-compact table-border m-b-lg"),p(Dt,"class","section-title"),p(Lt,"class","tabs-header compact left"),p(Je,"class","tabs-content"),p(lt,"class","tabs")},m(se,de){w(se,e,de),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),rt&&rt.m(e,null),w(se,d,de),w(se,h,de),m(h,g),m(g,v),m(g,b),m(b,C),m(g,S),m(h,$),m(h,M),m(h,T),m(h,O),w(se,E,de),w(se,P,de),w(se,I,de),j(N,se,de),w(se,B,de),w(se,U,de),w(se,ee,de),w(se,J,de),m(J,ie),m(J,Q),m(J,Y),m(Y,G),m(Y,ge);for(let we=0;we<_e.length;we+=1)_e[we].m(Y,null);w(se,ae,de),w(se,ke,de),w(se,H,de),w(se,me,de),m(me,oe),m(me,K),m(me,be),m(be,He),m(He,Ue),m(He,Z),m(He,ve),m(He,ce),m(He,Se),m(Se,Ze),j(et,Se,null),m(Se,Ye),m(Se,tt),m(Se,Me),m(Se,ze),m(Se,Xe),m(Se,nt),m(Se,ft),m(Se,ye),m(Se,Ne),w(se,dt,de),w(se,Dt,de),w(se,pt,de),w(se,lt,de),m(lt,Lt);for(let we=0;we<gt.length;we+=1)gt[we].m(Lt,null);m(lt,Ot),m(lt,Je);for(let we=0;we<Ce.length;we+=1)Ce[we].m(Je,null);ot=!0},p(se,[de]){var fe,he,Ie;(!ot||de&1)&&a!==(a=se[0].name+"")&&ue(u,a),se[4]?rt||(rt=Fd(),rt.c(),rt.m(e,null)):rt&&(rt.d(1),rt=null),(!ot||de&1)&&y!==(y=se[0].name+"")&&ue(C,y);const we={};de&9&&(we.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${se[3]}');
...
const data = { ... };
const record = await client.records.create('${(fe=se[0])==null?void 0:fe.name}', data);
`),de&9&&(we.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${se[3]}');
...
final body = <String, dynamic>{ ... };
final record = await client.records.create('${(he=se[0])==null?void 0:he.name}', body: body);
`),N.$set(we),de&1&&(Ht=(Ie=se[0])==null?void 0:Ie.schema,_e=kt(_e,de,Ct,1,se,Ht,x,Y,Mn,Nd,null,Id)),de&6&&(ct=se[2],gt=kt(gt,de,xt,1,se,ct,Nt,Lt,Mn,Rd,null,Ld)),de&6&&(R=se[2],Pe(),Ce=kt(Ce,de,z,1,se,R,Be,Je,Zt,Hd,null,Pd),Le())},i(se){if(!ot){A(N.$$.fragment,se),A(et.$$.fragment,se);for(let de=0;de<R.length;de+=1)A(Ce[de]);ot=!0}},o(se){L(N.$$.fragment,se),L(et.$$.fragment,se);for(let de=0;de<Ce.length;de+=1)L(Ce[de]);ot=!1},d(se){se&&k(e),rt&&rt.d(),se&&k(d),se&&k(h),se&&k(E),se&&k(P),se&&k(I),q(N,se),se&&k(B),se&&k(U),se&&k(ee),se&&k(J);for(let de=0;de<_e.length;de+=1)_e[de].d();se&&k(ae),se&&k(ke),se&&k(H),se&&k(me),q(et),se&&k(dt),se&&k(Dt),se&&k(pt),se&&k(lt);for(let de=0;de<gt.length;de+=1)gt[de].d();for(let de=0;de<Ce.length;de+=1)Ce[de].d()}}}function $C(n,e,t){let i,s,{collection:l=new cn}=e,o=200,r=[];const a=u=>t(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.createRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(W.dummyCollectionRecord(l),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to create record.",
"data": {
"${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`}])},t(3,s=W.getApiExampleUrl($e.baseUrl)),[l,o,r,s,i,a]}class SC extends Ee{constructor(e){super(),Oe(this,e,$C,wC,De,{collection:0})}}function jd(n,e,t){const i=n.slice();return i[6]=e[t],i}function qd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Vd(n,e,t){const i=n.slice();return i[11]=e[t],i}function zd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function CC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function MC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function TC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("User "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function DC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("Relation record "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function OC(n){let e,t,i,s,l;return{c(){e=F("FormData object."),t=_("br"),i=F(`
Set to `),s=_("code"),s.textContent="null",l=F(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:le,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function EC(n){let e;return{c(){e=F("URL address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function AC(n){let e;return{c(){e=F("Email address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function PC(n){let e;return{c(){e=F("JSON array or object.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function LC(n){let e;return{c(){e=F("Number value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function IC(n){let e;return{c(){e=F("Plain text value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Bd(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=W.getFieldValueType(e[11])+"",h,g,v,b;function y(O,E){return O[11].required?MC:CC}let C=y(e),S=C(e);function $(O,E){if(O[11].type==="text")return IC;if(O[11].type==="number")return LC;if(O[11].type==="json")return PC;if(O[11].type==="email")return AC;if(O[11].type==="url")return EC;if(O[11].type==="file")return OC;if(O[11].type==="relation")return DC;if(O[11].type==="user")return TC}let M=$(e),T=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),S.c(),l=D(),o=_("span"),a=F(r),u=D(),f=_("td"),c=_("span"),h=F(d),g=D(),v=_("td"),T&&T.c(),b=D(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(O,E){w(O,t,E),m(t,i),m(i,s),S.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,v),T&&T.m(v,null),m(t,b)},p(O,E){e=O,C!==(C=y(e))&&(S.d(1),S=C(e),S&&(S.c(),S.m(s,l))),E&1&&r!==(r=e[11].name+"")&&ue(a,r),E&1&&d!==(d=W.getFieldValueType(e[11])+"")&&ue(h,d),M===(M=$(e))&&T?T.p(e,E):(T&&T.d(1),T=M&&M(e),T&&(T.c(),T.m(v,null)))},d(O){O&&k(t),S.d(),T&&T.d()}}}function Ud(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=D(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&ne(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Wd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=D(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),r&6&&ne(t,"active",e[1]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function FC(n){var se,de,we;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,C=n[0].name+"",S,$,M,T,O,E,P,I,N,B,U,ee,J,ie,Q,Y,G,ge,_e,x,ae,ke=[],H=new Map,me,oe,K,be,He,Ue,Z,ve,ce,Se,Ze,et,Ye,tt,Me,ze,Xe,nt,ft,ye,Ne,dt,Dt,pt,lt,Lt,gt,Nt,Ot,Je=[],Ce=new Map,Be,ot,rt=[],Ht=new Map,Ct,ct=n[4]&&zd();B=new Is({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
const data = { ... };
const record = await client.records.update('${(se=n[0])==null?void 0:se.name}', 'RECORD_ID', data);
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
final body = <String, dynamic>{ ... };
final record = await client.records.update('${(de=n[0])==null?void 0:de.name}', 'RECORD_ID', body: body);
`}});let xt=(we=n[0])==null?void 0:we.schema;const R=fe=>fe[11].name;for(let fe=0;fe<xt.length;fe+=1){let he=Vd(n,xt,fe),Ie=R(he);H.set(Ie,ke[fe]=Bd(Ie,he))}Me=new _n({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let z=n[2];const te=fe=>fe[6].code;for(let fe=0;fe<z.length;fe+=1){let he=qd(n,z,fe),Ie=te(he);Ce.set(Ie,Je[fe]=Ud(Ie,he))}let re=n[2];const Ae=fe=>fe[6].code;for(let fe=0;fe<re.length;fe+=1){let he=jd(n,re,fe),Ie=Ae(he);Ht.set(Ie,rt[fe]=Wd(Ie,he))}return{c(){e=_("div"),t=_("strong"),t.textContent="PATCH",i=D(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records/"),c=_("strong"),c.textContent=":id",d=D(),ct&&ct.c(),h=D(),g=_("div"),v=_("p"),b=F("Update a single "),y=_("strong"),S=F(C),$=F(" record."),M=D(),T=_("p"),T.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,O=D(),E=_("p"),E.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",P=D(),I=_("div"),I.textContent="Client SDKs example",N=D(),V(B.$$.fragment),U=D(),ee=_("div"),ee.textContent="Path parameters",J=D(),ie=_("table"),ie.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to update.</td></tr></tbody>`,Q=D(),Y=_("div"),Y.textContent="Body Parameters",G=D(),ge=_("table"),_e=_("thead"),_e.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,x=D(),ae=_("tbody");for(let fe=0;fe<ke.length;fe+=1)ke[fe].c();me=D(),oe=_("div"),oe.textContent="Query parameters",K=D(),be=_("table"),He=_("thead"),He.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,Ue=D(),Z=_("tbody"),ve=_("tr"),ce=_("td"),ce.textContent="expand",Se=D(),Ze=_("td"),Ze.innerHTML='<span class="label">String</span>',et=D(),Ye=_("td"),tt=F(`Auto expand relations when returning the updated record. Ex.:
`),V(Me.$$.fragment),ze=F(`
Supports up to 6-levels depth nested relations expansion. `),Xe=_("br"),nt=F(`
The expanded relations will be appended to the record under the
`),ft=_("code"),ft.textContent="@expand",ye=F(" property (eg. "),Ne=_("code"),Ne.textContent='"@expand": {"rel1": {...}, ...}',dt=F(`). Only the
relations that the user has permissions to `),Dt=_("strong"),Dt.textContent="view",pt=F(" will be expanded."),lt=D(),Lt=_("div"),Lt.textContent="Responses",gt=D(),Nt=_("div"),Ot=_("div");for(let fe=0;fe<Je.length;fe+=1)Je[fe].c();Be=D(),ot=_("div");for(let fe=0;fe<rt.length;fe+=1)rt[fe].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-warning"),p(g,"class","content m-b-base"),p(I,"class","section-title"),p(ee,"class","section-title"),p(ie,"class","table-compact table-border m-b-lg"),p(Y,"class","section-title"),p(ge,"class","table-compact table-border m-b-lg"),p(oe,"class","section-title"),p(be,"class","table-compact table-border m-b-lg"),p(Lt,"class","section-title"),p(Ot,"class","tabs-header compact left"),p(ot,"class","tabs-content"),p(Nt,"class","tabs")},m(fe,he){w(fe,e,he),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),ct&&ct.m(e,null),w(fe,h,he),w(fe,g,he),m(g,v),m(v,b),m(v,y),m(y,S),m(v,$),m(g,M),m(g,T),m(g,O),m(g,E),w(fe,P,he),w(fe,I,he),w(fe,N,he),j(B,fe,he),w(fe,U,he),w(fe,ee,he),w(fe,J,he),w(fe,ie,he),w(fe,Q,he),w(fe,Y,he),w(fe,G,he),w(fe,ge,he),m(ge,_e),m(ge,x),m(ge,ae);for(let Ie=0;Ie<ke.length;Ie+=1)ke[Ie].m(ae,null);w(fe,me,he),w(fe,oe,he),w(fe,K,he),w(fe,be,he),m(be,He),m(be,Ue),m(be,Z),m(Z,ve),m(ve,ce),m(ve,Se),m(ve,Ze),m(ve,et),m(ve,Ye),m(Ye,tt),j(Me,Ye,null),m(Ye,ze),m(Ye,Xe),m(Ye,nt),m(Ye,ft),m(Ye,ye),m(Ye,Ne),m(Ye,dt),m(Ye,Dt),m(Ye,pt),w(fe,lt,he),w(fe,Lt,he),w(fe,gt,he),w(fe,Nt,he),m(Nt,Ot);for(let Ie=0;Ie<Je.length;Ie+=1)Je[Ie].m(Ot,null);m(Nt,Be),m(Nt,ot);for(let Ie=0;Ie<rt.length;Ie+=1)rt[Ie].m(ot,null);Ct=!0},p(fe,[he]){var mt,an,jt;(!Ct||he&1)&&a!==(a=fe[0].name+"")&&ue(u,a),fe[4]?ct||(ct=zd(),ct.c(),ct.m(e,null)):ct&&(ct.d(1),ct=null),(!Ct||he&1)&&C!==(C=fe[0].name+"")&&ue(S,C);const Ie={};he&9&&(Ie.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${fe[3]}');
...
const data = { ... };
const record = await client.records.update('${(mt=fe[0])==null?void 0:mt.name}', 'RECORD_ID', data);
`),he&9&&(Ie.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${fe[3]}');
...
final body = <String, dynamic>{ ... };
final record = await client.records.update('${(an=fe[0])==null?void 0:an.name}', 'RECORD_ID', body: body);
`),B.$set(Ie),he&1&&(xt=(jt=fe[0])==null?void 0:jt.schema,ke=kt(ke,he,R,1,fe,xt,H,ae,Mn,Bd,null,Vd)),he&6&&(z=fe[2],Je=kt(Je,he,te,1,fe,z,Ce,Ot,Mn,Ud,null,qd)),he&6&&(re=fe[2],Pe(),rt=kt(rt,he,Ae,1,fe,re,Ht,ot,Zt,Wd,null,jd),Le())},i(fe){if(!Ct){A(B.$$.fragment,fe),A(Me.$$.fragment,fe);for(let he=0;he<re.length;he+=1)A(rt[he]);Ct=!0}},o(fe){L(B.$$.fragment,fe),L(Me.$$.fragment,fe);for(let he=0;he<rt.length;he+=1)L(rt[he]);Ct=!1},d(fe){fe&&k(e),ct&&ct.d(),fe&&k(h),fe&&k(g),fe&&k(P),fe&&k(I),fe&&k(N),q(B,fe),fe&&k(U),fe&&k(ee),fe&&k(J),fe&&k(ie),fe&&k(Q),fe&&k(Y),fe&&k(G),fe&&k(ge);for(let he=0;he<ke.length;he+=1)ke[he].d();fe&&k(me),fe&&k(oe),fe&&k(K),fe&&k(be),q(Me),fe&&k(lt),fe&&k(Lt),fe&&k(gt),fe&&k(Nt);for(let he=0;he<Je.length;he+=1)Je[he].d();for(let he=0;he<rt.length;he+=1)rt[he].d()}}}function NC(n,e,t){let i,s,{collection:l=new cn}=e,o=200,r=[];const a=u=>t(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.updateRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(W.dummyCollectionRecord(l),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to update record.",
"data": {
"${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`},{code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}])},t(3,s=W.getApiExampleUrl($e.baseUrl)),[l,o,r,s,i,a]}class RC extends Ee{constructor(e){super(),Oe(this,e,NC,FC,De,{collection:0})}}function Yd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Kd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Jd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Zd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=D(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ne(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Gd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=D(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&20&&ne(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function HC(n){var He,Ue;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,C=n[0].name+"",S,$,M,T,O,E,P,I,N,B,U,ee,J,ie,Q,Y=[],G=new Map,ge,_e,x=[],ae=new Map,ke,H=n[1]&&Jd();E=new Is({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
await client.records.delete('${(He=n[0])==null?void 0:He.name}', 'RECORD_ID');
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
await client.records.delete('${(Ue=n[0])==null?void 0:Ue.name}', 'RECORD_ID');
`}});let me=n[4];const oe=Z=>Z[6].code;for(let Z=0;Z<me.length;Z+=1){let ve=Kd(n,me,Z),ce=oe(ve);G.set(ce,Y[Z]=Zd(ce,ve))}let K=n[4];const be=Z=>Z[6].code;for(let Z=0;Z<K.length;Z+=1){let ve=Yd(n,K,Z),ce=be(ve);ae.set(ce,x[Z]=Gd(ce,ve))}return{c(){e=_("div"),t=_("strong"),t.textContent="DELETE",i=D(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records/"),c=_("strong"),c.textContent=":id",d=D(),H&&H.c(),h=D(),g=_("div"),v=_("p"),b=F("Delete a single "),y=_("strong"),S=F(C),$=F(" record."),M=D(),T=_("div"),T.textContent="Client SDKs example",O=D(),V(E.$$.fragment),P=D(),I=_("div"),I.textContent="Path parameters",N=D(),B=_("table"),B.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to delete.</td></tr></tbody>`,U=D(),ee=_("div"),ee.textContent="Responses",J=D(),ie=_("div"),Q=_("div");for(let Z=0;Z<Y.length;Z+=1)Y[Z].c();ge=D(),_e=_("div");for(let Z=0;Z<x.length;Z+=1)x[Z].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-danger"),p(g,"class","content m-b-base"),p(T,"class","section-title"),p(I,"class","section-title"),p(B,"class","table-compact table-border m-b-lg"),p(ee,"class","section-title"),p(Q,"class","tabs-header compact left"),p(_e,"class","tabs-content"),p(ie,"class","tabs")},m(Z,ve){w(Z,e,ve),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),H&&H.m(e,null),w(Z,h,ve),w(Z,g,ve),m(g,v),m(v,b),m(v,y),m(y,S),m(v,$),w(Z,M,ve),w(Z,T,ve),w(Z,O,ve),j(E,Z,ve),w(Z,P,ve),w(Z,I,ve),w(Z,N,ve),w(Z,B,ve),w(Z,U,ve),w(Z,ee,ve),w(Z,J,ve),w(Z,ie,ve),m(ie,Q);for(let ce=0;ce<Y.length;ce+=1)Y[ce].m(Q,null);m(ie,ge),m(ie,_e);for(let ce=0;ce<x.length;ce+=1)x[ce].m(_e,null);ke=!0},p(Z,[ve]){var Se,Ze;(!ke||ve&1)&&a!==(a=Z[0].name+"")&&ue(u,a),Z[1]?H||(H=Jd(),H.c(),H.m(e,null)):H&&(H.d(1),H=null),(!ke||ve&1)&&C!==(C=Z[0].name+"")&&ue(S,C);const ce={};ve&9&&(ce.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${Z[3]}');
...
await client.records.delete('${(Se=Z[0])==null?void 0:Se.name}', 'RECORD_ID');
`),ve&9&&(ce.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${Z[3]}');
...
await client.records.delete('${(Ze=Z[0])==null?void 0:Ze.name}', 'RECORD_ID');
`),E.$set(ce),ve&20&&(me=Z[4],Y=kt(Y,ve,oe,1,Z,me,G,Q,Mn,Zd,null,Kd)),ve&20&&(K=Z[4],Pe(),x=kt(x,ve,be,1,Z,K,ae,_e,Zt,Gd,null,Yd),Le())},i(Z){if(!ke){A(E.$$.fragment,Z);for(let ve=0;ve<K.length;ve+=1)A(x[ve]);ke=!0}},o(Z){L(E.$$.fragment,Z);for(let ve=0;ve<x.length;ve+=1)L(x[ve]);ke=!1},d(Z){Z&&k(e),H&&H.d(),Z&&k(h),Z&&k(g),Z&&k(M),Z&&k(T),Z&&k(O),q(E,Z),Z&&k(P),Z&&k(I),Z&&k(N),Z&&k(B),Z&&k(U),Z&&k(ee),Z&&k(J),Z&&k(ie);for(let ve=0;ve<Y.length;ve+=1)Y[ve].d();for(let ve=0;ve<x.length;ve+=1)x[ve].d()}}}function jC(n,e,t){let i,s,{collection:l=new cn}=e,o=204,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.deleteRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:204,body:`
null
`}),r.push({code:400,body:`
{
"code": 400,
"message": "Failed to delete record. Make sure that the record is not part of a required relation reference.",
"data": {}
}
`}),i&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},t(3,s=W.getApiExampleUrl($e.baseUrl)),[l,i,o,s,r,a]}class qC extends Ee{constructor(e){super(),Oe(this,e,jC,HC,De,{collection:0})}}function VC(n){var h,g,v,b,y,C,S,$;let e,t,i,s,l,o,r,a,u,f,c,d;return r=new Is({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(h=n[0])==null?void 0:h.name}', function (e) {
console.log(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${(g=n[0])==null?void 0:g.name}/RECORD_ID', function (e) {
console.log(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(v=n[0])==null?void 0:v.name}') // remove only the collection subscription
client.realtime.unsubscribe('${(b=n[0])==null?void 0:b.name}/RECORD_ID') // remove only the record subscription
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(y=n[0])==null?void 0:y.name}', (e) {
print(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${(C=n[0])==null?void 0:C.name}/RECORD_ID', (e) {
print(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(S=n[0])==null?void 0:S.name}') // remove only the collection subscription
client.realtime.unsubscribe('${($=n[0])==null?void 0:$.name}/RECORD_ID') // remove only the record subscription
`}}),c=new _n({props:{content:JSON.stringify({action:"create",record:W.dummyCollectionRecord(n[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')}}),{c(){e=_("div"),e.innerHTML=`<strong class="label label-primary">SSE</strong>
<div class="content"><p>/api/realtime</p></div>`,t=D(),i=_("div"),i.innerHTML=`<p>Subscribe to realtime changes via Server-Sent Events (SSE).</p>
<p>Events are send for <strong>create</strong>, <strong>update</strong>
and <strong>delete</strong> record operations (see &quot;Event data format&quot; section below).</p>
<div class="alert alert-info m-t-10"><div class="icon"><i class="ri-information-line"></i></div>
<div class="contet"><p><strong>You could subscribe to a single record or to an entire collection.</strong></p>
<p>When you subscribe to a <strong>single record</strong>, the collection&#39;s
<strong>ViewRule</strong> will be used to determine whether the subscriber has access to receive
the event message.</p>
<p>When you subscribe to an <strong>entire collection</strong>, the collection&#39;s
<strong>ListRule</strong> will be used to determine whether the subscriber has access to receive
the event message.</p></div></div>`,s=D(),l=_("div"),l.textContent="Client SDKs example",o=D(),V(r.$$.fragment),a=D(),u=_("div"),u.textContent="Event data format",f=D(),V(c.$$.fragment),p(e,"class","alert"),p(i,"class","content m-b-base"),p(l,"class","section-title"),p(u,"class","section-title")},m(M,T){w(M,e,T),w(M,t,T),w(M,i,T),w(M,s,T),w(M,l,T),w(M,o,T),j(r,M,T),w(M,a,T),w(M,u,T),w(M,f,T),j(c,M,T),d=!0},p(M,[T]){var P,I,N,B,U,ee,J,ie;const O={};T&3&&(O.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${M[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(P=M[0])==null?void 0:P.name}', function (e) {
console.log(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${(I=M[0])==null?void 0:I.name}/RECORD_ID', function (e) {
console.log(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(N=M[0])==null?void 0:N.name}') // remove only the collection subscription
client.realtime.unsubscribe('${(B=M[0])==null?void 0:B.name}/RECORD_ID') // remove only the record subscription
`),T&3&&(O.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${M[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(U=M[0])==null?void 0:U.name}', (e) {
print(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${(ee=M[0])==null?void 0:ee.name}/RECORD_ID', (e) {
print(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(J=M[0])==null?void 0:J.name}') // remove only the collection subscription
client.realtime.unsubscribe('${(ie=M[0])==null?void 0:ie.name}/RECORD_ID') // remove only the record subscription
`),r.$set(O);const E={};T&1&&(E.content=JSON.stringify({action:"create",record:W.dummyCollectionRecord(M[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),c.$set(E)},i(M){d||(A(r.$$.fragment,M),A(c.$$.fragment,M),d=!0)},o(M){L(r.$$.fragment,M),L(c.$$.fragment,M),d=!1},d(M){M&&k(e),M&&k(t),M&&k(i),M&&k(s),M&&k(l),M&&k(o),q(r,M),M&&k(a),M&&k(u),M&&k(f),q(c,M)}}}function zC(n,e,t){let i,{collection:s=new cn}=e;return n.$$set=l=>{"collection"in l&&t(0,s=l.collection)},t(1,i=W.getApiExampleUrl($e.baseUrl)),[s,i]}class BC extends Ee{constructor(e){super(),Oe(this,e,zC,VC,De,{collection:0})}}function Xd(n,e,t){const i=n.slice();return i[14]=e[t],i}function Qd(n,e,t){const i=n.slice();return i[14]=e[t],i}function xd(n){let e,t,i,s;var l=n[14].component;function o(r){return{props:{collection:r[3]}}}return l&&(t=new l(o(n))),{c(){e=_("div"),t&&V(t.$$.fragment),i=D(),p(e,"class","tab-item active")},m(r,a){w(r,e,a),t&&j(t,e,null),m(e,i),s=!0},p(r,a){const u={};if(a&8&&(u.collection=r[3]),l!==(l=r[14].component)){if(t){Pe();const f=t;L(f.$$.fragment,1,0,()=>{q(f,1)}),Le()}l?(t=new l(o(r)),V(t.$$.fragment),A(t.$$.fragment,1),j(t,e,i)):t=null}else l&&t.$set(u)},i(r){s||(t&&A(t.$$.fragment,r),s=!0)},o(r){t&&L(t.$$.fragment,r),s=!1},d(r){r&&k(e),t&&q(t)}}}function ep(n,e){let t,i,s,l=e[4]===e[14].id&&xd(e);return{key:n,first:null,c(){t=Ke(),l&&l.c(),i=Ke(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[4]===e[14].id?l?(l.p(e,r),r&16&&A(l,1)):(l=xd(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Pe(),L(l,1,1,()=>{l=null}),Le())},i(o){s||(A(l),s=!0)},o(o){L(l),s=!1},d(o){o&&k(t),l&&l.d(o),o&&k(i)}}}function UC(n){let e,t=[],i=new Map,s,l=n[5];const o=r=>r[14].id;for(let r=0;r<l.length;r+=1){let a=Xd(n,l,r),u=o(a);i.set(u,t[r]=ep(u,a))}return{c(){e=_("div");for(let r=0;r<t.length;r+=1)t[r].c();p(e,"class","tabs-content")},m(r,a){w(r,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(r,a){a&56&&(l=r[5],Pe(),t=kt(t,a,o,1,r,l,i,e,Zt,ep,null,Xd),Le())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)L(t[a]);s=!1},d(r){r&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function tp(n,e){let t,i,s=e[14].label+"",l,o,r,a;function u(){return e[9](e[14])}function f(...c){return e[10](e[14],...c)}return{key:n,first:null,c(){t=_("button"),i=_("span"),l=F(s),o=D(),p(i,"class","txt"),p(t,"tabindex","0"),p(t,"class","tab-item"),ne(t,"active",e[4]===e[14].id),this.first=t},m(c,d){w(c,t,d),m(t,i),m(i,l),m(t,o),r||(a=[X(t,"click",u),X(t,"keydown",$m(f))],r=!0)},p(c,d){e=c,d&48&&ne(t,"active",e[4]===e[14].id)},d(c){c&&k(t),r=!1,Ge(a)}}}function WC(n){let e,t,i=n[3].name+"",s,l,o,r,a=[],u=new Map,f=n[5];const c=d=>d[14].id;for(let d=0;d<f.length;d+=1){let h=Qd(n,f,d),g=c(h);u.set(g,a[d]=tp(g,h))}return{c(){e=_("h4"),t=_("strong"),s=F(i),l=F(" records API"),o=D(),r=_("div");for(let d=0;d<a.length;d+=1)a[d].c();p(r,"class","tabs-header stretched")},m(d,h){w(d,e,h),m(e,t),m(t,s),m(e,l),w(d,o,h),w(d,r,h);for(let g=0;g<a.length;g+=1)a[g].m(r,null)},p(d,h){h&8&&i!==(i=d[3].name+"")&&ue(s,i),h&114&&(f=d[5],a=kt(a,h,c,1,d,f,u,r,Mn,tp,null,Qd))},d(d){d&&k(e),d&&k(o),d&&k(r);for(let h=0;h<a.length;h+=1)a[h].d()}}}function YC(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[8]),t=!0)},p:le,d(s){s&&k(e),t=!1,i()}}}function KC(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[YC],header:[WC],default:[UC]},$$scope:{ctx:n}};return e=new mi({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&524312&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[11](null),q(e,s)}}}function JC(n,e,t){const i=[{id:"list",label:"List",component:aC},{id:"view",label:"View",component:cC},{id:"create",label:"Create",component:SC},{id:"update",label:"Update",component:RC},{id:"delete",label:"Delete",
<span class="txt">Upload new file</span>`,p(t,"type","file"),p(t,"class","hidden"),t.multiple=n[5],p(s,"type","button"),p(s,"class","btn btn-secondary btn-sm btn-block"),p(e,"class","list-item btn-list-item")},m(r,a){w(r,e,a),m(e,t),n[16](t),m(e,i),m(e,s),l||(o=[X(t,"change",n[17]),X(s,"click",n[18])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&k(e),n[16](null),l=!1,Ge(o)}}}function J4(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,h,g,v,b=n[4];const y=T=>T[25];for(let T=0;T<b.length;T+=1){let O=sp(n,b,T),E=y(O);d.set(E,c[T]=lp(E,O))}let C=n[0],S=[];for(let T=0;T<C.length;T+=1)S[T]=op(ip(n,C,T));const $=T=>L(S[T],1,1,()=>{S[T]=null});let M=!n[8]&&rp(n);return{c(){e=_("label"),t=_("i"),s=D(),l=_("span"),r=F(o),u=D(),f=_("div");for(let T=0;T<c.length;T+=1)c[T].c();h=D();for(let T=0;T<S.length;T+=1)S[T].c();g=D(),M&&M.c(),p(t,"class",i=W.getFieldTypeIcon(n[3].type)),p(l,"class","txt"),p(e,"for",a=n[21]),p(f,"class","files-list")},m(T,O){w(T,e,O),m(e,t),m(e,s),m(e,l),m(l,r),w(T,u,O),w(T,f,O);for(let E=0;E<c.length;E+=1)c[E].m(f,null);m(f,h);for(let E=0;E<S.length;E+=1)S[E].m(f,null);m(f,g),M&&M.m(f,null),n[19](f),v=!0},p(T,O){if((!v||O&8&&i!==(i=W.getFieldTypeIcon(T[3].type)))&&p(t,"class",i),(!v||O&8)&&o!==(o=T[3].name+"")&&ue(r,o),(!v||O&2097152&&a!==(a=T[21]))&&p(e,"for",a),O&1558&&(b=T[4],Pe(),c=kt(c,O,y,1,T,b,d,f,Zt,lp,h,sp),Le()),O&2049){C=T[0];let E;for(E=0;E<C.length;E+=1){const P=ip(T,C,E);S[E]?(S[E].p(P,O),A(S[E],1)):(S[E]=op(P),S[E].c(),A(S[E],1),S[E].m(f,g))}for(Pe(),E=C.length;E<S.length;E+=1)$(E);Le()}T[8]?M&&(M.d(1),M=null):M?M.p(T,O):(M=rp(T),M.c(),M.m(f,null))},i(T){if(!v){for(let O=0;O<b.length;O+=1)A(c[O]);for(let O=0;O<C.length;O+=1)A(S[O]);v=!0}},o(T){for(let O=0;O<c.length;O+=1)L(c[O]);S=S.filter(Boolean);for(let O=0;O<S.length;O+=1)L(S[O]);v=!1},d(T){T&&k(e),T&&k(u),T&&k(f);for(let O=0;O<c.length;O+=1)c[O].d();Qt(S,T),M&&M.d(),n[19](null)}}}function Z4(n){let e,t;return e=new Re({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[J4,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&136315391&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function G4(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new Dn}=e,c,d;function h(E){W.removeByValue(u,E),t(1,u)}function g(E){W.pushUnique(u,E),t(1,u)}function v(E){W.isEmpty(a[E])||a.splice(E,1),t(0,a)}function b(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const y=E=>h(E),C=E=>g(E),S=E=>v(E);function $(E){pe[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)},T=()=>c==null?void 0:c.click();function O(E){pe[E?"unshift":"push"](()=>{d=E,t(7,d)})}return n.$$set=E=>{"record"in E&&t(2,o=E.record),"value"in E&&t(12,r=E.value),"uploadedFiles"in E&&t(0,a=E.uploadedFiles),"deletedFileIndexes"in E&&t(1,u=E.deletedFileIndexes),"field"in E&&t(3,f=E.field)},n.$$.update=()=>{var E,P;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=W.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=W.toArray(u))),n.$$.dirty&8&&t(5,i=((E=f.options)==null?void 0:E.maxSelect)>1),n.$$.dirty&4128&&W.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=W.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((P=f.options)==null?void 0:P.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&b()},[a,u,o,f,s,i,c,d,l,h,g,v,r,y,C,S,$,M,T,O]}class X4 extends Ee{constructor(e){super(),Oe(this,e,G4,Z4,De,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function ap(n){let e,t;return{c(){e=_("small"),t=F(n[1]),p(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&ue(t,i[1])},d(i){i&&k(e)}}}function Q4(n){let e,t,i,s,l,o=n[0].id
`,p(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function yM(n){let e,t,i;function s(o){n[31](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new bM({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function kM(n){let e,t,i;function s(o){n[30](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new aM({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function wM(n){let e,t,i,s,l;function o(f){n[27](f,n[40])}function r(f){n[28](f,n[40])}function a(f){n[29](f,n[40])}let u={field:n[40],record:n[2]};return n[2][n[40].name]!==void 0&&(u.value=n[2][n[40].name]),n[3][n[40].name]!==void 0&&(u.uploadedFiles=n[3][n[40].name]),n[4][n[40].name]!==void 0&&(u.deletedFileIndexes=n[4][n[40].name]),e=new X4({props:u}),pe.push(()=>Fe(e,"value",o)),pe.push(()=>Fe(e,"uploadedFiles",r)),pe.push(()=>Fe(e,"deletedFileIndexes",a)),{c(){V(e.$$.fragment)},m(f,c){j(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[40]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[40].name],je(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],je(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[40].name],je(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),l=!1},d(f){q(e,f)}}}function $M(n){let e,t,i;function s(o){n[26](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new E4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function SM(n){let e,t,i;function s(o){n[25](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new M4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function CM(n){let e,t,i;function s(o){n[24](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new w4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function MM(n){let e,t,i;function s(o){n[23](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new b4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function TM(n){let e,t,i;function s(o){n[22](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new h4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function DM(n){let e,t,i;function s(o){n[21](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new f4({props:l}),pe.push(()=>Fe(e,"value",
<span class="txt">Delete</span>`,p(e,"tabindex","0"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[18]),t=!0)},p:le,d(s){s&&k(e),t=!1,i()}}}function LM(n){let e,t=n[2].isNew?"New":"Edit",i,s,l=n[0].name+"",o,r,a,u,f,c=!n[2].isNew&&n[10]&&_p(n);return{c(){e=_("h4"),i=F(t),s=D(),o=F(l),r=F(" record"),a=D(),c&&c.c(),u=Ke()},m(d,h){w(d,e,h),m(e,i),m(e,s),m(e,o),m(e,r),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&ue(i,t),(!f||h[0]&1)&&l!==(l=d[0].name+"")&&ue(o,l),!d[2].isNew&&d[10]?c?(c.p(d,h),h[0]&1028&&A(c,1)):(c=_p(d),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Pe(),L(c,1,1,()=>{c=null}),Le())},i(d){f||(A(c),f=!0)},o(d){L(c),f=!1},d(d){d&&k(e),d&&k(a),c&&c.d(d),d&&k(u)}}}function IM(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=D(),s=_("button"),l=_("span"),r=F(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[11]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[9]||n[7],ne(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,r),u||(f=X(e,"click",n[17]),u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&ue(r,o),d[0]&640&&a!==(a=!c[9]||c[7])&&(s.disabled=a),d[0]&128&&ne(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function FM(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[IM],header:[LM],default:[AM]},$$scope:{ctx:n}};return e=new mi({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&288&&(o.beforeHide=s[32]),l[0]&1693|l[1]&8192&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[33](null),q(e,s)}}}function bp(n){return JSON.stringify(n)}function NM(n,e,t){let i,s,l,o;const r=rn(),a="record_"+W.randomString(5);let{collection:u}=e,f,c=null,d=new co,h=!1,g=!1,v={},b={},y="";function C(oe){return $(oe),t(8,g=!0),f==null?void 0:f.show()}function S(){return f==null?void 0:f.hide()}async function $(oe){hi({}),c=oe||{},t(2,d=oe!=null&&oe.clone?oe.clone():new co),t(3,v={}),t(4,b={}),await si(),t(15,y=bp(d))}function M(){if(h||!l)return;t(7,h=!0);const oe=O();let K;d.isNew?K=$e.records.create(u==null?void 0:u.id,oe):K=$e.records.update(u==null?void 0:u.id,d.id,oe),K.then(async be=>{dn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),S(),r("save",be)}).catch(be=>{$e.errorResponseHandler(be)}).finally(()=>{t(7,h=!1)})}function T(){!(c!=null&&c.id)||pi("Do you really want to delete the selected record?",()=>$e.records.delete(c["@collectionId"],c.id).then(()=>{S(),dn("Successfully deleted record."),r("delete",c)}).catch(oe=>{$e.errorResponseHandler(oe)}))}function O(){const oe=(d==null?void 0:d.export())||{},K=new FormData,be={};for(const He of(u==null?void 0:u.schema)||[])be[He.name]=He;for(const He in oe)!be[He]||(typeof oe[He]>"u"&&(oe[He]=null),W.addValueToFormData(K,He,oe[He]));for(const He in v){const Ue=W.toArray(v[He]);for(const Z of Ue)K.append(He,Z)}for(const He in b){const Ue=W.toArray(b[He]);for(const Z of Ue)K.append(He+"."+Z,"")}return K}const E=()=>S(),P=()=>T();function I(oe,K){n.$$.not_equal(d[K.name],oe)&&(d[K.name]=oe,t(2,d))}function N(oe,K){n.$$.not_equal(d[K.name],oe)&&(d[K.name]=oe,t(2,d))}function B(oe,K){n.$$.not_equal(d[K.name],oe)&&(d[K.name]=oe,t(2,d))}function U(oe,K){n.$$.not_equal(d[K.name],oe)&&(d[K.name]=oe,t(2,d))}function ee(oe,K){n.$$.not_equal(d[K.name],oe)&&(d[K.name]=oe,t(2,d))}function J(oe,K){n.$$.not_equal(d[K.name],oe)&&(d[K.name]=oe,t(2,d))}function ie(oe,K){n.$$.not_equal(d[K.name],oe)&&(d[K.name]=oe,t(2,d))}function Q(oe,K){n.$$.not_equal(d[K.name],oe)&&(d[K.name]=oe,t(2,d))}function Y(oe,K){n.$$.not_equal(d[K.name],oe)&&(d[K.name]=oe,t(2,d))}function G(oe,K){n.$$.not_equal(v[K.name],oe)&&(v[K.name]=oe,t(3,v))}function ge(oe,K){n.$$.not_equ
`},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Ep(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[28]),t=!0)},p:le,d(s){s&&k(e),t=!1,i()}}}function Ap(n,e){let t,i,s;return i=new J_({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=Ke(),V(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),j(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&8&&(r.record=e[35]),o[0]&2048&&(r.field=e[38]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),q(i,l)}}}function Pp(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,g,v=[],b=new Map,y,C,S,$,M,T,O,E,P,I,N,B;function U(){return e[25](e[35])}h=new xo({props:{id:e[35].id}});let ee=e[11];const J=Y=>Y[38].name;for(let Y=0;Y<ee.length;Y+=1){let G=Mp(e,ee,Y),ge=J(G);b.set(ge,v[Y]=Ap(ge,G))}S=new $i({props:{date:e[35].created}}),T=new $i({props:{date:e[35].updated}});function ie(){return e[26](e[35])}function Q(...Y){return e[27](e[35],...Y)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),l=_("input"),a=D(),u=_("label"),c=D(),d=_("td"),V(h.$$.fragment),g=D();for(let Y=0;Y<v.length;Y+=1)v[Y].c();y=D(),C=_("td"),V(S.$$.fragment),$=D(),M=_("td"),V(T.$$.fragment),O=D(),E=_("td"),E.innerHTML='<i class="ri-arrow-right-line"></i>',P=D(),p(l,"type","checkbox"),p(l,"id",o="checkbox_"+e[35].id),l.checked=r=e[5][e[35].id],p(u,"for",f="checkbox_"+e[35].id),p(s,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-id"),p(C,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(E,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Y,G){w(Y,t,G),m(t,i),m(i,s),m(s,l),m(s,a),m(s,u),m(t,c),m(t,d),j(h,d,null),m(t,g);for(let ge=0;ge<v.length;ge+=1)v[ge].m(t,null);m(t,y),m(t,C),j(S,C,null),m(t,$),m(t,M),j(T,M,null),m(t,O),m(t,E),m(t,P),I=!0,N||(B=[X(l,"change",U),X(s,"click",ti(e[19])),X(t,"click",ie),X(t,"keydown",Q)],N=!0)},p(Y,G){e=Y,(!I||G[0]&8&&o!==(o="checkbox_"+e[35].id))&&p(l,"id",o),(!I||G[0]&40&&r!==(r=e[5][e[35].id]))&&(l.checked=r),(!I||G[0]&8&&f!==(f="checkbox_"+e[35].id))&&p(u,"for",f);const ge={};G[0]&8&&(ge.id=e[35].id),h.$set(ge),G[0]&2056&&(ee=e[11],Pe(),v=kt(v,G,J,1,e,ee,b,t,Zt,Ap,y,Mp),Le());const _e={};G[0]&8&&(_e.date=e[35].created),S.$set(_e);const x={};G[0]&8&&(x.date=e[35].updated),T.$set(x)},i(Y){if(!I){A(h.$$.fragment,Y);for(let G=0;G<ee.length;G+=1)A(v[G]);A(S.$$.fragment,Y),A(T.$$.fragment,Y),I=!0}},o(Y){L(h.$$.fragment,Y);for(let G=0;G<v.length;G+=1)L(v[G]);L(S.$$.fragment,Y),L(T.$$.fragment,Y),I=!1},d(Y){Y&&k(t),q(h);for(let G=0;G<v.length;G+=1)v[G].d();q(S),q(T),N=!1,Ge(B)}}}function Lp(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=F("Showing "),s=F(i),l=F(" of "),o=F(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&8&&i!==(i=r[3].length+"")&&ue(s,i),a[0]&16&&ue(o,r[4])},d(r){r&&k(e)}}}function Ip(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=F("Load more ("),o=F(l),r=F(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ne(t,"btn-loading",n[8]),ne(t,"btn-disabled",n[8]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=X(t,"click",n[29]),a=!0)},p(f,c){c[0]&24&&l!==(l=f[4]-f[3].length+"")&&ue(o,l),c[0]&256&&ne(t,"btn-loading",f[8]),c[0]&256&&ne(t,"btn-disabled",f[8])},d(f){f&&k(e),a=!1,u()}}}function Fp(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,h,g,v,b,y,C;return{c(){e=_("div"),t=_("div"),i=F("Selected "),s=_("strong"),l=F(n[6]),o=D(),a=F(r),u=D(),f=_("button"),f.innerHTML='<span class="txt">Reset</span>',c=D(),d=_("div"),h=D(),g=_("button"),g.innerHTML='<span class="txt">Delete selected</span>',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),ne(f,"btn-disabled",n[9]),p(d,
<span class="txt">API Preview</span>`,v=D(),b=_("button"),b.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,y=D(),V(C.$$.fragment),S=D(),V($.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(g,"type","button"),p(g,"class","btn btn-outline"),p(b,"type","button"),p(b,"class","btn btn-expanded"),p(h,"class","btns-group"),p(e,"class","page-header")},m(ee,J){w(ee,e,J),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),m(e,u),I&&I.m(u,null),m(u,f),j(c,u,null),m(e,d),m(e,h),m(h,g),m(h,v),m(h,b),w(ee,y,J),j(C,ee,J),w(ee,S,J),j($,ee,J),O=!0,E||(P=[X(g,"click",n[15]),X(b,"click",n[16])],E=!0)},p(ee,J){(!O||J[0]&4)&&o!==(o=ee[2].name+"")&&ue(r,o),ee[9]?I&&(I.d(1),I=null):I?I.p(ee,J):(I=Np(ee),I.c(),I.m(u,f));const ie={};J[0]&1&&(ie.value=ee[0]),J[0]&4&&(ie.autocompleteCollection=ee[2]),C.$set(ie);const Q={};J[0]&4&&(Q.collection=ee[2]),!M&&J[0]&1&&(M=!0,Q.filter=ee[0],je(()=>M=!1)),!T&&J[0]&2&&(T=!0,Q.sort=ee[1],je(()=>T=!1)),$.$set(Q)},i(ee){O||(A(c.$$.fragment,ee),A(C.$$.fragment,ee),A($.$$.fragment,ee),O=!0)},o(ee){L(c.$$.fragment,ee),L(C.$$.fragment,ee),L($.$$.fragment,ee),O=!1},d(ee){ee&&k(e),I&&I.d(),q(c),ee&&k(y),q(C,ee),ee&&k(S),n[18](null),q($,ee),E=!1,Ge(P)}}}function cT(n){let e,t,i,s,l;return{c(){e=_("h1"),e.textContent="Create your first collection to add records!",t=D(),i=_("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=X(i,"click",n[12]),s=!0)},p:le,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,l()}}}function dT(n){let e;return{c(){e=_("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function pT(n){let e,t,i;function s(r,a){return r[9]?dT:cT}let l=s(n),o=l(n);return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=D(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),m(e,t),m(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&k(e),o.d()}}}function hT(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function mT(n){let e,t,i,s,l,o,r,a,u;const f=[uT,aT,rT],c=[];function d(b,y){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let h={};s=new Za({props:h}),n[22](s);let g={};o=new ZC({props:g}),n[23](o);let v={collection:n[2]};return a=new K_({props:v}),n[24](a),a.$on("save",n[25]),a.$on("delete",n[26]),{c(){t.c(),i=D(),V(s.$$.fragment),l=D(),V(o.$$.fragment),r=D(),V(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),j(s,b,y),w(b,l,y),j(o,b,y),w(b,r,y),j(a,b,y),u=!0},p(b,y){let C=e;e=d(b),e===C?c[e].p(b,y):(Pe(),L(c[C],1,1,()=>{c[C]=null}),Le(),t=c[e],t?t.p(b,y):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const S={};s.$set(S);const $={};o.$set($);const M={};y[0]&4&&(M.collection=b[2]),a.$set(M)},i(b){u||(A(t),A(s.$$.fragment,b),A(o.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){L(t),L(s.$$.fragment,b),L(o.$$.fragment,b),L(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[22](null),q(s,b),b&&k(l),n[23](null),q(o,b),b&&k(r),n[24](null),q(a,b)}}}function gT(n,e,t){let i,s,l,o,r,a,u;at(n,ci,Y=>t(2,s=Y)),at(n,Os,Y=>t(11,l=Y)),at(n,Ho,Y=>t(27,o=Y)),at(n,Ft,Y=>t(28,r=Y)),at(n,la,Y=>t(8,a=Y)),at(n,rs,Y=>t(9,u=Y)),tn(Ft,r="Collections",r);const f=new URLSearchParams(o);let c,d,h,g,v=f.get("filter")||"",b=f.get("sort")||"-created",y=f.get("collectionId")||"";function C(){t(10,y=s.id),t(1,b="-created"),t(0,v="")}k$(y);const S=()=>c==null?void 0:c.show(),$=()=>c==null?void 0:c.show(s),M=()=>g==null?void 0:g.load(),T=()=>d==null?void 0:d.show(s),O=()=>h==null?void 0:h.show(),E=Y=>t(0,v=Y.detail);function P(Y){pe[Y?"unshift":"push"](()=>{g=Y,t(6,g)})}function I(Y){v=Y,t(0,v)}function N(Y){b=Y,t(1,b)}const B=Y=>h==null?void 0:h.show(Y==null?void 0:Y.detail);function U(Y){pe[Y?"unshift":"push"](()=>{c=Y,t(3,c)})}function ee(Y){pe[Y?"unshift":"push"](()=>{d=Y,t(4,d)})}function J(Y){pe[Y?"unshift":"push"](()=>{h=Y,t(5,h)})}const ie=()=>g==null?void 0:g.load(),Q=()=>g==null?void 0:g.load();return n.$$.update=()=>{if(n.$$.dirty[0]&2048&&t(7,i=l.filter(Y=>Y.name!="profiles")),n.$$.dirty[0]&1028&&(s==null?void 0:s.id)&&y!=s.id&&C(),n.$$.dirty[0]&7&&(b||v||(s==null?void 0:s.id))){const Y=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:v,sort:b}).toString();Si("/collections?"+Y)}},[v,b,s,c,d,h,g,i,a,u,y,l,S,$,M,T,O,E,P,I,N,B,U,ee,J,ie,Q]}class _T extends Ee{constructor(e){super(),Oe(this,e,gT,mT,De,{},null,[-1,-1])}}function Rp(n){let e,t;return e=new Re({props:{class:"form-field disabled",name:"id",$$slots:{default:[bT,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&2|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function bT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=D(),s=_("span"),s.textContent="ID",o=D(),r=_("input"),p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[31]),p(r,"type","text"),p(r,"id",a=n[31]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[1]&1&&l!==(l=f[31])&&p(e,"for",l),c[1]&1&&a!==(a=f[31])&&p(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function Hp(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-shield-check-line"></i>',p(e,"class","form-field-addon txt-success")},m(s,l){w(s,e,l),t||(i=We(vt.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function vT(n){let e,t,i,s,l,o,r,a,u,f,c,d=n[1].verified&&Hp();return{c(){e=_("label"),t=_("i"),i=D(),s=_("span"),s.textContent="Email",o=D(),d&&d.c(),r=D(),a=_("input"),p(t,"class",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[31]),p(a,"type","email"),p(a,"autocomplete","off"),p(a,"id",u=n[31]),a.required=!0},m(h,g){w(h,e,g),m(e,t),m(e,i),m(e,s),w(h,o,g),d&&d.m(h,g),w(h,r,g),w(h,a,g),Te(a,n[2]),f||(c=X(a,"input",n[19]),f=!0)},p(h,g){g[1]&1&&l!==(l=h[31])&&p(e,"for",l),h[1].verified?d||(d=Hp(),d.c(),d
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[16]),t=!0)},p:le,d(s){s&&k(e),t=!1,i()}}}function MT(n){let e,t,i,s,l=!n[1].verified&&Bp(n);return{c(){l&&l.c(),e=D(),t=_("button"),t.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,p(t,"type","button"),p(t,"class","dropdown-item")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),i||(s=X(t,"click",n[17]),i=!0)},p(o,r){o[1].verified?l&&(l.d(1),l=null):l?l.p(o,r):(l=Bp(o),l.c(),l.m(e.parentNode,e))},d(o){l&&l.d(o),o&&k(e),o&&k(t),i=!1,s()}}}function TT(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&zp(n);return{c(){h&&h.c(),e=D(),t=_("button"),i=_("span"),i.textContent="Cancel",s=D(),l=_("button"),o=_("span"),a=F(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[5],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[5],ne(l,"btn-loading",n[5])},m(g,v){h&&h.m(g,v),w(g,e,v),w(g,t,v),m(t,i),w(g,s,v),w(g,l,v),m(l,o),m(o,a),f=!0,c||(d=X(t,"click",n[18]),c=!0)},p(g,v){g[1].isNew?h&&(Pe(),L(h,1,1,()=>{h=null}),Le()):h?(h.p(g,v),v[0]&2&&A(h,1)):(h=zp(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||v[0]&32)&&(t.disabled=g[5]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&ue(a,r),(!f||v[0]&1056&&u!==(u=!g[10]||g[5]))&&(l.disabled=u),v[0]&32&&ne(l,"btn-loading",g[5])},i(g){f||(A(h),f=!0)},o(g){L(h),f=!1},d(g){h&&h.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function DT(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[TT],header:[CT],default:[ST]},$$scope:{ctx:n}};return e=new mi({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&1088&&(o.beforeHide=s[24]),l[0]&1966|l[1]&2&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[25](null),q(e,s)}}}function OT(n,e,t){let i;const s=rn(),l="user_"+W.randomString(5);let o,r=new po,a=!1,u=!1,f="",c="",d="",h=!1,g=!0;function v(Y){return y(Y),t(6,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(Y){hi({}),t(1,r=Y!=null&&Y.clone?Y.clone():new po),C()}function C(){t(3,h=!1),t(9,g=!0),t(2,f=(r==null?void 0:r.email)||""),t(7,c=""),t(8,d="")}function S(){if(a||!i)return;t(5,a=!0);const Y={email:f};(r.isNew||h)&&(Y.password=c,Y.passwordConfirm=d);let G;r.isNew?G=$e.users.create(Y):G=$e.users.update(r.id,Y),G.then(async ge=>{g&&M(!1),t(6,u=!1),b(),dn(r.isNew?"Successfully created user.":"Successfully updated user."),s("save",ge)}).catch(ge=>{$e.errorResponseHandler(ge)}).finally(()=>{t(5,a=!1)})}function $(){!(r!=null&&r.id)||pi("Do you really want to delete the selected user?",()=>$e.users.delete(r.id).then(()=>{t(6,u=!1),b(),dn("Successfully deleted user."),s("delete",r)}).catch(Y=>{$e.errorResponseHandler(Y)}))}function M(Y=!0){return $e.users.requestVerification(r.isNew?f:r.email).then(()=>{t(6,u=!1),b(),Y&&dn(`Successfully sent verification email to ${r.email}.`)}).catch(G=>{$e.errorResponseHandler(G)})}const T=()=>M(),O=()=>$(),E=()=>b();function P(){f=this.value,t(2,f)}function I(){h=this.checked,t(3,h)}function N(){c=this.value,t(7,c)}function B(){d=this.value,t(8,d)}function U(){g=this.checked,t(9,g)}const ee=()=>i&&u?(pi("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),b()}),!1):!0;function J(Y){pe[Y?"unshift":"push"](()=>{o=Y,t(4,o)})}function ie(Y){st.call(this,n,Y)}function Q(Y){st.call(this,n,Y)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(10,i=r.isNew&&f!=""||h||f!==r.email)},[b,r,f,h,o,a,u,c,d,g,i,l,S,$,M,v,T,O,E,P,I,N,B,U,ee,J,ie,Q]}class ET extends Ee{constructor(e){super(),Oe(this,e,OT,DT,De,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Up(n,e,t){const i=n.slice();return i[41]=e[t],i}function Wp(n,e,t){const i=n.slice();return i[44]=e[t],i}function Yp(n,e,t){const i=n.slice();return i[44]=e[t],i}function AT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,T,O,E,P=[],I=new Map,N,B,U,ee,J,ie,Q,Y,G,ge,_e=[],x=new Map,ae,ke,H,me,oe,K,be=!n[15]&&Kp(n);r=new Wo({}),r.$on("refresh",n[18]),h=new Uo({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","
<span class="txt">New user</span>`,d=D(),V(h.$$.fragment),g=D(),v=_("div"),b=_("table"),y=_("thead"),C=_("tr"),V(S.$$.fragment),M=D(),V(T.$$.fragment),E=D();for(let ye=0;ye<P.length;ye+=1)P[ye].c();N=D(),V(B.$$.fragment),ee=D(),V(J.$$.fragment),Q=D(),Y=_("th"),G=D(),ge=_("tbody");for(let ye=0;ye<_e.length;ye+=1)_e[ye].c();Xe&&Xe.c(),ae=D(),nt&&nt.c(),ke=D(),ft&&ft.c(),H=Ke(),p(i,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(e,"class","page-header"),p(Y,"class","col-type-action min-width"),p(b,"class","table"),ne(b,"table-loading",n[10]),p(v,"class","table-wrapper")},m(ye,Ne){w(ye,e,Ne),m(e,t),m(t,i),m(i,s),m(e,l),be&&be.m(e,null),m(e,o),j(r,e,null),m(e,a),m(e,u),m(e,f),m(e,c),w(ye,d,Ne),j(h,ye,Ne),w(ye,g,Ne),w(ye,v,Ne),m(v,b),m(b,y),m(y,C),j(S,C,null),m(C,M),j(T,C,null),m(C,E);for(let dt=0;dt<P.length;dt+=1)P[dt].m(C,null);m(C,N),j(B,C,null),m(C,ee),j(J,C,null),m(C,Q),m(C,Y),m(b,G),m(b,ge);for(let dt=0;dt<_e.length;dt+=1)_e[dt].m(ge,null);Xe&&Xe.m(ge,null),w(ye,ae,Ne),nt&&nt.m(ye,Ne),w(ye,ke,Ne),ft&&ft.m(ye,Ne),w(ye,H,Ne),me=!0,oe||(K=X(c,"click",n[19]),oe=!0)},p(ye,Ne){(!me||Ne[0]&16384)&&ue(s,ye[14]),ye[15]?be&&(be.d(1),be=null):be?be.p(ye,Ne):(be=Kp(ye),be.c(),be.m(e,o));const dt={};Ne[0]&8&&(dt.value=ye[3]),h.$set(dt);const Dt={};Ne[1]&262144&&(Dt.$$scope={dirty:Ne,ctx:ye}),!$&&Ne[0]&16&&($=!0,Dt.sort=ye[4],je(()=>$=!1)),S.$set(Dt);const pt={};Ne[1]&262144&&(pt.$$scope={dirty:Ne,ctx:ye}),!O&&Ne[0]&16&&(O=!0,pt.sort=ye[4],je(()=>O=!1)),T.$set(pt),Ne[0]&4096&&(ce=ye[12],P=kt(P,Ne,Se,1,ye,ce,I,C,Mn,Jp,N,Yp));const lt={};Ne[1]&262144&&(lt.$$scope={dirty:Ne,ctx:ye}),!U&&Ne[0]&16&&(U=!0,lt.sort=ye[4],je(()=>U=!1)),B.$set(lt);const Lt={};Ne[1]&262144&&(Lt.$$scope={dirty:Ne,ctx:ye}),!ie&&Ne[0]&16&&(ie=!0,Lt.sort=ye[4],je(()=>ie=!1)),J.$set(Lt),Ne[0]&5450&&(Me=ye[1],Pe(),_e=kt(_e,Ne,ze,1,ye,Me,x,ge,Zt,Qp,null,Up),Le(),!Me.length&&Xe?Xe.p(ye,Ne):Me.length?Xe&&(Xe.d(1),Xe=null):(Xe=Zp(ye),Xe.c(),Xe.m(ge,null))),Ne[0]&1024&&ne(b,"table-loading",ye[10]),ye[1].length?nt?nt.p(ye,Ne):(nt=xp(ye),nt.c(),nt.m(ke.parentNode,ke)):nt&&(nt.d(1),nt=null),ye[1].length&&ye[13]?ft?ft.p(ye,Ne):(ft=eh(ye),ft.c(),ft.m(H.parentNode,H)):ft&&(ft.d(1),ft=null)},i(ye){if(!me){A(r.$$.fragment,ye),A(h.$$.fragment,ye),A(S.$$.fragment,ye),A(T.$$.fragment,ye),A(B.$$.fragment,ye),A(J.$$.fragment,ye);for(let Ne=0;Ne<Me.length;Ne+=1)A(_e[Ne]);me=!0}},o(ye){L(r.$$.fragment,ye),L(h.$$.fragment,ye),L(S.$$.fragment,ye),L(T.$$.fragment,ye),L(B.$$.fragment,ye),L(J.$$.fragment,ye);for(let Ne=0;Ne<_e.length;Ne+=1)L(_e[Ne]);me=!1},d(ye){ye&&k(e),be&&be.d(),q(r),ye&&k(d),q(h,ye),ye&&k(g),ye&&k(v),q(S),q(T);for(let Ne=0;Ne<P.length;Ne+=1)P[Ne].d();q(B),q(J);for(let Ne=0;Ne<_e.length;Ne+=1)_e[Ne].d();Xe&&Xe.d(),ye&&k(ae),nt&&nt.d(ye),ye&&k(ke),ft&&ft.d(ye),ye&&k(H),oe=!1,K()}}}function PT(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading users...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function Kp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<i class="ri-settings-4-line"></i>',p(e,"type","button"),p(e,"class","btn btn-secondary btn-circle")},m(s,l){w(s,e,l),t||(i=[We(vt.call(null,e,{text:"Edit profile collection",position:"right"})),X(e,"click",n[17])],t=!0)},p:le,d(s){s&&k(e),t=!1,Ge(i)}}}function LT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="id",p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&k(e)}}}function IT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="email",p(t,"class",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&k(e)}}}function Jp(n,e){let t,i,s,l,o,r,a,u=e[44].name+"",f,c,d;return{key:n,first:null,c(){t=_("th"),i=_("div"),s=_("i"),o=D(),r=_("span"),a=F("profile."),f=F(u),p(s,"class",l=W.getFieldTypeIcon(e[44].type)),p(r,"class","txt"),p(i,"class","col-header-content"),p(t,"class",c="col-type-"+e[44].type+" col-field-"+e[44].name),p(t,"name",d=e[44].name),this.first=t},m(h,g){w(h,t,g),m(t,i),m(i,s),m(i,o),m(i,r),m(r,a),m(r,f)},p(h,g){e=h,g[0]&4096&&l!==(l=W.getFieldTypeIcon(e[44].type))&&p(s,"class",l),g[0]&4096&&u!==(u=e[44].name+"")&&ue(f,u),g[0]&4096&&c!==(c="col-type-"+e[44].type+" col-field-"+e[44].name)&&p(t,"class",c),g[0]&4096&&d!==(d=e[44].name)&&p(t,"name",d)},d(h){h&&k(t)}}}function FT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="created",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&k(e)}}}function NT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="updated",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&k(e)}}}function Zp(n){let e;function t(l,o){return l[10]?HT:RT}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function RT(n){var r;let e,t,i,s,l,o=((r=n[3])==null?void 0:r.length)&&Gp(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No users found.",s=D(),o&&o.c(),l=D(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[3])!=null&&f.length?o?o.p(a,u):(o=Gp(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function HT(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Gp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[27]),t=!0)},p:le,d(s){s&&k(e),t=!1,i()}}}function Xp(n,e){let t,i,s;return i=new J_({props:{field:e[44],record:e[41].profile||{}}}),{key:n,first:null,c(){t=Ke(),V(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),j(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&4096&&(r.field=e[44]),o[0]&2&&(r.record=e[41].profile||{}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),q(i,l)}}}function Qp(n,e){let t,i,s,l,o,r,a,u=e[41].email+"",f,c,d,h,g=e[41].verified?"Verified":"Unverified",v,b,y=[],C=new Map,S,$,M,T,O,E,P,I,N,B,U,ee,J,ie,Q;s=new xo({props:{id:e[41].id}});let Y=e[12];const G=x=>x[44].name;for(let x=0;x<Y.length;x+=1){let ae=Wp(e,Y,x),ke=G(ae);C.set(ke,y[x]=Xp(ke,ae))}M=new $i({props:{date:e[41].created}}),E=new $i({props:{date:e[41].updated}});function ge(){return e[25](e[41])}function _e(){return e[26](e[41])}return{key:n,first:null,c(){t=_("tr"),i=_("td"),V(s.$$.fragment),l=D(),o=_("td"),r=_("div"),a=_("span"),f=F(u),d=D(),h=_("span"),v=F(g),b=D();for(let x=0;x<y.length;x+=1)y[x].c();S=D(),$=_("td"),V(M.$$.fragment),T=D(),O=_("td"),V(E.$$.fragment),P=D(),I=_("td"),N=_("button"),N.innerHTML=`<i class="ri-user-settings-line"></i>
<span class="txt">Edit user</span>`,B=D(),U=_("button"),U.innerHTML=`<i class="ri-profile-line"></i>
<span class="txt">Edit profile</span>`,ee=D(),p(i,"class","col-type-text col-field-id"),p(a,"class","txt"),p(a,"title",c=e[41].email),p(h,"class","label"),ne(h,"label-success",e[41].verified),ne(h,"label-warning",!e[41].verified),p(r,"class","inline-flex"),p(o,"class","col-type-email col-field-email"),p($,"class","col-type-date col-field-created"),p(O,"class","col-type-date col-field-updated"),p(N,"type","button"),p(N,"class","btn btn-sm btn-outline"),p(U,"type","button"),p(U,"class","btn btn-sm m-l-10"),p(I,"class","col-type-action min-width"),this.first=t},m(x,ae){w(x,t,ae),m(t,i),j(s,i,null),m(t,l),m(t,o),m(o,r),m(r,a),m(a,f),m(r,d),m(r,h),m(h,v),m(t,b);for(let ke=0;ke<y.length;ke+=1)y[ke].m(t,null);m(t,S),m(t,$),j(M,$,null),m(t,T),m(t,O),j(E,O,null),m(t,P),m(t,I),m(I,N),m(I,B),m(I,U),m(t,ee),J=!0,ie||(Q=[X(N,"click",ti(ge)),X(U,"click",ti(_e))],ie=!0)},p(x,ae){e=x;const ke={};ae[0]&2&&(ke.id=e[41].id),s.$set(ke),(!J||ae[0]&2)&&u!==(u=e[41].email+"")&&ue(f,u),(!J||ae[0]&2&&c!==(c=e[41].email))&&p(a,"title",c),(!J||ae[0]&2)&&g!==(g=e[41].verified?"Verified":"Unverified")&&ue(v,g),ae[0]&2&&ne(h,"label-success",e[41].verified),ae[0]&2&&ne(h,"label-warning",!e[41].verified),ae[0]&4098&&(Y=e[12],Pe(),y=kt(y,ae,G,1,e,Y,C,t,Zt,Xp,S,Wp),Le());const H={};ae[0]&2&&(H.date=e[41].created),M.$set(H);const me={};ae[0]&2&&(me.date=e[41].updated),E.$set(me)},i(x){if(!J){A(s.$$.fragment,x);for(let ae=0;ae<Y.length;ae+=1)A(y[ae]);A(M.$$.fragment,x),A(E.$$.fragment,x),J=!0}},o(x){L(s.$$.fragment,x);for(let ae=0;ae<y.length;ae+=1)L(y[ae]);L(M.$$.fragment,x),L(E.$$.fragment,x),J=!1},d(x){x&&k(t),q(s);for(let ae=0;ae<y.length;ae+=1)y[ae].d();q(M),q(E),ie=!1,Ge(Q)}}}function xp(n){let e,t,i=n[1].length+"",s,l,o;return{c(){e=_("small"),t=F("Showing "),s=F(i),l=F(" of "),o=F(n[2]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&2&&i!==(i=r[1].length+"")&&ue(s,i),a[0]&4&&ue(o,r[2])},d(r){r&&k(e)}}}function eh(n){let e,t,i,s,l=n[2]-n[1].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=F("Load more ("),o=F(l),r=F(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ne(t,"btn-loading",n[10]),ne(t,"btn-disabled",n[10]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=X(t,"click",n[28]),a=!0)},p(f,c){c[0]&6&&l!==(l=f[2]-f[1].length+"")&&ue(o,l),c[0]&1024&&ne(t,"btn-loading",f[10]),c[0]&1024&&ne(t,"btn-disabled",f[10])},d(f){f&&k(e),a=!1,u()}}}function jT(n){let e,t,i,s;const l=[PT,AT],o=[];function r(a,u){return a[11]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(Pe(),L(o[f],1,1,()=>{o[f]=null}),Le(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){L(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function qT(n){let e,t,i,s,l,o,r,a;e=new On({props:{$$slots:{default:[jT]},$$scope:{ctx:n}}});let u={};i=new ET({props:u}),n[29](i),i.$on("save",n[30]),i.$on("delete",n[31]);let f={};l=new Za({props:f}),n[32](l),l.$on("save",n[33]);let c={collection:n[5]};return r=new K_({props:c}),n[34](r),r.$on("save",n[35]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment),o=D(),V(r.$$.fragment)},m(d,h){j(e,d,h),w(d,t,h),j(i,d,h),w(d,s,h),j(l,d,h),w(d,o,h),j(r,d,h),a=!0},p(d,h){const g={};h[0]&65534|h[1]&262144&&(g.$$scope={dirty:h,ctx:d}),e.$set(g);const v={};i.$set(v);const b={};l.$set(b);const y={};h[0]&32&&(y.collection=d[5]),r.$set(y)},i(d){a||(A(e.$$.fragment,d),A(i.$$.fragment,d),A(l.$$.fragment,d),A(r.$$.fragment,d),a=!0)},o(d){L(e.$$.fragment,d),L(i.$$.fragment,d),L(l.$$.fragment,d),L(r.$$.fragment,d),a=!1},d(d){q(e,d),d&&k(t),n[29](null),q(i,d),d&&k(s),n[32](null),q(l,d),d&&k(o),n[34](null),q(r,d)}}}function VT(n,e,t){let i,s,l,o,r;at(n,Ho,K=>t(36,l=K)),at(n,Ft,K=>t(14,o=K)),at(n,rs,K=>t(15,r=K)),tn(Ft,o="Users",o);const a=new URLSearchParams(l),u=["id","userId","created","updated"];let f,c,d,h=[],g=1,v=0,b=!1,y=a.get("filter")
<span class="txt">Application</span>`,o=D(),r=_("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=D(),u=_("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=D(),c=_("div"),c.innerHTML=`<span class="txt">Sync</span>
<small class="label label-danger label-sm">Experimental</small>`,d=D(),h=_("a"),h.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,g=D(),v=_("a"),v.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,b=D(),y=_("div"),y.textContent="Authentication",C=D(),S=_("a"),S.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,$=D(),M=_("a"),M.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,T=D(),O=_("a"),O.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"class","sidebar-title"),p(h,"href","/settings/export-collections"),p(h,"class","sidebar-list-item"),p(v,"href","/settings/import-collections"),p(v,"class","sidebar-list-item"),p(y,"class","sidebar-title"),p(S,"href","/settings/auth-providers"),p(S,"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(I,N){w(I,e,N),m(e,t),m(t,i),m(t,s),m(t,l),m(t,o),m(t,r),m(t,a),m(t,u),m(t,f),m(t,c),m(t,d),m(t,h),m(t,g),m(t,v),m(t,b),m(t,y),m(t,C),m(t,S),m(t,$),m(t,M),m(t,T),m(t,O),E||(P=[We(jn.call(null,l,{path:"/settings"})),We(mn.call(null,l)),We(jn.call(null,r,{path:"/settings/mail/?.*"})),We(mn.call(null,r)),We(jn.call(null,u,{path:"/settings/storage/?.*"})),We(mn.call(null,u)),We(jn.call(null,h,{path:"/settings/export-collections/?.*"})),We(mn.call(null,h)),We(jn.call(null,v,{path:"/settings/import-collections/?.*"})),We(mn.call(null,v)),We(jn.call(null,S,{path:"/settings/auth-providers/?.*"})),We(mn.call(null,S)),We(jn.call(null,M,{path:"/settings/tokens/?.*"})),We(mn.call(null,M)),We(jn.call(null,O,{path:"/settings/admins/?.*"})),We(mn.call(null,O))],E=!0)},p:le,i:le,o:le,d(I){I&&k(e),E=!1,Ge(P)}}}class Bi extends Ee{constructor(e){super(),Oe(this,e,null,BT,De,{})}}function th(n,e,t){const i=n.slice();return i[31]=e[t],i}function nh(n){let e,t;return e=new Re({props:{class:"form-field disabled",name:"id",$$slots:{default:[UT,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function UT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=D(),s=_("span"),s.textContent="ID",o=D(),r=_("input"),p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","text"),p(r,"id",a=n[30]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[0]&1073741824&&l!==(l=f[30])&&p(e,"for",l),c[0]&1073741824&&a!==(a=f[30])&&p(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function ih(n){let e,t,i,s,l,o,r;function a(){return n[17](n[31])}function u(...f){return n[18](n[31],...f)}return{c(){e=_("figure"),t=_("img"),s=D(),ei(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"tabindex","0"),p(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(f,c){w(f,e,c),m(e,t),m(e,s),o||(r=[X(e,"click",a),X(e,"keydown",u)],o=!0)},p(f,c){n=f,c[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(f){f&&k(e),o=!1,Ge(r)}}}function WT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=D(),s=_("span"),s.textContent="Email",o=D(),r=_("input"),p(t,"class",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Te(r,n[3]),u||(f=X(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&Te(r,c[3])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function sh(n){let e,t;return e=new Re({props:{class:"form-field form-field-toggle",$$slots:{default:[YT,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[15]),t=!0)},p:le,d(s){s&&k(e),t=!1,i()}}}function QT(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&oh(n);return{c(){h&&h.c(),e=D(),t=_("button"),i=_("span"),i.textContent="Cancel",s=D(),l=_("button"),o=_("span"),a=F(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[6],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],ne(l,"btn-loading",n[6])},m(g,v){h&&h.m(g,v),w(g,e,v),w(g,t,v),m(t,i),w(g,s,v),w(g,l,v),m(l,o),m(o,a),f=!0,c||(d=X(t,"click",n[16]),c=!0)},p(g,v){g[1].isNew?h&&(Pe(),L(h,1,1,()=>{h=null}),Le()):h?(h.p(g,v),v[0]&2&&A(h,1)):(h=oh(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||v[0]&64)&&(t.disabled=g[6]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&ue(a,r),(!f||v[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),v[0]&64&&ne(l,"btn-loading",g[6])},i(g){f||(A(h),f=!0)},o(g){L(h),f=!1},d(g){h&&h.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function xT(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[QT],header:[GT],default:[ZT]},$$scope:{ctx:n}};return e=new mi({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[23]),l[0]&1886|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[24](null),q(e,s)}}}function eD(n,e,t){let i;const s=rn(),l="admin_"+W.randomString(5);let o,r=new Ss,a=!1,u=!1,f=0,c="",d="",h="",g=!1;function v(Q){return y(Q),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(Q){hi({}),t(1,r=Q!=null&&Q.clone?Q.clone():new Ss),C()}function C(){t(4,g=!1),t(3,c=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,d=""),t(9,h="")}function S(){if(a||!i)return;t(6,a=!0);const Q={email:c,avatar:f};(r.isNew||g)&&(Q.password=d,Q.passwordConfirm=h);let Y;r.isNew?Y=$e.admins.create(Q):Y=$e.admins.update(r.id,Q),Y.then(async G=>{var ge;t(7,u=!1),b(),dn(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",G),((ge=$e.authStore.model)==null?void 0:ge.id)===G.id&&$e.authStore.save($e.authStore.token,G)}).catch(G=>{$e.errorResponseHandler(G)}).finally(()=>{t(6,a=!1)})}function $(){!(r!=null&&r.id)||pi("Do you really want to delete the selected admin?",()=>$e.admins.delete(r.id).then(()=>{t(7,u=!1),b(),dn("Successfully deleted admin."),s("delete",r)}).catch(Q=>{$e.errorResponseHandler(Q)}))}const M=()=>$(),T=()=>b(),O=Q=>t(2,f=Q),E=(Q,Y)=>{(Y.code==="Enter"||Y.code==="Space")&&(Y.preventDefault(),t(2,f=Q))};function P(){c=this.value,t(3,c)}function I(){g=this.checked,t(4,g)}function N(){d=this.value,t(8,d)}function B(){h=this.value,t(9,h)}const U=()=>i&&u?(pi("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function ee(Q){pe[Q?"unshift":"push"](()=>{o=Q,t(5,o)})}function J(Q){st.call(this,n,Q)}function ie(Q){st.call(this,n,Q)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||g||c!==r.email||f!==r.avatar)},[b,r,f,c,g,o,a,u,d,h,i,l,S,$,v,M,T,O,E,P,I,N,B,U,ee,J,ie]}class tD extends Ee{constructor(e){super(),Oe(this,e,eD,xT,De,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function rh(n,e,t){const i=n.slice();return i[24]=e[t],i}function nD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="id",p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&k(e)}}}function iD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="email",p(t,"class",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&k(e)}}}function sD(n){let e,t,i,s;return{c(){e=
`},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function uh(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[17]),t=!0)},p:le,d(s){s&&k(e),t=!1,i()}}}function fh(n){let e;return{c(){e=_("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ch(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,g=e[24].email+"",v,b,y,C,S,$,M,T,O,E,P,I,N,B;u=new xo({props:{id:e[24].id}});let U=e[24].id===e[7].id&&fh();S=new $i({props:{date:e[24].created}}),T=new $i({props:{date:e[24].updated}});function ee(){return e[15](e[24])}function J(...ie){return e[16](e[24],...ie)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("figure"),l=_("img"),r=D(),a=_("td"),V(u.$$.fragment),f=D(),U&&U.c(),c=D(),d=_("td"),h=_("span"),v=F(g),y=D(),C=_("td"),V(S.$$.fragment),$=D(),M=_("td"),V(T.$$.fragment),O=D(),E=_("td"),E.innerHTML='<i class="ri-arrow-right-line"></i>',P=D(),ei(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(l,"src",o),p(l,"alt","Admin avatar"),p(s,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(a,"class","col-type-text col-field-id"),p(h,"class","txt txt-ellipsis"),p(h,"title",b=e[24].email),p(d,"class","col-type-email col-field-email"),p(C,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(E,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ie,Q){w(ie,t,Q),m(t,i),m(i,s),m(s,l),m(t,r),m(t,a),j(u,a,null),m(a,f),U&&U.m(a,null),m(t,c),m(t,d),m(d,h),m(h,v),m(t,y),m(t,C),j(S,C,null),m(t,$),m(t,M),j(T,M,null),m(t,O),m(t,E),m(t,P),I=!0,N||(B=[X(t,"click",ee),X(t,"keydown",J)],N=!0)},p(ie,Q){e=ie,(!I||Q&16&&!ei(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const Y={};Q&16&&(Y.id=e[24].id),u.$set(Y),e[24].id===e[7].id?U||(U=fh(),U.c(),U.m(a,null)):U&&(U.d(1),U=null),(!I||Q&16)&&g!==(g=e[24].email+"")&&ue(v,g),(!I||Q&16&&b!==(b=e[24].email))&&p(h,"title",b);const G={};Q&16&&(G.date=e[24].created),S.$set(G);const ge={};Q&16&&(ge.date=e[24].updated),T.$set(ge)},i(ie){I||(A(u.$$.fragment,ie),A(S.$$.fragment,ie),A(T.$$.fragment,ie),I=!0)},o(ie){L(u.$$.fragment,ie),L(S.$$.fragment,ie),L(T.$$.fragment,ie),I=!1},d(ie){ie&&k(t),q(u),U&&U.d(),q(S),q(T),N=!1,Ge(B)}}}function dh(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=_("small"),t=F("Showing "),s=F(i),l=F(" of "),r=F(o),p(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){w(a,e,u),m(e,t),m(e,s),m(e,l),m(e,r)},p(a,u){u&16&&i!==(i=a[4].length+"")&&ue(s,i),u&16&&o!==(o=a[4].length+"")&&ue(r,o)},d(a){a&&k(e)}}}function aD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,T,O,E,P,I,N,B,U,ee,J,ie,Q,Y,G,ge,_e=[],x=new Map,ae,ke,H,me,oe;a=new Wo({}),a.$on("refresh",n[8]),g=new Uo({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),g.$on("submit",n[10]);function K(Me){n[11](Me)}let be={class:"col-type-text",name:"id",$$slots:{default:[nD]},$$scope:{ctx:n}};n[2]!==void 0&&(be.sort=n[2]),T=new ln({props:be}),pe.push(()=>Fe(T,"sort",K));function He(Me){n[12](Me)}let Ue={class:"col-type-email col-field-email",name:"email",$$slots:{default:[iD]},$$scope:{ctx:n}};n[2]!==void 0&&(Ue.sort=n[2]),P=new ln({props:Ue}),pe.push(()=>Fe(P,"sort",He));function Z(Me){n[13](Me)}let ve={class:"col-type-date col-field-created",name:"created",$$slots:{default:[sD]},$$scope:{ctx:n}};n[2]!==void 0&&(ve.sort=n[2]),B=new ln({props:ve}),pe.push(()=>Fe(B,"sort",Z));function ce(Me){n[14](Me)}let Se={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[lD]},$$scope:{ctx:n}};n[2]!==void 0&&(Se.sort=n[2]),J=new ln({props:Se}),pe.push(()=>Fe(J,"sort",ce));let Ze=n[4];const et=Me=>Me[24].id;for(let Me=0;Me<Ze.length;Me+=1){let ze=rh(n,Ze,Me),Xe=et(ze);x.set(Xe,_e[Me]=ch(Xe,ze))}let Ye=null;Ze.length||(Ye=ah(n));let tt=n[4].length&&dh(n);return{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="
<span class="txt">New admin</span>`,h=D(),V(g.$$.fragment),v=D(),b=_("div"),y=_("table"),C=_("thead"),S=_("tr"),$=_("th"),M=D(),V(T.$$.fragment),E=D(),V(P.$$.fragment),N=D(),V(B.$$.fragment),ee=D(),V(J.$$.fragment),Q=D(),Y=_("th"),G=D(),ge=_("tbody");for(let Me=0;Me<_e.length;Me+=1)_e[Me].c();Ye&&Ye.c(),ae=D(),tt&&tt.c(),ke=Ke(),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","min-width"),p(Y,"class","col-type-action min-width"),p(y,"class","table"),ne(y,"table-loading",n[5]),p(b,"class","table-wrapper")},m(Me,ze){w(Me,e,ze),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(e,r),j(a,e,null),m(e,u),m(e,f),m(e,c),m(e,d),w(Me,h,ze),j(g,Me,ze),w(Me,v,ze),w(Me,b,ze),m(b,y),m(y,C),m(C,S),m(S,$),m(S,M),j(T,S,null),m(S,E),j(P,S,null),m(S,N),j(B,S,null),m(S,ee),j(J,S,null),m(S,Q),m(S,Y),m(y,G),m(y,ge);for(let Xe=0;Xe<_e.length;Xe+=1)_e[Xe].m(ge,null);Ye&&Ye.m(ge,null),w(Me,ae,ze),tt&&tt.m(Me,ze),w(Me,ke,ze),H=!0,me||(oe=X(d,"click",n[9]),me=!0)},p(Me,ze){(!H||ze&64)&&ue(o,Me[6]);const Xe={};ze&2&&(Xe.value=Me[1]),g.$set(Xe);const nt={};ze&134217728&&(nt.$$scope={dirty:ze,ctx:Me}),!O&&ze&4&&(O=!0,nt.sort=Me[2],je(()=>O=!1)),T.$set(nt);const ft={};ze&134217728&&(ft.$$scope={dirty:ze,ctx:Me}),!I&&ze&4&&(I=!0,ft.sort=Me[2],je(()=>I=!1)),P.$set(ft);const ye={};ze&134217728&&(ye.$$scope={dirty:ze,ctx:Me}),!U&&ze&4&&(U=!0,ye.sort=Me[2],je(()=>U=!1)),B.$set(ye);const Ne={};ze&134217728&&(Ne.$$scope={dirty:ze,ctx:Me}),!ie&&ze&4&&(ie=!0,Ne.sort=Me[2],je(()=>ie=!1)),J.$set(Ne),ze&186&&(Ze=Me[4],Pe(),_e=kt(_e,ze,et,1,Me,Ze,x,ge,Zt,ch,null,rh),Le(),!Ze.length&&Ye?Ye.p(Me,ze):Ze.length?Ye&&(Ye.d(1),Ye=null):(Ye=ah(Me),Ye.c(),Ye.m(ge,null))),ze&32&&ne(y,"table-loading",Me[5]),Me[4].length?tt?tt.p(Me,ze):(tt=dh(Me),tt.c(),tt.m(ke.parentNode,ke)):tt&&(tt.d(1),tt=null)},i(Me){if(!H){A(a.$$.fragment,Me),A(g.$$.fragment,Me),A(T.$$.fragment,Me),A(P.$$.fragment,Me),A(B.$$.fragment,Me),A(J.$$.fragment,Me);for(let ze=0;ze<Ze.length;ze+=1)A(_e[ze]);H=!0}},o(Me){L(a.$$.fragment,Me),L(g.$$.fragment,Me),L(T.$$.fragment,Me),L(P.$$.fragment,Me),L(B.$$.fragment,Me),L(J.$$.fragment,Me);for(let ze=0;ze<_e.length;ze+=1)L(_e[ze]);H=!1},d(Me){Me&&k(e),q(a),Me&&k(h),q(g,Me),Me&&k(v),Me&&k(b),q(T),q(P),q(B),q(J);for(let ze=0;ze<_e.length;ze+=1)_e[ze].d();Ye&&Ye.d(),Me&&k(ae),tt&&tt.d(Me),Me&&k(ke),me=!1,oe()}}}function uD(n){let e,t,i,s,l,o;e=new Bi({}),i=new On({props:{$$slots:{default:[aD]},$$scope:{ctx:n}}});let r={};return l=new tD({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),w(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){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){q(e,a),a&&k(t),q(i,a),a&&k(s),n[18](null),q(l,a)}}}function fD(n,e,t){let i,s,l;at(n,Ho,N=>t(21,i=N)),at(n,Ft,N=>t(6,s=N)),at(n,Sa,N=>t(7,l=N)),tn(Ft,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=[]),$e.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),h(),$e.errorResponseHandler(N,!1))})}function h(){t(4,a=[])}const g=()=>d(),v=()=>r==null?void 0:r.show(),b=N=>t(1,f=N.detail);function y(N){c=N,t(2,c)}function C(N){c=N,t(2,c)}function S(N){c=N,t(2,c)}function $(N){c=N,t(2,c)}const M=N=>r==null?void 0:r.show(N),T=(N,B)=>{(B.code==="Enter"||B.code==="Space")&&(B.preventDefault(),r==null||r.show(N))},O=()=>t(1,f="");function E(N){pe[N?"unshift":"push"](()=>{r=N,t(3,r)})}const P=()=>d(),I=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const N=new URLSearchParams({filter:f,sort:c}).toString();Si("/settings/admins?"+N),d()}},[d,f,c,r,a,u,s,l,g,v,b,y,C,S,$,M,T,O
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),ne(a,"btn-disabled",n[2]),ne(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){w(d,e,h),m(e,t),m(e,i),j(s,e,null),m(e,l),j(o,e,null),m(e,r),m(e,a),u=!0,f||(c=X(e,"submit",Yt(n[3])),f=!0)},p(d,h){const g={};h&769&&(g.$$scope={dirty:h,ctx:d}),s.$set(g);const v={};h&770&&(v.$$scope={dirty:h,ctx:d}),o.$set(v),h&4&&ne(a,"btn-disabled",d[2]),h&4&&ne(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){L(s.$$.fragment,d),L(o.$$.fragment,d),u=!1},d(d){d&&k(e),q(s),q(o),f=!1,c()}}}function mD(n){let e,t;return e=new qg({props:{$$slots:{default:[hD]},$$scope:{ctx:n}}}),{c(){V(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){L(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function gD(n,e,t){let i;at(n,Ho,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),$e.admins.authViaEmail(l,o).then(()=>{Si("/")}).catch(()=>{_o("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 _D extends Ee{constructor(e){super(),Oe(this,e,gD,mD,De,{})}}function bD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M;i=new Re({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[yD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[kD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),a=new Re({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[wD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),f=new Re({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[$D,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}});let T=n[3]&&ph(n);return{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=D(),l=_("div"),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),V(f.$$.fragment),c=D(),d=_("div"),h=_("div"),g=D(),T&&T.c(),v=D(),b=_("button"),y=_("span"),y.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(h,"class","flex-fill"),p(y,"class","txt"),p(b,"type","submit"),p(b,"class","btn btn-expanded"),b.disabled=C=!n[3]||n[2],ne(b,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(O,E){w(O,e,E),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),j(a,e,null),m(e,u),j(f,e,null),m(e,c),m(e,d),m(d,h),m(d,g),T&&T.m(d,null),m(d,v),m(d,b),m(b,y),S=!0,$||(M=X(b,"click",n[13]),$=!0)},p(O,E){const P={};E&1572865&&(P.$$scope={dirty:E,ctx:O}),i.$set(P);const I={};E&1572865&&(I.$$scope={dirty:E,ctx:O}),o.$set(I);const N={};E&1572865&&(N.$$scope={dirty:E,ctx:O}),a.$set(N);const B={};E&1572865&&(B.$$scope={dirty:E,ctx:O}),f.$set(B),O[3]?T?T.p(O,E):(T=ph(O),T.c(),T.m(d,v)):T&&(T.d(1),T=null),(!S||E&12&&C!==(C=!O[3]||O[2]))&&(b.disabled=C),E&4&&ne(b,"btn-loading",O[2])},i(O){S||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(a.$$.fragment,O),A(f.$$.fragment,O),S=!0)},o(O){L(i.$$.fragment,O),L(o.$$.fragment,O),L(a.$$.fragment,O),L(f.$$.fragment,O),S=!1},d(O){O&&k(e),q(i),q(o),q(a),q(f),T&&T.d(),$=!1,M()}}}function vD(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function yD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Application name"),s=D(),l=_("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].meta.appName),r||(a=X(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&&Te(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function kD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Application url"),s=D(),l=_("input"),p(e,"for",i=n[
<div class="breadcrumb-item">Application</div></nav>`,t=D(),i=_("div"),s=_("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(h,g){w(h,e,g),w(h,t,g),w(h,i,g),m(i,s),c[l].m(s,null),r=!0,a||(u=X(s,"submit",Yt(n[4])),a=!0)},p(h,g){let v=l;l=d(h),l===v?c[l].p(h,g):(Pe(),L(c[v],1,1,()=>{c[v]=null}),Le(),o=c[l],o?o.p(h,g):(o=c[l]=f[l](h),o.c()),A(o,1),o.m(s,null))},i(h){r||(A(o),r=!0)},o(h){L(o),r=!1},d(h){h&&k(e),h&&k(t),h&&k(i),c[l].d(),a=!1,u()}}}function CD(n){let e,t,i,s;return e=new Bi({}),i=new On({props:{$$slots:{default:[SD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(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){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&k(t),q(i,l)}}}function MD(n,e,t){let i,s,l,o;at(n,rs,T=>t(14,s=T)),at(n,vo,T=>t(15,l=T)),at(n,Ft,T=>t(16,o=T)),tn(Ft,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const T=await $e.settings.getAll()||{};g(T)}catch(T){$e.errorResponseHandler(T)}t(1,u=!1)}async function h(){if(!(f||!i)){t(2,f=!0);try{const T=await $e.settings.update(W.filterRedactedProps(a));g(T),dn("Successfully saved application settings.")}catch(T){$e.errorResponseHandler(T)}t(2,f=!1)}}function g(T={}){var O,E;tn(vo,l=(O=T==null?void 0:T.meta)==null?void 0:O.appName,l),tn(rs,s=!!((E=T==null?void 0:T.meta)!=null&&E.hideControls),s),t(0,a={meta:(T==null?void 0:T.meta)||{},logs:(T==null?void 0:T.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function v(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function b(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function C(){a.logs.maxDays=Pt(this.value),t(0,a)}function S(){a.meta.hideControls=this.checked,t(0,a)}const $=()=>v(),M=()=>h();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,h,v,r,c,b,y,C,S,$,M]}class TD extends Ee{constructor(e){super(),Oe(this,e,MD,CD,De,{})}}function DD(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=ut(l,s[o]);return{c(){e=_("input"),di(e,l)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[7](e),Te(e,n[0]),t||(i=X(e,"input",n[8]),t=!0)},p(o,r){di(e,l=pn(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&Te(e,o[0])},d(o){o&&k(e),n[7](null),t=!1,i()}}}function OD(n){let e,t,i,s,l,o,r=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let u=0;u<r.length;u+=1)a=ut(a,r[u]);return{c(){e=_("div"),t=_("button"),t.innerHTML='<i class="ri-key-line"></i>',i=D(),s=_("input"),p(t,"type","button"),p(t,"class","btn btn-secondary btn-circle"),p(e,"class","form-field-addon"),di(s,a)},m(u,f){w(u,e,f),m(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[We(vt.call(null,t,{position:"left",text:"Set new value"})),X(t,"click",n[6])],l=!0)},p(u,f){di(s,a=pn(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&k(e),u&&k(i),u&&k(s),l=!1,Ge(o)}}}function ED(n){let e;function t(l,o){return l[3]?OD:DD}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:le,o:le,d(l){s.d(l),l&&k(e)}}}function AD(n,e,t){const i=["value","mask"];let s=Bt(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await si(),r==null||r.focus()}const f=()=>u();function c(h){pe[h?"unshift":"push"](()=>{r=h,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=ut(ut({},e),ii(h)),t(5,s=Bt(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,o=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&l===o&&t(3,a=!0)},[l,o,r,a,u,s,f,c,d]}class Ga extends Ee{constructor(e){super(),Oe(this,e,AD,ED,De,{value:0,mask:1})}}function PD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v;return{c(){e=_("label"),t=F("Subject"),s=D(),l=_("input"),r=D(),a=_("div"),u=F(`Available placeholder para
`),f=_("span"),f.textContent=`{APP_NAME}
`,c=F(`,
`),d=_("span"),d.textContent=`{APP_URL}
`,h=F("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(b,y){w(b,e,y),m(e,t),w(b,s,y),w(b,l,y),Te(l,n[0].subject),w(b,r,y),w(b,a,y),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),g||(v=[X(l,"input",n[13]),X(f,"click",n[14]),X(d,"click",n[15])],g=!0)},p(b,y){y[1]&1&&i!==(i=b[31])&&p(e,"for",i),y[1]&1&&o!==(o=b[31])&&p(l,"id",o),y[0]&1&&l.value!==b[0].subject&&Te(l,b[0].subject)},d(b){b&&k(e),b&&k(s),b&&k(l),b&&k(r),b&&k(a),g=!1,Ge(v)}}}function LD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y;return{c(){e=_("label"),t=F("Action URL"),s=D(),l=_("input"),r=D(),a=_("div"),u=F(`Available placeholder parameters:
`),f=_("span"),f.textContent=`{APP_NAME}
`,c=F(`,
`),d=_("span"),d.textContent=`{APP_URL}
`,h=F(`,
`),g=_("span"),g.textContent="{TOKEN}",v=F("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(C,S){w(C,e,S),m(e,t),w(C,s,S),w(C,l,S),Te(l,n[0].actionUrl),w(C,r,S),w(C,a,S),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),m(a,g),m(a,v),b||(y=[X(l,"input",n[16]),X(f,"click",n[17]),X(d,"click",n[18]),X(g,"click",n[19])],b=!0)},p(C,S){S[1]&1&&i!==(i=C[31])&&p(e,"for",i),S[1]&1&&o!==(o=C[31])&&p(l,"id",o),S[0]&1&&l.value!==C[0].actionUrl&&Te(l,C[0].actionUrl)},d(C){C&&k(e),C&&k(s),C&&k(l),C&&k(r),C&&k(a),b=!1,Ge(y)}}}function ID(n){let e,t,i,s;return{c(){e=_("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","12"),e.required=!0},m(l,o){w(l,e,o),Te(e,n[0].body),i||(s=X(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&Te(e,l[0].body)},i:le,o:le,d(l){l&&k(e),i=!1,s()}}}function FD(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=new o(r(n)),pe.push(()=>Fe(e,"value",l))),{c(){e&&V(e.$$.fragment),i=Ke()},m(a,u){e&&j(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,je(()=>t=!1)),o!==(o=a[4])){if(e){Pe();const c=e;L(c.$$.fragment,1,0,()=>{q(c,1)}),Le()}o?(e=new o(r(a)),pe.push(()=>Fe(e,"value",l)),V(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&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&q(e,a)}}}function ND(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$;const M=[FD,ID],T=[];function O(E,P){return E[4]&&!E[5]?0:1}return l=O(n),o=T[l]=M[l](n),{c(){e=_("label"),t=F("Body (HTML)"),s=D(),o.c(),r=D(),a=_("div"),u=F(`Available placeholder parameters:
`),f=_("span"),f.textContent=`{APP_NAME}
`,c=F(`,
`),d=_("span"),d.textContent=`{APP_URL}
`,h=F(`,
`),g=_("span"),g.textContent=`{TOKEN}
`,v=F(`,
`),b=_("span"),b.textContent=`{ACTION_URL}
2022-08-19 01:32:07 +08:00
`,y=F("."),p(e,"for",i=n[31]),p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"class","label label-sm link-primary txt-mono"),p(b,"class","label label-sm link-primary txt-mono"),p(b,"title","Required parameter"),p(a,"class","help-block")},m(E,P){w(E,e,P),m(e,t),w(E,s,P),T[l].m(E,P),w(E,r,P),w(E,a,P),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),m(a,g),m(a,v),m(a,b),m(a,y),C=!0,S||($=[X(f,"click",n[22]),X(d,"click",n[23]),X(g,"click",n[24]),X(b,"click",n[25])],S=!0)},p(E,P){(!C||P[1]&1&&i!==(i=E[31]))&&p(e,"for",i);let I=l;l=O(E),l===I?T[l].p(E,P):(Pe(),L(T[I],1,1,()=>{T[I]=null}),Le(),o=T[l],o?o.p(E,P):(o=T[l]=M[l](E),o.c()),A(o,1),o.m(r.parentNode,r))},i(E){C||(A(o),C=!0)},o(E){L(o),C=!1},d(E){E&&k(e),E&&k(s),T[l].d(E),E&&k(r),E&&k(a),S=!1,Ge($)}}}function RD(n){let e,t,i,s,l,o;return e=new Re({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[PD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new Re({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[LD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new Re({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[ND,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment)},m(r,a){j(e,r,a),w(r,t,a),j(i,r,a),w(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){L(e.$$.fragment,r),L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){q(e,r),r&&k(t),q(i,r),r&&k(s),q(l,r)}}}function hh(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=We(vt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=it(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=it(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function HD(n){let e,t,i,s,l,o,r,a,u,f,c=n[6]&&hh();return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),l=F(n[2]),o=D(),r=_("div"),a=D(),c&&c.c(),u=Ke(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,s),m(s,l),w(d,o,h),w(d,r,h),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&ue(l,d[2]),d[6]?c?h[0]&64&&A(c,1):(c=hh(),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Pe(),L(c,1,1,()=>{c=null}),Le())},i(d){f||(A(c),f=!0)},o(d){L(c),f=!1},d(d){d&&k(e),d&&k(o),d&&k(r),d&&k(a),c&&c.d(d),d&&k(u)}}}function jD(n){let e,t;const i=[n[8]];let s={$$slots:{header:[HD],default:[RD]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=ut(s,i[l]);return e=new Qo({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){V(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,o){const r=o[0]&256?pn(i,[li(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[26](null),q(e,l)}}}function qD(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Bt(e,s),o;at(n,qi,G=>t(12,o=G));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c,d=!1;function h(){f==null||f.expand()}function g(){f==null||f.collapse()}function v(){f==null||f.collapseSiblings()}async function b(){c||d||(t(5,d=!0),t(4,c=(await Ai(()=>import("./CodeEditor.96a0fdf8.js"),["CodeEditor.96a0fdf8.js","index.90bde420.js"],import.meta.url)).default),t(5,d=!1))}b();function y(G){W.copyToClipboard(G),Rg(`Copied ${G} to clipboard`,2e3)}function C(){u.subject=this.value,t(0,u)}const S=()=>y("{APP_NAME}"),$=()=>y("{APP_URL}");function M(){u.actionUrl=this.value,t(0,u)}const T=()=>y("{APP_NAME}"),O=()=>y("{APP_UR
2022-08-19 01:28:20 +08:00
the
`),r=_("strong"),u=F(a),f=F(`
to the
`),c=_("strong"),h=F(d),g=F(`.
`),v=_("br"),b=F(`
There are numerous command line tools that can help you, such as:
`),y=_("a"),y.textContent=`rclone
`,C=F(`,
`),S=_("a"),S.textContent=`s5cmd
`,$=F(", etc."),M=D(),T=_("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener"),p(y,"class","txt-bold"),p(S,"href","https://github.com/peak/s5cmd"),p(S,"target","_blank"),p(S,"rel","noopener"),p(S,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(T,"class","clearfix m-t-base")},m(I,N){w(I,e,N),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(c,h),m(l,g),m(l,v),m(l,b),m(l,y),m(l,C),m(l,S),m(l,$),m(e,M),m(e,T),E=!0},p(I,N){var B;(!E||N&1)&&a!==(a=(B=I[0].s3)!=null&&B.enabled?"S3 storage":"local file system")&&ue(u,a),(!E||N&2)&&d!==(d=I[1].s3.enabled?"S3 storage":"local file system")&&ue(h,d)},i(I){E||(I&&Tt(()=>{O||(O=it(e,nn,{duration:150},!0)),O.run(1)}),E=!0)},o(I){I&&(O||(O=it(e,nn,{duration:150},!1)),O.run(0)),E=!1},d(I){I&&k(e),I&&O&&O.end()}}}function bh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,T;return i=new Re({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[sO,({uniqueId:O})=>({21:O}),({uniqueId:O})=>O?2097152:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[lO,({uniqueId:O})=>({21:O}),({uniqueId:O})=>O?2097152:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field required",name:"s3.region",$$slots:{default:[oO,({uniqueId:O})=>({21:O}),({uniqueId:O})=>O?2097152:0]},$$scope:{ctx:n}}}),d=new Re({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[rO,({uniqueId:O})=>({21:O}),({uniqueId:O})=>O?2097152:0]},$$scope:{ctx:n}}}),v=new Re({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[aO,({uniqueId:O})=>({21:O}),({uniqueId:O})=>O?2097152:0]},$$scope:{ctx:n}}}),C=new Re({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[uO,({uniqueId:O})=>({21:O}),({uniqueId:O})=>O?2097152:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=D(),l=_("div"),V(o.$$.fragment),r=D(),a=_("div"),V(u.$$.fragment),f=D(),c=_("div"),V(d.$$.fragment),h=D(),g=_("div"),V(v.$$.fragment),b=D(),y=_("div"),V(C.$$.fragment),S=D(),$=_("div"),p(t,"class","col-lg-12"),p(l,"class","col-lg-6"),p(a,"class","col-lg-6"),p(c,"class","col-lg-6"),p(g,"class","col-lg-6"),p(y,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid")},m(O,E){w(O,e,E),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),m(e,f),m(e,c),j(d,c,null),m(e,h),m(e,g),j(v,g,null),m(e,b),m(e,y),j(C,y,null),m(e,S),m(e,$),T=!0},p(O,E){const P={};E&6291458&&(P.$$scope={dirty:E,ctx:O}),i.$set(P);const I={};E&6291458&&(I.$$scope={dirty:E,ctx:O}),o.$set(I);const N={};E&6291458&&(N.$$scope={dirty:E,ctx:O}),u.$set(N);const B={};E&6291458&&(B.$$scope={dirty:E,ctx:O}),d.$set(B);const U={};E&6291458&&(U.$$scope={dirty:E,ctx:O}),v.$set(U);const ee={};E&6291458&&(ee.$$scope={dirty:E,ctx:O}),C.$set(ee)},i(O){T||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(d.$$.fragment,O),A(v.$$.fragment,O),A(C.$$.fragment,O),O&&Tt(()=>{M||(M=it(e,nn,{duration:150},!0)),M.run(1)}),T=!0)},o(O){L(i.$$.fragment,O),L(o.$$.fragment,O),L(u.$$.fragment,O),L(d.$$.fragment,O),L(v.$$.fragment,O),L(C.$$.fragment,O),O&&(M||(M=it(e,nn,{duration:150},!1)),M.run(0)),T=!1},d(O){O&&k(e),q(i),q(o),q(u),q(d),q(v),q(C),O&&M&&M.end()}}}function sO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Endpoint"),s=D(),l=_("input"),p(e,"for",i=n[21]),p(l,"type","text"),p(l,"id",o=n[21]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[1].s3.endpoint),r||(a=X(l,"input",n[10]),r=!0)},p(u,f){f&2097152&&i!==(i=u[21])&&p(e,"for",i),f&2097152&&o!==(o=u[21])&&p(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&Te(l,u[1].s3.endpoint)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function lO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Bucket"),s=D(),l=_("input"),p(e,"for",i=n[21]),p(l,"type","text"),p(l,"id",o=n[21]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[1].s3.bucket),r||(a=X(l,"input",n[11]),r=!0)},p(u,f){f&2097152&&i!==(i=u[21])&&p(e,"for",i),f&2097152&&o!==(o=u[21])&&p(l,"
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,c=D(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m($,M){w($,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w($,r,M),w($,a,M),m(a,u),m(u,f),m(u,c),C[d].m(u,null),g=!0,v||(b=X(u,"submit",Yt(n[18])),v=!0)},p($,M){(!g||M&32)&&ue(o,$[5]);let T=d;d=S($),d===T?C[d].p($,M):(Pe(),L(C[T],1,1,()=>{C[T]=null}),Le(),h=C[d],h?h.p($,M):(h=C[d]=y[d]($),h.c()),A(h,1),h.m(u,null))},i($){g||(A(h),g=!0)},o($){L(h),g=!1},d($){$&&k(e),$&&k(r),$&&k(a),C[d].d(),v=!1,b()}}}function cO(n){let e,t,i,s;return e=new Bi({}),i=new On({props:{$$slots:{default:[fO]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&4194367&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&k(t),q(i,l)}}}function dO(n,e,t){let i,s,l;at(n,Ft,E=>t(5,l=E)),tn(Ft,l="Files storage",l);let o={},r={},a=!1,u=!1;f();async function f(){t(2,a=!0);try{const E=await $e.settings.getAll()||{};d(E)}catch(E){$e.errorResponseHandler(E)}t(2,a=!1)}async function c(){if(!(u||!s)){t(3,u=!0);try{const E=await $e.settings.update(W.filterRedactedProps(r));d(E),hi({}),dn("Successfully saved files storage settings.")}catch(E){$e.errorResponseHandler(E)}t(3,u=!1)}}function d(E={}){t(1,r={s3:(E==null?void 0:E.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}function h(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function g(){r.s3.enabled=this.checked,t(1,r)}function v(){r.s3.endpoint=this.value,t(1,r)}function b(){r.s3.bucket=this.value,t(1,r)}function y(){r.s3.region=this.value,t(1,r)}function C(){r.s3.accessKey=this.value,t(1,r)}function S(E){n.$$.not_equal(r.s3.secret,E)&&(r.s3.secret=E,t(1,r))}function $(){r.s3.forcePathStyle=this.checked,t(1,r)}const M=()=>h(),T=()=>c(),O=()=>c();return n.$$.update=()=>{n.$$.dirty&1&&t(8,i=JSON.stringify(o)),n.$$.dirty&258&&t(4,s=i!=JSON.stringify(r))},[o,r,a,u,s,l,c,h,i,g,v,b,y,C,S,$,M,T,O]}class pO extends Ee{constructor(e){super(),Oe(this,e,dO,cO,De,{})}}function hO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=F("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[16]),p(s,"for",o=n[16])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[8]),r=!0)},p(u,f){f&65536&&t!==(t=u[16])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&65536&&o!==(o=u[16])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function yh(n){let e,t,i,s,l,o,r,a,u,f,c;return i=new Re({props:{class:"form-field required",name:"emailAuth.minPasswordLength",$$slots:{default:[mO,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field "+(W.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailAuth.exceptDomains",$$slots:{default:[gO,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field "+(W.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailAuth.onlyDomains",$$slots:{default:[_O,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=D(),l=_("div"),V(o.$$.fragment),r=D(),a=_("div"),V(u.$$.fragment),p(t,"class","col-sm-12 m-t-sm"),p(l,"class","col-lg-6"),p(a,"class","col-lg-6"),p(e,"class","grid")},m(d,h){w(d,e,h),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),c=!0},p(d,h){const g={};h&196609&&(g.$$scope={dirty:h,ctx:d}),i.$set(g);const v={};h&1&&(v.class="form-field "+(W.isEmpty(d[0].onlyDomains)?"":"disabled")),h&196609&&(v.$$scope={dirty:h,ctx:d}),o.$set(v);const b={};h&1&&(b.class="form-field "+(W.isEmpty(d[0].exceptDomains)?"":"disabled")),h&196609&&(b.$$scope={dirty:h,ctx:d}),u.$set(b)},i(d){c||(A(i.$$.fragment,d),A(o.$$.fragment,d),A(u.$$.fragment,d),d&&Tt(()=>{f||(f=it(e,nn,{duration:
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&65536&&l!==(l=b[16]))&&p(e,"for",l);const C={};y&65536&&(C.id=b[16]),y&1&&(C.disabled=!W.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,C.value=b[0].exceptDomains,je(()=>a=!1)),r.$set(C)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function _O(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[11](b)}let v={id:n[16]+".config.onlyDomains",disabled:!W.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new ds({props:v}),pe.push(()=>Fe(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=D(),s=_("i"),o=D(),V(r.$$.fragment),u=D(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[16]+".config.onlyDomains"),p(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=We(vt.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&65536&&l!==(l=b[16]+".config.onlyDomains"))&&p(e,"for",l);const C={};y&65536&&(C.id=b[16]+".config.onlyDomains"),y&1&&(C.disabled=!W.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,C.value=b[0].onlyDomains,je(()=>a=!1)),r.$set(C)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function bO(n){let e,t,i,s;e=new Re({props:{class:"form-field form-field-toggle m-b-0",name:"emailAuth.enabled",$$slots:{default:[hO,({uniqueId:o})=>({16:o}),({uniqueId:o})=>o?65536:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&yh(n);return{c(){V(e.$$.fragment),t=D(),l&&l.c(),i=Ke()},m(o,r){j(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&196609&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].enabled?l?(l.p(o,r),r&1&&A(l,1)):(l=yh(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Pe(),L(l,1,1,()=>{l=null}),Le())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){q(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function vO(n){let e;return{c(){e=_("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function yO(n){let e;return{c(){e=_("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function kh(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=We(vt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=it(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=it(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function kO(n){let e,t,i,s,l,o,r;function a(d,h){return d[0].enabled?yO:vO}let u=a(n),f=u(n),c=n[2]&&kh();return{c(){e=_("div"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Email/Password</span>`,t=D(),f.c(),i=D(),s=_("div"),l=D(),c&&c.c(),o=Ke(),p(e,"class","inline-flex"),p(s,"class","flex-fill")},m(d,h){w(d,e,h),w(d,t,h),f.m(d,h),w(d,i,h),w(d,s,h),w(d,l,h),c&&c.m(d,h),w(d,o,h),r=!0},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(i.parentNode,i))),d[2]?c?h&4&&A(c,1):(c=kh(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(Pe(),L(c,1,1,()=>{c=null}),Le())},i(d){r||(A(c),r=!0)},o(d){L(c),r=!1},d(d){d&&k(e),d&&k(t),f.d(d),d&&k(i),d&&k(s),d&&k(l),c&&c.d(d),d&&k(o)}}}function wO(n){let e,t;const i=[n[3]];let s={$$slots:{header:[kO],default:[bO]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=ut(s,i[l]);return e=new Qo({props:s}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){V(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,[o]){const r=o&8?pn(i,[li(l[3])]):{};o&131077&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[12](null),q(e,l)}}}function $O(n,e,t){let i;const s=["config","expand","collapse","collapseSiblings"];let l=Bt(e,s),o;at(n,qi,$=>t(7,o=$));let{config:r={}}=e,a;function u(){a==null||a.expand()}function f(){a==null||a.collapse()}function c(){a==null||a.collapseSiblings()}function d(){r.enabled=this.checked,t(0,r)}function h(){r.minPasswordLength=Pt(this.value),t(0,r)}function g($){n.$$.not_equal(r.exceptDomains,$)&&(r.exceptDomains=$,t(0,r))}function v($){n.$$.not_equal(r.onlyDomains,$)&&(r.onlyDomains=$,t(0,r))}function b($){pe[$?"unshift":"push"](()=>{a=$,t(1,a)})}function y($){st.call(this,n,$)}function C($){st.call(this,n,$)}function S($){st.call(this,n,$)}return n.$$set=$=>{e=ut(ut({},e),ii($)),t(3,l=Bt(e,s)),"config"in $&&t(0,r=$.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!W.isEmpty(o==null?void 0:o.emailAuth))},[r,a,i,l,u,f,c,o,d,h,g,v,b,y,C,S]}class SO extends Ee{constructor(e){super(),Oe(this,e,$O,wO,De,{config:0,expand:4,collapse:5,collapseSiblings:6})}get expand(){return this.$$.ctx[4]}get collapse(){return this.$$.ctx[5]}get collapseSiblings(){return this.$$.ctx[6]}}function CO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=F("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[12]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&8388608&&o!==(o=u[23])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function wh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;l=new Re({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[MO,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}}),a=new Re({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[TO,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}}),c=new Re({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[DO,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}});let v=n[4]&&$h(n);return{c(){e=_("div"),t=_("div"),i=D(),s=_("div"),V(l.$$.fragment),o=D(),r=_("div"),V(a.$$.fragment),u=D(),f=_("div"),V(c.$$.fragment),d=D(),v&&v.c(),p(t,"class","col-12 spacing"),p(s,"class","col-lg-6"),p(r,"class","col-lg-6"),p(f,"class","col-lg-12"),p(e,"class","grid")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),j(l,s,null),m(e,o),m(e,r),j(a,r,null),m(e,u),m(e,f),j(c,f,null),m(e,d),v&&v.m(e,null),g=!0},p(b,y){const C={};y&2&&(C.name=b[1]+".clientId"),y&25165825&&(C.$$scope={dirty:y,ctx:b}),l.$set(C);const S={};y&2&&(S.name=b[1]+".clientSecret"),y&25165825&&(S.$$scope={dirty:y,ctx:b}),a.$set(S);const $={};y&2&&($.name=b[1]+".allowRegistrations"),y&25165825&&($.$$scope={dirty:y,ctx:b}),c.$set($),b[4]?v?(v.p(b,y),y&16&&A(v,1)):(v=$h(b),v.c(),A(v,1),v.m(e,null)):v&&(Pe(),L(v,1,1,()=>{v=null}),Le())},i(b){g||(A(l.$$.fragment,b),A(a.$$.fragment,b),A(c.$$.fragment,b),A(v),b&&Tt(()=>{h||(h=it(e,nn,{duration:200},!0)),h.run(1)}),g=!0)},o(b){L(l.$$.fragment,b),L(a.$$.fragment,b),L(c.$$.fragment,b),L(v),b&&(h||(h=it(e,nn,{duration:200},!1)),h.run(0)),g=!1},d(b){b
another PocketBase environment.</p>`,t=D(),i=_("div"),s=_("button"),s.innerHTML='<span class="txt">Copy</span>',l=D(),V(o.$$.fragment),r=D(),a=_("div"),u=_("div"),f=D(),c=_("button"),c.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-secondary fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(v,b){w(v,e,b),w(v,t,b),w(v,i,b),m(i,s),m(i,l),j(o,i,null),n[8](i),w(v,r,b),w(v,a,b),m(a,u),m(a,f),m(a,c),d=!0,h||(g=[X(s,"click",n[7]),X(i,"keydown",n[9]),X(c,"click",n[10])],h=!0)},p(v,b){const y={};b&4&&(y.content=v[2]),o.$set(y)},i(v){d||(A(o.$$.fragment,v),d=!0)},o(v){L(o.$$.fragment,v),d=!1},d(v){v&&k(e),v&&k(t),v&&k(i),q(o),n[8](null),v&&k(r),v&&k(a),h=!1,Ge(g)}}}function QO(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function xO(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[QO,XO],g=[];function v(b,y){return b[1]?0:1}return f=v(n),c=g[f]=h[f](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=F(n[3]),r=D(),a=_("div"),u=_("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(b,r,y),w(b,a,y),m(a,u),g[f].m(u,null),d=!0},p(b,y){(!d||y&8)&&ue(o,b[3]);let C=f;f=v(b),f===C?g[f].p(b,y):(Pe(),L(g[C],1,1,()=>{g[C]=null}),Le(),c=g[f],c?c.p(b,y):(c=g[f]=h[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){L(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),g[f].d()}}}function eE(n){let e,t,i,s;return e=new Bi({}),i=new On({props:{$$slots:{default:[xO]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(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){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&k(t),q(i,l)}}}function tE(n,e,t){let i,s;at(n,Ft,b=>t(3,s=b)),tn(Ft,s="Export collections",s);const l="export_"+W.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await $e.collections.getFullList(100,{$cancelKey:l}));for(let b of r)delete b.created,delete b.updated}catch(b){$e.errorResponseHandler(b)}t(1,a=!1)}function f(){W.downloadJson(r,"pb_schema")}function c(){W.copyToClipboard(i),Rg("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function h(b){pe[b?"unshift":"push"](()=>{o=b,t(0,o)})}const g=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const y=window.getSelection(),C=document.createRange();C.selectNodeContents(o),y.removeAllRanges(),y.addRange(C)}},v=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,h,g,v]}class nE extends Ee{constructor(e){super(),Oe(this,e,tE,eE,De,{})}}function Eh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Ah(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Ph(n,e,t){const i=n.slice();return i[14]=e[t],i}function Lh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Ih(n,e,t){const i=n.slice();return i[14]=e[t],i}function Fh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Nh(n,e,t){const i=n.slice();return i[30]=e[t],i}function iE(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Rh(),a=n[0].name!==n[1].name&&Hh(n);return{c(){e=_("div"),r&&r.c(),t=D(),a&&a.c(),i=D(),s=_("strong"),o=F(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),m(e,t),a&&a.m(e,null),m(e,i),m(e,s),m(s,o)},p(u,f){u[9]?r||(r=Rh(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Hh(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&ue(o,l)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function sE(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=_("span"),e.textContent="Deleted",t=D(),i=_("strong"),l=F(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),m(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?vo
<th width="10%" class="svelte-lmkr38">Old</th>
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=D(),o=_("tbody");for(let $=0;$<g.length;$+=1)g[$].c();r=D(),v&&v.c(),a=D();for(let $=0;$<y.length;$+=1)y[$].c();u=D();for(let $=0;$<S.length;$+=1)S[$].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m($,M){w($,e,M),d.m(e,null),w($,t,M),w($,i,M),m(i,s),m(i,l),m(i,o);for(let T=0;T<g.length;T+=1)g[T].m(o,null);m(o,r),v&&v.m(o,null),m(o,a);for(let T=0;T<y.length;T+=1)y[T].m(o,null);m(o,u);for(let T=0;T<S.length;T+=1)S[T].m(o,null)},p($,M){if(c===(c=f($))&&d?d.p($,M):(d.d(1),d=c($),d&&(d.c(),d.m(e,null))),M[0]&7203){h=$[11];let T;for(T=0;T<h.length;T+=1){const O=Nh($,h,T);g[T]?g[T].p(O,M):(g[T]=jh(O),g[T].c(),g[T].m(o,r))}for(;T<g.length;T+=1)g[T].d(1);g.length=h.length}if($[2]||$[5]?v?v.p($,M):(v=qh($),v.c(),v.m(o,a)):v&&(v.d(1),v=null),M[0]&4248){b=$[7];let T;for(T=0;T<b.length;T+=1){const O=Ph($,b,T);y[T]?y[T].p(O,M):(y[T]=Wh(O),y[T].c(),y[T].m(o,u))}for(;T<y.length;T+=1)y[T].d(1);y.length=b.length}if(M[0]&4352){C=$[8];let T;for(T=0;T<C.length;T+=1){const O=Eh($,C,T);S[T]?S[T].p(O,M):(S[T]=Kh(O),S[T].c(),S[T].m(o,null))}for(;T<S.length;T+=1)S[T].d(1);S.length=C.length}},i:le,o:le,d($){$&&k(e),d.d(),$&&k(t),$&&k(i),Qt(g,$),v&&v.d(),Qt(y,$),Qt(S,$)}}}function qn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function vn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function rE(n,e,t){let i,s,l,{collectionA:o=new cn}=e,{collectionB:r=new cn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],h=[];const g=Object.keys(new cn().export()).filter(y=>!["schema","created","updated"].includes(y));function v(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(y=>!f.find(C=>y.id==C.id))))}function b(y){return typeof y>"u"?"":W.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&v(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find(C=>y.id==C.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find(C=>C.id==y.id))),n.$$.dirty[0]&24&&t(8,h=f.filter(y=>!u.find(C=>C.id==y.id))),n.$$.dirty[0]&7&&t(9,l=W.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,h,l,s,g,b]}class aE extends Ee{constructor(e){super(),Oe(this,e,rE,oE,De,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Jh(n,e,t){const i=n.slice();return i[17]=e[t],i}function Zh(n){let e,t;return e=new aE({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){V(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){L(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function uE(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=Zh(Jh(n,i,o));const l=o=>L(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Ke()},m(o,r){for(let a=0;a<s.length;a+=1)s[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=Jh(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Zh(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);Le()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)L(s[r]);t=!1},d(o){Qt(s,o),o&&k(e)}}}function fE(n){let e;return{c(){e=_("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function cE(n){let e,t,i,s,l,o,r;return{c(){e=_("button"),t=F("Close"),i=D(),s=_("button"),l=_("span"),l.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=
- ${$.join(`
- `)}`,()=>{g()}):g()}async function g(){if(!u){t(4,u=!0);try{await $e.collections.import(o,a),dn("Successfully imported collections configuration."),i("submit")}catch($){$e.errorResponseHandler($)}t(4,u=!1),c()}}const v=()=>h(),b=()=>!u;function y($){pe[$?"unshift":"push"](()=>{s=$,t(1,s)})}function C($){st.call(this,n,$)}function S($){st.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,h,f,l,o,v,b,y,C,S]}class hE extends Ee{constructor(e){super(),Oe(this,e,pE,dE,De,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function Gh(n,e,t){const i=n.slice();return i[32]=e[t],i}function Xh(n,e,t){const i=n.slice();return i[35]=e[t],i}function Qh(n,e,t){const i=n.slice();return i[32]=e[t],i}function mE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,T,O;a=new Re({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[_E,({uniqueId:U})=>({40:U}),({uniqueId:U})=>[0,U?512:0]]},$$scope:{ctx:n}}});let E=!1,P=n[6]&&n[1].length&&!n[7]&&em(),I=n[6]&&n[1].length&&n[7]&&tm(n),N=n[13].length&&dm(n),B=!!n[0]&&pm(n);return{c(){e=_("input"),t=D(),i=_("div"),s=_("p"),l=F(`Paste below the collections configuration you want to import or
`),o=_("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=D(),V(a.$$.fragment),u=D(),f=D(),P&&P.c(),c=D(),I&&I.c(),d=D(),N&&N.c(),h=D(),g=_("div"),B&&B.c(),v=D(),b=_("div"),y=D(),C=_("button"),S=_("span"),S.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"),ne(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(b,"class","flex-fill"),p(S,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-expanded btn-warning m-l-auto"),C.disabled=$=!n[14],p(g,"class","flex m-t-base")},m(U,ee){w(U,e,ee),n[19](e),w(U,t,ee),w(U,i,ee),m(i,s),m(s,l),m(s,o),w(U,r,ee),j(a,U,ee),w(U,u,ee),w(U,f,ee),P&&P.m(U,ee),w(U,c,ee),I&&I.m(U,ee),w(U,d,ee),N&&N.m(U,ee),w(U,h,ee),w(U,g,ee),B&&B.m(g,null),m(g,v),m(g,b),m(g,y),m(g,C),m(C,S),M=!0,T||(O=[X(e,"change",n[20]),X(o,"click",n[21]),X(C,"click",n[26])],T=!0)},p(U,ee){ee[0]&4096&&ne(o,"btn-loading",U[12]);const J={};ee[0]&64&&(J.class="form-field "+(U[6]?"":"field-error")),ee[0]&65|ee[1]&1536&&(J.$$scope={dirty:ee,ctx:U}),a.$set(J),U[6]&&U[1].length&&!U[7]?P||(P=em(),P.c(),P.m(c.parentNode,c)):P&&(P.d(1),P=null),U[6]&&U[1].length&&U[7]?I?I.p(U,ee):(I=tm(U),I.c(),I.m(d.parentNode,d)):I&&(I.d(1),I=null),U[13].length?N?N.p(U,ee):(N=dm(U),N.c(),N.m(h.parentNode,h)):N&&(N.d(1),N=null),U[0]?B?B.p(U,ee):(B=pm(U),B.c(),B.m(g,v)):B&&(B.d(1),B=null),(!M||ee[0]&16384&&$!==($=!U[14]))&&(C.disabled=$)},i(U){M||(A(a.$$.fragment,U),A(E),M=!0)},o(U){L(a.$$.fragment,U),L(E),M=!1},d(U){U&&k(e),n[19](null),U&&k(t),U&&k(i),U&&k(r),q(a,U),U&&k(u),U&&k(f),P&&P.d(U),U&&k(c),I&&I.d(U),U&&k(d),N&&N.d(U),U&&k(h),U&&k(g),B&&B.d(),T=!1,Ge(O)}}}function gE(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function xh(n){let e;return{c(){e=_("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function _E(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&xh();return{c(){e=_("label"),t=F("Collections"),s=D(),l=_("textarea"),r=D(),c&&c.c(),a=Ke(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,h){w(d,e,h),m(e,t),w(d,s,h),w(d,l,h),Te(l,n[0]),w(d,r,h),c&&c.m(d,h),w(d,a,h),u||(f=X(l,"input",n[22]),u=!0)},p(d,h){h[1]&512&&i!==(i=d[40])&&p(e,"for",i),h[1]&512&&o!==(o=d[40])&&p(l,"id",o),h[0]&1&&Te(l,d[0]),!!d[0]&&!d[6]?c||(c=xh(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),c&&c.d(d),d&&k(a),u=!1,f()}}}function em(n){let e;return{c(){e=_("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function tm(n){let e,t,i,s,l,o=n[9].length&&nm(n),r=n[4].length&&lm(n),a=n[8].length&&um(n);return{c(){e=_("h5"),e.textContent="Detected changes",t=D(),i=_("div"),o&&o.c(),s=D(),r&&r.c(),l=D(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),o&&o.m(i,null),m(i,s),r&&r.m(i,null),m(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=nm(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=lm(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=um(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),u&&k(t),u&&k(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function nm(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=Qh(n,s,o),a=l(r);t.set(a,e[o]=sm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ke()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=kt(e,r,l,1,o,s,t,i.parentNode,Mn,sm,i,Qh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function im(n){let e,t,i=n[32].id+"",s,l;return{c(){e=_("small"),t=F("("),s=F(i),l=F(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&ue(s,i)},d(o){o&&k(e)}}}function sm(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&im(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Deleted",s=D(),l=_("strong"),r=F(o),a=D(),f&&f.c(),u=D(),p(i,"class","label label-danger list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){w(c,t,d),m(t,i),m(t,s),m(t,l),m(l,r),m(t,a),f&&f.m(t,null),m(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&ue(r,o),e[32].id?f?f.p(e,d):(f=im(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&k(t),f&&f.d()}}}function lm(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=Xh(n,s,o),a=l(r);t.set(a,e[o]=am(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ke()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=kt(e,r,l,1,o,s,t,i.parentNode,Mn,am,i,Xh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function om(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=_("strong"),i=F(t),s=D(),l=_("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),m(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&ue(i,t)},d(o){o&&k(e),o&&k(s),o&&k(l)}}}function rm(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=_("small"),t=F("("),s=F(i),l=F(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&ue(s,i)},d(o){o&&k(e)}}}function am(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&&om(e),h=e[35].new.id&&rm(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Changed",s=D(),l=_("div"),d&&d.c(),o=D(),r=_("strong"),u=F(a),f=D(),h&&h.c(),c=D(),p(i,"class","label label-warning list-label svelte-1jx20fl"),p(l,"class","inline-flex flex-gap-5"),p(t,"class","list-item"),this.first=t},m(g,v){w(g,t,v),m(t,i),m(t,s),m(t,l),d&&d.m(l,null),m(l,o),m(l,r),m(r,u),m(l,f),h&&h.m(l,null),m(t,c)},p(g,v){e=g,e[35].old.name!==e[35].new.name?d?d.p(e,v):(d=om(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),v[0]&16&&a!==(a=e[35].new.name+"")&&ue(u,a),e[35].new.id?h?h.p(e,v):(h=rm(e),h.c(),h.m(l,null)):h&&(h.d(1),h=null)},d(g){g&&k(t),d&&d.d(),h&&h.d()}}}function um(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=Gh(n,s,o),a=l(r);t.set(a,e[o]=cm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ke()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=kt(e,r,l,1,o,s,t,i.parentNode,Mn,cm,i,Gh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function fm(n){let e,t,i=n[32].id+"",s,l;return{c(){e=_("small"),t=F("("),s=F(i),l=F(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(
imported with different IDs. You can replace them in the import if you want
2022-08-19 01:32:07 +08:00
to.</string>`,l=D(),o=_("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){w(u,e,f),m(e,t),m(e,i),m(e,s),m(e,l),m(e,o),r||(a=X(o,"click",n[24]),r=!0)},p:le,d(u){u&&k(e),r=!1,a()}}}function pm(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-secondary link-hint")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[25]),t=!0)},p:le,d(s){s&&k(e),t=!1,i()}}}function bE(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[gE,mE],g=[];function v(b,y){return b[5]?0:1}return f=v(n),c=g[f]=h[f](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=F(n[15]),r=D(),a=_("div"),u=_("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(b,r,y),w(b,a,y),m(a,u),g[f].m(u,null),d=!0},p(b,y){(!d||y[0]&32768)&&ue(o,b[15]);let C=f;f=v(b),f===C?g[f].p(b,y):(Pe(),L(g[C],1,1,()=>{g[C]=null}),Le(),c=g[f],c?c.p(b,y):(c=g[f]=h[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){L(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),g[f].d()}}}function vE(n){let e,t,i,s,l,o;e=new Bi({}),i=new On({props:{$$slots:{default:[bE]},$$scope:{ctx:n}}});let r={};return l=new hE({props:r}),n[27](l),l.$on("submit",n[28]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),w(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){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){q(e,a),a&&k(t),q(i,a),a&&k(s),n[27](null),q(l,a)}}}function yE(n,e,t){let i,s,l,o,r,a,u;at(n,Ft,G=>t(15,u=G)),tn(Ft,u="Import collections",u);let f,c,d="",h=!1,g=[],v=[],b=!0,y=[],C=!1;S();async function S(){t(5,C=!0);try{t(2,v=await $e.collections.getFullList(200));for(let G of v)delete G.created,delete G.updated}catch(G){$e.errorResponseHandler(G)}t(5,C=!1)}function $(){if(t(4,y=[]),!!i)for(let G of g){const ge=W.findByKey(v,"id",G.id);!(ge!=null&&ge.id)||!W.hasCollectionChanges(ge,G,b)||y.push({new:G,old:ge})}}function M(){t(1,g=[]);try{t(1,g=JSON.parse(d))}catch{}Array.isArray(g)?t(1,g=W.filterDuplicatesByKey(g)):t(1,g=[]);for(let G of g)delete G.created,delete G.updated,G.schema=W.filterDuplicatesByKey(G.schema)}function T(){var G,ge;for(let _e of g){const x=W.findByKey(v,"name",_e.name)||W.findByKey(v,"id",_e.id);if(!x)continue;const ae=_e.id,ke=x.id;_e.id=ke;const H=Array.isArray(x.schema)?x.schema:[],me=Array.isArray(_e.schema)?_e.schema:[];for(const oe of me){const K=W.findByKey(H,"name",oe.name);K&&K.id&&(oe.id=K.id)}for(let oe of g)if(!!Array.isArray(oe.schema))for(let K of oe.schema)((G=K.options)==null?void 0:G.collectionId)&&((ge=K.options)==null?void 0:ge.collectionId)===ae&&(K.options.collectionId=ke)}t(0,d=JSON.stringify(g,null,4))}function O(G){t(12,h=!0);const ge=new FileReader;ge.onload=async _e=>{t(12,h=!1),t(10,f.value="",f),t(0,d=_e.target.result),await si(),g.length||(_o("Invalid collections configuration."),E())},ge.onerror=_e=>{console.warn(_e),_o("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},ge.readAsText(G)}function E(){t(0,d=""),t(10,f.value="",f),hi({})}function P(G){pe[G?"unshift":"push"](()=>{f=G,t(10,f)})}const I=()=>{f.files.length&&O(f.files[0])},N=()=>{f.click()};function B(){d=this.value,t(0,d)}function U(){b=this.checked,t(3,b)}const ee=()=>T(),J=()=>E(),ie=()=>c==null?void 0:c.show(v,g,b);function Q(G){pe[G?"unshift":"push"](()=>{c=G,t(11,c)})}const Y=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&g.length&&g.length===g.filter(G=>!!G.id&&!!G.name).length),n.$$.dirty[0]&78&&t(9,s=v.filter(G=>i&&b&&!W.findByKey(
2022-08-19 01:28:20 +08:00
<span class="txt">Manage admins</span>`,t=D(),i=_("hr"),s=D(),l=_("div"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"tabindex","0"),p(l,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[We(mn.call(null,e)),X(l,"click",n[6])],o=!0)},p:le,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),o=!1,Ge(r)}}}function RE(n){var h;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=W.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((h=n[0])==null?void 0:h.id)&&n[1]&&gm(n);return o=new mb({props:{routes:wE}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new EE({}),f=new FE({}),{c(){t=D(),i=_("div"),d&&d.c(),s=D(),l=_("div"),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),V(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(g,v){w(g,t,v),w(g,i,v),d&&d.m(i,null),m(i,s),m(i,l),j(o,l,null),m(l,r),j(a,l,null),w(g,u,v),j(f,g,v),c=!0},p(g,[v]){var b;(!c||v&12)&&e!==(e=W.joinNonEmpty([g[3],g[2],"PocketBase"]," - "))&&(document.title=e),((b=g[0])==null?void 0:b.id)&&g[1]?d?(d.p(g,v),v&3&&A(d,1)):(d=gm(g),d.c(),A(d,1),d.m(i,s)):d&&(Pe(),L(d,1,1,()=>{d=null}),Le())},i(g){c||(A(d),A(o.$$.fragment,g),A(a.$$.fragment,g),A(f.$$.fragment,g),c=!0)},o(g){L(d),L(o.$$.fragment,g),L(a.$$.fragment,g),L(f.$$.fragment,g),c=!1},d(g){g&&k(t),g&&k(i),d&&d.d(),q(o),q(a),g&&k(u),q(f,g)}}}function HE(n,e,t){let i,s,l,o;at(n,rs,h=>t(8,i=h)),at(n,vo,h=>t(2,s=h)),at(n,Sa,h=>t(0,l=h)),at(n,Ft,h=>t(3,o=h));let r,a=!1;function u(h){var g,v,b,y;((g=h==null?void 0:h.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((b=(v=h==null?void 0:h.detail)==null?void 0:v.userData)!=null&&b.showAppSidebar)),r=(y=h==null?void 0:h.detail)==null?void 0:y.location,tn(Ft,o="",o),hi({}),V_())}function f(){Si("/")}async function c(){var h,g;if(!!(l!=null&&l.id))try{const v=await $e.settings.getAll({$cancelKey:"initialAppSettings"});tn(vo,s=((h=v==null?void 0:v.meta)==null?void 0:h.appName)||"",s),tn(rs,i=!!((g=v==null?void 0:v.meta)!=null&&g.hideControls),i)}catch(v){console.warn("Failed to load app settings.",v)}}function d(){$e.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class jE extends Ee{constructor(e){super(),Oe(this,e,HE,RE,De,{})}}new jE({target:document.getElementById("app")});export{Ge as A,dn as B,W as C,Si as D,Ke as E,qg as F,at as G,Os as H,rn as I,cn as J,Jn as K,pe as L,xa as M,Ee as S,L as a,D as b,V as c,q as d,_ as e,p as f,w as g,m as h,Oe as i,We as j,Pe as k,mn as l,j as m,Le as n,k as o,$e as p,Re as q,ne as r,De as s,A as t,X as u,Yt as v,F as w,ue as x,le as y,Te as z};