pocketbase/ui/dist/assets/index.26aaf498.js

378 lines
769 KiB
JavaScript
Raw Normal View History

const __=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 oe(){}const _l=n=>n;function pt(n,e){for(const t in e)n[t]=e[t];return n}function jp(n){return n()}function Ya(){return Object.create(null)}function st(n){n.forEach(jp)}function Wn(n){return typeof n=="function"}function Ee(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ll;function Xn(n,e){return Ll||(Ll=document.createElement("a")),Ll.href=e,n===Ll.href}function b_(n){return Object.keys(n).length===0}function qp(n,...e){if(n==null)return oe;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function At(n,e,t){n.$$.on_destroy.push(qp(e,t))}function Mn(n,e,t,i){if(n){const s=Vp(n,e,t,i);return n[0](s)}}function Vp(n,e,t,i){return n[1]&&i?pt(t.ctx.slice(),n[1](i(e))):t.ctx}function Tn(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 Dn(n,e,t,i,s,l){if(s){const o=Vp(e,t,i,l);n.p(o,s)}}function On(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function ri(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Kt(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 Ka(n){return n==null?"":n}function bn(n,e,t){return n.set(t),e}function Qe(n){return n&&Wn(n.destroy)?n.destroy:oe}const zp=typeof window<"u";let Po=zp?()=>window.performance.now():()=>Date.now(),sa=zp?n=>requestAnimationFrame(n):oe;const gs=new Set;function Bp(n){gs.forEach(e=>{e.c(n)||(gs.delete(e),e.f())}),gs.size!==0&&sa(Bp)}function Lo(n){let e;return gs.size===0&&sa(Bp),{promise:new Promise(t=>{gs.add(e={c:n,f:t})}),abort(){gs.delete(e)}}}function m(n,e){n.appendChild(e)}function Up(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function v_(n){const e=_("style");return y_(Up(n),e),e.sheet}function y_(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 jn(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function _(n){return document.createElement(n)}function R(n){return document.createTextNode(n)}function T(){return R(" ")}function rt(){return R("")}function X(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Bt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function qn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function Wp(n){return function(e){e.target===this&&n.call(this,e)}}function h(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function oi(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:h(n,i,e[i])}function Ot(n){return n===""?null:+n}function k_(n){return Array.from(n.childNodes)}function me(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Ce(n,e){n.value=e==null?"":e}function Za(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function ee(n,e,t){n.classList[t?"add":"remove"](e)}function Yp(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.ini
`;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)}}
}`,c=`__svelte_${w_(f)}_${r}`,d=Up(n),{stylesheet:p,rules:g}=ao.get(d)||S_(d,n);g[c]||(g[c]=!0,p.insertRule(`@keyframes ${c} ${f}`,p.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${c} ${i}ms linear ${s}ms 1 both`,uo+=1,c}function rl(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(", "),uo-=s,uo||$_())}function $_(){sa(()=>{uo||(ao.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),ao.clear())})}function C_(n,e,t,i){if(!e)return oe;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return oe;const{delay:l=0,duration:o=300,easing:r=_l,start:a=Po()+l,end:u=a+o,tick:f=oe,css:c}=t(n,{from:e,to:s},i);let d=!0,p=!1,g;function v(){c&&(g=ol(n,0,1,o,l,r,c)),l||(p=!0)}function b(){c&&rl(n,g),d=!1}return Lo(y=>{if(!p&&y>=a&&(p=!0),p&&y>=u&&(f(1,0),b()),!d)return!1;if(p){const C=y-a,$=0+1*r(C/o);f($,1-$)}return!0}),v(),f(0,1),b}function M_(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,Kp(n,s)}}function Kp(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 al;function Js(n){al=n}function Fo(){if(!al)throw new Error("Function called outside component initialization");return al}function Yn(n){Fo().$$.on_mount.push(n)}function T_(n){Fo().$$.after_update.push(n)}function D_(n){Fo().$$.on_destroy.push(n)}function un(){const n=Fo();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=Yp(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function ht(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Us=[],he=[],no=[],Cr=[],Zp=Promise.resolve();let Mr=!1;function Jp(){Mr||(Mr=!0,Zp.then(Gp))}function ai(){return Jp(),Zp}function Dt(n){no.push(n)}function He(n){Cr.push(n)}const Jo=new Set;let Fl=0;function Gp(){const n=al;do{for(;Fl<Us.length;){const e=Us[Fl];Fl++,Js(e),O_(e.$$)}for(Js(null),Us.length=0,Fl=0;he.length;)he.pop()();for(let e=0;e<no.length;e+=1){const t=no[e];Jo.has(t)||(Jo.add(t),t())}no.length=0}while(Us.length);for(;Cr.length;)Cr.pop()();Mr=!1,Jo.clear(),Js(n)}function O_(n){if(n.fragment!==null){n.update(),st(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Dt)}}let Ps;function la(){return Ps||(Ps=Promise.resolve(),Ps.then(()=>{Ps=null})),Ps}function Qi(n,e,t){n.dispatchEvent(Yp(`${e?"intro":"outro"}${t}`))}const io=new Set;let ii;function De(){ii={r:0,c:[],p:ii}}function Oe(){ii.r||st(ii.c),ii=ii.p}function A(n,e){n&&n.i&&(io.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(io.has(n))return;io.add(n),ii.c.push(()=>{io.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const oa={duration:0};function Xp(n,e,t){let i=e(n,t),s=!1,l,o,r=0;function a(){l&&rl(n,l)}function u(){const{delay:c=0,duration:d=300,easing:p=_l,tick:g=oe,css:v}=i||oa;v&&(l=ol(n,0,1,d,c,p,v,r++)),g(0,1);const b=Po()+c,y=b+d;o&&o.abort(),s=!0,Dt(()=>Qi(n,!0,"start")),o=Lo(C=>{if(s){if(C>=y)return g(1,0),Qi(n,!0,"end"),a(),s=!1;if(C>=b){const $=p((C-b)/d);g($,1-$)}}return s})}let f=!1;return{start(){f||(f=!0,rl(n),Wn(i)?(i=i(),la().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function Qp(n,e,t){let i=e(n,t),s=!0,l;const o=ii;o.r+=1;function r(){const{delay:a=0,duration:u=300,easing:f=_l,tick:c=oe,css:d}=i||oa;d&&(l=ol(n,1,0,u,a,f,d));const p=Po()+a,g=p+u;Dt(()=>Qi(n,!1,"start")),Lo(v=>{if(s){if(v>=g)return c(0,1),Qi(n,!1,"end"),--o.r||st(o.c),!1;if(v>=p){const b=f((v-p)/u);c(1-b,b)}}return s})}return Wn(i)?la().then(()=>{i=i(),r()}):r(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&rl(n,l),s=!1)}}}function ut(n,e,t,i){let s=e(n,t),l=i?0:1,o=nu
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=T(),i=_("div"),h(e,"class","block txt-center m-b-lg"),h(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 Zb(n){let e,t,i,s,l,o,r,a,u=!n[0]&&Cu();const f=n[2].default,c=Mn(f,n,n[1],null);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),u&&u.c(),l=T(),c&&c.c(),o=T(),r=_("div"),h(t,"class","flex-fill"),h(s,"class","wrapper wrapper-sm m-b-xl svelte-1wbawr2"),h(r,"class","flex-fill"),h(e,"class","page-wrapper full-page-panel svelte-1wbawr2")},m(d,p){w(d,e,p),m(e,t),m(e,i),m(e,s),u&&u.m(s,null),m(s,l),c&&c.m(s,null),m(e,o),m(e,r),a=!0},p(d,[p]){d[0]?u&&(u.d(1),u=null):u||(u=Cu(),u.c(),u.m(s,l)),c&&c.p&&(!a||p&2)&&Dn(c,f,d,d[1],a?Tn(f,d[1],p,null):On(d[1]),null)},i(d){a||(A(c,d),a=!0)},o(d){P(c,d),a=!1},d(d){d&&k(e),u&&u.d(),c&&c.d(d)}}}function Jb(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(1,s=o.$$scope)},[l,s,i]}class fg extends Pe{constructor(e){super(),Ae(this,e,Jb,Zb,Ee,{nobranding:0})}}function Mu(n,e,t){const i=n.slice();return i[11]=e[t],i}const Gb=n=>({}),Tu=n=>({uniqueId:n[3]});function Xb(n){let e=(n[11]||go)+"",t;return{c(){t=R(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||go)+"")&&me(t,e)},d(i){i&&k(t)}}}function Qb(n){var i,s;let e=(((i=n[11])==null?void 0:i.message)||((s=n[11])==null?void 0:s.code)||go)+"",t;return{c(){t=R(e)},m(l,o){w(l,t,o)},p(l,o){var r,a;o&4&&e!==(e=(((r=l[11])==null?void 0:r.message)||((a=l[11])==null?void 0:a.code)||go)+"")&&me(t,e)},d(l){l&&k(t)}}}function Du(n){let e,t;function i(o,r){return typeof o[11]=="object"?Qb:Xb}let s=i(n),l=s(n);return{c(){e=_("div"),l.c(),t=T(),h(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 xb(n){let e,t,i,s,l;const o=n[7].default,r=Mn(o,n,n[6],Tu);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=Du(Mu(n,a,f));return{c(){e=_("div"),r&&r.c(),t=T();for(let f=0;f<u.length;f+=1)u[f].c();h(e,"class",n[0]),ee(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)&&Dn(r,o,f,f[6],i?Tn(o,f[6],c,Gb):On(f[6]),Tu),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const p=Mu(f,a,d);u[d]?u[d].p(p,c):(u[d]=Du(p),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)&&h(e,"class",f[0]),c&5&&ee(e,"error",f[2].length)},i(f){i||(A(r,f),i=!0)},o(f){P(r,f),i=!1},d(f){f&&k(e),r&&r.d(f),jn(u,f),n[9](null),s=!1,l()}}}const go="Invalid value";function e1(n,e,t){let i;At(n,ss,g=>t(5,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+Y.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){ug(r)}Yn(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(g){ht.call(this,n,g)}function p(g){he[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=Y.toArray(Y.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,p]}class Le extends Pe{constructor(e){super(),Ae(this,e,e1,xb,Ee,{name:4,class:0})}}function t1(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Email"),s=T(),l=_("input"),h(e,"for",i=n[9]),h(l,"type","email"),h(l,"autocomplete","off"),h(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0]),l.focus(),r||(a=X(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&1&&l.value!==u[0]&&Ce(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function n1(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=R("Password"),s=T(),l=_("input"),r=T(),a=_("div"),a.textContent="Minimum 10 characters.",h(e,"for",i=n[9]),h(l,"type","password"),h(l,"autocomplete","new-password"),h(l,"minlength","10
<i class="ri-arrow-right-line"></i>`,h(t,"class","content txt-center m-b-base"),h(f,"type","submit"),h(f,"class","btn btn-lg btn-block btn-next"),ee(f,"btn-disabled",n[3]),ee(f,"btn-loading",n[3]),h(e,"class","block"),h(e,"autocomplete","off")},m(g,v){w(g,e,v),m(e,t),m(e,i),q(s,e,null),m(e,l),q(o,e,null),m(e,r),q(a,e,null),m(e,u),m(e,f),c=!0,d||(p=X(e,"submit",Bt(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&&ee(f,"btn-disabled",g[3]),v&8&&ee(f,"btn-loading",g[3])},i(g){c||(A(s.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){P(s.$$.fragment,g),P(o.$$.fragment,g),P(a.$$.fragment,g),c=!1},d(g){g&&k(e),V(s),V(o),V(a),d=!1,p()}}}function l1(n,e,t){const i=un();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await we.Admins.create({email:s,password:l,passwordConfirm:o}),await we.Admins.authViaEmail(s,l),i("submit")}catch(d){we.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 o1 extends Pe{constructor(e){super(),Ae(this,e,l1,s1,Ee,{})}}function Ou(n){let e,t;return e=new fg({props:{$$slots:{default:[r1]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function r1(n){let e,t;return e=new o1({}),e.$on("submit",n[1]),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p:oe,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function a1(n){let e,t,i=n[0]&&Ou(n);return{c(){i&&i.c(),e=rt()},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=Ou(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(De(),P(i,1,1,()=>{i=null}),Oe())},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function u1(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){we.logout(!1),t(0,i=!0);return}we.AuthStore.isValid?Ms("/collections"):we.logout()}return[i,async()=>{t(0,i=!1),await ai(),window.location.search=""}]}class f1 extends Pe{constructor(e){super(),Ae(this,e,u1,a1,Ee,{})}}const Zt=xn(""),_o=xn("");function qo(n){const e=n-1;return e*e*e+1}function bo(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 Vn(n,{delay:e=0,duration:t=400,easing:i=qo,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 xt(n,{delay:e=0,duration:t=400,easing:i=qo}={}){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:p=>`overflow: hidden;opacity: ${Math.min(p*20,1)*l};height: ${p*o}px;padding-top: ${p*r}px;padding-bottom: ${p*a}px;margin-top: ${p*u}px;margin-bottom: ${p*f}px;border-top-width: ${p*c}px;border-bottom-width: ${p*d}px;`}}function zn(n,{delay:e=0,duration:t=400,easing:i=qo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
`}}function c1(n){let e,t,i,s;return{c(){e=_("input"),h(e,"type","text"),h(e,"id",n[8]),h(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),Ce(e,n[7]),i||(s=X(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&h(e,"placeholder",t),o&128&&e.value!==l[7]&&Ce(e,l[7])},i:oe,o:oe,d(l){l&&k(e),n[13](null),i=!1,s()}}}function d1(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={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)),he.push(()=>Ie(e,"value",l)),e.$on("submit",n[10])),{c(){e&&z(e.$$.fragment),i=rt()},m(a,u){e&&q(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],He(()=>t=!1)),o!==(o=a[4])){if(e){De();const c=e;P(c.$$.fragment,1,0,()=>{V(c,1)}),Oe()}o?(e=new o(r(a)),he.push(()=>Ie(e,"value",l)),e.$on("submit",a[10]),z(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function Eu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Au();return{c(){r&&r.c(),e=T(),t=_("button"),t.innerHTML='<span class="txt">Clear</span>',h(t,"type","button"),h(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=Au(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(De(),P(r,1,1,()=>{r=null}),Oe())},i(a){s||(A(r),Dt(()=>{i||(i=ut(t,Vn,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),i||(i=ut(t,Vn,{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 Au(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Search</span>',h(e,"type","submit"),h(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(Dt(()=>{t||(t=ut(e,Vn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){t||(t=ut(e,Vn,{duration:150,x:5},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function h1(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[d1,c1],p=[];function g(b,y){return b[4]&&!b[5]?0:1}o=g(n),r=p[o]=d[o](n);let v=(n[0].length||n[7].length)&&Eu(n);return{c(){e=_("div"),t=_("form"),i=_("label"),s=_("i"),l=T(),r.c(),a=T(),v&&v.c(),h(s,"class","ri-search-line"),h(i,"for",n[8]),h(i,"class","m-l-10 txt-xl"),h(t,"class","searchbar"),h(e,"class","searchbar-wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(i,s),m(t,l),p[o].m(t,null),m(t,a),v&&v.m(t,null),u=!0,f||(c=[X(t,"submit",Bt(n[10])),X(e,"click",qn(n[11]))],f=!0)},p(b,[y]){let C=o;o=g(b),o===C?p[o].p(b,y):(De(),P(p[C],1,1,()=>{p[C]=null}),Oe(),r=p[o],r?r.p(b,y):(r=p[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=Eu(b),v.c(),A(v,1),v.m(t,null)):v&&(De(),P(v,1,1,()=>{v=null}),Oe())},i(b){u||(A(r),A(v),u=!0)},o(b){P(r),P(v),u=!1},d(b){b&&k(e),p[o].d(),v&&v.d(),f=!1,st(c)}}}function p1(n,e,t){const i=un(),s="search_"+Y.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new An}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function p(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 Ji(()=>import("./FilterAutocompleteInput.ec82b78a.js"),[])).default),t(5,f=!1))}Yn(()=>{v()});function b(M){ht.call(this,n,M)}function y(M){d=M,t(7,d),t(0,l)}function C(M){he[M?"unshift":"push"](()=>{c=M,t(6,c)})}function $(){d=this.value,t(7,d),t(0,l)}const S=()=>{p(!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,a,u,f,c,d,s,p,g,b,y,C,$,S]}class Vo extends Pe{constructor(e){super(),Ae(this,e,p1,h1,Ee,{value:0
<span class="txt">method</span>`,h(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function C1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="url",h(t,"class",Y.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function M1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="referer",h(t,"class",Y.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function T1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="status",h(t,"class",Y.getFieldTypeIcon("number")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function D1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",h(t,"class",Y.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function Fu(n){let e;function t(l,o){return l[6]?E1:O1}let i=t(n),s=i(n);return{c(){s.c(),e=rt()},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 O1(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Iu(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No logs found.",s=T(),o&&o.c(),l=T(),h(t,"colspan","99"),h(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=Iu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function E1(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:oe,d(t){t&&k(e)}}}function Iu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Nu(n){let e;return{c(){e=_("i"),h(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),h(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ru(n,e){var le,ue,Te;let t,i,s,l=((le=e[21].method)==null?void 0:le.toUpperCase())+"",o,r,a,u,f,c=e[21].url+"",d,p,g,v,b,y,C=(e[21].referer||"N/A")+"",$,S,M,D,E,O=e[21].status+"",F,L,H,j,Q,ne,B,K,W,J,ie=(((ue=e[21].meta)==null?void 0:ue.errorMessage)||((Te=e[21].meta)==null?void 0:Te.errorData))&&Nu();j=new vi({props:{date:e[21].created}});function fe(){return e[16](e[21])}function ye(...Z){return e[17](e[21],...Z)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),o=R(l),a=T(),u=_("td"),f=_("span"),d=R(c),g=T(),ie&&ie.c(),v=T(),b=_("td"),y=_("span"),$=R(C),M=T(),D=_("td"),E=_("span"),F=R(O),L=T(),H=_("td"),z(j.$$.fragment),Q=T(),ne=_("td"),ne.innerHTML='<i class="ri-arrow-right-line"></i>',B=T(),h(s,"class",r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),h(i,"class","col-type-text col-field-method min-width"),h(f,"class","txt txt-ellipsis"),h(f,"title",p=e[21].url),h(u,"class","col-type-text col-field-url"),h(y,"class","txt txt-ellipsis"),h(y,"title",S=e[21].referer),ee(y,"txt-hint",!e[21].referer),h(b,"class","col-type-text col-field-referer"),h(E,"class","label"),ee(E,"label-danger",e[21].status>=400),h(D,"class","col-type-number col-field-status"),h(H,"class","col-type-date col-field-created"),h(ne,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(Z,be){w(Z,t,be),m(t,i),m(i,s),m(s,o),m(t,a),m(t,u),m(u,f),m(f,d),m(u,g),ie&&ie.m(u,null),m(t,v),m(t,b),m(b,y),m(y,$),m(t,M),m(t,D),m(D,E),m(E,F),m(t,L),m(t,H),q(j,H,null),m(t,Q),m(t,ne),m(t,B),K=!0,W||(J=[X(t,"click",fe),X(t,"keydown",ye)],W=!0)},p(Z,be){var G,_e,je;e=Z,(!K||be&8)&&l!==(l=((G=e[21].method)==null?void 0:G.toUpperCase())+"")&&me(o,l),(!K||be&8&&r!==(r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&h(s,"class",r),(!K||be&8)&&c!==(c=e[21].url+"")&&me(d,c),(!K||be&8&&p!==(p=e[21].url))&&h(f,"title",p),((_e=e[21].meta)==null?void 0:_e.errorMessage)||((je=e[21].meta)==null?void 0:je.errorData)?ie||(ie=Nu(),ie.c(),ie.m(u,null)):ie&&(ie.d(1),ie=null),(!K||be&8)&&C!==(C=(e[21].referer||"N/A")+"")&&me($,C),(!K||be&8&&S!==(S=e[21].referer))&&h(y,"title",S),be&8&&ee(y,"txt-hint",!e[21].referer),(!K||be&8)&&O!==(O=e[21].status+"")&&me(F,O),be&8&&ee(E,"label-danger",e[21].status>=400);const x={};be&8&&(x.date=e[21].created),j.$set(x)},i(Z){K||(A(j.$$.fragment,Z),K=!0)},o(Z){P(j.$$.fragment,Z),K=!1},d(Z){Z&&k(t),ie&&ie.d(),V(j),W=!1,st(J)}}}function Hu(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=R("Showing "),s=R(i),l=R(" of "),o=R(n[4]),h(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+"")&&me(s,i),a&16&&me(o,r[4])},d(r){r&&k(e)}}}function ju(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=R("Load more ("),o=R(l),r=R(")"),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-lg btn-secondary btn-expanded"),ee(t,"btn-loading",n[6]),ee(t,"btn-disabled",n[6]),h(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+"")&&me(o,l),c&64&&ee(t,"btn-loading",f[6]),c&64&&ee(t,"btn-disabled",f[6])},d(f){f&&k(e),a=!1,u()}}}function A1(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$,S,M,D,E=[],O=new Map,F,L,H,j;function Q(G){n[11](G)}let ne={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[$1]},$$scope:{ctx:n}};n[1]!==void 0&&(ne.sort=n[1]),l=new tn({props:ne}),he.push(()=>Ie(l,"sort",Q));function B(G){n[12](G)}let K={disable:!0,class:"col-type-text col-field-url",name:"url",$$slot
* Chart.js v3.8.0
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/const dg=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function hg(n,e,t){const i=t||(o=>Array.prototype.slice.call(o));let s=!1,l=[];return function(...o){l=i(o),s||(s=!0,dg.call(window,()=>{s=!1,n.apply(e,l)}))}}function F1(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const I1=n=>n==="start"?"left":n==="end"?"right":"center",qu=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function di(){}const N1=function(){let n=0;return function(){return n++}}();function Tt(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 gt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const zt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Fn(n,e){return zt(n)?n:e}function bt(n,e){return typeof n>"u"?e:n}const R1=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,pg=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function jt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function Mt(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(gt(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function vo(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 yo(n){if(It(n))return n.map(yo);if(gt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=yo(n[t[s]]);return e}return n}function mg(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function H1(n,e,t,i){if(!mg(n))return;const s=e[n],l=t[n];gt(s)&&gt(l)?ul(s,l,i):e[n]=yo(l)}function ul(n,e,t){const i=It(e)?e:[e],s=i.length;if(!gt(n))return n;t=t||{};const l=t.merger||H1;for(let o=0;o<s;++o){if(e=i[o],!gt(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 el(n,e){return ul(n,e,{merger:j1})}function j1(n,e,t){if(!mg(n))return;const i=e[n],s=t[n];gt(i)&&gt(s)?el(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=yo(s))}const q1="",V1=".";function Vu(n,e){const t=n.indexOf(V1,e);return t===-1?n.length:t}function Li(n,e){if(e===q1)return n;let t=0,i=Vu(e,t);for(;n&&i>t;)n=n[e.slice(t,i)],t=i+1,i=Vu(e,t);return n}function va(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Bn=n=>typeof n<"u",Fi=n=>typeof n=="function",zu=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function z1(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Vt=Math.PI,Pt=2*Vt,B1=Pt+Vt,ko=Number.POSITIVE_INFINITY,U1=Vt/180,qt=Vt/2,Rs=Vt/4,Bu=Vt*2/3,Rn=Math.log10,si=Math.sign;function Uu(n){const e=Math.round(n);n=tl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Rn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function W1(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 fl(n){return!isNaN(parseFloat(n))&&isFinite(n)}function tl(n,e,t){return Math.abs(n-e)<t}function Y1(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function gg(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 Gn(n){return n*(Vt/180)}function ya(n){return n*(180/Vt)}function Wu(n){if(!zt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function _g(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*Vt&&(l+=Pt),{angle:l,distance:s}}function Vr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function K1(n,e){return(n-e+B1)%Pt-Vt}function Sn(n){return(n%Pt+Pt)%Pt}function cl(n,e,t,i){const s=Sn(n),l=Sn(e),o=Sn(t),r=Sn(l-s),a=Sn(o-s),u=Sn(s-l),f=Sn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function on(n,e,t){return Ma
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function Sl(n){return n+.5|0}const Oi=(n,e,t)=>Math.max(Math.min(n,t),e);function Ks(n){return Oi(Sl(n*2.55),0,255)}function Pi(n){return Oi(Sl(n*255),0,255)}function mi(n){return Oi(Sl(n/2.55)/100,0,1)}function Zu(n){return Oi(Sl(n*100),0,100)}const Ln={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},zr=[..."0123456789ABCDEF"],J1=n=>zr[n&15],G1=n=>zr[(n&240)>>4]+zr[n&15],Vl=n=>(n&240)>>4===(n&15),X1=n=>Vl(n.r)&&Vl(n.g)&&Vl(n.b)&&Vl(n.a);function Q1(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Ln[n[1]]*17,g:255&Ln[n[2]]*17,b:255&Ln[n[3]]*17,a:e===5?Ln[n[4]]*17:255}:(e===7||e===9)&&(t={r:Ln[n[1]]<<4|Ln[n[2]],g:Ln[n[3]]<<4|Ln[n[4]],b:Ln[n[5]]<<4|Ln[n[6]],a:e===9?Ln[n[7]]<<4|Ln[n[8]]:255})),t}const x1=(n,e)=>n<255?e(n):"";function ev(n){var e=X1(n)?J1:G1;return n?"#"+e(n.r)+e(n.g)+e(n.b)+x1(n.a,e):void 0}const tv=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function bg(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 nv(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 iv(n,e,t){const i=bg(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 sv(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 ka(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=sv(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function wa(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Pi)}function Sa(n,e,t){return wa(bg,n,e,t)}function lv(n,e,t){return wa(iv,n,e,t)}function ov(n,e,t){return wa(nv,n,e,t)}function vg(n){return(n%360+360)%360}function rv(n){const e=tv.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Ks(+e[5]):Pi(+e[5]));const s=vg(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=lv(s,l,o):e[1]==="hsv"?i=ov(s,l,o):i=Sa(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function av(n,e){var t=ka(n);t[0]=vg(t[0]+e),t=Sa(t),n.r=t[0],n.g=t[1],n.b=t[2]}function uv(n){if(!n)return;const e=ka(n),t=e[0],i=Zu(e[1]),s=Zu(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${mi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Ju={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"},Gu={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.8.0
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class py{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=dg.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);!t||(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var hi=new py;const ff="transparent",my={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Qu(n||ff),s=i.valid&&Qu(e||ff);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class gy{constructor(e,t,i,s){const l=t[i];s=Ul([e.to,s,l,e.from]);const o=Ul([e.from,l,s]);this._active=!0,this._fn=e.fn||my[e.type||typeof o],this._easing=nl[e.easing]||nl.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=Ul([e.to,t,s,e.from]),this._from=Ul([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 _y=["x","y","borderWidth","radius","tension"],by=["color","borderColor","backgroundColor"];vt.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 vy=Object.keys(vt.animation);vt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});vt.set("animations",{colors:{type:"color",properties:by},numbers:{type:"number",properties:_y}});vt.describe("animations",{_fallback:"animation"});vt.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 Ng{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!gt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!gt(s))return;const l={};for(co
`)>-1?n.split(`
`):n}function R2(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 qf(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Cn(e.bodyFont),u=Cn(e.titleFont),f=Cn(e.footerFont),c=l.length,d=s.length,p=i.length,g=Un(e.padding);let v=g.height,b=0,y=i.reduce((S,M)=>S+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 S=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;v+=p*S+(y-p)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let C=0;const $=function(S){b=Math.max(b,t.measureText(S).width+C)};return t.save(),t.font=u.string,Mt(n.title,$),t.font=a.string,Mt(n.beforeBody.concat(n.afterBody),$),C=e.displayColors?o+2+e.boxPadding:0,Mt(i,S=>{Mt(S.before,$),Mt(S.lines,$),Mt(S.after,$)}),C=0,t.font=f.string,Mt(n.footer,$),t.restore(),b+=g.width,{width:b,height:v}}function H2(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function j2(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 q2(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"),j2(u,n,e,t)&&(u="center"),u}function Vf(n,e,t){const i=t.yAlign||e.yAlign||H2(n,t);return{xAlign:t.xAlign||e.xAlign||q2(n,e,t,i),yAlign:i}}function V2(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function z2(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:p}=bs(o);let g=V2(e,r);const v=z2(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,p)+s),{x:on(g,0,i.width-e.width),y:on(v,0,i.height-e.height)}}function Xl(n,e,t){const i=Un(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Bf(n){return ti([],pi(n))}function B2(n,e,t){return Ni(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Uf(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class Xr extends ki{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 Ng(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=B2(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=ti(r,pi(s)),r=ti(r,pi(l)),r=ti(r,pi(o)),r}getBeforeBody(e,t){return Bf(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return Mt(e,l=>{const o={before:[],lines:[],after:[]},r=Uf(i,l);ti(o.before,pi(r.beforeLabel.call(this,l))
* chartjs-adapter-luxon v1.1.0
* https://www.chartjs.org
* (c) 2021 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const fw={datetime:et.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:et.TIME_WITH_SECONDS,minute:et.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};qg._date.override({_id:"luxon",_create:function(n){return et.fromMillis(n,this.options)},formats:function(){return fw},parse:function(n,e){const t=this.options;if(n===null||typeof n>"u")return null;const i=typeof n;return i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=et.fromFormat(n,e,t):n=et.fromISO(n,t):n instanceof Date?n=et.fromJSDate(n,t):i==="object"&&!(n instanceof et)&&(n=et.fromObject(n)),n.isValid?n.valueOf():null},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e,this.options):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function Qf(n){let e,t,i;return{c(){e=_("div"),h(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(Dt(()=>{t||(t=ut(e,zn,{duration:150},!0)),t.run(1)}),i=!0)},o(s){t||(t=ut(e,zn,{duration:150},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function cw(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=R(n[1]),t=T(),s=R(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&me(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&me(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function dw(n){let e;return{c(){e=R("Loading...")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function hw(n){let e,t,i,s,l,o,r=n[2]&&Qf();function a(c,d){return c[2]?dw:cw}let u=a(n),f=u(n);return{c(){e=_("div"),r&&r.c(),t=T(),i=_("canvas"),s=T(),l=_("div"),f.c(),h(i,"class","chart-canvas svelte-vh4sl8"),Za(i,"height","250px"),Za(i,"width","100%"),h(e,"class","chart-wrapper svelte-vh4sl8"),ee(e,"loading",n[2]),h(l,"class","txt-hint m-t-xs txt-right")},m(c,d){w(c,e,d),r&&r.m(e,null),m(e,t),m(e,i),n[8](i),w(c,s,d),w(c,l,d),f.m(l,null),o=!0},p(c,[d]){c[2]?r?d&4&&A(r,1):(r=Qf(),r.c(),A(r,1),r.m(e,t)):r&&(De(),P(r,1,1,()=>{r=null}),Oe()),d&4&&ee(e,"loading",c[2]),u===(u=a(c))&&f?f.p(c,d):(f.d(1),f=u(c),f&&(f.c(),f.m(l,null)))},i(c){o||(A(r),o=!0)},o(c){P(r),o=!1},d(c){c&&k(e),r&&r.d(),n[8](null),c&&k(s),c&&k(l),f.d()}}}function pw(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),we.Logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(p=>{c();for(let g of p)r.push({x:Y.getDateTime(g.date).toLocal().toJSDate(),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(p=>{p!=null&&p.isAbort||(c(),console.warn(p),we.errorResponseHandler(p,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Yn(()=>(Oo.register(Ri,Wo,Ml,qa,Dl,N2,U2),t(6,o=new Oo(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:p=>p.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:p=>p.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(p){he[p?"unshift":"push"](()=>{l=p,t(0,l)})}return n.$$set=p=>{"filter"in p&&t(3,i=p.filter),"presets"in p&&t(4,s=p.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function C($){return $ instanceof a?new a($.type,C($.content),$.alias):Array.isArray($)?$.map(C):$.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){S=S||{};var M,D;switch(r.util.type($)){case"Object":if(D=r.util.objId($),S[D])return S[D];M={},S[D]=M;for(var E in $)$.hasOwnProperty(E)&&(M[E]=C($[E],S));return M;case"Array":return D=r.util.objId($),S[D]?S[D]:(M=[],S[D]=M,$.forEach(function(O,F){M[F]=C(O,S)}),M);default:return $}},getLanguage:function(C){for(;C;){var $=s.exec(C.className);if($)return $[1].toLowerCase();C=C.parentElement}return"none"},setLanguage:function(C,$){C.className=C.className.replace(RegExp(s,"gi"),""),C.classList.add("language-"+$)},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 $=document.getElementsByTagName("script");for(var S in $)if($[S].src==C)return $[S]}return null}},isActive:function(C,$,S){for(var M="no-"+$;C;){var D=C.classList;if(D.contains($))return!0;if(D.contains(M))return!1;C=C.parentElement}return!!S}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(C,$){var S=r.util.clone(r.languages[C]);for(var M in $)S[M]=$[M];return S},insertBefore:function(C,$,S,M){M=M||r.languages;var D=M[C],E={};for(var O in D)if(D.hasOwnProperty(O)){if(O==$)for(var F in S)S.hasOwnProperty(F)&&(E[F]=S[F]);S.hasOwnProperty(O)||(E[O]=D[O])}var L=M[C];return M[C]=E,r.languages.DFS(r.languages,function(H,j){j===L&&H!=C&&(this[H]=E)}),E},DFS:function C($,S,M,D){D=D||{};var E=r.util.objId;for(var O in $)if($.hasOwnProperty(O)){S.call($,O,$[O],M||O);var F=$[O],L=r.util.type(F);L==="Object"&&!D[E(F)]?(D[E(F)]=!0,C(F,S,null,D)):L==="Array"&&!D[E(F)]&&(D[E(F)]=!0,C(F,S,O,D))}}},plugins:{},highlightAll:function(C,$){r.highlightAllUnder(document,C,$)},highlightAllUnder:function(C,$,S){var M={callback:S,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 D=0,E;E=M.elements[D++];)r.highlightElement(E,$===!0,M.callback)},highlightElement:function(C,$,S){var M=r.util.getLanguage(C),D=r.languages[M];r.util.setLanguage(C,M);var E=C.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(E,M);var O=C.textContent,F={element:C,language:M,grammar:D,code:O};function L(j){F.highlightedCode=j,r.hooks.run("before-insert",F),F.element.innerHTML=F.highlightedCode,r.hooks.run("after-highlight",F),r.hooks.run("complete",F),S&&S.call(F.element)}if(r.hooks.run("before-sanity-check",F),E=F.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!F.code){r.hooks.run("complete",F),S&&S.call(F.element);return}if(r.hooks.run("before-highlight",F),!F.grammar){L(r.util.encode(F.code));return}if($&&i.Worker){var H=new Worker(r.filename);H.onmessage=function(j){L(j.data)},H.postMessage(JSON.stringify({language:F.language,code:F.code,immediateClose:!0}))}else L(r.highlight(F.code,F.grammar,F.language))},highlight:function(C,$,S){var M={code:C,grammar:$,language:S};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,$){var S=$.rest;if(S){for(var M in S)$[M]=S[M];delete $.rest}var D=new c;return d(D,D.head,C),f(C,D,$,D.head,0),g(D)},hooks:{all:{},add:function
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(F+1))}y.textContent=D,t.highlightElement(y)},function(D){b.setAttribute(r,f),y.textContent=D})}}),t.plugins.fileHighlight={highlight:function(b){for(var y=(b||document).querySelectorAll(c),C=0,$;$=y[C++];)t.highlightElement($)}};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)}}()})(r_);const Bs=r_.exports;var gw={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 p=a[d];p==l.element?c=!0:p.nodeName==="#text"&&(c?f+=p.nodeValue:u+=p.nodeValue,r.removeChild(p),--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}}}})})()})(gw);function _w(n){let e,t;return{c(){e=_("div"),t=_("code"),h(t,"class","svelte-tv7jme"),h(e,"class","code-wrapper prism-light svelte-tv7jme")},m(i,s){w(i,e,s),m(e,t),t.innerHTML=n[0]},p(i,[s]){s&1&&(t.innerHTML=i[0])},i:oe,o:oe,d(i){i&&k(e)}}}function bw(n,e,t){let{content:i=""}=e,{language:s="javascript"}=e,l="";function o(r){return r=typeof r=="string"?r:"",r=Bs.plugins.NormalizeWhitespace.normalize(r,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Bs.highlight(r,Bs.languages[s]||Bs.languages.javascript,s)}return n.$$set=r=>{"content"in r&&t(1,i=r.content),"language"in r&&t(2,s=r.language)},n.$$.update=()=>{n.$$.dirty&2&&typeof Bs<"u"&&i&&t(0,l=o(i))},[l,i,s]}class nn extends Pe{constructor(e){super(),Ae(this,e,bw,_w,Ee,{content:1,language:2})}}const vw=n=>({}),ec=n=>({}),yw=n=>({}),tc=n=>({});function nc(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$=n[4]&&!n[2]&&ic(n);const S=n[18].header,M=Mn(S,n,n[17],tc);let D=n[4]&&n[2]&&sc(n);const E=n[18].default,O=Mn(E,n,n[17],null),F=n[18].footer,L=Mn(F,n,n[17],ec);return{c(){e=_("div"),t=_("div"),s=T(),l=_("div"),o=_("div"),$&&$.c(),r=T(),M&&M.c(),a=T(),D&&D.c(),u=T(),f=_("div"),O&&O.c(),c=T(),d=_("div"),L&&L.c(),h(t,"class","overlay"),h(o,"class","overlay-panel-section panel-header"),h(f,"class","overlay-panel-section panel-content"),h(d,"class","overlay-panel-section panel-footer"),h(l,"class",p="overlay-panel "+n[1]+" "+n[8]),ee(l,"popup",n[2]),h(e,"class","overlay-panel-container"),ee(e,"padded",n[2]),ee(e,"active",n[0])},m(H,j){w(H,e,j),m(e,t),m(e,s),m(e,l),m(l,o),$&&$.m(o,null),m(o,r),M&&M.m(o,null),m(o,a),D&&D.m(o,null),m(l,u),m(l,f),O&&O.m(f,null),n[20](f),m(l,c),m(l,d),L&&L.m(d,null),b=!0,y||(C=[X(t,"click",Bt(n[19])),X(f,"scroll",n[21])],y=!0)},p(H,j){n=H,n[4]&&!n[2]?$?$.p(n,j):($=ic(n),$.c(),$.m(o,r)):$&&($.d(1),$=null),M&&M.p&&(!b||j&131072)&&Dn(M,S,n,n[17],b?Tn(S,n[17],j,yw):On(n[17]),tc),n[4]&&n[2]?D?D.p(n,j):(D=sc(n),D.c(),D.m(o,null)):D&&(D.d(1),D=null),O&&O.p&&(!b||j&131072)&&Dn(O,E,n,n[17],b?Tn(E,n[17],j,null):On(n[17]),null),L&&L.p&&(!b||j&131072)&&Dn(L,F,n,n[17],b?Tn(F,n[17],j,vw):On(n[17]),ec),(!b||j&258&&p!==(p="overlay-panel "+n[1]+" "+n[8]))&&h(l,"class",p),j&262&&ee(l,"popup",n[2]),j&4&&ee(e,"padded",n[2]),j&1&&ee(e,"active",n[0])},i(H){b||(Dt(()=>{i||(i=ut(t,bo,{duration:ms,opacity:0},!0)),i.run(1)}),A(M,H),A(O,H),A(L,H),Dt(()=>{v&&v.end(1),g=Xp(l,Vn,n[2]?{duration:ms,y:-10}:{duration:ms,x:50}),g.start()}),b=!0)},o(H){i||(i=ut(t,bo,{duration:ms,opacity:0},!1)),i.run(0),P(M,H),P(O,H),P(L,H),g&&g.invalidate(),v=Qp(l,Vn,n[2]?{duration:ms,y:10}:{duration:ms,x:50}),b=!1},d(H){H&&k(e),H&&i&&i.end(),$&&$.d(),M&&M.d(H),D&&D.d(),O&&O.d(H),n[20](null),L&&L.d(H),H&&v&&v.end(),y=!1,st(C)}}}function ic(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-close-line"></i>',h(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=X(e,"click",Bt(n[5])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function sc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<i class="ri-close-line txt-lg"></i>',h(e,"type","button"),h(e,"class","btn btn-sm btn-circle btn-secondary btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=X(e,"click",Bt(n[5])),t
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]))&&h(e,"for",l);const C={};y&16&&(C.id=b[4]),y&1&&(C.disabled=!Y.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,C.value=b[0].exceptDomains,He(()=>a=!1)),r.$set(C)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function MS(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[3](b)}let v={id:n[4]+".options.onlyDomains",disabled:!Y.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new as({props:v}),he.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[4]+".options.onlyDomains"),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=Qe(Ct.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"))&&h(e,"for",l);const C={};y&16&&(C.id=b[4]+".options.onlyDomains"),y&1&&(C.disabled=!Y.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,C.value=b[0].onlyDomains,He(()=>a=!1)),r.$set(C)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function TS(n){let e,t,i,s,l,o,r;return i=new Le({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[CS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[MS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function DS(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 c_ extends Pe{constructor(e){super(),Ae(this,e,DS,TS,Ee,{key:1,options:0})}}function OS(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 c_({props:r}),he.push(()=>Ie(e,"key",l)),he.push(()=>Ie(e,"options",o)),{c(){z(e.$$.fragment)},m(a,u){q(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],He(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],He(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){V(e,a)}}}function ES(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 AS extends Pe{constructor(e){super(),Ae(this,e,ES,OS,Ee,{key:0,options:1})}}var vr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],vs={_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'>
`+I.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function fe(){t.calendarContainer.classList.add("hasWeeks");var N=St("div","flatpickr-weekwrapper");N.appendChild(St("span","flatpickr-weekday",t.l10n.weekAbbreviation));var I=St("div","flatpickr-weeks");return N.appendChild(I),{weekWrapper:N,weekNumbers:I}}function ye(N,I){I===void 0&&(I=!0);var U=I?N:N-t.currentMonth;U<0&&t._hidePrevMonthArrow===!0||U>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=U,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,tt("onYearChange"),Q()),j(),tt("onMonthChange"),Ge())}function le(N,I){if(N===void 0&&(N=!0),I===void 0&&(I=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,I===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var U=Sr(t.config),se=U.hours,Ne=U.minutes,ze=U.seconds;p(se,Ne,ze)}t.redraw(),N&&tt("onChange")}function ue(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),tt("onClose")}function Te(){t.config!==void 0&&tt("onDestroy");for(var N=t._handlers.length;N--;)t._handlers[N].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 I=t.calendarContainer.parentNode;if(I.lastChild&&I.removeChild(I.lastChild),I.parentNode){for(;I.firstChild;)I.parentNode.insertBefore(I.firstChild,I);I.parentNode.removeChild(I)}}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(U){try{delete t[U]}catch{}})}function Z(N){return t.calendarContainer.contains(N)}function be(N){if(t.isOpen&&!t.config.inline){var I=kn(N),U=Z(I),se=I===t.input||I===t.altInput||t.element.contains(I)||N.path&&N.path.indexOf&&(~N.path.indexOf(t.input)||~N.path.indexOf(t.altInput)),Ne=!se&&!U&&!Z(N.relatedTarget),ze=!t.config.ignoredFocusElements.some(function(it){return it.contains(I)});Ne&&ze&&(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 x(N){if(!(!N||t.config.minDate&&N<t.config.minDate.getFullYear()||t.config.maxDate&&N>t.config.maxDate.getFullYear())){var I=N,U=t.currentYear!==I;t.currentYear=I||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)),U&&(t.redraw(),tt("onYearChange"),Q())}}function G(N,I){var U;I===void 0&&(I=!0);var se=t.parseDate(N,void 0,I);if(t.config.minDate&&se&&wn(se,t.config.minDate,I!==void 0?I:!t.minDateHasTime)<0||t.config.maxDate&&se&&wn(se,t.config.maxDate,I!==void 0?I:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(se===void 0
`),d=_("span"),p=_("span"),p.textContent="Choose presets",g=T(),z(v.$$.fragment),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[10]),h(p,"class","txt link-primary"),h(d,"class","inline-flex"),h(f,"class","help-block")},m(M,D){w(M,e,D),m(e,t),m(e,i),m(e,s),w(M,o,D),q(r,M,D),w(M,u,D),w(M,f,D),m(f,c),m(f,d),m(d,p),m(d,g),q(v,d,null),b=!0,y||(C=Qe(Ct.call(null,s,{text:`Allow files ONLY with the listed mime types.
Leave empty for no restriction.`,position:"top"})),y=!0)},p(M,D){(!b||D&1024&&l!==(l=M[10]))&&h(e,"for",l);const E={};D&1024&&(E.id=M[10]),!a&&D&1&&(a=!0,E.value=M[0].mimeTypes,He(()=>a=!1)),r.$set(E);const O={};D&2049&&(O.$$scope={dirty:D,ctx:M}),v.$set(O)},i(M){b||(A(r.$$.fragment,M),A(v.$$.fragment,M),b=!0)},o(M){P(r.$$.fragment,M),P(v.$$.fragment,M),b=!1},d(M){M&&k(e),M&&k(o),V(r,M),M&&k(u),M&&k(f),V(v),y=!1,C()}}}function s3(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[9](b)}let v={id:n[10],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(v.value=n[0].thumbs),r=new as({props:v}),he.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[10]),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=Qe(Ct.call(null,s,{text:"List of thumb sizes for image files. The thumbs will be generated lazily on first access.",position:"top"})),d=!0)},p(b,y){(!c||y&1024&&l!==(l=b[10]))&&h(e,"for",l);const C={};y&1024&&(C.id=b[10]),!a&&y&1&&(a=!0,C.value=b[0].thumbs,He(()=>a=!1)),r.$set(C)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function l3(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;return i=new Le({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[e3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[t3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),u=new Le({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[i3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),d=new Le({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[s3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),f=T(),c=_("div"),z(d.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(a,"class","col-sm-12"),h(c,"class","col-sm-12"),h(e,"class","grid")},m(g,v){w(g,e,v),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),m(e,f),m(e,c),q(d,c,null),p=!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 $={};v&2&&($.name="schema."+g[1]+".options.thumbs"),v&3073&&($.$$scope={dirty:v,ctx:g}),d.$set($)},i(g){p||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),p=!0)},o(g){P(i.$$.fragment,g),P(o.$$.fragment,g),P(u.$$.fragment,g),P(d.$$.fragment,g),p=!1},d(g){g&&k(e),V(i),V(o),V(u),V(d)}}}function o3(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=Ot(this.value),t(0,s)}function o(){s.maxSelect=Ot(this.value),t(0,s)}function r(p){n.$$.not_equal(s.mimeTypes,p)&&(s.mimeTypes=p,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/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},c=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function d(p){n.$$.not_equal(s.thumbs,p)&&(s.thumbs=p,t(0,s))}return n.$$set=p=>{"key"in p&&t(1,i=p.key),"options"in p&&t(0,s=p.options)},n.$$.update=()=>{n.$$.dirty&1&&Y.isEmpty(s)&&t(0,s
form-field
required
`+(n[5]?"":"invalid")+`
`+(n[0].id&&n[0].system?"disabled":"")+`
`,name:"schema."+n[1]+".name",$$slots:{default:[y3,({uniqueId:j})=>({38:j}),({uniqueId:j})=>[0,j?128:0]]},$$scope:{ctx:n}}});const E=[A3,E3,O3,D3,T3,M3,C3,$3,S3,w3,k3],O=[];function F(j,Q){return j[0].type==="text"?0:j[0].type==="number"?1:j[0].type==="bool"?2:j[0].type==="email"?3:j[0].type==="url"?4:j[0].type==="date"?5:j[0].type==="select"?6:j[0].type==="json"?7:j[0].type==="file"?8:j[0].type==="relation"?9:j[0].type==="user"?10:-1}~(f=F(n))&&(c=O[f]=E[f](n)),g=new Le({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[P3,({uniqueId:j})=>({38:j}),({uniqueId:j})=>[0,j?128:0]]},$$scope:{ctx:n}}});let L=n[0].type!=="file"&&Fc(n),H=!n[0].toDelete&&Ic(n);return{c(){e=_("form"),t=_("div"),i=_("div"),z(s.$$.fragment),l=T(),o=_("div"),z(r.$$.fragment),a=T(),u=_("div"),c&&c.c(),d=T(),p=_("div"),z(g.$$.fragment),v=T(),b=_("div"),L&&L.c(),y=T(),H&&H.c(),C=T(),$=_("input"),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(u,"class","col-sm-12 hidden-empty"),h(p,"class","col-sm-4 flex"),h(b,"class","col-sm-4 flex"),h(t,"class","grid"),h($,"type","submit"),h($,"class","hidden"),h($,"tabindex","-1"),h(e,"class","field-form")},m(j,Q){w(j,e,Q),m(e,t),m(t,i),q(s,i,null),m(t,l),m(t,o),q(r,o,null),m(t,a),m(t,u),~f&&O[f].m(u,null),m(t,d),m(t,p),q(g,p,null),m(t,v),m(t,b),L&&L.m(b,null),m(t,y),H&&H.m(t,null),m(e,C),m(e,$),S=!0,M||(D=X(e,"submit",Bt(n[31])),M=!0)},p(j,Q){const ne={};Q[0]&1&&(ne.class="form-field required "+(j[0].id?"disabled":"")),Q[0]&2&&(ne.name="schema."+j[1]+".type"),Q[0]&1|Q[1]&384&&(ne.$$scope={dirty:Q,ctx:j}),s.$set(ne);const B={};Q[0]&33&&(B.class=`
form-field
required
`+(j[5]?"":"invalid")+`
`+(j[0].id&&j[0].system?"disabled":"")+`
`),Q[0]&2&&(B.name="schema."+j[1]+".name"),Q[0]&33|Q[1]&384&&(B.$$scope={dirty:Q,ctx:j}),r.$set(B);let K=f;f=F(j),f===K?~f&&O[f].p(j,Q):(c&&(De(),P(O[K],1,1,()=>{O[K]=null}),Oe()),~f?(c=O[f],c?c.p(j,Q):(c=O[f]=E[f](j),c.c()),A(c,1),c.m(u,null)):c=null);const W={};Q[0]&1|Q[1]&384&&(W.$$scope={dirty:Q,ctx:j}),g.$set(W),j[0].type!=="file"?L?(L.p(j,Q),Q[0]&1&&A(L,1)):(L=Fc(j),L.c(),A(L,1),L.m(b,null)):L&&(De(),P(L,1,1,()=>{L=null}),Oe()),j[0].toDelete?H&&(H.d(1),H=null):H?H.p(j,Q):(H=Ic(j),H.c(),H.m(t,null))},i(j){S||(A(s.$$.fragment,j),A(r.$$.fragment,j),A(c),A(g.$$.fragment,j),A(L),S=!0)},o(j){P(s.$$.fragment,j),P(r.$$.fragment,j),P(c),P(g.$$.fragment,j),P(L),S=!1},d(j){j&&k(e),V(s),V(r),~f&&O[f].d(),V(g),L&&L.d(),H&&H.d(),M=!1,D()}}}function Rc(n){let e,t,i,s,l=n[0].system&&Hc(),o=!n[0].id&&jc(n),r=n[0].required&&qc(),a=n[0].unique&&Vc();return{c(){e=_("div"),l&&l.c(),t=T(),o&&o.c(),i=T(),r&&r.c(),s=T(),a&&a.c(),h(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=Hc(),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=jc(u),o.c(),o.m(e,i)),u[0].required?r||(r=qc(),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=Vc(),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 Hc(n){let e;return{c(){e=_("span"),e.textContent="System",h(e,"class","label label-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function jc(n){let e;return{c(){e=_("span"),e.textContent="New",h(e,"class","label"),ee(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){w(t,e,i)},p(t,i){i[0]&257&&ee(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&k(e)}}}function qc(n){let e;return{c(){e=_("span"),e.textContent="Required",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Vc(n){let e;return{c(){e=_("span"),e.textContent="Unique",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function zc(n){let e,t,i,s,l;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Qe(Ct.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Dt(()=>{t||(t=ut(e,zn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=ut(e,zn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function Bc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Restore</span>',h(e,"type","button"),h(e,"class","btn btn-sm btn-danger btn-secondary")},m(s,l){w(s,e,l),t||(i=X(e,"click",qn(n[15])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function I3(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,p,g,v,b,y=!n[0].toDelete&&Rc(n),C=n[7]&&!n[0].system&&zc(),$=n[0].toDelete&&Bc(n);return{c(){e=_("div"),t=_("span"),i=_("i"),l=T(),o=_("strong"),a=R(r),f=T(),y&&y.c(),c=T(),d=_("div"),p=T(),C&&C.c(),g=T(),$&&$.c(),v=rt(),h(i,"class",s=Ka(Y.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),h(t,"class","icon field-type"),h(o,"class","title field-name svelte-1tpxlm5"),h(o,"title",u=n[0].name),ee(o,"txt-strikethrough",n[0].toDelete),h(e,"class","inline-flex"),h(d,"class","flex-fill")},m(S,M){w(S,e,M),m(e,t),m(t,i),m(e,l),m(e,o),m(o,a),w(S,f,M),y&&y.m(S,M),w(S,c,M),w(S,d,M),w(S,p,M),C&&C.m(S,M),w(S,g,M),$&&$.m(S,M),w(S,v,M),b=!0},p(S,M){(!b||M[0]&1&&s!==(s=Ka(Y.getFieldTypeIcon(S[0].type))+" svelte-1tpxlm5"))&&h(i,"class",s),(!b||M[0]&1)&&r!==(r=(S[0].name||"-")+"")&&me(a,r),(!b||M[0]&1&&u!==(u=S[0].name))&&h(o,"title",u),M[0]&1&&ee(o,"txt-strikethrough",S[0].toDelete),S[0].toDelete?y&&(y.d(1),y=null):y?y.p(S,M):(y=Rc(S),y.c(),y.m(c.parentNode,c)),S[7]&&!S[0].system?C?M[0]&129&&A(C,1):(C=zc(),C.c(),A(C,1),C.m(g.parentNode,g)):C&&(De(),P(C,1,1,()=>{C=null}),Oe()),S[0].toDelete?$?$.p(S,M):($=Bc(S),$.c(),$.m(v.parentNode,v)):$&&($.d(1),$=null)},i(S){b||(A(C),b=!0)},o(S){P(C),b=!1},d(S){S&&k(e),S&&k(f),y&&y.d(S),S&&k(c),S&&k(d),S&&k(p),C&&C.d(S),S&&k(g),$&&$.d(S),S&&k(v)}}}function N3(n){let e,t,i={single:!0,interactive:n[8],class:n[2]||n[0].toDelete||n[0].system?"field-accordion disabled":"field-accor
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.user.*</code>`,$=T(),S=_("hr"),M=T(),D=_("p"),D.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",E=T(),O=_("div"),O.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",F=T(),L=_("hr"),H=T(),j=_("p"),j.innerHTML=`Example rule:
<br/>
<code>@request.user.id!=&quot;&quot; &amp;&amp; created&gt;&quot;2022-01-01 00:00:00&quot;</code>`,h(s,"class","m-b-0"),h(o,"class","inline-flex flex-gap-5"),h(g,"class","m-t-10 m-b-5"),h(b,"class","m-b-0"),h(C,"class","inline-flex flex-gap-5"),h(S,"class","m-t-10 m-b-5"),h(D,"class","m-b-0"),h(O,"class","inline-flex flex-gap-5"),h(L,"class","m-t-10 m-b-5"),h(i,"class","content"),h(t,"class","alert alert-warning m-0")},m(W,J){w(W,e,J),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 ie=0;ie<K.length;ie+=1)K[ie].m(o,null);m(i,p),m(i,g),m(i,v),m(i,b),m(i,y),m(i,C),m(i,$),m(i,S),m(i,M),m(i,D),m(i,E),m(i,O),m(i,F),m(i,L),m(i,H),m(i,j),ne=!0},p(W,J){if(J&1){B=W[0].schema;let ie;for(ie=0;ie<B.length;ie+=1){const fe=Kc(W,B,ie);K[ie]?K[ie].p(fe,J):(K[ie]=Jc(fe),K[ie].c(),K[ie].m(o,null))}for(;ie<K.length;ie+=1)K[ie].d(1);K.length=B.length}},i(W){ne||(W&&Dt(()=>{Q||(Q=ut(e,xt,{duration:150},!0)),Q.run(1)}),ne=!0)},o(W){W&&(Q||(Q=ut(e,xt,{duration:150},!1)),Q.run(0)),ne=!1},d(W){W&&k(e),jn(K,W),W&&Q&&Q.end()}}}function z3(n){let e,t=n[19].name+"",i;return{c(){e=_("code"),i=R(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[19].name+"")&&me(i,t)},d(s){s&&k(e)}}}function B3(n){let e,t=n[19].name+"",i,s;return{c(){e=_("code"),i=R(t),s=R(".*")},m(l,o){w(l,e,o),m(e,i),m(e,s)},p(l,o){o&1&&t!==(t=l[19].name+"")&&me(i,t)},d(l){l&&k(e)}}}function Jc(n){let e;function t(l,o){return l[19].type==="relation"||l[19].type==="user"?B3:z3}let i=t(n),s=i(n);return{c(){s.c(),e=rt()},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 U3(n){let e=[],t=new Map,i,s,l=Object.entries(n[6]);const o=r=>r[14];for(let r=0;r<l.length;r+=1){let a=Yc(n,l,r),u=o(a);t.set(u,e[r]=Gc(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=rt()},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&262235&&(l=Object.entries(r[6]),De(),e=ft(e,a,o,1,r,l,t,i.parentNode,Nt,Gc,i,Yc),Oe())},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)P(e[a]);s=!1},d(r){for(let a=0;a<e.length;a+=1)e[a].d(r);r&&k(i)}}}function W3(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',h(e,"class","txt-center")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function Y3(n){let e,t,i;function s(){return n[9](n[14])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-line"></i>',h(e,"type","button"),h(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Qe(Ct.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,st(i)}}}function K3(n){let e,t,i;function s(){return n[8](n[14])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-unlock-line"></i>',h(e,"type","button"),h(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Qe(Ct.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,st(i)}}}function Z3(n){let e;return{c(){e=R("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function J3(n){let e;return{c(){e=R("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function G3(n){let e,t=n[15]+"",i,s,l=Di(n[0][n[14]])?"Admins only":"Custom rule",o,r,a,u,f=n[14],c,d,p,g,v,b,y;function C(){return n[10](n[14])}const $=()=>n[11](u,f),S=()=>n[11](null,f);function M(H){n[12](H,n[14])}var D=n[4];function E(H){let j={baseCollection:H[0],disabled:Di(H[0][H[14]])};return H[0][H[14]]!==void 0&&(j.value=H[0][H[14]]),{props:j}}D&&(u=new D(E(n)),$(),he.push(()=>Ie(u,"value",M)));function O(H,j){return j&1&&(g=null),g==null&&(g=!!Di(H[0][H[14]])),g?J3:Z3}let F=O(n,-1),L=F(n);return{c(){e=_("label"),i=R(t),s=R(" - "),o=R(l),a=T(),u&&z(u.$$.fragment),d=T(),p=_("div"),L.c(),h(e,"for",r=n[18]),h(p,"class","help-block")},m(H,j){w(H,e,j),m(e,i),m(e,s),m(e,o),w(H,a,j),u&&q(u,H,j),w(H,d,j),w(H,p,j),L.m(p,null),v=!0,b||(y=X(e,"click",C),b=!0)},p(H,j){n=H,(!v||j
<a href="https://pocketbase.io/docs/manage-collections#rules-filters-syntax" target="_blank" rel="noopener">PocketBase filter syntax and operators
</a>.`,s=T(),l=_("span"),r=R(o),a=T(),b&&b.c(),u=T(),c.c(),d=rt(),h(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),h(t,"class","flex"),h(e,"class","block m-b-base")},m(S,M){w(S,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(S,u,M),C[f].m(S,M),w(S,d,M),p=!0,g||(v=X(l,"click",n[7]),g=!0)},p(S,[M]){(!p||M&4)&&o!==(o=S[2]?"Hide available fields":"Show available fields")&&me(r,o),S[2]?b?(b.p(S,M),M&4&&A(b,1)):(b=Zc(S),b.c(),A(b,1),b.m(e,null)):b&&(De(),P(b,1,1,()=>{b=null}),Oe());let D=f;f=$(S),f===D?C[f].p(S,M):(De(),P(C[D],1,1,()=>{C[D]=null}),Oe(),c=C[f],c?c.p(S,M):(c=C[f]=y[f](S),c.c()),A(c,1),c.m(d.parentNode,d))},i(S){p||(A(b),A(c),p=!0)},o(S){P(b),P(c),p=!1},d(S){S&&k(e),b&&b.d(),S&&k(u),C[f].d(S),S&&k(d),g=!1,v()}}}function Di(n){return n===null}function Q3(n,e,t){let{collection:i=new An}=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 Ji(()=>import("./FilterAutocompleteInput.ec82b78a.js"),[])).default)}catch(y){console.warn(y),t(4,r=null)}t(5,a=!1)}Yn(()=>{f()});const c=()=>t(2,l=!l),d=async y=>{var C;t(0,i[y]=s[y]||"",i),await ai(),(C=o[y])==null||C.focus()},p=y=>{t(1,s[y]=i[y],s),t(0,i[y]=null,i)},g=y=>{var C;return(C=o[y])==null?void 0:C.focus()};function v(y,C){he[y?"unshift":"push"](()=>{o[C]=y,t(3,o)})}function b(y,C){n.$$.not_equal(i[C],y)&&(i[C]=y,t(0,i))}return n.$$set=y=>{"collection"in y&&t(0,i=y.collection)},[i,s,l,o,r,a,u,c,d,p,g,v,b]}class x3 extends Pe{constructor(e){super(),Ae(this,e,Q3,X3,Ee,{collection:0})}}function Xc(n,e,t){const i=n.slice();return i[14]=e[t],i}function Qc(n,e,t){const i=n.slice();return i[14]=e[t],i}function xc(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 ed(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=R(`Renamed collection
`),s=_("strong"),o=R(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=R(c),h(s,"class","txt-strikethrough txt-hint"),h(a,"class","ri-arrow-right-line txt-sm"),h(f,"class","txt"),h(t,"class","inline-flex")},m(p,g){w(p,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(p,g){g&2&&l!==(l=p[1].originalName+"")&&me(o,l),g&2&&c!==(c=p[1].name+"")&&me(d,c)},d(p){p&&k(e)}}}function td(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=R(`Renamed field
`),s=_("strong"),o=R(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=R(c),h(s,"class","txt-strikethrough txt-hint"),h(a,"class","ri-arrow-right-line txt-sm"),h(f,"class","txt"),h(t,"class","inline-flex")},m(p,g){w(p,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(p,g){g&16&&l!==(l=p[14].originalName+"")&&me(o,l),g&16&&c!==(c=p[14].name+"")&&me(d,c)},d(p){p&&k(e)}}}function nd(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=_("li"),t=R("Removed field "),i=_("span"),l=R(s),o=T(),h(i,"class","txt-bold"),h(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+"")&&me(l,s)},d(r){r&&k(e)}}}function e$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p=n[3].length&&xc(),g=n[5]&&ed(n),v=n[4],b=[];for(let $=0;$<v.length;$+=1)b[$]=td(Qc(n,v,$));let y=n[3],C=[];for(let $=0;$<y.length;$+=1)C[$]=nd(Xc(n,y,$));return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=T(),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=T(),p&&p.c(),r=T(),a=_("h6"),a.textContent="Changes:",u=T(),f=_("ul"),g&&g.c(),c=T();for(let $=0;$<b.length;$+=1)b[$].c();d=T();for(let $=0;$<C.length;$+=1)C[$].c();h(t,"class","icon"),h(s,"class","content txt-bold"),h(e,"class","alert alert-warning"),h(f,"class","changes-list svelte-1ghly2p")},m($,S){w($,e,S),m(e,t),m(e,i),m(e,s),m(s,l),m(s,o),p&&p.m(s,null),w($,r,S),w($,a,S),w($,u,S),w($,f,S),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($[3].length?p||(p=xc(),p.c(),p.m(s,null)):p&&(p.d(1),p=null),$[5]?g?g.p($,S):(g=ed($),g.c(),g.m(f,c)):g&&(g.d(1),g=null),S&16){v=$[4];let M;for(M=0;M<v.length;M+=1){const D=Qc($,v,M);b[M]?b[M].p(D,S):(b[M]=td(D),b[M].c(),b[M].m(f,d))}for(;M<b.length;M+=1)b[M].d(1);b.length=v.length}if(S&8){y=$[3];let M;for(M=0;M<y.length;M+=1){const D=Xc($,y,M);C[M]?C[M].p(D,S):(C[M]=nd(D),C[M].c(),C[M].m(f,null))}for(;M<C.length;M+=1)C[M].d(1);C.length=y.length}},d($){$&&k(e),p&&p.d(),$&&k(r),$&&k(a),$&&k(u),$&&k(f),g&&g.d(),jn(b,$),jn(C,$)}}}function t$(n){let e;return{c(){e=_("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function n$(n){let e,t,i,s,l;return{c(){e=_("button"),e.innerHTML='<span class="txt">Cancel</span>',t=T(),i=_("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,h(e,"type","button"),h(e,"class","btn btn-secondary"),h(i,"type","button"),h(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:oe,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,st(l)}}}function i$(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[n$],header:[t$],default:[e$]},$$scope:{ctx:n}};return e=new wi({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&524346&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),V(e,s)}}}function s$(n,e,t){let i,s,l;const o=un();let r,a;async function u(y){t(1,a=y),await ai(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),p=()=>c();function g(y){he[y?"unshift":"push"](()=>{r=y,t(2,r)})}function v(y){ht.call(this,n,y)}function b(y){ht.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,p,g,v,b]}class l$ extends Pe{constructor(e){super(),Ae(this,e,s$,i$,Ee,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function id(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 x3({props:o}),he.push(()=>Ie(t,"collection",l)),{c(){e=_("div"),z(t.$$.fragment),h(e,"class","tab-item active")},m(r,a){w(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],He(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&k(e),V(t)}}}function o$(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 V3({props:a}),he.push(()=>Ie(i,"collection",r));let u=n[9]===gl&&id(n);return{c(){e=_("div"),t=_("div"),z(i.$$.fragment),l=T(),u&&u.c(),h(t,"class","tab-item"),ee(t,"active",n[9]===ts),h(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),m(e,t),q(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],He(()=>s=!1)),i.$set(d),c[0]&512&&ee(t,"active",f[9]===ts),f[9]===gl?u?(u.p(f,c),c[0]&512&&A(u,1)):(u=id(f),u.c(),A(u,1),u.m(e,null)):u&&(De(),P(u,1,1,()=>{u=null}),Oe())},i(f){o||(A(i.$$.fragment,f),A(u),o=!0)},o(f){P(i.$$.fragment,f),P(u),o=!1},d(f){f&&k(e),V(i),u&&u.d()}}}function sd(n){let e,t,i,s,l,o,r;return o=new os({props:{class:"dropdown dropdown-right m
<span class="txt">Delete</span>`,h(e,"type","button"),h(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[20]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function ld(n){let e;return{c(){e=_("div"),e.textContent="System collection",h(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function a$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p=n[2].system&&ld();return{c(){e=_("label"),t=R("Name"),s=T(),l=_("input"),u=T(),p&&p.c(),f=rt(),h(e,"for",i=n[38]),h(l,"type","text"),h(l,"id",o=n[38]),l.required=!0,l.disabled=n[11],h(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,h(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),p&&p.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])&&h(e,"for",i),v[1]&128&&o!==(o=g[38])&&h(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?p||(p=ld(),p.c(),p.m(f.parentNode,f)):p&&(p.d(1),p=null)},d(g){g&&k(e),g&&k(s),g&&k(l),g&&k(u),p&&p.d(g),g&&k(f),c=!1,d()}}}function od(n){let e,t,i,s,l,o;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=Qe(t=Ct.call(null,e,n[12])),l=!0)},p(r,a){t&&Wn(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&Dt(()=>{i||(i=ut(e,zn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=ut(e,zn,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function rd(n){let e,t,i,s,l;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Qe(Ct.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Dt(()=>{t||(t=ut(e,zn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=ut(e,zn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function u$(n){var H,j,Q,ne,B,K;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,p,g,v=!Y.isEmpty((H=n[4])==null?void 0:H.schema),b,y,C,$,S=!Y.isEmpty((j=n[4])==null?void 0:j.listRule)||!Y.isEmpty((Q=n[4])==null?void 0:Q.viewRule)||!Y.isEmpty((ne=n[4])==null?void 0:ne.createRule)||!Y.isEmpty((B=n[4])==null?void 0:B.updateRule)||!Y.isEmpty((K=n[4])==null?void 0:K.deleteRule),M,D,E,O=!n[2].isNew&&!n[2].system&&sd(n);r=new Le({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[a$,({uniqueId:W})=>({38:W}),({uniqueId:W})=>[0,W?128:0]]},$$scope:{ctx:n}}});let F=v&&od(n),L=S&&rd();return{c(){e=_("h4"),i=R(t),s=T(),O&&O.c(),l=T(),o=_("form"),z(r.$$.fragment),a=T(),u=_("input"),f=T(),c=_("div"),d=_("button"),p=_("span"),p.textContent="Fields",g=T(),F&&F.c(),b=T(),y=_("button"),C=_("span"),C.textContent="API Rules",$=T(),L&&L.c(),h(u,"type","submit"),h(u,"class","hidden"),h(u,"tabindex","-1"),h(o,"class","block"),h(p,"class","txt"),h(d,"type","button"),h(d,"class","tab-item"),ee(d,"active",n[9]===ts),h(C,"class","txt"),h(y,"type","button"),h(y,"class","tab-item"),ee(y,"active",n[9]===gl),h(c,"class","tabs-header stretched")},m(W,J){w(W,e,J),m(e,i),w(W,s,J),O&&O.m(W,J),w(W,l,J),w(W,o,J),q(r,o,null),m(o,a),m(o,u),w(W,f,J),w(W,c,J),m(c,d),m(d,p),m(d,g),F&&F.m(d,null),m(c,b),m(c,y),m(y,C),m(y,$),L&&L.m(y,null),M=!0,D||(E=[X(o,"submit",Bt(n[22])),X(d,"click",n[23]),X(y,"click",n[24])],D=!0)},p(W,J){var fe,ye,le,ue,Te,Z;(!M||J[0]&4)&&t!==(t=W[2].isNew?"New collection":"Edit collection")&&me(i,t),!W[2].isNew&&!W[2].system?O?(O.p(W,J),J[0]&4&&A(O,1)):(O=sd(W),O.c(),A(O,1),O.m(l.parentNode,l)):O&&(De(),P(O,1,1,()=>{O=null}),Oe());const ie={};J[0]&2048&&(ie.class="form-field required m-b-0 "+(W[11]?"disabled":"")),J[0]&2052|J[1]&384&&(ie.$$scope={dirty:J,ctx:W}),r.$set(ie),J[0]&16&&(v=!Y.isEmpty((fe=W[4])==null?void 0:fe.schema)),v?F?(F.p(W,J),J[0]&16&&A(F,1)):(F=od(W),F.c(),A(F,1),F.m(d,null)):F&&(De(),P(F,1,1,()=>{F=null}),Oe()),J[0]&512&&ee(d,"active",W[9]===ts),J[0]&16&&(S=!Y.isEmpty((ye=W[4])==null?void 0:ye.listRule)||!Y.isEmpty((le=W[4])==null?void 0:le.viewRule)||!Y.isEmpty((ue=W[4])==null?void 0:ue.createRu
<span class="txt">New collection</span>`,y=T(),z(C.$$.fragment),h(l,"type","button"),h(l,"class","btn btn-xs btn-secondary btn-circle btn-clear"),ee(l,"hidden",!n[4]),h(s,"class","form-field-addon"),h(r,"type","text"),h(r,"placeholder","Search collections..."),h(i,"class","form-field search"),ee(i,"active",n[4]),h(t,"class","sidebar-header"),h(u,"class","m-t-5 m-b-xs"),h(c,"class","sidebar-content"),h(b,"type","button"),h(b,"class","btn btn-block btn-outline"),h(v,"class","sidebar-footer"),h(e,"class","page-sidebar collection-sidebar")},m(L,H){w(L,e,H),m(e,t),m(t,i),m(i,s),m(s,l),m(i,o),m(i,r),Ce(r,n[0]),m(e,a),m(e,u),m(e,f),m(e,c);for(let j=0;j<d.length;j+=1)d[j].m(c,null);O&&O.m(c,null),m(e,g),m(e,v),m(v,b),w(L,y,H),q(C,L,H),$=!0,S||(M=[X(l,"click",n[8]),X(r,"input",n[9]),X(b,"click",n[11])],S=!0)},p(L,[H]){H&16&&ee(l,"hidden",!L[4]),H&1&&r.value!==L[0]&&Ce(r,L[0]),H&16&&ee(i,"active",L[4]),H&106&&(D=L[3],d=ft(d,H,E,1,L,D,p,c,rn,cd,null,ad),!D.length&&O?O.p(L,H):D.length?O&&(O.d(1),O=null):(O=ud(L),O.c(),O.m(c,null)));const j={};C.$set(j)},i(L){$||(A(C.$$.fragment,L),$=!0)},o(L){P(C.$$.fragment,L),$=!1},d(L){L&&k(e);for(let H=0;H<d.length;H+=1)d[H].d();O&&O.d(),L&&k(y),n[12](null),V(C,L),S=!1,st(M)}}}function g$(n,e,t){let i,s,l,o,r;At(n,li,b=>t(5,o=b)),At(n,Cs,b=>t(7,r=b));let a,u="";function f(b){bn(li,o=b,o)}const c=()=>t(0,u="");function d(){u=this.value,t(0,u)}const p=b=>f(b),g=()=>a==null?void 0:a.show();function v(b){he[b?"unshift":"push"](()=>{a=b,t(2,a)})}return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=u.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=u!==""),n.$$.dirty&131&&t(3,l=r.filter(b=>b.name!="profiles"&&(b.id==u||b.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[u,i,a,l,s,o,f,r,c,d,p,g,v]}class _$ extends Pe{constructor(e){super(),Ae(this,e,g$,m$,Ee,{})}}function b$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$,S,M,D,E,O,F,L,H,j,Q,ne,B,K,W,J,ie,fe,ye,le,ue,Te,Z,be,x,G,_e,je,Fe,Re,re,ae,ke,Ke;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=T(),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=T(),o=_("li"),r=_("code"),r.textContent="OPERATOR",a=R(` - is one of:
`),u=_("br"),f=T(),c=_("ul"),d=_("li"),p=_("code"),p.textContent="=",g=T(),v=_("span"),v.textContent="Equal",b=T(),y=_("li"),C=_("code"),C.textContent="!=",$=T(),S=_("span"),S.textContent="NOT equal",M=T(),D=_("li"),E=_("code"),E.textContent=">",O=T(),F=_("span"),F.textContent="Greater than",L=T(),H=_("li"),j=_("code"),j.textContent=">=",Q=T(),ne=_("span"),ne.textContent="Greater than or equal",B=T(),K=_("li"),W=_("code"),W.textContent="<",J=T(),ie=_("span"),ie.textContent="Less than or equal",fe=T(),ye=_("li"),le=_("code"),le.textContent="<=",ue=T(),Te=_("span"),Te.textContent="Less than or equal",Z=T(),be=_("li"),x=_("code"),x.textContent="~",G=T(),_e=_("span"),_e.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
match)`,je=T(),Fe=_("li"),Re=_("code"),Re.textContent="!~",re=T(),ae=_("span"),ae.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,ke=T(),Ke=_("p"),Ke.innerHTML=`To group and combine several expressions you could use brackets
<code>(...)</code>, <code>&amp;&amp;</code> (AND) and <code>||</code> (OR) tokens.`,h(r,"class","txt-danger"),h(p,"class","filter-op svelte-1w7s5nw"),h(v,"class","txt-hint"),h(C,"class","filter-op svelte-1w7s5nw"),h(S,"class","txt-hint"),h(E,"class","filter-op svelte-1w7s5nw"),h(F,"class","txt-hint"),h(j,"class","filter-op svelte-1w7s5nw"),h(ne,"class","txt-hint"),h(W,"class","filter-op svelte-1w7s5nw"),h(ie,"class","txt-hint"),h(le,"class","filter-op svelte-1w7s5nw"),h(Te,"class","txt-hint"),h(x,"class","filter-op svelte-1w7s5nw"),h(_e,"class","txt-hint"),h(Re,"class","filter-op svelte-1w7s5nw"),h(ae,"class","txt-hint")},m(Ye,nt){w(Ye,e,nt),w(Ye,t,nt),w(Ye,i,nt),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,p),m(d,g),m(d,v),m(c,b),m(c,y),m(y,C),m(y,$),m(y,S),m(c,M),m(c,D),m(D,E),m(D,O),m(D,F),m(c,L),m(c,H),m(H,j),m(H,Q),m(H,ne),m(c,B),m(c,K),m(K,W),m(K,J),m(K,ie),m(c,fe),m(c,ye),m(ye,le),m(ye,ue),m(ye,Te),m(c,Z),m(c,be),m(be,x),m(be,G),m(be,_e),m(c,je),m(c,Fe),m(Fe,Re),m(Fe,re),m(Fe,ae),w(Ye,ke,nt),w(Ye,Ke,nt)},p:oe,i:oe,o:oe,d(Ye){Ye&&k(e),Ye&&k(t),Ye&&k(i),Ye&&k(ke),Ye&&k(Ke)}}}class v$ extends Pe{constructor(e){super(),Ae(this,e,null,b$,Ee,{})}}function dd(n,e,t){const i=n.slice();return i[8]=e[t],i}function hd(n,e,t){const i=n.slice();return i[8]=e[t],i}function pd(n,e,t){const i=n.slice();return i[13]=e[t],i}function md(n,e,t){const i=n.slice();return i[13]=e[t],i}function gd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function _d(n,e){let t,i=e[13].lang+"",s,l,o,r;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[3]===e[13].lang),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&16&&i!==(i=e[13].lang+"")&&me(s,i),f&24&&ee(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),o=!1,r()}}}function bd(n,e){let t,i,s,l;return i=new nn({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[3]===e[13].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[13].code),i.$set(a),r&24&&ee(t,"active",e[3]===e[13].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function vd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("div"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[8].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&36&&ee(t,"active",e[2]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function yd(n,e){let t,i,s,l;return i=new nn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&36&&ee(t,"active",e[2]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function y$(n){let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y=n[0].name+"",C,$,S,M,D,E,O,F=[],L=new Map,H,j,Q=[],ne=new Map,B,K,W,J,ie,fe,ye,le,ue,Te,Z,be,x,G,_e,je,Fe,Re,re,ae,ke,Ke,Ye,nt,lt,xe,ge,de,qe,ct,te,ve,Ze,at,mt,yt,Lt,pe,Se,Je,tt,Ft,ce,$e,Ge,Xt,Ut,ei,dt,N,I,U,se,Ne,ze,it,We,ot,Ue,Xe=[],$t=new Map,yn,Jt,Qt=[],ci=new Map,Si,en=n[1]&&gd(),us=n[4];const Ol=Me=>Me[13].lang;for(let Me=0;Me<us.length;Me+=1){let Be=md(n,us,Me),Et=Ol(Be);L.set(Et,F[Me]=_d(Et,Be))}let Hi=n[4];const El=Me=>Me[13].lang;for(let Me=0;Me<Hi.length;Me+=1){let Be=pd(n,Hi,Me),Et=El(Be);ne.set(Et,Q[Me]=bd(Et,Be))}lt=new nn({props:{content:`
// DESC by created and ASC by id
?sort=-created,id
`}}),at=new nn({props:{content:`
?filter=(id='abc' && created>'2022-01-01')
`}}),yt=new v$({}),Ge=new nn({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let fs=n[5];const Al=Me=>Me[8].code;for(let Me=0;Me<fs.length;Me+=1){let Be=hd(n,fs,Me),Et=Al(Be);$t.set(Et,Xe[Me]=vd(Et,Be))}let ji=n[5];const Pl=Me=>Me[8].code;for(let Me=0;Me<ji.length;Me+=1){let Be=dd(n,ji,Me),Et=Pl(Be);ci.set(Et,Qt[Me]=yd(Et,Be))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records"),c=T(),en&&en.c(),d=T(),p=_("div"),g=_("p"),v=R("Fetch a paginated "),b=_("strong"),C=R(y),$=R(" records list."),S=T(),M=_("div"),M.textContent="Client SDKs example",D=T(),E=_("div"),O=_("div");for(let Me=0;Me<F.length;Me+=1)F[Me].c();H=T(),j=_("div");for(let Me=0;Me<Q.length;Me+=1)Q[Me].c();B=T(),K=_("div"),K.textContent="Query parameters",W=T(),J=_("table"),ie=_("thead"),ie.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,fe=T(),ye=_("tbody"),le=_("tr"),le.innerHTML=`<td>page</td>
<td><span class="label">Number</span></td>
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,ue=T(),Te=_("tr"),Te.innerHTML=`<td>perPage</td>
<td><span class="label">Number</span></td>
<td>Specify the max returned records per page (default to 30).</td>`,Z=T(),be=_("tr"),x=_("td"),x.textContent="sort",G=T(),_e=_("td"),_e.innerHTML='<span class="label">String</span>',je=T(),Fe=_("td"),Re=R("Specify the records order attribute(s). "),re=_("br"),ae=R(`
Add `),ke=_("code"),ke.textContent="-",Ke=R(" / "),Ye=_("code"),Ye.textContent="+",nt=R(` (default) in front of the attribute for DESC / ASC order.
Ex.:
`),z(lt.$$.fragment),xe=T(),ge=_("tr"),de=_("td"),de.textContent="filter",qe=T(),ct=_("td"),ct.innerHTML='<span class="label">String</span>',te=T(),ve=_("td"),Ze=R(`Filter the returned records. Ex.:
`),z(at.$$.fragment),mt=T(),z(yt.$$.fragment),Lt=T(),pe=_("tr"),Se=_("td"),Se.textContent="expand",Je=T(),tt=_("td"),tt.innerHTML='<span class="label">String</span>',Ft=T(),ce=_("td"),$e=R(`Auto expand nested record relations. Ex.:
`),z(Ge.$$.fragment),Xt=R(`
Supports up to 6-levels depth nested relations expansion. `),Ut=_("br"),ei=R(`
The expanded relations will be appended to each individual record under the
`),dt=_("code"),dt.textContent="@expand",N=R(" property (eg. "),I=_("code"),I.textContent='"@expand": {"rel1": {...}, ...}',U=R(`). Only the
relations that the user has permissions to `),se=_("strong"),se.textContent="view",Ne=R(" will be expanded."),ze=T(),it=_("div"),it.textContent="Responses",We=T(),ot=_("div"),Ue=_("div");for(let Me=0;Me<Xe.length;Me+=1)Xe[Me].c();yn=T(),Jt=_("div");for(let Me=0;Me<Qt.length;Me+=1)Qt[Me].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-info"),h(p,"class","content m-b-base"),h(M,"class","section-title"),h(O,"class","tabs-header compact left"),h(j,"class","tabs-content"),h(E,"class","tabs m-b-lg"),h(K,"class","section-title"),h(J,"class","table-compact table-border m-b-lg"),h(it,"class","section-title"),h(Ue,"class","tabs-header compact left"),h(Jt,"class","tabs-content"),h(ot,"class","tabs")},m(Me,Be){w(Me,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(e,c),en&&en.m(e,null),w(Me,d,Be),w(Me,p,Be),m(p,g),m(g,v),m(g,b),m(b,C),m(g,$),w(Me,S,Be),w(Me,M,Be),w(Me,D,Be),w(Me,E,Be),m(E,O);for(let Et=0;Et<F.length;Et+=1)F[Et].m(O,null);m(E,H),m(E,j);for(let Et=0;Et<Q.length;Et+=1)Q[Et].m(j,null);w(Me,B,Be),w(Me,K,Be),w(Me,W,Be),w(Me,J,Be),m(J,ie),m(J,fe),m(J,ye),m(ye,le),m(ye,ue),m(ye,Te),m(ye,Z),m(ye,be),m(be,x),m(be,G),m(be,_e),m(be,je),m(be,Fe),m(Fe,Re),m(Fe,re),m(Fe,ae),m(Fe,ke),m(Fe,Ke),m(Fe,Ye),m(Fe,nt),q(lt,Fe,null),m(ye,xe),m(ye,ge),m(ge,de),m(ge,qe),m(ge,ct),m(ge,te),m(ge,ve),m(ve,Ze),q(at,ve,null),m(ve,mt),q(yt,ve,null),m(ye,Lt),m(ye,pe),m(pe,Se),m(pe,Je),m(pe,tt),m(pe,Ft),m(pe,ce),m(ce,$e),q(Ge,ce,null),m(ce,Xt),m(ce,Ut),m(ce,ei),m(ce,dt),m(ce,N),m(ce,I),m(ce,U),m(ce,se),m(ce,Ne),w(Me,ze,Be),w(Me,it,Be),w(Me,We,Be),w(Me,ot,Be),m(ot,Ue);for(let Et=0;Et<Xe.length;Et+=1)Xe[Et].m(Ue,null);m(ot,yn),m(ot,Jt);for(let Et=0;Et<Qt.length;Et+=1)Qt[Et].m(Jt,null);Si=!0},p(Me,[Be]){(!Si||Be&1)&&a!==(a=Me[0].name+"")&&me(u,a),Me[1]?en||(en=gd(),en.c(),en.m(e,null)):en&&(en.d(1),en=null),(!Si||Be&1)&&y!==(y=Me[0].name+"")&&me(C,y),Be&24&&(us=Me[4],F=ft(F,Be,Ol,1,Me,us,L,O,rn,_d,null,md)),Be&24&&(Hi=Me[4],De(),Q=ft(Q,Be,El,1,Me,Hi,ne,j,Nt,bd,null,pd),Oe()),Be&36&&(fs=Me[5],Xe=ft(Xe,Be,Al,1,Me,fs,$t,Ue,rn,vd,null,hd)),Be&36&&(ji=Me[5],De(),Qt=ft(Qt,Be,Pl,1,Me,ji,ci,Jt,Nt,yd,null,dd),Oe())},i(Me){if(!Si){for(let Be=0;Be<Hi.length;Be+=1)A(Q[Be]);A(lt.$$.fragment,Me),A(at.$$.fragment,Me),A(yt.$$.fragment,Me),A(Ge.$$.fragment,Me);for(let Be=0;Be<ji.length;Be+=1)A(Qt[Be]);Si=!0}},o(Me){for(let Be=0;Be<Q.length;Be+=1)P(Q[Be]);P(lt.$$.fragment,Me),P(at.$$.fragment,Me),P(yt.$$.fragment,Me),P(Ge.$$.fragment,Me);for(let Be=0;Be<Qt.length;Be+=1)P(Qt[Be]);Si=!1},d(Me){Me&&k(e),en&&en.d(),Me&&k(d),Me&&k(p),Me&&k(S),Me&&k(M),Me&&k(D),Me&&k(E);for(let Be=0;Be<F.length;Be+=1)F[Be].d();for(let Be=0;Be<Q.length;Be+=1)Q[Be].d();Me&&k(B),Me&&k(K),Me&&k(W),Me&&k(J),V(lt),V(at),V(yt),V(Ge),Me&&k(ze),Me&&k(it),Me&&k(We),Me&&k(ot);for(let Be=0;Be<Xe.length;Be+=1)Xe[Be].d();for(let Be=0;Be<Qt.length;Be+=1)Qt[Be].d()}}}function k$(n,e,t){let i,{collection:s=new An}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(3,o=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.listRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(r.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[Y.dummyCollectionRecord(s),Y.dummyCollectionRecord(s)]},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": {}
}
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${we.baseUrl}");
client.Records.getList("${s==null?void 0:s.name}", { page: 2 })
.then(function (list) {
// success...
}).catch(function (error) {
// error...
});
// alternatively you can also fetch all records at once via getFullList:
client.Records.getFullList("${s==null?void 0:s.name}", 200 /* batch size */)
.then(function (records) {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,i,l,o,a,r,u,f]}class w$ extends Pe{constructor(e){super(),Ae(this,e,k$,y$,Ee,{collection:0})}}function kd(n,e,t){const i=n.slice();return i[8]=e[t],i}function wd(n,e,t){const i=n.slice();return i[8]=e[t],i}function Sd(n,e,t){const i=n.slice();return i[13]=e[t],i}function $d(n,e,t){const i=n.slice();return i[13]=e[t],i}function Cd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Md(n,e){let t,i=e[13].lang+"",s,l,o,r;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[3]===e[13].lang),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&16&&i!==(i=e[13].lang+"")&&me(s,i),f&24&&ee(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),o=!1,r()}}}function Td(n,e){let t,i,s,l;return i=new nn({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[3]===e[13].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[13].code),i.$set(a),r&24&&ee(t,"active",e[3]===e[13].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function Dd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[8].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&36&&ee(t,"active",e[2]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function Od(n,e){let t,i,s,l;return i=new nn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&36&&ee(t,"active",e[2]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function S$(n){let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y,C=n[0].name+"",$,S,M,D,E,O,F,L=[],H=new Map,j,Q,ne=[],B=new Map,K,W,J,ie,fe,ye,le,ue,Te,Z,be,x,G,_e,je,Fe,Re,re,ae,ke,Ke,Ye,nt,lt,xe,ge,de,qe,ct,te,ve,Ze,at,mt=[],yt=new Map,Lt,pe,Se=[],Je=new Map,tt,Ft=n[1]&&Cd(),ce=n[4];const $e=I=>I[13].lang;for(let I=0;I<ce.length;I+=1){let U=$d(n,ce,I),se=$e(U);H.set(se,L[I]=Md(se,U))}let Ge=n[4];const Xt=I=>I[13].lang;for(let I=0;I<Ge.length;I+=1){let U=Sd(n,Ge,I),se=Xt(U);B.set(se,ne[I]=Td(se,U))}ae=new nn({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let Ut=n[5];const ei=I=>I[8].code;for(let I=0;I<Ut.length;I+=1){let U=wd(n,Ut,I),se=ei(U);yt.set(se,mt[I]=Dd(se,U))}let dt=n[5];const N=I=>I[8].code;for(let I=0;I<dt.length;I+=1){let U=kd(n,dt,I),se=N(U);Je.set(se,Se[I]=Od(se,U))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records/"),c=_("strong"),c.textContent=":id",d=T(),Ft&&Ft.c(),p=T(),g=_("div"),v=_("p"),b=R("Fetch a single "),y=_("strong"),$=R(C),S=R(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",E=T(),O=_("div"),F=_("div");for(let I=0;I<L.length;I+=1)L[I].c();j=T(),Q=_("div");for(let I=0;I<ne.length;I+=1)ne[I].c();K=T(),W=_("div"),W.textContent="Path Parameters",J=T(),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 view.</td></tr></tbody>`,fe=T(),ye=_("div"),ye.textContent="Query parameters",le=T(),ue=_("table"),Te=_("thead"),Te.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,Z=T(),be=_("tbody"),x=_("tr"),G=_("td"),G.textContent="expand",_e=T(),je=_("td"),je.innerHTML='<span class="label">String</span>',Fe=T(),Re=_("td"),re=R(`Auto expand nested record relations. Ex.:
`),z(ae.$$.fragment),ke=R(`
Supports up to 6-levels depth nested relations expansion. `),Ke=_("br"),Ye=R(`
The expanded relations will be appended to the record under the
`),nt=_("code"),nt.textContent="@expand",lt=R(" property (eg. "),xe=_("code"),xe.textContent='"@expand": {"rel1": {...}, ...}',ge=R(`). Only the
relations that the user has permissions to `),de=_("strong"),de.textContent="view",qe=R(" will be expanded."),ct=T(),te=_("div"),te.textContent="Responses",ve=T(),Ze=_("div"),at=_("div");for(let I=0;I<mt.length;I+=1)mt[I].c();Lt=T(),pe=_("div");for(let I=0;I<Se.length;I+=1)Se[I].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-info"),h(g,"class","content m-b-base"),h(D,"class","section-title"),h(F,"class","tabs-header compact left"),h(Q,"class","tabs-content"),h(O,"class","tabs m-b-lg"),h(W,"class","section-title"),h(ie,"class","table-compact table-border m-b-lg"),h(ye,"class","section-title"),h(ue,"class","table-compact table-border m-b-lg"),h(te,"class","section-title"),h(at,"class","tabs-header compact left"),h(pe,"class","tabs-content"),h(Ze,"class","tabs")},m(I,U){w(I,e,U),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),Ft&&Ft.m(e,null),w(I,p,U),w(I,g,U),m(g,v),m(v,b),m(v,y),m(y,$),m(v,S),w(I,M,U),w(I,D,U),w(I,E,U),w(I,O,U),m(O,F);for(let se=0;se<L.length;se+=1)L[se].m(F,null);m(O,j),m(O,Q);for(let se=0;se<ne.length;se+=1)ne[se].m(Q,null);w(I,K,U),w(I,W,U),w(I,J,U),w(I,ie,U),w(I,fe,U),w(I,ye,U),w(I,le,U),w(I,ue,U),m(ue,Te),m(ue,Z),m(ue,be),m(be,x),m(x,G),m(x,_e),m(x,je),m(x,Fe),m(x,Re),m(Re,re),q(ae,Re,null),m(Re,ke),m(Re,Ke),m(Re,Ye),m(Re,nt),m(Re,lt),m(Re,xe),m(Re,ge),m(Re,de),m(Re,qe),w(I,ct,U),w(I,te,U),w(I,ve,U),w(I,Ze,U),m(Ze,at);for(let se=0;se<mt.length;se+=1)mt[se].m(at,null);m(Ze,Lt),m(Ze,pe);for(let se=0;se<Se.length;se+=1)Se[se].m(pe,null);tt=!0},p(I,[U]){(!tt||U&1)&&a!==(a=I[0].name+"")&&me(u,a),I[1]?Ft||(Ft=Cd(),Ft.c(),Ft.m(e,null)):Ft&&(Ft.d(1),Ft=null),(!tt||U&1)&&C!==(C=I[0].name+"")&&me($,C),U&24&&(ce=I[4],L=ft(L,U,$e,1,I,ce,H,F,rn,Md,null,$d)),U&24&&(Ge=I[4],De(),ne=ft(ne,U,Xt,1,I,Ge,B,Q,Nt,Td,null,Sd),Oe()),U&36&&(Ut=I[5],mt=ft(mt,U,ei,1,I,Ut,yt,at,rn,Dd,null,wd)),U&36&&(dt=I[5],De(),Se=ft(Se,U,N,1,I,dt,Je,pe,Nt,Od,null,kd),Oe())},i(I){if(!tt){for(let U=0;U<Ge.length;U+=1)A(ne[U]);A(ae.$$.fragment,I);for(let U=0;U<dt.length;U+=1)A(Se[U]);tt=!0}},o(I){for(let U=0;U<ne.length;U+=1)P(ne[U]);P(ae.$$.fragment,I);for(let U=0;U<Se.length;U+=1)P(Se[U]);tt=!1},d(I){I&&k(e),Ft&&Ft.d(),I&&k(p),I&&k(g),I&&k(M),I&&k(D),I&&k(E),I&&k(O);for(let U=0;U<L.length;U+=1)L[U].d();for(let U=0;U<ne.length;U+=1)ne[U].d();I&&k(K),I&&k(W),I&&k(J),I&&k(ie),I&&k(fe),I&&k(ye),I&&k(le),I&&k(ue),V(ae),I&&k(ct),I&&k(te),I&&k(ve),I&&k(Ze);for(let U=0;U<mt.length;U+=1)mt[U].d();for(let U=0;U<Se.length;U+=1)Se[U].d()}}}function $$(n,e,t){let i,{collection:s=new An}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(3,o=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.viewRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(r.push({code:200,body:JSON.stringify(Y.dummyCollectionRecord(s),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": {}
}
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${we.baseUrl}");
client.Records.getOne("${s==null?void 0:s.name}", "RECORD_ID")
.then(function (record) {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,i,l,o,a,r,u,f]}class C$ extends Pe{constructor(e){super(),Ae(this,e,$$,S$,Ee,{collection:0})}}function Ed(n,e,t){const i=n.slice();return i[8]=e[t],i}function Ad(n,e,t){const i=n.slice();return i[8]=e[t],i}function Pd(n,e,t){const i=n.slice();return i[13]=e[t],i}function Ld(n,e,t){const i=n.slice();return i[16]=e[t],i}function Fd(n,e,t){const i=n.slice();return i[16]=e[t],i}function Id(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Nd(n,e){let t,i=e[16].lang+"",s,l,o,r;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[16].lang),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&16&&i!==(i=e[16].lang+"")&&me(s,i),f&20&&ee(t,"active",e[2]===e[16].lang)},d(u){u&&k(t),o=!1,r()}}}function Rd(n,e){let t,i,s,l;return i=new nn({props:{content:e[16].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[16].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[16].code),i.$set(a),r&20&&ee(t,"active",e[2]===e[16].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function M$(n){let e;return{c(){e=_("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function T$(n){let e;return{c(){e=_("span"),e.textContent="Required",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function D$(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=R("User "),i=R(t),s=R(".")},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[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&me(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function O$(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=R("Relation record "),i=R(t),s=R(".")},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[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&me(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function E$(n){let e,t,i,s,l;return{c(){e=R("FormData object."),t=_("br"),i=R(`
Set to `),s=_("code"),s.textContent="null",l=R(" 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:oe,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function A$(n){let e;return{c(){e=R("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function P$(n){let e;return{c(){e=R("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function L$(n){let e;return{c(){e=R("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function F$(n){let e;return{c(){e=R("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function I$(n){let e;return{c(){e=R("Plain text value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Hd(n,e){let t,i,s,l,o,r=e[13].name+"",a,u,f,c,d=Y.getFieldValueType(e[13])+"",p,g,v,b;function y(E,O){return E[13].required?T$:M$}let C=y(e),$=C(e);function S(E,O){if(E[13].type==="text")return I$;if(E[13].type==="number")return F$;if(E[13].type==="json")return L$;if(E[13].type==="email")return P$;if(E[13].type==="url")return A$;if(E[13].type==="file")return E$;if(E[13].type==="relation")return O$;if(E[13].type==="user")return D$}let M=S(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),$.c(),l=T(),o=_("span"),a=R(r),u=T(),f=_("td"),c=_("span"),p=R(d),g=T(),v=_("td"),D&&D.c(),b=T(),h(s,"class","inline-flex"),h(c,"class","label"),this.first=t},m(E,O){w(E,t,O),m(t,i),m(i,s),$.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,p),m(t,g),m(t,v),D&&D.m(v,null),m(t,b)},p(E,O){e=E,C!==(C=y(e))&&($.d(1),$=C(e),$&&($.c(),$.m(s,l))),O&1&&r!==(r=e[13].name+"")&&me(a,r),O&1&&d!==(d=Y.getFieldValueType(e[13])+"")&&me(p,d),M===(M=S(e))&&D?D.p(e,O):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(E){E&&k(t),$.d(),D&&D.d()}}}function jd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[1]===e[8].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&8&&i!==(i=e[8].code+"")&&me(s,i),f&10&&ee(t,"active",e[1]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function qd(n,e){let t,i,s,l;return i=new nn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[1]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&8&&(a.content=e[8].body),i.$set(a),r&10&&ee(t,"active",e[1]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function N$(n){var Lt;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y=n[0].name+"",C,$,S,M,D,E,O,F,L,H,j,Q=[],ne=new Map,B,K,W=[],J=new Map,ie,fe,ye,le,ue,Te,Z,be=[],x=new Map,G,_e,je,Fe,Re,re=[],ae=new Map,ke,Ke,Ye=[],nt=new Map,lt,xe=n[5]&&Id(),ge=n[4];const de=pe=>pe[16].lang;for(let pe=0;pe<ge.length;pe+=1){let Se=Fd(n,ge,pe),Je=de(Se);ne.set(Je,Q[pe]=Nd(Je,Se))}let qe=n[4];const ct=pe=>pe[16].lang;for(let pe=0;pe<qe.length;pe+=1){let Se=Ld(n,qe,pe),Je=ct(Se);J.set(Je,W[pe]=Rd(Je,Se))}let te=(Lt=n[0])==null?void 0:Lt.schema;const ve=pe=>pe[13].name;for(let pe=0;pe<te.length;pe+=1){let Se=Pd(n,te,pe),Je=ve(Se);x.set(Je,be[pe]=Hd(Je,Se))}let Ze=n[3];const at=pe=>pe[8].code;for(let pe=0;pe<Ze.length;pe+=1){let Se=Ad(n,Ze,pe),Je=at(Se);ae.set(Je,re[pe]=jd(Je,Se))}let mt=n[3];const yt=pe=>pe[8].code;for(let pe=0;pe<mt.length;pe+=1){let Se=Ed(n,mt,pe),Je=yt(Se);nt.set(Je,Ye[pe]=qd(Je,Se))}return{c(){e=_("div"),t=_("strong"),t.textContent="POST",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records"),c=T(),xe&&xe.c(),d=T(),p=_("div"),g=_("p"),v=R("Create a new "),b=_("strong"),C=R(y),$=R(" record."),S=T(),M=_("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,D=T(),E=_("p"),E.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",O=T(),F=_("div"),F.textContent="Client SDKs example",L=T(),H=_("div"),j=_("div");for(let pe=0;pe<Q.length;pe+=1)Q[pe].c();B=T(),K=_("div");for(let pe=0;pe<W.length;pe+=1)W[pe].c();ie=T(),fe=_("div"),fe.textContent="Body Parameters",ye=T(),le=_("table"),ue=_("thead"),ue.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,Te=T(),Z=_("tbody");for(let pe=0;pe<be.length;pe+=1)be[pe].c();G=T(),_e=_("div"),_e.textContent="Responses",je=T(),Fe=_("div"),Re=_("div");for(let pe=0;pe<re.length;pe+=1)re[pe].c();ke=T(),Ke=_("div");for(let pe=0;pe<Ye.length;pe+=1)Ye[pe].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-success"),h(p,"class","content m-b-base"),h(F,"class","section-title"),h(j,"class","tabs-header compact left"),h(K,"class","tabs-content"),h(H,"class","tabs m-b-lg"),h(fe,"class","section-title"),h(le,"class","table-compact table-border m-b-lg"),h(_e,"class","section-title"),h(Re,"class","tabs-header compact left"),h(Ke,"class","tabs-content"),h(Fe,"class","tabs")},m(pe,Se){w(pe,e,Se),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),xe&&xe.m(e,null),w(pe,d,Se),w(pe,p,Se),m(p,g),m(g,v),m(g,b),m(b,C),m(g,$),m(p,S),m(p,M),m(p,D),m(p,E),w(pe,O,Se),w(pe,F,Se),w(pe,L,Se),w(pe,H,Se),m(H,j);for(let Je=0;Je<Q.length;Je+=1)Q[Je].m(j,null);m(H,B),m(H,K);for(let Je=0;Je<W.length;Je+=1)W[Je].m(K,null);w(pe,ie,Se),w(pe,fe,Se),w(pe,ye,Se),w(pe,le,Se),m(le,ue),m(le,Te),m(le,Z);for(let Je=0;Je<be.length;Je+=1)be[Je].m(Z,null);w(pe,G,Se),w(pe,_e,Se),w(pe,je,Se),w(pe,Fe,Se),m(Fe,Re);for(let Je=0;Je<re.length;Je+=1)re[Je].m(Re,null);m(Fe,ke),m(Fe,Ke);for(let Je=0;Je<Ye.length;Je+=1)Ye[Je].m(Ke,null);lt=!0},p(pe,[Se]){var Je;(!lt||Se&1)&&a!==(a=pe[0].name+"")&&me(u,a),pe[5]?xe||(xe=Id(),xe.c(),xe.m(e,null)):xe&&(xe.d(1),xe=null),(!lt||Se&1)&&y!==(y=pe[0].name+"")&&me(C,y),Se&20&&(ge=pe[4],Q=ft(Q,Se,de,1,pe,ge,ne,j,rn,Nd,null,Fd)),Se&20&&(qe=pe[4],De(),W=ft(W,Se,ct,1,pe,qe,J,K,Nt,Rd,null,Ld),Oe()),Se&1&&(te=(Je=pe[0])==null?void 0:Je.schema,be=ft(be,Se,ve,1,pe,te,x,Z,rn,Hd,null,Pd)),Se&10&&(Ze=pe[3],re=ft(re,Se,at,1,pe,Ze,ae,Re,rn,jd,null,Ad)),Se&10&&(mt=pe[3],De(),Ye=ft(Ye,Se,yt,1,pe,mt,nt,Ke,Nt,qd,null,Ed),Oe())},i(pe){if(!lt){for(let Se=0;Se<qe.length;Se+=1)A(W[Se]);for(let Se=0;Se<mt.length;Se+=1)A(Ye[Se]);lt=!0}},o(pe){for(let Se=0;Se<W.length;Se+=1)P(W[Se]);for(let Se=0;Se<Ye.length;Se+=1)P(Ye[Se]);lt=!1},d(pe){pe&&k(e),xe&&xe.d(),pe&&k(d),pe&&k(p),pe&&k(O),pe&&k(F),pe&&k(L),pe&&k(H);for(let Se=0;Se<Q.length;Se+=1)Q[Se].d();for(let Se=0;Se<W.length;Se+=1)W[Se].d();pe&&k(ie),pe&&k(fe),pe&&k(ye),pe&&k(le);for(let Se=0;Se<be.length;Se+=1)be[Se].d();pe&&k(G),pe&&k(_e),pe&&k(je),pe&&k(Fe);for(let Se=0;Se<re.length;Se+=1)re[Se].d();for(let Se=0;Se<Ye.length;Se+=1)Ye[Se].d()}}}function R$(n,e,t){let i,{collection:s=new An}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(2,o=c.lang),f=c=>t(1,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{var c,d;n.$$.dirty&1&&t(5,i=(s==null?void 0:s.createRule)===null),n.$$.dirty&1&&t(3,r=[{code:200,body:JSON.stringify(Y.dummyCollectionRecord(s),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to create record.",
"data": {
"${(d=(c=s==null?void 0:s.schema)==null?void 0:c[0])==null?void 0:d.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${we.baseUrl}");
const data = { ... };
client.Records.create("${s==null?void 0:s.name}", data)
.then(function (record) {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,l,o,r,a,i,u,f]}class H$ extends Pe{constructor(e){super(),Ae(this,e,R$,N$,Ee,{collection:0})}}function Vd(n,e,t){const i=n.slice();return i[8]=e[t],i}function zd(n,e,t){const i=n.slice();return i[8]=e[t],i}function Bd(n,e,t){const i=n.slice();return i[13]=e[t],i}function Ud(n,e,t){const i=n.slice();return i[16]=e[t],i}function Wd(n,e,t){const i=n.slice();return i[16]=e[t],i}function Yd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Kd(n,e){let t,i=e[16].lang+"",s,l,o,r;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[16].lang),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&16&&i!==(i=e[16].lang+"")&&me(s,i),f&20&&ee(t,"active",e[2]===e[16].lang)},d(u){u&&k(t),o=!1,r()}}}function Zd(n,e){let t,i,s,l;return i=new nn({props:{content:e[16].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[16].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[16].code),i.$set(a),r&20&&ee(t,"active",e[2]===e[16].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function j$(n){let e;return{c(){e=_("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function q$(n){let e;return{c(){e=_("span"),e.textContent="Required",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function V$(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=R("User "),i=R(t),s=R(".")},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[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&me(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function z$(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=R("Relation record "),i=R(t),s=R(".")},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[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&me(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function B$(n){let e,t,i,s,l;return{c(){e=R("FormData object."),t=_("br"),i=R(`
Set to `),s=_("code"),s.textContent="null",l=R(" 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:oe,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function U$(n){let e;return{c(){e=R("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function W$(n){let e;return{c(){e=R("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Y$(n){let e;return{c(){e=R("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function K$(n){let e;return{c(){e=R("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Z$(n){let e;return{c(){e=R("Plain text value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Jd(n,e){let t,i,s,l,o,r=e[13].name+"",a,u,f,c,d=Y.getFieldValueType(e[13])+"",p,g,v,b;function y(E,O){return E[13].required?q$:j$}let C=y(e),$=C(e);function S(E,O){if(E[13].type==="text")return Z$;if(E[13].type==="number")return K$;if(E[13].type==="json")return Y$;if(E[13].type==="email")return W$;if(E[13].type==="url")return U$;if(E[13].type==="file")return B$;if(E[13].type==="relation")return z$;if(E[13].type==="user")return V$}let M=S(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),$.c(),l=T(),o=_("span"),a=R(r),u=T(),f=_("td"),c=_("span"),p=R(d),g=T(),v=_("td"),D&&D.c(),b=T(),h(s,"class","inline-flex"),h(c,"class","label"),this.first=t},m(E,O){w(E,t,O),m(t,i),m(i,s),$.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,p),m(t,g),m(t,v),D&&D.m(v,null),m(t,b)},p(E,O){e=E,C!==(C=y(e))&&($.d(1),$=C(e),$&&($.c(),$.m(s,l))),O&1&&r!==(r=e[13].name+"")&&me(a,r),O&1&&d!==(d=Y.getFieldValueType(e[13])+"")&&me(p,d),M===(M=S(e))&&D?D.p(e,O):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(E){E&&k(t),$.d(),D&&D.d()}}}function Gd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[1]===e[8].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&8&&i!==(i=e[8].code+"")&&me(s,i),f&10&&ee(t,"active",e[1]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function Xd(n,e){let t,i,s,l;return i=new nn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[1]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&8&&(a.content=e[8].body),i.$set(a),r&10&&ee(t,"active",e[1]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function J$(n){var Ft;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y,C=n[0].name+"",$,S,M,D,E,O,F,L,H,j,Q,ne=[],B=new Map,K,W,J=[],ie=new Map,fe,ye,le,ue,Te,Z,be,x,G,_e,je,Fe=[],Re=new Map,re,ae,ke,Ke,Ye,nt=[],lt=new Map,xe,ge,de=[],qe=new Map,ct,te=n[5]&&Yd(),ve=n[4];const Ze=ce=>ce[16].lang;for(let ce=0;ce<ve.length;ce+=1){let $e=Wd(n,ve,ce),Ge=Ze($e);B.set(Ge,ne[ce]=Kd(Ge,$e))}let at=n[4];const mt=ce=>ce[16].lang;for(let ce=0;ce<at.length;ce+=1){let $e=Ud(n,at,ce),Ge=mt($e);ie.set(Ge,J[ce]=Zd(Ge,$e))}let yt=(Ft=n[0])==null?void 0:Ft.schema;const Lt=ce=>ce[13].name;for(let ce=0;ce<yt.length;ce+=1){let $e=Bd(n,yt,ce),Ge=Lt($e);Re.set(Ge,Fe[ce]=Jd(Ge,$e))}let pe=n[3];const Se=ce=>ce[8].code;for(let ce=0;ce<pe.length;ce+=1){let $e=zd(n,pe,ce),Ge=Se($e);lt.set(Ge,nt[ce]=Gd(Ge,$e))}let Je=n[3];const tt=ce=>ce[8].code;for(let ce=0;ce<Je.length;ce+=1){let $e=Vd(n,Je,ce),Ge=tt($e);qe.set(Ge,de[ce]=Xd(Ge,$e))}return{c(){e=_("div"),t=_("strong"),t.textContent="PATCH",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records/"),c=_("strong"),c.textContent=":id",d=T(),te&&te.c(),p=T(),g=_("div"),v=_("p"),b=R("Update a single "),y=_("strong"),$=R(C),S=R(" record."),M=T(),D=_("p"),D.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,E=T(),O=_("p"),O.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",F=T(),L=_("div"),L.textContent="Client SDKs example",H=T(),j=_("div"),Q=_("div");for(let ce=0;ce<ne.length;ce+=1)ne[ce].c();K=T(),W=_("div");for(let ce=0;ce<J.length;ce+=1)J[ce].c();fe=T(),ye=_("div"),ye.textContent="Path parameters",le=T(),ue=_("table"),ue.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>`,Te=T(),Z=_("div"),Z.textContent="Body Parameters",be=T(),x=_("table"),G=_("thead"),G.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,_e=T(),je=_("tbody");for(let ce=0;ce<Fe.length;ce+=1)Fe[ce].c();re=T(),ae=_("div"),ae.textContent="Responses",ke=T(),Ke=_("div"),Ye=_("div");for(let ce=0;ce<nt.length;ce+=1)nt[ce].c();xe=T(),ge=_("div");for(let ce=0;ce<de.length;ce+=1)de[ce].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-warning"),h(g,"class","content m-b-base"),h(L,"class","section-title"),h(Q,"class","tabs-header compact left"),h(W,"class","tabs-content"),h(j,"class","tabs m-b-lg"),h(ye,"class","section-title"),h(ue,"class","table-compact table-border m-b-lg"),h(Z,"class","section-title"),h(x,"class","table-compact table-border m-b-lg"),h(ae,"class","section-title"),h(Ye,"class","tabs-header compact left"),h(ge,"class","tabs-content"),h(Ke,"class","tabs")},m(ce,$e){w(ce,e,$e),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),te&&te.m(e,null),w(ce,p,$e),w(ce,g,$e),m(g,v),m(v,b),m(v,y),m(y,$),m(v,S),m(g,M),m(g,D),m(g,E),m(g,O),w(ce,F,$e),w(ce,L,$e),w(ce,H,$e),w(ce,j,$e),m(j,Q);for(let Ge=0;Ge<ne.length;Ge+=1)ne[Ge].m(Q,null);m(j,K),m(j,W);for(let Ge=0;Ge<J.length;Ge+=1)J[Ge].m(W,null);w(ce,fe,$e),w(ce,ye,$e),w(ce,le,$e),w(ce,ue,$e),w(ce,Te,$e),w(ce,Z,$e),w(ce,be,$e),w(ce,x,$e),m(x,G),m(x,_e),m(x,je);for(let Ge=0;Ge<Fe.length;Ge+=1)Fe[Ge].m(je,null);w(ce,re,$e),w(ce,ae,$e),w(ce,ke,$e),w(ce,Ke,$e),m(Ke,Ye);for(let Ge=0;Ge<nt.length;Ge+=1)nt[Ge].m(Ye,null);m(Ke,xe),m(Ke,ge);for(let Ge=0;Ge<de.length;Ge+=1)de[Ge].m(ge,null);ct=!0},p(ce,[$e]){var Ge;(!ct||$e&1)&&a!==(a=ce[0].name+"")&&me(u,a),ce[5]?te||(te=Yd(),te.c(),te.m(e,null)):te&&(te.d(1),te=null),(!ct||$e&1)&&C!==(C=ce[0].name+"")&&me($,C),$e&20&&(ve=ce[4],ne=ft(ne,$e,Ze,1,ce,ve,B,Q,rn,Kd,null,Wd)),$e&20&&(at=ce[4],De(),J=ft(J,$e,mt,1,ce,at,ie,W,Nt,Zd,null,Ud),Oe()),$e&1&&(yt=(Ge=ce[0])==null?void 0:Ge.schema,Fe=ft(Fe,$e,Lt,1,ce,yt,Re,je,rn,Jd,null,Bd)),$e&10&&(pe=ce[3],nt=ft(nt,$e,Se,1,ce,pe,lt,Ye,rn,Gd,null,zd)),$e&10&&(Je=ce[3],De(),de=ft(de,$e,tt,1,ce,Je,qe,ge,Nt,Xd,null,Vd),Oe())},i(ce){if(!ct){for(let $e=0;$e<at.length;$e+=1)A(J[$e]);for(let $e=0;$e<Je.length;$e+=1)A(de[$e]);ct=!0}},o(ce){for(let $e=0;$e<J.length;$e+=1)P(J[$e]);for(let $e=0;$e<de.length;$e+=1)P(de[$e]);ct=!1},d(ce){ce&&k(e),te&&te.d(),ce&&k(p),ce&&k(g),ce&&k(F),ce&&k(L),ce&&k(H),ce&&k(j);for(let $e=0;$e<ne.length;$e+=1)ne[$e].d();for(let $e=0;$e<J.length;$e+=1)J[$e].d();ce&&k(fe),ce&&k(ye),ce&&k(le),ce&&k(ue),ce&&k(Te),ce&&k(Z),ce&&k(be),ce&&k(x);for(let $e=0;$e<Fe.length;$e+=1)Fe[$e].d();ce&&k(re),ce&&k(ae),ce&&k(ke),ce&&k(Ke);for(let $e=0;$e<nt.length;$e+=1)nt[$e].d();for(let $e=0;$e<de.length;$e+=1)de[$e].d()}}}function G$(n,e,t){let i,{collection:s=new An}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(2,o=c.lang),f=c=>t(1,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{var c,d;n.$$.dirty&1&&t(5,i=(s==null?void 0:s.updateRule)===null),n.$$.dirty&1&&t(3,r=[{code:200,body:JSON.stringify(Y.dummyCollectionRecord(s),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to update record.",
"data": {
"${(d=(c=s==null?void 0:s.schema)==null?void 0:c[0])==null?void 0:d.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`},{code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${we.baseUrl}");
const data = { ... };
client.Records.update("${s==null?void 0:s.name}", "RECORD_ID", data)
.then(function (record) {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,l,o,r,a,i,u,f]}class X$ extends Pe{constructor(e){super(),Ae(this,e,G$,J$,Ee,{collection:0})}}function Qd(n,e,t){const i=n.slice();return i[8]=e[t],i}function xd(n,e,t){const i=n.slice();return i[8]=e[t],i}function eh(n,e,t){const i=n.slice();return i[13]=e[t],i}function th(n,e,t){const i=n.slice();return i[13]=e[t],i}function nh(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ih(n,e){let t,i=e[13].lang+"",s,l,o,r;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[3]===e[13].lang),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&16&&i!==(i=e[13].lang+"")&&me(s,i),f&24&&ee(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),o=!1,r()}}}function sh(n,e){let t,i,s,l;return i=new nn({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[3]===e[13].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[13].code),i.$set(a),r&24&&ee(t,"active",e[3]===e[13].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function lh(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[8].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&36&&ee(t,"active",e[2]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function oh(n,e){let t,i,s,l;return i=new nn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&36&&ee(t,"active",e[2]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function Q$(n){let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y,C=n[0].name+"",$,S,M,D,E,O,F,L=[],H=new Map,j,Q,ne=[],B=new Map,K,W,J,ie,fe,ye,le,ue,Te,Z=[],be=new Map,x,G,_e=[],je=new Map,Fe,Re=n[1]&&nh(),re=n[4];const ae=ge=>ge[13].lang;for(let ge=0;ge<re.length;ge+=1){let de=th(n,re,ge),qe=ae(de);H.set(qe,L[ge]=ih(qe,de))}let ke=n[4];const Ke=ge=>ge[13].lang;for(let ge=0;ge<ke.length;ge+=1){let de=eh(n,ke,ge),qe=Ke(de);B.set(qe,ne[ge]=sh(qe,de))}let Ye=n[5];const nt=ge=>ge[8].code;for(let ge=0;ge<Ye.length;ge+=1){let de=xd(n,Ye,ge),qe=nt(de);be.set(qe,Z[ge]=lh(qe,de))}let lt=n[5];const xe=ge=>ge[8].code;for(let ge=0;ge<lt.length;ge+=1){let de=Qd(n,lt,ge),qe=xe(de);je.set(qe,_e[ge]=oh(qe,de))}return{c(){e=_("div"),t=_("strong"),t.textContent="DELETE",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records/"),c=_("strong"),c.textContent=":id",d=T(),Re&&Re.c(),p=T(),g=_("div"),v=_("p"),b=R("Delete a single "),y=_("strong"),$=R(C),S=R(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",E=T(),O=_("div"),F=_("div");for(let ge=0;ge<L.length;ge+=1)L[ge].c();j=T(),Q=_("div");for(let ge=0;ge<ne.length;ge+=1)ne[ge].c();K=T(),W=_("div"),W.textContent="Path parameters",J=T(),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 delete.</td></tr></tbody>`,fe=T(),ye=_("div"),ye.textContent="Responses",le=T(),ue=_("div"),Te=_("div");for(let ge=0;ge<Z.length;ge+=1)Z[ge].c();x=T(),G=_("div");for(let ge=0;ge<_e.length;ge+=1)_e[ge].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-danger"),h(g,"class","content m-b-base"),h(D,"class","section-title"),h(F,"class","tabs-header compact left"),h(Q,"class","tabs-content"),h(O,"class","tabs m-b-lg"),h(W,"class","section-title"),h(ie,"class","table-compact table-border m-b-lg"),h(ye,"class","section-title"),h(Te,"class","tabs-header compact left"),h(G,"class","tabs-content"),h(ue,"class","tabs")},m(ge,de){w(ge,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(l,c),m(e,d),Re&&Re.m(e,null),w(ge,p,de),w(ge,g,de),m(g,v),m(v,b),m(v,y),m(y,$),m(v,S),w(ge,M,de),w(ge,D,de),w(ge,E,de),w(ge,O,de),m(O,F);for(let qe=0;qe<L.length;qe+=1)L[qe].m(F,null);m(O,j),m(O,Q);for(let qe=0;qe<ne.length;qe+=1)ne[qe].m(Q,null);w(ge,K,de),w(ge,W,de),w(ge,J,de),w(ge,ie,de),w(ge,fe,de),w(ge,ye,de),w(ge,le,de),w(ge,ue,de),m(ue,Te);for(let qe=0;qe<Z.length;qe+=1)Z[qe].m(Te,null);m(ue,x),m(ue,G);for(let qe=0;qe<_e.length;qe+=1)_e[qe].m(G,null);Fe=!0},p(ge,[de]){(!Fe||de&1)&&a!==(a=ge[0].name+"")&&me(u,a),ge[1]?Re||(Re=nh(),Re.c(),Re.m(e,null)):Re&&(Re.d(1),Re=null),(!Fe||de&1)&&C!==(C=ge[0].name+"")&&me($,C),de&24&&(re=ge[4],L=ft(L,de,ae,1,ge,re,H,F,rn,ih,null,th)),de&24&&(ke=ge[4],De(),ne=ft(ne,de,Ke,1,ge,ke,B,Q,Nt,sh,null,eh),Oe()),de&36&&(Ye=ge[5],Z=ft(Z,de,nt,1,ge,Ye,be,Te,rn,lh,null,xd)),de&36&&(lt=ge[5],De(),_e=ft(_e,de,xe,1,ge,lt,je,G,Nt,oh,null,Qd),Oe())},i(ge){if(!Fe){for(let de=0;de<ke.length;de+=1)A(ne[de]);for(let de=0;de<lt.length;de+=1)A(_e[de]);Fe=!0}},o(ge){for(let de=0;de<ne.length;de+=1)P(ne[de]);for(let de=0;de<_e.length;de+=1)P(_e[de]);Fe=!1},d(ge){ge&&k(e),Re&&Re.d(),ge&&k(p),ge&&k(g),ge&&k(M),ge&&k(D),ge&&k(E),ge&&k(O);for(let de=0;de<L.length;de+=1)L[de].d();for(let de=0;de<ne.length;de+=1)ne[de].d();ge&&k(K),ge&&k(W),ge&&k(J),ge&&k(ie),ge&&k(fe),ge&&k(ye),ge&&k(le),ge&&k(ue);for(let de=0;de<Z.length;de+=1)Z[de].d();for(let de=0;de<_e.length;de+=1)_e[de].d()}}}function x$(n,e,t){let i,{collection:s=new An}=e,l=204,o="JavaScript",r=[],a=[];const u=c=>t(3,o=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.deleteRule)===null),n.$$.dirty&3&&s!=null&&s.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": {}
}
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${we.baseUrl}");
client.Records.delete("${s==null?void 0:s.name}", "RECORD_ID")
.then(function () {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,i,l,o,a,r,u,f]}class eC extends Pe{constructor(e){super(),Ae(this,e,x$,Q$,Ee,{collection:0})}}function rh(n,e,t){const i=n.slice();return i[4]=e[t],i}function ah(n,e,t){const i=n.slice();return i[4]=e[t],i}function uh(n,e){let t,i=e[4].lang+"",s,l,o,r;function a(){return e[3](e[4])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[1]===e[4].lang),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[4].lang+"")&&me(s,i),f&6&&ee(t,"active",e[1]===e[4].lang)},d(u){u&&k(t),o=!1,r()}}}function fh(n,e){let t,i,s,l;return i=new nn({props:{content:e[4].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[1]===e[4].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[4].code),i.$set(a),r&6&&ee(t,"active",e[1]===e[4].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function tC(n){let e,t,i,s,l,o,r,a,u=[],f=new Map,c,d,p=[],g=new Map,v,b,y,C,$,S=n[2];const M=O=>O[4].lang;for(let O=0;O<S.length;O+=1){let F=ah(n,S,O),L=M(F);f.set(L,u[O]=uh(L,F))}let D=n[2];const E=O=>O[4].lang;for(let O=0;O<D.length;O+=1){let F=rh(n,D,O),L=E(F);g.set(L,p[O]=fh(L,F))}return C=new nn({props:{content:JSON.stringify({action:"create",record:Y.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=T(),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=T(),l=_("div"),l.textContent="Client SDKs example",o=T(),r=_("div"),a=_("div");for(let O=0;O<u.length;O+=1)u[O].c();c=T(),d=_("div");for(let O=0;O<p.length;O+=1)p[O].c();v=T(),b=_("div"),b.textContent="Event data format",y=T(),z(C.$$.fragment),h(e,"class","alert"),h(i,"class","content m-b-base"),h(l,"class","section-title"),h(a,"class","tabs-header compact left"),h(d,"class","tabs-content"),h(r,"class","tabs m-b-base"),h(b,"class","section-title")},m(O,F){w(O,e,F),w(O,t,F),w(O,i,F),w(O,s,F),w(O,l,F),w(O,o,F),w(O,r,F),m(r,a);for(let L=0;L<u.length;L+=1)u[L].m(a,null);m(r,c),m(r,d);for(let L=0;L<p.length;L+=1)p[L].m(d,null);w(O,v,F),w(O,b,F),w(O,y,F),q(C,O,F),$=!0},p(O,[F]){F&6&&(S=O[2],u=ft(u,F,M,1,O,S,f,a,rn,uh,null,ah)),F&6&&(D=O[2],De(),p=ft(p,F,E,1,O,D,g,d,Nt,fh,null,rh),Oe());const L={};F&1&&(L.content=JSON.stringify({action:"create",record:Y.dummyCollectionRecord(O[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),C.$set(L)},i(O){if(!$){for(let F=0;F<D.length;F+=1)A(p[F]);A(C.$$.fragment,O),$=!0}},o(O){for(let F=0;F<p.length;F+=1)P(p[F]);P(C.$$.fragment,O),$=!1},d(O){O&&k(e),O&&k(t),O&&k(i),O&&k(s),O&&k(l),O&&k(o),O&&k(r);for(let F=0;F<u.length;F+=1)u[F].d();for(let F=0;F<p.length;F+=1)p[F].d();O&&k(v),O&&k(b),O&&k(y),V(C,O)}}}function nC(n,e,t){let{collection:i=new An}=e,s="JavaScript",l=[];const o=r=>t(1,s=r.lang);return n.$$set=r=>{"collection"in r&&t(0,i=r.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,l=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${we.baseUrl}");
// (Optionally) authenticate
client.Users.authViaEmail("test@example.com", "123456");
// Subscribe to changes in any record from the collection
client.Realtime.subscribe("${i==null?void 0:i.name}", function (e) {
console.log(e.record);
});
// Subscribe to changes in a single record
client.Realtime.subscribe("${i==null?void 0:i.name}/RECORD_ID", function (e) {
console.log(e.record);
});
// Unsubscribe
client.Realtime.unsubscribe() // remove all subscriptions
client.Realtime.unsubscribe("${i==null?void 0:i.name}") // remove the collection subscription
client.Realtime.unsubscribe("${i==null?void 0:i.name}/RECORD_ID") // remove the record subscription
`}])},[i,s,l,o]}class iC extends Pe{constructor(e){super(),Ae(this,e,nC,tC,Ee,{collection:0})}}function ch(n,e,t){const i=n.slice();return i[14]=e[t],i}function dh(n,e,t){const i=n.slice();return i[14]=e[t],i}function hh(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&&z(t.$$.fragment),i=T(),h(e,"class","tab-item active")},m(r,a){w(r,e,a),t&&q(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){De();const f=t;P(f.$$.fragment,1,0,()=>{V(f,1)}),Oe()}l?(t=new l(o(r)),z(t.$$.fragment),A(t.$$.fragment,1),q(t,e,i)):t=null}else l&&t.$set(u)},i(r){s||(t&&A(t.$$.fragment,r),s=!0)},o(r){t&&P(t.$$.fragment,r),s=!1},d(r){r&&k(e),t&&V(t)}}}function ph(n,e){let t,i,s,l=e[4]===e[14].id&&hh(e);return{key:n,first:null,c(){t=rt(),l&&l.c(),i=rt(),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=hh(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(De(),P(l,1,1,()=>{l=null}),Oe())},i(o){s||(A(l),s=!0)},o(o){P(l),s=!1},d(o){o&&k(t),l&&l.d(o),o&&k(i)}}}function sC(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=ch(n,l,r),u=o(a);i.set(u,t[r]=ph(u,a))}return{c(){e=_("div");for(let r=0;r<t.length;r+=1)t[r].c();h(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],De(),t=ft(t,a,o,1,r,l,i,e,Nt,ph,null,ch),Oe())},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)P(t[a]);s=!1},d(r){r&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function mh(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=R(s),o=T(),h(i,"class","txt"),h(t,"tabindex","0"),h(t,"class","tab-item"),ee(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",Wp(f))],r=!0)},p(c,d){e=c,d&48&&ee(t,"active",e[4]===e[14].id)},d(c){c&&k(t),r=!1,st(a)}}}function lC(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 p=dh(n,f,d),g=c(p);u.set(g,a[d]=mh(g,p))}return{c(){e=_("h4"),t=_("strong"),s=R(i),l=R(" records API"),o=T(),r=_("div");for(let d=0;d<a.length;d+=1)a[d].c();h(r,"class","tabs-header stretched")},m(d,p){w(d,e,p),m(e,t),m(t,s),m(e,l),w(d,o,p),w(d,r,p);for(let g=0;g<a.length;g+=1)a[g].m(r,null)},p(d,p){p&8&&i!==(i=d[3].name+"")&&me(s,i),p&114&&(f=d[5],a=ft(a,p,c,1,d,f,u,r,rn,mh,null,dh))},d(d){d&&k(e),d&&k(o),d&&k(r);for(let p=0;p<a.length;p+=1)a[p].d()}}}function oC(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',h(e,"type","button"),h(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[8]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function rC(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[oC],header:[lC],default:[sC]},$$scope:{ctx:n}};return e=new wi({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){z(e.$$.fragment)},m(s,l){q(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){P(e.$$.fragment,s),t=!1},d(s){n[11](null),V(e,s)}}}function aC(n,e,t){const i=[{id:"list",label:"List",component:w$},{id:"view",label:"View",component:C$},{id:"create",label:"Create",component:H$},{id:"update",label:"Update",component:X$},{id:"delete",label:"Delete",component:eC},{id:"realtime",label:"Realtime",component:iC}];let s,l=new An,o=i[0].id;function r(y){return t(3,l=y),u(i[0].id),s==null?void 0:s.show()}function a(){return s==null?void 0:s.hide()}function u(y){t(4,o=y)}function f(y,C){(y.code==="Enter"||y.code==="Space")&&(y.preventDefault(),u(C))}const c=()=>a(),d=y=>u(y.id),p=(y,C)=>f(C,y.id);function g(y){he[y?"unshift":"push"](()=>{s=y,t(2,s)})}function v(y){ht.call(this,n,y)}function b(y){ht.call(this,n,y)}return[a,u,s,l,o,i,f,r,c,d,p,g,v,b]}class uC extends Pe{constructor
<span class="txt">Upload new file</span>`,h(t,"type","file"),h(t,"class","hidden"),t.multiple=n[5],h(s,"type","button"),h(s,"class","btn btn-secondary btn-sm btn-block"),h(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,st(o)}}}function a4(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,p,g,v,b=n[4];const y=D=>D[25];for(let D=0;D<b.length;D+=1){let E=bh(n,b,D),O=y(E);d.set(O,c[D]=vh(O,E))}let C=n[0],$=[];for(let D=0;D<C.length;D+=1)$[D]=yh(_h(n,C,D));const S=D=>P($[D],1,1,()=>{$[D]=null});let M=!n[8]&&kh(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),f=_("div");for(let D=0;D<c.length;D+=1)c[D].c();p=T();for(let D=0;D<$.length;D+=1)$[D].c();g=T(),M&&M.c(),h(t,"class",i=Y.getFieldTypeIcon(n[3].type)),h(l,"class","txt"),h(e,"for",a=n[21]),h(f,"class","files-list")},m(D,E){w(D,e,E),m(e,t),m(e,s),m(e,l),m(l,r),w(D,u,E),w(D,f,E);for(let O=0;O<c.length;O+=1)c[O].m(f,null);m(f,p);for(let O=0;O<$.length;O+=1)$[O].m(f,null);m(f,g),M&&M.m(f,null),n[19](f),v=!0},p(D,E){if((!v||E&8&&i!==(i=Y.getFieldTypeIcon(D[3].type)))&&h(t,"class",i),(!v||E&8)&&o!==(o=D[3].name+"")&&me(r,o),(!v||E&2097152&&a!==(a=D[21]))&&h(e,"for",a),E&1558&&(b=D[4],De(),c=ft(c,E,y,1,D,b,d,f,Nt,vh,p,bh),Oe()),E&2049){C=D[0];let O;for(O=0;O<C.length;O+=1){const F=_h(D,C,O);$[O]?($[O].p(F,E),A($[O],1)):($[O]=yh(F),$[O].c(),A($[O],1),$[O].m(f,g))}for(De(),O=C.length;O<$.length;O+=1)S(O);Oe()}D[8]?M&&(M.d(1),M=null):M?M.p(D,E):(M=kh(D),M.c(),M.m(f,null))},i(D){if(!v){for(let E=0;E<b.length;E+=1)A(c[E]);for(let E=0;E<C.length;E+=1)A($[E]);v=!0}},o(D){for(let E=0;E<c.length;E+=1)P(c[E]);$=$.filter(Boolean);for(let E=0;E<$.length;E+=1)P($[E]);v=!1},d(D){D&&k(e),D&&k(u),D&&k(f);for(let E=0;E<c.length;E+=1)c[E].d();jn($,D),M&&M.d(),n[19](null)}}}function u4(n){let e,t;return e=new Le({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[a4,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(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){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function f4(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new vn}=e,c,d;function p(O){Y.removeByValue(u,O),t(1,u)}function g(O){Y.pushUnique(u,O),t(1,u)}function v(O){Y.isEmpty(a[O])||a.splice(O,1),t(0,a)}function b(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const y=O=>p(O),C=O=>g(O),$=O=>v(O);function S(O){he[O?"unshift":"push"](()=>{c=O,t(6,c)})}const M=()=>{for(let O of c.files)a.push(O);t(0,a),t(6,c.value=null,c)},D=()=>c==null?void 0:c.click();function E(O){he[O?"unshift":"push"](()=>{d=O,t(7,d)})}return n.$$set=O=>{"record"in O&&t(2,o=O.record),"value"in O&&t(12,r=O.value),"uploadedFiles"in O&&t(0,a=O.uploadedFiles),"deletedFileIndexes"in O&&t(1,u=O.deletedFileIndexes),"field"in O&&t(3,f=O.field)},n.$$.update=()=>{var O,F;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=Y.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=Y.toArray(u))),n.$$.dirty&8&&t(5,i=((O=f.options)==null?void 0:O.maxSelect)>1),n.$$.dirty&4128&&Y.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=Y.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((F=f.options)==null?void 0:F.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&b()},[a,u,o,f,s,i,c,d,l,p,g,v,r,y,C,$,S,M,D,E]}class c4 extends Pe{constructor(e){super(),Ae(this,e,f4,u4,Ee,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function wh(n){let e,t;return{c(){e=_("small"),t=R(n[1]),h(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&me(t,i[1])},d(i){i&&k(e)}}}function d4(n){let e,t,i,s,l,o=n[0].id
`,h(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function F4(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 P4({props:l}),he.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function I4(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 w4({props:l}),he.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function N4(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 c4({props:u}),he.push(()=>Ie(e,"value",o)),he.push(()=>Ie(e,"uploadedFiles",r)),he.push(()=>Ie(e,"deletedFileIndexes",a)),{c(){z(e.$$.fragment)},m(f,c){q(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],He(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],He(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[40].name],He(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){V(e,f)}}}function R4(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 UC({props:l}),he.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function H4(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 qC({props:l}),he.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function j4(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 NC({props:l}),he.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function q4(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 PC({props:l}),he.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function V4(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 DC({props:l}),he.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function z4(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 $C({props:l}),he.push(()=>Ie(e,"value",
<span class="txt">Delete</span>`,h(e,"tabindex","0"),h(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function K4(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]&&Ah(n);return{c(){e=_("h4"),i=R(t),s=T(),o=R(l),r=R(" record"),a=T(),c&&c.c(),u=rt()},m(d,p){w(d,e,p),m(e,i),m(e,s),m(e,o),m(e,r),w(d,a,p),c&&c.m(d,p),w(d,u,p),f=!0},p(d,p){(!f||p[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&me(i,t),(!f||p[0]&1)&&l!==(l=d[0].name+"")&&me(o,l),!d[2].isNew&&d[10]?c?(c.p(d,p),p[0]&1028&&A(c,1)):(c=Ah(d),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(De(),P(c,1,1,()=>{c=null}),Oe())},i(d){f||(A(c),f=!0)},o(d){P(c),f=!1},d(d){d&&k(e),d&&k(a),c&&c.d(d),d&&k(u)}}}function Z4(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=T(),s=_("button"),l=_("span"),r=R(o),h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-secondary"),e.disabled=n[7],h(l,"class","txt"),h(s,"type","submit"),h(s,"form",n[11]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[9]||n[7],ee(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")&&me(r,o),d[0]&640&&a!==(a=!c[9]||c[7])&&(s.disabled=a),d[0]&128&&ee(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function J4(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[Z4],header:[K4],default:[W4]},$$scope:{ctx:n}};return e=new wi({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){z(e.$$.fragment)},m(s,l){q(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){P(e.$$.fragment,s),t=!1},d(s){n[33](null),V(e,s)}}}function Ph(n){return JSON.stringify(n)}function G4(n,e,t){let i,s,l,o;const r=un(),a="record_"+Y.randomString(5);let{collection:u}=e,f,c=null,d=new fo,p=!1,g=!1,v={},b={},y="";function C(x){return S(x),t(8,g=!0),f==null?void 0:f.show()}function $(){return f==null?void 0:f.hide()}async function S(x){Ii({}),c=x||{},t(2,d=x!=null&&x.clone?x.clone():new fo),t(3,v={}),t(4,b={}),await ai(),t(15,y=Ph(d))}function M(){if(p||!l)return;t(7,p=!0);const x=E();let G;d.isNew?G=we.Records.create(u==null?void 0:u.id,x):G=we.Records.update(u==null?void 0:u.id,d.id,x),G.then(async _e=>{hn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),$(),r("save",_e)}).catch(_e=>{we.errorResponseHandler(_e)}).finally(()=>{t(7,p=!1)})}function D(){!(c!=null&&c.id)||yi("Do you really want to delete the selected record?",()=>we.Records.delete(c["@collectionId"],c.id).then(()=>{$(),hn("Successfully deleted record."),r("delete",c)}).catch(x=>{we.errorResponseHandler(x)}))}function E(){const x=(d==null?void 0:d.export())||{},G=new FormData,_e={};for(const je of(u==null?void 0:u.schema)||[])_e[je.name]=je;for(const je in x)!_e[je]||(typeof x[je]>"u"&&(x[je]=null),Y.addValueToFormData(G,je,x[je]));for(const je in v){const Fe=Y.toArray(v[je]);for(const Re of Fe)G.append(je,Re)}for(const je in b){const Fe=Y.toArray(b[je]);for(const Re of Fe)G.append(je+"."+Re,"")}return G}const O=()=>$(),F=()=>D();function L(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}function H(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}function j(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}function Q(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}function ne(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}function B(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}function K(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}function W(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}function J(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}function ie(x,G){n.$$.not_equal(v[G.name],x)&&(v[G.name]=x,t(3,v))}function fe(x,G){n.$$.not_equal(b[G.name],x)&&(b[G.name]=x,t(4,b))}functi
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Uh(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[28]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Wh(n,e){let t,i,s;return i=new g_({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=rt(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),q(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){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(i,l)}}}function Yh(n,e){let t,i,s,l,o,r,a,u,f,c,d,p,g,v=[],b=new Map,y,C,$,S,M,D,E,O,F,L,H,j;function Q(){return e[25](e[35])}p=new Zo({props:{id:e[35].id}});let ne=e[11];const B=J=>J[38].name;for(let J=0;J<ne.length;J+=1){let ie=qh(e,ne,J),fe=B(ie);b.set(fe,v[J]=Wh(fe,ie))}$=new vi({props:{date:e[35].created}}),D=new vi({props:{date:e[35].updated}});function K(){return e[26](e[35])}function W(...J){return e[27](e[35],...J)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),l=_("input"),a=T(),u=_("label"),c=T(),d=_("td"),z(p.$$.fragment),g=T();for(let J=0;J<v.length;J+=1)v[J].c();y=T(),C=_("td"),z($.$$.fragment),S=T(),M=_("td"),z(D.$$.fragment),E=T(),O=_("td"),O.innerHTML='<i class="ri-arrow-right-line"></i>',F=T(),h(l,"type","checkbox"),h(l,"id",o="checkbox_"+e[35].id),l.checked=r=e[5][e[35].id],h(u,"for",f="checkbox_"+e[35].id),h(s,"class","form-field"),h(i,"class","bulk-select-col min-width"),h(d,"class","col-type-text col-field-id"),h(C,"class","col-type-date col-field-created"),h(M,"class","col-type-date col-field-updated"),h(O,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(J,ie){w(J,t,ie),m(t,i),m(i,s),m(s,l),m(s,a),m(s,u),m(t,c),m(t,d),q(p,d,null),m(t,g);for(let fe=0;fe<v.length;fe+=1)v[fe].m(t,null);m(t,y),m(t,C),q($,C,null),m(t,S),m(t,M),q(D,M,null),m(t,E),m(t,O),m(t,F),L=!0,H||(j=[X(l,"change",Q),X(s,"click",qn(e[19])),X(t,"click",K),X(t,"keydown",W)],H=!0)},p(J,ie){e=J,(!L||ie[0]&8&&o!==(o="checkbox_"+e[35].id))&&h(l,"id",o),(!L||ie[0]&40&&r!==(r=e[5][e[35].id]))&&(l.checked=r),(!L||ie[0]&8&&f!==(f="checkbox_"+e[35].id))&&h(u,"for",f);const fe={};ie[0]&8&&(fe.id=e[35].id),p.$set(fe),ie[0]&2056&&(ne=e[11],De(),v=ft(v,ie,B,1,e,ne,b,t,Nt,Wh,y,qh),Oe());const ye={};ie[0]&8&&(ye.date=e[35].created),$.$set(ye);const le={};ie[0]&8&&(le.date=e[35].updated),D.$set(le)},i(J){if(!L){A(p.$$.fragment,J);for(let ie=0;ie<ne.length;ie+=1)A(v[ie]);A($.$$.fragment,J),A(D.$$.fragment,J),L=!0}},o(J){P(p.$$.fragment,J);for(let ie=0;ie<v.length;ie+=1)P(v[ie]);P($.$$.fragment,J),P(D.$$.fragment,J),L=!1},d(J){J&&k(t),V(p);for(let ie=0;ie<v.length;ie+=1)v[ie].d();V($),V(D),H=!1,st(j)}}}function Kh(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=R("Showing "),s=R(i),l=R(" of "),o=R(n[4]),h(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+"")&&me(s,i),a[0]&16&&me(o,r[4])},d(r){r&&k(e)}}}function Zh(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=R("Load more ("),o=R(l),r=R(")"),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-lg btn-secondary btn-expanded"),ee(t,"btn-loading",n[8]),ee(t,"btn-disabled",n[8]),h(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+"")&&me(o,l),c[0]&256&&ee(t,"btn-loading",f[8]),c[0]&256&&ee(t,"btn-disabled",f[8])},d(f){f&&k(e),a=!1,u()}}}function Jh(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,p,g,v,b,y,C;return{c(){e=_("div"),t=_("div"),i=R("Selected "),s=_("strong"),l=R(n[6]),o=T(),a=R(r),u=T(),f=_("button"),f.innerHTML='<span class="txt">Reset</span>',c=T(),d=_("div"),p=T(),g=_("button"),g.innerHTML='<span class="txt">Delete selected</span>',h(t,"class","txt"),h(f,"type","button"),h(f,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),ee(
<span class="txt">API Preview</span>`,C=T(),$=_("button"),$.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,S=T(),z(M.$$.fragment),D=T(),z(E.$$.fragment),h(o,"class","breadcrumb-item"),h(a,"class","breadcrumb-item"),h(l,"class","breadcrumbs"),h(d,"type","button"),h(d,"class","btn btn-secondary btn-circle"),h(y,"type","button"),h(y,"class","btn btn-outline"),h($,"type","button"),h($,"class","btn btn-expanded"),h(b,"class","btns-group"),h(s,"class","page-header"),h(i,"class","page-wrapper")},m(K,W){q(e,K,W),w(K,t,W),w(K,i,W),m(i,s),m(s,l),m(l,o),m(l,r),m(l,a),m(a,f),m(s,c),m(s,d),m(s,p),q(g,s,null),m(s,v),m(s,b),m(b,y),m(b,C),m(b,$),m(i,S),q(M,i,null),m(i,D),q(E,i,null),L=!0,H||(j=[Qe(Ct.call(null,d,{text:"Edit collection",position:"right"})),X(d,"click",n[12]),X(y,"click",n[14]),X($,"click",n[15])],H=!0)},p(K,W){(!L||W&4)&&u!==(u=K[2].name+"")&&me(f,u);const J={};W&1&&(J.value=K[0]),W&4&&(J.autocompleteCollection=K[2]),M.$set(J);const ie={};W&4&&(ie.collection=K[2]),!O&&W&1&&(O=!0,ie.filter=K[0],He(()=>O=!1)),!F&&W&2&&(F=!0,ie.sort=K[1],He(()=>F=!1)),E.$set(ie)},i(K){L||(A(e.$$.fragment,K),A(g.$$.fragment,K),A(M.$$.fragment,K),A(E.$$.fragment,K),L=!0)},o(K){P(e.$$.fragment,K),P(g.$$.fragment,K),P(M.$$.fragment,K),P(E.$$.fragment,K),L=!1},d(K){V(e,K),K&&k(t),K&&k(i),V(g),V(M),n[17](null),V(E),H=!1,st(j)}}}function wM(n){let e,t,i,s,l,o,r,a;return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=T(),s=_("h1"),s.textContent="Create your first collection to add records!",l=T(),o=_("button"),o.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,h(t,"class","icon"),h(s,"class","m-b-10"),h(o,"type","button"),h(o,"class","btn btn-expanded-lg btn-lg"),h(e,"class","placeholder-section m-b-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[11]),r=!0)},p:oe,i:oe,o:oe,d(u){u&&k(e),r=!1,a()}}}function SM(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,h(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function $M(n){let e,t,i,s,l,o,r,a,u;const f=[SM,wM,kM],c=[];function d(b,y){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let p={};s=new Ua({props:p}),n[21](s);let g={};o=new uC({props:g}),n[22](o);let v={collection:n[2]};return a=new m_({props:v}),n[23](a),a.$on("save",n[24]),a.$on("delete",n[25]),{c(){t.c(),i=T(),z(s.$$.fragment),l=T(),z(o.$$.fragment),r=T(),z(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),q(s,b,y),w(b,l,y),q(o,b,y),w(b,r,y),q(a,b,y),u=!0},p(b,[y]){let C=e;e=d(b),e===C?c[e].p(b,y):(De(),P(c[C],1,1,()=>{c[C]=null}),Oe(),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.$set($);const S={};o.$set(S);const M={};y&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){P(t),P(s.$$.fragment,b),P(o.$$.fragment,b),P(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[21](null),V(s,b),b&&k(l),n[22](null),V(o,b),b&&k(r),n[23](null),V(a,b)}}}function CM(n,e,t){var K;let i,s,l,o,r;At(n,li,W=>t(2,s=W)),At(n,Cs,W=>t(10,l=W)),At(n,Zt,W=>t(26,o=W)),At(n,ea,W=>t(8,r=W));const a=Y.getQueryParams((K=window.location)==null?void 0:K.href);bn(Zt,o="Collections",o);let u,f,c,d,p=a.filter||"",g=a.sort||"-created",v=a.collectionId;function b(){t(9,v=s.id),t(1,g="-created"),t(0,p="")}jw(v);const y=()=>u==null?void 0:u.show(),C=()=>u==null?void 0:u.show(s),$=()=>d==null?void 0:d.load(),S=()=>f==null?void 0:f.show(s),M=()=>c==null?void 0:c.show(),D=W=>t(0,p=W.detail);function E(W){he[W?"unshift":"push"](()=>{d=W,t(6,d)})}function O(W){p=W,t(0,p)}function F(W){g=W,t(1,g)}const L=W=>c==null?void 0:c.show(W==null?void 0:W.detail);function H(W){he[W?"unshift":"push"](()=>{u=W,t(3,u)})}function j(W){he[W?"unshift":"push"](()=>{f=W,t(4,f)})}function Q(W){he[W?"unshift":"push"](()=>{c=W,t(5,c)})}const ne=()=>d==null?void 0:d.load(),B=()=>d==null?void 0:d.load();return n.$$.update=()=>{n.$$.dirty&1024&&t(7,i=l.filter(W=>W.name!="profiles")),n.$$.dirty&516&&(s==null?void 0:s.id)&&v!=s.id&&b(),n.$$.dirty&7&&(g||p||(s==null?void 0:s.id))&&Y.replaceClientQueryParams({collectionId:s==null?void 0:s.id,filter:p,sort:g})},[p,g,s,u,f,c,d,i,r,v,l,y,C,$,S,M,D,E,O,F,L,H,j,Q,ne,B]}class MM extends Pe{constructor(e){super(),Ae(this,e,CM,$M,Ee,{})}}function Gh(n){let e,t;return e=new Le({props:{class:"form-field disabled",name:"id",$$slots:{default:[TM,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(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){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function TM(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="ID",o=T(),r=_("input"),h(t,"class",Y.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"for",l=n[31]),h(r,"type","text"),h(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])&&h(e,"for",l),c[1]&1&&a!==(a=f[31])&&h(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 Xh(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-shield-check-line"></i>',h(e,"class","form-field-addon txt-success")},m(s,l){w(s,e,l),t||(i=Qe(Ct.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function DM(n){let e,t,i,s,l,o,r,a,u,f,c,d=n[1].verified&&Xh();return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Email",o=T(),d&&d.c(),r=T(),a=_("input"),h(t,"class",Y.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"for",l=n[31]),h(a,"type","email"),h(a,"autocomplete","off"),h(a,"id",u=n[31]),a.required=!0},m(p,g){w(p,e,g),m(e,t),m(e,i),m(e,s),w(p,o,g),d&&d.m(p,g),w(p,r,g),w(p,a,g),Ce(a,n[2]),f||(c=X(a,"input",n[19]),f=!0)},p(p,g){g[1]&1&&l!==(l=p[31])&&h(e,"for",l),p[1].verified?d||(d=Xh(),d.c(),d.m(r.parentNode,r)):d&&(d.d(1),d=null),g[1]&1&&u!==(u=p[31])&&h(a,"id",u),g[0]&4&&a.value!==p[2]&&
<span class="txt">Send verification email</span>`,h(e,"type","button"),h(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[16]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function IM(n){let e,t,i,s,l=!n[1].verified&&np(n);return{c(){l&&l.c(),e=T(),t=_("button"),t.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,h(t,"type","button"),h(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=np(o),l.c(),l.m(e.parentNode,e))},d(o){l&&l.d(o),o&&k(e),o&&k(t),i=!1,s()}}}function NM(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,p=!n[1].isNew&&tp(n);return{c(){p&&p.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=R(r),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-secondary"),t.disabled=n[5],h(o,"class","txt"),h(l,"type","submit"),h(l,"form",n[11]),h(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[5],ee(l,"btn-loading",n[5])},m(g,v){p&&p.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?p&&(De(),P(p,1,1,()=>{p=null}),Oe()):p?(p.p(g,v),v[0]&2&&A(p,1)):(p=tp(g),p.c(),A(p,1),p.m(e.parentNode,e)),(!f||v[0]&32)&&(t.disabled=g[5]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&me(a,r),(!f||v[0]&1056&&u!==(u=!g[10]||g[5]))&&(l.disabled=u),v[0]&32&&ee(l,"btn-loading",g[5])},i(g){f||(A(p),f=!0)},o(g){P(p),f=!1},d(g){p&&p.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function RM(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[NM],header:[FM],default:[LM]},$$scope:{ctx:n}};return e=new wi({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){z(e.$$.fragment)},m(s,l){q(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){P(e.$$.fragment,s),t=!1},d(s){n[25](null),V(e,s)}}}function HM(n,e,t){let i;const s=un(),l="user_"+Y.randomString(5);let o,r=new co,a=!1,u=!1,f="",c="",d="",p=!1,g=!0;function v(J){return y(J),t(6,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(J){Ii({}),t(1,r=J!=null&&J.clone?J.clone():new co),C()}function C(){t(3,p=!1),t(9,g=!0),t(2,f=(r==null?void 0:r.email)||""),t(7,c=""),t(8,d="")}function $(){if(a||!i)return;t(5,a=!0);const J={email:f};(r.isNew||p)&&(J.password=c,J.passwordConfirm=d);let ie;r.isNew?ie=we.Users.create(J):ie=we.Users.update(r.id,J),ie.then(async fe=>{g&&M(!1),t(6,u=!1),b(),hn(r.isNew?"Successfully created user.":"Successfully updated user."),s("save",fe)}).catch(fe=>{we.errorResponseHandler(fe)}).finally(()=>{t(5,a=!1)})}function S(){!(r!=null&&r.id)||yi("Do you really want to delete the selected user?",()=>we.Users.delete(r.id).then(()=>{t(6,u=!1),b(),hn("Successfully deleted user."),s("delete",r)}).catch(J=>{we.errorResponseHandler(J)}))}function M(J=!0){return we.Users.requestVerification(r.isNew?f:r.email).then(()=>{t(6,u=!1),b(),J&&hn(`Successfully sent verification email to ${r.email}.`)}).catch(ie=>{we.errorResponseHandler(ie)})}const D=()=>M(),E=()=>S(),O=()=>b();function F(){f=this.value,t(2,f)}function L(){p=this.checked,t(3,p)}function H(){c=this.value,t(7,c)}function j(){d=this.value,t(8,d)}function Q(){g=this.checked,t(9,g)}const ne=()=>i&&u?(yi("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),b()}),!1):!0;function B(J){he[J?"unshift":"push"](()=>{o=J,t(4,o)})}function K(J){ht.call(this,n,J)}function W(J){ht.call(this,n,J)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(10,i=r.isNew&&f!=""||p||f!==r.email)},[b,r,f,p,o,a,u,c,d,g,i,l,$,S,M,v,D,E,O,F,L,H,j,Q,ne,B,K,W]}class jM extends Pe{constructor(e){super(),Ae(this,e,HM,RM,Ee,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function ip(n,e,t){const i=n.slice();return i[39]=e[t],i}function sp(n,e,t){const i=n.slice();return i[42]=e[t],i}function lp(n,e,t){const i=n.slice();return i[42]=e[t],i}function qM(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$,S,M,D,E,O,F,L,H=[],j=new Map,Q,ne,B,K,W,J,ie,fe,ye,le,ue=[],Te=new Map,Z,be,x,G,_e;u=new zo({}),u.$on("refresh",n[17]),v=new Vo({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}})
<span class="txt">New user</span>`,g=T(),z(v.$$.fragment),b=T(),y=_("div"),C=_("table"),$=_("thead"),S=_("tr"),z(M.$$.fragment),E=T(),z(O.$$.fragment),L=T();for(let te=0;te<H.length;te+=1)H[te].c();Q=T(),z(ne.$$.fragment),K=T(),z(W.$$.fragment),ie=T(),fe=_("th"),ye=T(),le=_("tbody");for(let te=0;te<ue.length;te+=1)ue[te].c();de&&de.c(),Z=T(),qe&&qe.c(),be=T(),ct&&ct.c(),h(s,"class","breadcrumb-item"),h(i,"class","breadcrumbs"),h(r,"type","button"),h(r,"class","btn btn-secondary btn-circle"),h(c,"class","flex-fill"),h(p,"type","button"),h(p,"class","btn btn-expanded"),h(t,"class","page-header"),h(fe,"class","col-type-action min-width"),h(C,"class","table"),ee(C,"table-loading",n[10]),h(y,"class","table-wrapper"),h(e,"class","page-wrapper")},m(te,ve){w(te,e,ve),m(e,t),m(t,i),m(i,s),m(s,l),m(t,o),m(t,r),m(t,a),q(u,t,null),m(t,f),m(t,c),m(t,d),m(t,p),m(e,g),q(v,e,null),m(e,b),m(e,y),m(y,C),m(C,$),m($,S),q(M,S,null),m(S,E),q(O,S,null),m(S,L);for(let Ze=0;Ze<H.length;Ze+=1)H[Ze].m(S,null);m(S,Q),q(ne,S,null),m(S,K),q(W,S,null),m(S,ie),m(S,fe),m(C,ye),m(C,le);for(let Ze=0;Ze<ue.length;Ze+=1)ue[Ze].m(le,null);de&&de.m(le,null),m(e,Z),qe&&qe.m(e,null),m(e,be),ct&&ct.m(e,null),x=!0,G||(_e=[Qe(Ct.call(null,r,{text:"Edit profile collection",position:"right"})),X(r,"click",n[16]),X(p,"click",n[18])],G=!0)},p(te,ve){(!x||ve[0]&16384)&&me(l,te[14]);const Ze={};ve[0]&8&&(Ze.value=te[3]),v.$set(Ze);const at={};ve[1]&65536&&(at.$$scope={dirty:ve,ctx:te}),!D&&ve[0]&16&&(D=!0,at.sort=te[4],He(()=>D=!1)),M.$set(at);const mt={};ve[1]&65536&&(mt.$$scope={dirty:ve,ctx:te}),!F&&ve[0]&16&&(F=!0,mt.sort=te[4],He(()=>F=!1)),O.$set(mt),ve[0]&4096&&(ae=te[12],H=ft(H,ve,ke,1,te,ae,j,S,rn,op,Q,lp));const yt={};ve[1]&65536&&(yt.$$scope={dirty:ve,ctx:te}),!B&&ve[0]&16&&(B=!0,yt.sort=te[4],He(()=>B=!1)),ne.$set(yt);const Lt={};ve[1]&65536&&(Lt.$$scope={dirty:ve,ctx:te}),!J&&ve[0]&16&&(J=!0,Lt.sort=te[4],He(()=>J=!1)),W.$set(Lt),ve[0]&5450&&(xe=te[1],De(),ue=ft(ue,ve,ge,1,te,xe,Te,le,Nt,fp,null,ip),Oe(),!xe.length&&de?de.p(te,ve):xe.length?de&&(de.d(1),de=null):(de=rp(te),de.c(),de.m(le,null))),ve[0]&1024&&ee(C,"table-loading",te[10]),te[1].length?qe?qe.p(te,ve):(qe=cp(te),qe.c(),qe.m(e,be)):qe&&(qe.d(1),qe=null),te[1].length&&te[13]?ct?ct.p(te,ve):(ct=dp(te),ct.c(),ct.m(e,null)):ct&&(ct.d(1),ct=null)},i(te){if(!x){A(u.$$.fragment,te),A(v.$$.fragment,te),A(M.$$.fragment,te),A(O.$$.fragment,te),A(ne.$$.fragment,te),A(W.$$.fragment,te);for(let ve=0;ve<xe.length;ve+=1)A(ue[ve]);x=!0}},o(te){P(u.$$.fragment,te),P(v.$$.fragment,te),P(M.$$.fragment,te),P(O.$$.fragment,te),P(ne.$$.fragment,te),P(W.$$.fragment,te);for(let ve=0;ve<ue.length;ve+=1)P(ue[ve]);x=!1},d(te){te&&k(e),V(u),V(v),V(M),V(O);for(let ve=0;ve<H.length;ve+=1)H[ve].d();V(ne),V(W);for(let ve=0;ve<ue.length;ve+=1)ue[ve].d();de&&de.d(),qe&&qe.d(),ct&&ct.d(),G=!1,st(_e)}}}function VM(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading users...</h1>`,h(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function zM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",h(t,"class",Y.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function BM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",h(t,"class",Y.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function op(n,e){let t,i,s,l,o,r,a,u=e[42].name+"",f,c,d;return{key:n,first:null,c(){t=_("th"),i=_("div"),s=_("i"),o=T(),r=_("span"),a=R("profile."),f=R(u),h(s,"class",l=Y.getFieldTypeIcon(e[42].type)),h(r,"class","txt"),h(i,"class","col-header-content"),h(t,"class",c="col-type-"+e[42].type+" col-field-"+e[42].name),h(t,"name",d=e[42].name),this.first=t},m(p,g){w(p,t,g),m(t,i),m(i,s),m(i,o),m(i,r),m(r,a),m(r,f)},p(p,g){e=p,g[0]&4096&&l!==(l=Y.getFieldTypeIcon(e[42].type))&&h(s,"class",l),g[0]&4096&&u!==(u=e[42].name+"")&&me(f,u),g[0]&4096&&c!==(c="col-type-"+e[42].type+" col-field-"+e[42].name)&&h(t,"class",c),g[0]&4096&&d!==(d=e[42].name)&&h(t,"name",d)},d(p){p&&k(t)}}}function UM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",h(t,"class",Y.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function WM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",h(t,"class",Y.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function rp(n){let e;function t(l,o){return l[10]?KM:YM}let i=t(n),s=i(n);return{c(){s.c(),e=rt()},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 YM(n){var r;let e,t,i,s,l,o=((r=n[3])==null?void 0:r.length)&&ap(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No users found.",s=T(),o&&o.c(),l=T(),h(t,"colspan","99"),h(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=ap(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function KM(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:oe,d(t){t&&k(e)}}}function ap(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[26]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function up(n,e){let t,i,s;return i=new g_({props:{field:e[42],record:e[39].profile||{}}}),{key:n,first:null,c(){t=rt(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&4096&&(r.field=e[42]),o[0]&2&&(r.record=e[39].profile||{}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(i,l)}}}function fp(n,e){let t,i,s,l,o,r,a,u=e[39].email+"",f,c,d,p,g=e[39].verified?"Verified":"Unverified",v,b,y=[],C=new Map,$,S,M,D,E,O,F,L,H,j,Q,ne,B,K,W;s=new Zo({props:{id:e[39].id}});let J=e[12];const ie=le=>le[42].name;for(let le=0;le<J.length;le+=1){let ue=sp(e,J,le),Te=ie(ue);C.set(Te,y[le]=up(Te,ue))}M=new vi({props:{date:e[39].created}}),O=new vi({props:{date:e[39].updated}});function fe(){return e[24](e[39])}function ye(){return e[25](e[39])}return{key:n,first:null,c(){t=_("tr"),i=_("td"),z(s.$$.fragment),l=T(),o=_("td"),r=_("div"),a=_("span"),f=R(u),d=T(),p=_("span"),v=R(g),b=T();for(let le=0;le<y.length;le+=1)y[le].c();$=T(),S=_("td"),z(M.$$.fragment),D=T(),E=_("td"),z(O.$$.fragment),F=T(),L=_("td"),H=_("button"),H.innerHTML=`<i class="ri-user-settings-line"></i>
<span class="txt">Edit user</span>`,j=T(),Q=_("button"),Q.innerHTML=`<i class="ri-profile-line"></i>
<span class="txt">Edit profile</span>`,ne=T(),h(i,"class","col-type-text col-field-id"),h(a,"class","txt"),h(a,"title",c=e[39].email),h(p,"class","label"),ee(p,"label-success",e[39].verified),ee(p,"label-warning",!e[39].verified),h(r,"class","inline-flex"),h(o,"class","col-type-email col-field-email"),h(S,"class","col-type-date col-field-created"),h(E,"class","col-type-date col-field-updated"),h(H,"type","button"),h(H,"class","btn btn-sm btn-outline"),h(Q,"type","button"),h(Q,"class","btn btn-sm m-l-10"),h(L,"class","col-type-action min-width"),this.first=t},m(le,ue){w(le,t,ue),m(t,i),q(s,i,null),m(t,l),m(t,o),m(o,r),m(r,a),m(a,f),m(r,d),m(r,p),m(p,v),m(t,b);for(let Te=0;Te<y.length;Te+=1)y[Te].m(t,null);m(t,$),m(t,S),q(M,S,null),m(t,D),m(t,E),q(O,E,null),m(t,F),m(t,L),m(L,H),m(L,j),m(L,Q),m(t,ne),B=!0,K||(W=[X(H,"click",qn(fe)),X(Q,"click",qn(ye))],K=!0)},p(le,ue){e=le;const Te={};ue[0]&2&&(Te.id=e[39].id),s.$set(Te),(!B||ue[0]&2)&&u!==(u=e[39].email+"")&&me(f,u),(!B||ue[0]&2&&c!==(c=e[39].email))&&h(a,"title",c),(!B||ue[0]&2)&&g!==(g=e[39].verified?"Verified":"Unverified")&&me(v,g),ue[0]&2&&ee(p,"label-success",e[39].verified),ue[0]&2&&ee(p,"label-warning",!e[39].verified),ue[0]&4098&&(J=e[12],De(),y=ft(y,ue,ie,1,e,J,C,t,Nt,up,$,sp),Oe());const Z={};ue[0]&2&&(Z.date=e[39].created),M.$set(Z);const be={};ue[0]&2&&(be.date=e[39].updated),O.$set(be)},i(le){if(!B){A(s.$$.fragment,le);for(let ue=0;ue<J.length;ue+=1)A(y[ue]);A(M.$$.fragment,le),A(O.$$.fragment,le),B=!0}},o(le){P(s.$$.fragment,le);for(let ue=0;ue<y.length;ue+=1)P(y[ue]);P(M.$$.fragment,le),P(O.$$.fragment,le),B=!1},d(le){le&&k(t),V(s);for(let ue=0;ue<y.length;ue+=1)y[ue].d();V(M),V(O),K=!1,st(W)}}}function cp(n){let e,t,i=n[1].length+"",s,l,o;return{c(){e=_("small"),t=R("Showing "),s=R(i),l=R(" of "),o=R(n[2]),h(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+"")&&me(s,i),a[0]&4&&me(o,r[2])},d(r){r&&k(e)}}}function dp(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=R("Load more ("),o=R(l),r=R(")"),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-lg btn-secondary btn-expanded"),ee(t,"btn-loading",n[10]),ee(t,"btn-disabled",n[10]),h(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[27]),a=!0)},p(f,c){c[0]&6&&l!==(l=f[2]-f[1].length+"")&&me(o,l),c[0]&1024&&ee(t,"btn-loading",f[10]),c[0]&1024&&ee(t,"btn-disabled",f[10])},d(f){f&&k(e),a=!1,u()}}}function ZM(n){let e,t,i,s,l,o,r,a,u;const f=[VM,qM],c=[];function d(b,y){return b[11]?0:1}e=d(n),t=c[e]=f[e](n);let p={};s=new jM({props:p}),n[28](s),s.$on("save",n[29]),s.$on("delete",n[30]);let g={};o=new Ua({props:g}),n[31](o),o.$on("save",n[32]);let v={collection:n[5]};return a=new m_({props:v}),n[33](a),a.$on("save",n[34]),{c(){t.c(),i=T(),z(s.$$.fragment),l=T(),z(o.$$.fragment),r=T(),z(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),q(s,b,y),w(b,l,y),q(o,b,y),w(b,r,y),q(a,b,y),u=!0},p(b,y){let C=e;e=d(b),e===C?c[e].p(b,y):(De(),P(c[C],1,1,()=>{c[C]=null}),Oe(),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.$set($);const S={};o.$set(S);const M={};y[0]&32&&(M.collection=b[5]),a.$set(M)},i(b){u||(A(t),A(s.$$.fragment,b),A(o.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){P(t),P(s.$$.fragment,b),P(o.$$.fragment,b),P(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[28](null),V(s,b),b&&k(l),n[31](null),V(o,b),b&&k(r),n[33](null),V(a,b)}}}function JM(n,e,t){var be;let i,s,l;At(n,Zt,x=>t(14,l=x));const o=Y.getQueryParams((be=window.location)==null?void 0:be.href),r=["id","userId","created","updated"];bn(Zt,l="Users",l);let a,u,f,c=[],d=1,p=0,g=!1,v=o.filter||"",b=o.sort||"-created",y=new An,C=!1;D();async function $(x=1){return t(10,g=!0),x<=1&&S(),we.Users.getList(x,50,{sort:b||"-created",filter:v}).then(G=>{t(10,g=!1),t(1,c=c.concat(G.items)),t(9,d=G.page),t(2,p=G.totalItems)}).catch(G=>{G!=null&&G.isAbort||(t(10,g=!1),console.warn(G),S(),we.errorResponseHandler(G,!1)
<span class="txt">Application</span>`,o=T(),r=_("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=T(),u=_("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=T(),c=_("div"),c.textContent="Authentication",d=T(),p=_("a"),p.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,g=T(),v=_("a"),v.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,b=T(),y=_("a"),y.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,h(i,"class","sidebar-title"),h(l,"href","/settings"),h(l,"class","sidebar-list-item"),h(r,"href","/settings/mail"),h(r,"class","sidebar-list-item"),h(u,"href","/settings/storage"),h(u,"class","sidebar-list-item"),h(c,"class","sidebar-title"),h(p,"href","/settings/auth-providers"),h(p,"class","sidebar-list-item"),h(v,"href","/settings/tokens"),h(v,"class","sidebar-list-item"),h(y,"href","/settings/admins"),h(y,"class","sidebar-list-item"),h(t,"class","sidebar-content"),h(e,"class","page-sidebar settings-sidebar")},m(S,M){w(S,e,M),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,p),m(t,g),m(t,v),m(t,b),m(t,y),C||($=[Qe(ni.call(null,l,{path:"/settings"})),Qe($n.call(null,l)),Qe(ni.call(null,r,{path:"/settings/mail/?.*"})),Qe($n.call(null,r)),Qe(ni.call(null,u,{path:"/settings/storage/?.*"})),Qe($n.call(null,u)),Qe(ni.call(null,p,{path:"/settings/auth-providers/?.*"})),Qe($n.call(null,p)),Qe(ni.call(null,v,{path:"/settings/tokens/?.*"})),Qe($n.call(null,v)),Qe(ni.call(null,y,{path:"/settings/admins/?.*"})),Qe($n.call(null,y))],C=!0)},p:oe,i:oe,o:oe,d(S){S&&k(e),C=!1,st($)}}}class As extends Pe{constructor(e){super(),Ae(this,e,null,XM,Ee,{})}}function hp(n,e,t){const i=n.slice();return i[31]=e[t],i}function pp(n){let e,t;return e=new Le({props:{class:"form-field disabled",name:"id",$$slots:{default:[QM,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(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){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function QM(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="ID",o=T(),r=_("input"),h(t,"class",Y.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"for",l=n[30]),h(r,"type","text"),h(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])&&h(e,"for",l),c[0]&1073741824&&a!==(a=f[30])&&h(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 mp(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=T(),Xn(t.src,i="/_/images/avatars/avatar"+n[31]+".svg")||h(t,"src",i),h(t,"alt","Avatar "+n[31]),h(e,"tabindex","0"),h(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"))&&h(e,"class",l)},d(f){f&&k(e),o=!1,st(r)}}}function xM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Email",o=T(),r=_("input"),h(t,"class",Y.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"for",l=n[30]),h(r,"type","email"),h(r,"autocomplete","off"),h(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),Ce(r,n[3]),u||(f=X(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&h(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&h(r,"id",a),d[0]&8&&r.value!==c[3]&&Ce(r,c[3])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function gp(n){let e,t;return e=new Le({props:{class:"form-field form-field-toggle",$$slots:{default:[eT,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(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){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function eT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Change password"),h(e,"type","checkbox"),h(e,"id",t=n[30]),h(s,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[20]),r=!0)},p(u,f){f[0]&1073741824&&t!==(t=u[30])&&h(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&o!==(o=u[30])&&h(s,"for",o)},d(u){u&&k(e)
<span class="txt">Delete</span>`,h(e,"type","button"),h(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[15]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function oT(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,p=!n[1].isNew&&bp(n);return{c(){p&&p.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=R(r),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-secondary"),t.disabled=n[6],h(o,"class","txt"),h(l,"type","submit"),h(l,"form",n[11]),h(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],ee(l,"btn-loading",n[6])},m(g,v){p&&p.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?p&&(De(),P(p,1,1,()=>{p=null}),Oe()):p?(p.p(g,v),v[0]&2&&A(p,1)):(p=bp(g),p.c(),A(p,1),p.m(e.parentNode,e)),(!f||v[0]&64)&&(t.disabled=g[6]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&me(a,r),(!f||v[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),v[0]&64&&ee(l,"btn-loading",g[6])},i(g){f||(A(p),f=!0)},o(g){P(p),f=!1},d(g){p&&p.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function rT(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[oT],header:[sT],default:[iT]},$$scope:{ctx:n}};return e=new wi({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){z(e.$$.fragment)},m(s,l){q(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){P(e.$$.fragment,s),t=!1},d(s){n[24](null),V(e,s)}}}function aT(n,e,t){let i;const s=un(),l="admin_"+Y.randomString(5);let o,r=new ks,a=!1,u=!1,f=0,c="",d="",p="",g=!1;function v(W){return y(W),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(W){Ii({}),t(1,r=W!=null&&W.clone?W.clone():new ks),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,p="")}function $(){if(a||!i)return;t(6,a=!0);const W={email:c,avatar:f};(r.isNew||g)&&(W.password=d,W.passwordConfirm=p);let J;r.isNew?J=we.Admins.create(W):J=we.Admins.update(r.id,W),J.then(async ie=>{var fe;t(7,u=!1),b(),hn(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ie),((fe=we.AuthStore.model)==null?void 0:fe.id)===ie.id&&we.AuthStore.save(we.AuthStore.token,ie)}).catch(ie=>{we.errorResponseHandler(ie)}).finally(()=>{t(6,a=!1)})}function S(){!(r!=null&&r.id)||yi("Do you really want to delete the selected admin?",()=>we.Admins.delete(r.id).then(()=>{t(7,u=!1),b(),hn("Successfully deleted admin."),s("delete",r)}).catch(W=>{we.errorResponseHandler(W)}))}const M=()=>S(),D=()=>b(),E=W=>t(2,f=W),O=(W,J)=>{(J.code==="Enter"||J.code==="Space")&&(J.preventDefault(),t(2,f=W))};function F(){c=this.value,t(3,c)}function L(){g=this.checked,t(4,g)}function H(){d=this.value,t(8,d)}function j(){p=this.value,t(9,p)}const Q=()=>i&&u?(yi("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function ne(W){he[W?"unshift":"push"](()=>{o=W,t(5,o)})}function B(W){ht.call(this,n,W)}function K(W){ht.call(this,n,W)}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,p,i,l,$,S,v,M,D,E,O,F,L,H,j,Q,ne,B,K]}class uT extends Pe{constructor(e){super(),Ae(this,e,aT,rT,Ee,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function vp(n,e,t){const i=n.slice();return i[23]=e[t],i}function fT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",h(t,"class",Y.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function cT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",h(t,"class",Y.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function dT(n){let e,t,i,s;return{c(
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function kp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[17]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function wp(n){let e;return{c(){e=_("span"),e.textContent="You",h(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Sp(n,e){let t,i,s,l,o,r,a,u,f,c,d,p,g=e[23].email+"",v,b,y,C,$,S,M,D,E,O,F,L,H,j;u=new Zo({props:{id:e[23].id}});let Q=e[23].id===e[7].id&&wp();$=new vi({props:{date:e[23].created}}),D=new vi({props:{date:e[23].updated}});function ne(){return e[15](e[23])}function B(...K){return e[16](e[23],...K)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("figure"),l=_("img"),r=T(),a=_("td"),z(u.$$.fragment),f=T(),Q&&Q.c(),c=T(),d=_("td"),p=_("span"),v=R(g),y=T(),C=_("td"),z($.$$.fragment),S=T(),M=_("td"),z(D.$$.fragment),E=T(),O=_("td"),O.innerHTML='<i class="ri-arrow-right-line"></i>',F=T(),Xn(l.src,o="/_/images/avatars/avatar"+(e[23].avatar||0)+".svg")||h(l,"src",o),h(l,"alt","Admin avatar"),h(s,"class","thumb thumb-sm thumb-circle"),h(i,"class","min-width"),h(a,"class","col-type-text col-field-id"),h(p,"class","txt txt-ellipsis"),h(p,"title",b=e[23].email),h(d,"class","col-type-email col-field-email"),h(C,"class","col-type-date col-field-created"),h(M,"class","col-type-date col-field-updated"),h(O,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(K,W){w(K,t,W),m(t,i),m(i,s),m(s,l),m(t,r),m(t,a),q(u,a,null),m(a,f),Q&&Q.m(a,null),m(t,c),m(t,d),m(d,p),m(p,v),m(t,y),m(t,C),q($,C,null),m(t,S),m(t,M),q(D,M,null),m(t,E),m(t,O),m(t,F),L=!0,H||(j=[X(t,"click",ne),X(t,"keydown",B)],H=!0)},p(K,W){e=K,(!L||W&16&&!Xn(l.src,o="/_/images/avatars/avatar"+(e[23].avatar||0)+".svg"))&&h(l,"src",o);const J={};W&16&&(J.id=e[23].id),u.$set(J),e[23].id===e[7].id?Q||(Q=wp(),Q.c(),Q.m(a,null)):Q&&(Q.d(1),Q=null),(!L||W&16)&&g!==(g=e[23].email+"")&&me(v,g),(!L||W&16&&b!==(b=e[23].email))&&h(p,"title",b);const ie={};W&16&&(ie.date=e[23].created),$.$set(ie);const fe={};W&16&&(fe.date=e[23].updated),D.$set(fe)},i(K){L||(A(u.$$.fragment,K),A($.$$.fragment,K),A(D.$$.fragment,K),L=!0)},o(K){P(u.$$.fragment,K),P($.$$.fragment,K),P(D.$$.fragment,K),L=!1},d(K){K&&k(t),V(u),Q&&Q.d(),V($),V(D),H=!1,st(j)}}}function $p(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=_("small"),t=R("Showing "),s=R(i),l=R(" of "),r=R(o),h(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+"")&&me(s,i),u&16&&o!==(o=a[4].length+"")&&me(r,o)},d(a){a&&k(e)}}}function gT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$,S,M,D,E,O,F,L,H,j,Q,ne,B,K,W,J,ie,fe,ye,le,ue,Te=[],Z=new Map,be,x,G,_e,je,Fe;e=new As({}),c=new zo({}),c.$on("refresh",n[8]),y=new Vo({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),y.$on("submit",n[10]);function Re(te){n[11](te)}let re={class:"col-type-text",name:"id",$$slots:{default:[fT]},$$scope:{ctx:n}};n[2]!==void 0&&(re.sort=n[2]),F=new tn({props:re}),he.push(()=>Ie(F,"sort",Re));function ae(te){n[12](te)}let ke={class:"col-type-email col-field-email",name:"email",$$slots:{default:[cT]},$$scope:{ctx:n}};n[2]!==void 0&&(ke.sort=n[2]),j=new tn({props:ke}),he.push(()=>Ie(j,"sort",ae));function Ke(te){n[13](te)}let Ye={class:"col-type-date col-field-created",name:"created",$$slots:{default:[dT]},$$scope:{ctx:n}};n[2]!==void 0&&(Ye.sort=n[2]),B=new tn({props:Ye}),he.push(()=>Ie(B,"sort",Ke));function nt(te){n[14](te)}let lt={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[hT]},$$scope:{ctx:n}};n[2]!==void 0&&(lt.sort=n[2]),J=new tn({props:lt}),he.push(()=>Ie(J,"sort",nt));let xe=n[4];const ge=te=>te[23].id;for(let te=0;te<xe.length;te+=1){let ve=vp(n,xe,te),Ze=ge(ve);Z.set(Ze,Te[te]=Sp(Ze,ve))}let de=null;xe.length||(de=yp(n));let qe=n[4].length&&$p(n),ct={};return G=new uT({props:ct}),n[18](G),G.
<span class="txt">New admin</span>`,b=T(),z(y.$$.fragment),C=T(),$=_("div"),S=_("table"),M=_("thead"),D=_("tr"),E=_("th"),O=T(),z(F.$$.fragment),H=T(),z(j.$$.fragment),ne=T(),z(B.$$.fragment),W=T(),z(J.$$.fragment),fe=T(),ye=_("th"),le=T(),ue=_("tbody");for(let te=0;te<Te.length;te+=1)Te[te].c();de&&de.c(),be=T(),qe&&qe.c(),x=T(),z(G.$$.fragment),h(o,"class","breadcrumb-item"),h(a,"class","breadcrumb-item"),h(l,"class","breadcrumbs"),h(p,"class","flex-fill"),h(v,"type","button"),h(v,"class","btn btn-expanded"),h(s,"class","page-header"),h(E,"class","min-width"),h(ye,"class","col-type-action min-width"),h(S,"class","table"),ee(S,"table-loading",n[5]),h($,"class","table-wrapper"),h(i,"class","page-wrapper")},m(te,ve){q(e,te,ve),w(te,t,ve),w(te,i,ve),m(i,s),m(s,l),m(l,o),m(l,r),m(l,a),m(a,u),m(s,f),q(c,s,null),m(s,d),m(s,p),m(s,g),m(s,v),m(i,b),q(y,i,null),m(i,C),m(i,$),m($,S),m(S,M),m(M,D),m(D,E),m(D,O),q(F,D,null),m(D,H),q(j,D,null),m(D,ne),q(B,D,null),m(D,W),q(J,D,null),m(D,fe),m(D,ye),m(S,le),m(S,ue);for(let Ze=0;Ze<Te.length;Ze+=1)Te[Ze].m(ue,null);de&&de.m(ue,null),m(i,be),qe&&qe.m(i,null),w(te,x,ve),q(G,te,ve),_e=!0,je||(Fe=X(v,"click",n[9]),je=!0)},p(te,[ve]){(!_e||ve&64)&&me(u,te[6]);const Ze={};ve&2&&(Ze.value=te[1]),y.$set(Ze);const at={};ve&67108864&&(at.$$scope={dirty:ve,ctx:te}),!L&&ve&4&&(L=!0,at.sort=te[2],He(()=>L=!1)),F.$set(at);const mt={};ve&67108864&&(mt.$$scope={dirty:ve,ctx:te}),!Q&&ve&4&&(Q=!0,mt.sort=te[2],He(()=>Q=!1)),j.$set(mt);const yt={};ve&67108864&&(yt.$$scope={dirty:ve,ctx:te}),!K&&ve&4&&(K=!0,yt.sort=te[2],He(()=>K=!1)),B.$set(yt);const Lt={};ve&67108864&&(Lt.$$scope={dirty:ve,ctx:te}),!ie&&ve&4&&(ie=!0,Lt.sort=te[2],He(()=>ie=!1)),J.$set(Lt),ve&186&&(xe=te[4],De(),Te=ft(Te,ve,ge,1,te,xe,Z,ue,Nt,Sp,null,vp),Oe(),!xe.length&&de?de.p(te,ve):xe.length?de&&(de.d(1),de=null):(de=yp(te),de.c(),de.m(ue,null))),ve&32&&ee(S,"table-loading",te[5]),te[4].length?qe?qe.p(te,ve):(qe=$p(te),qe.c(),qe.m(i,null)):qe&&(qe.d(1),qe=null);const pe={};G.$set(pe)},i(te){if(!_e){A(e.$$.fragment,te),A(c.$$.fragment,te),A(y.$$.fragment,te),A(F.$$.fragment,te),A(j.$$.fragment,te),A(B.$$.fragment,te),A(J.$$.fragment,te);for(let ve=0;ve<xe.length;ve+=1)A(Te[ve]);A(G.$$.fragment,te),_e=!0}},o(te){P(e.$$.fragment,te),P(c.$$.fragment,te),P(y.$$.fragment,te),P(F.$$.fragment,te),P(j.$$.fragment,te),P(B.$$.fragment,te),P(J.$$.fragment,te);for(let ve=0;ve<Te.length;ve+=1)P(Te[ve]);P(G.$$.fragment,te),_e=!1},d(te){V(e,te),te&&k(t),te&&k(i),V(c),V(y),V(F),V(j),V(B),V(J);for(let ve=0;ve<Te.length;ve+=1)Te[ve].d();de&&de.d(),qe&&qe.d(),te&&k(x),n[18](null),V(G,te),je=!1,Fe()}}}function _T(n,e,t){var L;let i,s;At(n,Zt,H=>t(6,i=H)),At(n,ba,H=>t(7,s=H));const l=Y.getQueryParams((L=window.location)==null?void 0:L.href);bn(Zt,i="Admins",i);let o,r=[],a=!1,u=l.filter||"",f=l.sort||"-created";function c(){return t(5,a=!0),t(4,r=[]),we.Admins.getFullList(100,{sort:f||"-created",filter:u}).then(H=>{t(4,r=H),t(5,a=!1)}).catch(H=>{H!=null&&H.isAbort||(t(5,a=!1),console.warn(H),d(),we.errorResponseHandler(H,!1))})}function d(){t(4,r=[])}const p=()=>c(),g=()=>o==null?void 0:o.show(),v=H=>t(1,u=H.detail);function b(H){f=H,t(2,f)}function y(H){f=H,t(2,f)}function C(H){f=H,t(2,f)}function $(H){f=H,t(2,f)}const S=H=>o==null?void 0:o.show(H),M=(H,j)=>{(j.code==="Enter"||j.code==="Space")&&(j.preventDefault(),o==null||o.show(H))},D=()=>t(1,u="");function E(H){he[H?"unshift":"push"](()=>{o=H,t(3,o)})}const O=()=>c(),F=()=>c();return n.$$.update=()=>{n.$$.dirty&6&&f!==-1&&u!==-1&&(Y.replaceClientQueryParams({filter:u,sort:f}),c())},[c,u,f,o,r,a,i,s,p,g,v,b,y,C,$,S,M,D,E,O,F]}class bT extends Pe{constructor(e){super(),Ae(this,e,_T,gT,Ee,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function vT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Email"),s=T(),l=_("input"),h(e,"for",i=n[7]),h(l,"type","email"),h(l,"id",o=n[7]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0]),l.focus(),r||(a=X(l,"input",n[4]),r=!0)},p(u,f){f&128&&i!==(i=u[7])&&h(e,"for",i),f&128&&o!==(o=u[7])&&h(l,"id",o),f&1&&l.val
<i class="ri-arrow-right-line"></i>`,h(t,"class","content txt-center m-b-base"),h(a,"type","submit"),h(a,"class","btn btn-lg btn-block btn-next"),ee(a,"btn-disabled",n[2]),ee(a,"btn-loading",n[2]),h(e,"class","block")},m(d,p){w(d,e,p),m(e,t),m(e,i),q(s,e,null),m(e,l),q(o,e,null),m(e,r),m(e,a),u=!0,f||(c=X(e,"submit",Bt(n[3])),f=!0)},p(d,p){const g={};p&385&&(g.$$scope={dirty:p,ctx:d}),s.$set(g);const v={};p&386&&(v.$$scope={dirty:p,ctx:d}),o.$set(v),p&4&&ee(a,"btn-disabled",d[2]),p&4&&ee(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){P(s.$$.fragment,d),P(o.$$.fragment,d),u=!1},d(d){d&&k(e),V(s),V(o),f=!1,c()}}}function wT(n){let e,t;return e=new fg({props:{$$slots:{default:[kT]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&263&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function ST(n,e,t){var f;const i=Y.getQueryParams((f=window.location)==null?void 0:f.href);let s=i.demoEmail||"",l=i.demoPassword||"",o=!1;function r(){if(!o)return t(2,o=!0),we.Admins.authViaEmail(s,l).then(()=>{Ms("/")}).catch(()=>{lg("Invalid login credentials.")}).finally(()=>{t(2,o=!1)})}function a(){s=this.value,t(0,s)}function u(){l=this.value,t(1,l)}return[s,l,o,r,a,u]}class $T extends Pe{constructor(e){super(),Ae(this,e,ST,wT,Ee,{})}}function CT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C;return i=new Le({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[TT,({uniqueId:$})=>({14:$}),({uniqueId:$})=>$?16384:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[DT,({uniqueId:$})=>({14:$}),({uniqueId:$})=>$?16384:0]},$$scope:{ctx:n}}}),a=new Le({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[OT,({uniqueId:$})=>({14:$}),({uniqueId:$})=>$?16384:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),z(a.$$.fragment),u=T(),f=_("div"),c=_("div"),d=T(),p=_("button"),g=_("span"),g.textContent="Save changes",h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(c,"class","flex-fill"),h(g,"class","txt"),h(p,"type","submit"),h(p,"class","btn btn-expanded"),p.disabled=v=!n[3]||n[2],ee(p,"btn-loading",n[2]),h(f,"class","col-lg-12 flex"),h(e,"class","grid")},m($,S){w($,e,S),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),q(a,e,null),m(e,u),m(e,f),m(f,c),m(f,d),m(f,p),m(p,g),b=!0,y||(C=X(p,"click",n[9]),y=!0)},p($,S){const M={};S&49153&&(M.$$scope={dirty:S,ctx:$}),i.$set(M);const D={};S&49153&&(D.$$scope={dirty:S,ctx:$}),o.$set(D);const E={};S&49153&&(E.$$scope={dirty:S,ctx:$}),a.$set(E),(!b||S&12&&v!==(v=!$[3]||$[2]))&&(p.disabled=v),S&4&&ee(p,"btn-loading",$[2])},i($){b||(A(i.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),b=!0)},o($){P(i.$$.fragment,$),P(o.$$.fragment,$),P(a.$$.fragment,$),b=!1},d($){$&&k(e),V(i),V(o),V(a),y=!1,C()}}}function MT(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function TT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Application name"),s=T(),l=_("input"),h(e,"for",i=n[14]),h(l,"type","text"),h(l,"id",o=n[14]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.appName),r||(a=X(l,"input",n[6]),r=!0)},p(u,f){f&16384&&i!==(i=u[14])&&h(e,"for",i),f&16384&&o!==(o=u[14])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appName&&Ce(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function DT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Application url"),s=T(),l=_("input"),h(e,"for",i=n[14]),h(l,"type","text"),h(l,"id",o=n[14]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.appUrl),r||(a=X(l,"input",n[7]),r=!0)},p(u,f){f&16384&&i!==(i=u[14])&&h(e,"for",i),f&16384&&o!==(o=u[14])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&Ce(l,u[0].meta.appUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function OT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Logs max days retention"),s=T(),l=_("input"),h(e,"for",i=n[14]),h(
<div class="breadcrumb-item">Application</div></nav>`,l=T(),o=_("div"),r=_("form"),u.c(),h(s,"class","page-header"),h(r,"class","panel"),h(r,"autocomplete","off"),h(o,"class","wrapper"),h(i,"class","page-wrapper")},m(b,y){q(e,b,y),w(b,t,y),w(b,i,y),m(i,s),m(i,l),m(i,o),m(o,r),g[a].m(r,null),f=!0,c||(d=X(r,"submit",Bt(n[4])),c=!0)},p(b,[y]){let C=a;a=v(b),a===C?g[a].p(b,y):(De(),P(g[C],1,1,()=>{g[C]=null}),Oe(),u=g[a],u?u.p(b,y):(u=g[a]=p[a](b),u.c()),A(u,1),u.m(r,null))},i(b){f||(A(e.$$.fragment,b),A(u),f=!0)},o(b){P(e.$$.fragment,b),P(u),f=!1},d(b){V(e,b),b&&k(t),b&&k(i),g[a].d(),c=!1,d()}}}function AT(n,e,t){let i,s,l;At(n,_o,y=>t(10,s=y)),At(n,Zt,y=>t(11,l=y)),bn(Zt,l="Application settings",l);let o={},r=!1,a=!1,u="";f();async function f(){t(1,r=!0);try{const y=await we.Settings.getAll()||{};d(y)}catch(y){we.errorResponseHandler(y)}t(1,r=!1)}async function c(){if(!(a||!i)){t(2,a=!0);try{const y=await we.Settings.update(Y.filterRedactedProps(o));d(y),hn("Successfully saved application settings.")}catch(y){we.errorResponseHandler(y)}t(2,a=!1)}}function d(y={}){var C;bn(_o,s=(C=y==null?void 0:y.meta)==null?void 0:C.appName,s),t(0,o={meta:(y==null?void 0:y.meta)||{},logs:(y==null?void 0:y.logs)||{}}),t(5,u=JSON.stringify(o))}function p(){o.meta.appName=this.value,t(0,o)}function g(){o.meta.appUrl=this.value,t(0,o)}function v(){o.logs.maxDays=Ot(this.value),t(0,o)}const b=()=>c();return n.$$.update=()=>{n.$$.dirty&33&&t(3,i=u!=JSON.stringify(o))},[o,r,a,i,c,u,p,g,v,b]}class PT extends Pe{constructor(e){super(),Ae(this,e,AT,ET,Ee,{})}}function LT(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=pt(l,s[o]);return{c(){e=_("input"),oi(e,l)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[7](e),Ce(e,n[0]),t||(i=X(e,"input",n[8]),t=!0)},p(o,r){oi(e,l=pn(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&Ce(e,o[0])},d(o){o&&k(e),n[7](null),t=!1,i()}}}function FT(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=pt(a,r[u]);return{c(){e=_("div"),t=_("button"),t.innerHTML='<i class="ri-key-line"></i>',i=T(),s=_("input"),h(t,"type","button"),h(t,"class","btn btn-secondary btn-circle"),h(e,"class","form-field-addon"),oi(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=[Qe(Ct.call(null,t,{position:"left",text:"Set new value"})),X(t,"click",n[6])],l=!0)},p(u,f){oi(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,st(o)}}}function IT(n){let e;function t(l,o){return l[3]?FT:LT}let i=t(n),s=i(n);return{c(){s.c(),e=rt()},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:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function NT(n,e,t){const i=["value","mask"];let s=Kt(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await ai(),r==null||r.focus()}const f=()=>u();function c(p){he[p?"unshift":"push"](()=>{r=p,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=p=>{e=pt(pt({},e),ri(p)),t(5,s=Kt(e,i)),"value"in p&&t(0,l=p.value),"mask"in p&&t(1,o=p.mask)},n.$$.update=()=>{n.$$.dirty&3&&l===o&&t(3,a=!0)},[l,o,r,a,u,s,f,c,d]}class Wa extends Pe{constructor(e){super(),Ae(this,e,NT,IT,Ee,{value:0,mask:1})}}function RT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$,S,M,D,E,O,F,L,H,j,Q;i=new Le({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[jT,({uniqueId:B})=>({23:B}),({uniqueId:B})=>B?8388608:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[qT,({uniqueId:B})=>({23:B}),({uniqueId:B})=>B?8388608:0]},$$scope:{ctx:n}}}),a=new Le({props:{class:"form-field required",name:"meta.userVerificationUrl",$$slots:{default:[VT,({uniqueId:B})=>({23:B}),({uniqueId:B})=>B?8388608:0]},$$scope:{ctx:n}}}),f=new Le({props:{class:"form-field required",name:"meta.userResetPasswordUrl",$$slots:{default:[zT,({uniqueId:B})=>({23:B}),({uniqueId:B})=>B?8388608:0]},$
<br/>
<strong class="txt-bold">For better emails deliverability it is recommended to enable the SMTP settings
below.</strong></p>`,y=T(),z(C.$$.fragment),$=T(),ne&&ne.c(),S=T(),M=_("div"),D=_("div"),E=T(),O=_("button"),F=_("span"),F.textContent="Save changes",h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(e,"class","grid"),h(b,"class","content m-b-sm"),h(D,"class","flex-fill"),h(F,"class","txt"),h(O,"type","submit"),h(O,"class","btn btn-expanded"),O.disabled=L=!n[3]||n[2],ee(O,"btn-loading",n[2]),h(M,"class","flex")},m(B,K){w(B,e,K),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),q(a,e,null),m(e,u),q(f,e,null),m(e,c),q(d,e,null),w(B,p,K),w(B,g,K),w(B,v,K),w(B,b,K),w(B,y,K),q(C,B,K),w(B,$,K),ne&&ne.m(B,K),w(B,S,K),w(B,M,K),m(M,D),m(M,E),m(M,O),m(O,F),H=!0,j||(Q=X(O,"click",n[19]),j=!0)},p(B,K){const W={};K&25165825&&(W.$$scope={dirty:K,ctx:B}),i.$set(W);const J={};K&25165825&&(J.$$scope={dirty:K,ctx:B}),o.$set(J);const ie={};K&25165825&&(ie.$$scope={dirty:K,ctx:B}),a.$set(ie);const fe={};K&25165825&&(fe.$$scope={dirty:K,ctx:B}),f.$set(fe);const ye={};K&25165825&&(ye.$$scope={dirty:K,ctx:B}),d.$set(ye);const le={};K&25165825&&(le.$$scope={dirty:K,ctx:B}),C.$set(le),B[0].smtp.enabled?ne?(ne.p(B,K),K&1&&A(ne,1)):(ne=Cp(B),ne.c(),A(ne,1),ne.m(S.parentNode,S)):ne&&(De(),P(ne,1,1,()=>{ne=null}),Oe()),(!H||K&12&&L!==(L=!B[3]||B[2]))&&(O.disabled=L),K&4&&ee(O,"btn-loading",B[2])},i(B){H||(A(i.$$.fragment,B),A(o.$$.fragment,B),A(a.$$.fragment,B),A(f.$$.fragment,B),A(d.$$.fragment,B),A(C.$$.fragment,B),A(ne),H=!0)},o(B){P(i.$$.fragment,B),P(o.$$.fragment,B),P(a.$$.fragment,B),P(f.$$.fragment,B),P(d.$$.fragment,B),P(C.$$.fragment,B),P(ne),H=!1},d(B){B&&k(e),V(i),V(o),V(a),V(f),V(d),B&&k(p),B&&k(g),B&&k(v),B&&k(b),B&&k(y),V(C,B),B&&k($),ne&&ne.d(B),B&&k(S),B&&k(M),j=!1,Q()}}}function HT(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function jT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Sender name"),s=T(),l=_("input"),h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.senderName),r||(a=X(l,"input",n[8]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&h(e,"for",i),f&8388608&&o!==(o=u[23])&&h(l,"id",o),f&1&&l.value!==u[0].meta.senderName&&Ce(l,u[0].meta.senderName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function qT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Sender address"),s=T(),l=_("input"),h(e,"for",i=n[23]),h(l,"type","email"),h(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.senderAddress),r||(a=X(l,"input",n[9]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&h(e,"for",i),f&8388608&&o!==(o=u[23])&&h(l,"id",o),f&1&&l.value!==u[0].meta.senderAddress&&Ce(l,u[0].meta.senderAddress)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function VT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=R("User verification page url"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML=`Used in the user verification email. Available placeholder parameters:
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23]),l.required=!0,h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[0].meta.userVerificationUrl),w(c,r,d),w(c,a,d),u||(f=X(l,"input",n[10]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&h(e,"for",i),d&8388608&&o!==(o=c[23])&&h(l,"id",o),d&1&&l.value!==c[0].meta.userVerificationUrl&&Ce(l,c[0].meta.userVerificationUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function zT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=R("User reset password page url"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML=`Used in the user password reset email. Available placeholder parameters:
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23]),l.required=!0,h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[0].meta.userResetPasswordUrl),w(c,r,d),w(c,a,d),u||(f=X(l,"input",n[11]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&h(e,"for",i),d&8388608&&o!==(o=c[23])&&h(l,"id",o),d&1&&l.value!==c[0].meta.userResetPasswordUrl&&Ce(l,c[0].meta.userResetPasswordUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function BT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=R("User confirm email change page url"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML=`Used in the user email change confirmation email. Available placeholder
parameters:
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23]),l.required=!0,h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[0].meta.userConfirmEmailChangeUrl),w(c,r,d),w(c,a,d),u||(f=X(l,"input",n[12]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&h(e,"for",i),d&8388608&&o!==(o=c[23])&&h(l,"id",o),d&1&&l.value!==c[0].meta.userConfirmEmailChangeUrl&&Ce(l,c[0].meta.userConfirmEmailChangeUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function UT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Use SMTP mail server"),h(e,"type","checkbox"),h(e,"id",t=n[23]),e.required=!0,h(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[0].smtp.enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[13]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&h(e,"id",t),f&1&&(e.checked=u[0].smtp.enabled),f&8388608&&o!==(o=u[23])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Cp(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$;return i=new Le({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[WT,({uniqueId:S})=>({23:S}),({uniqueId:S})=>S?8388608:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[YT,({uniqueId:S})=>({23:S}),({uniqueId:S})=>S?8388608:0]},$$scope:{ctx:n}}}),u=new Le({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[KT,({uniqueId:S})=>({23:S}),({uniqueId:S})=>S?8388608:0]},$$scope:{ctx:n}}}),d=new Le({props:{class:"form-field",name:"smtp.username",$$slots:{default:[ZT,({uniqueId:S})=>({23:S}),({uniqueId:S})=>S?8388608:0]},$$scope:{ctx:n}}}),v=new Le({props:{class:"form-field",name:"smtp.password",$$slots:{default:[JT,({uniqueId:S})=>({23:S}),({uniqueId:S})=>S?8388608:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),f=T(),c=_("div"),z(d.$$.fragment),p=T(),g=_("div"),z(v.$$.fragment),b=T(),y=_("div"),h(t,"class","col-lg-6"),h(l,"class","col-lg-3"),h(a,"class","col-lg-3"),h(c,"class","col-lg-6"),h(g,"class","col-lg-6"),h(y,"class","col-lg-12"),h(e,"class","grid")},m(S,M){w(S,e,M),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),m(e,f),m(e,c),q(d,c,null),m(e,p),m(e,g),q(v,g,null),m(e,b),m(e,y),$=!0},p(S,M){const D={};M&25165825&&(D.$$scope={dirty:M,ctx:S}),i.$set(D);const E={};M&25165825&&(E.$$scope={dirty:M,ctx:S}),o.$set(E);const O={};M&25165825&&(O.$$scope={dirty:M,ctx:S}),u.$set(O);const F={};M&25165825&&(F.$$scope={dirty:M,ctx:S}),d.$set(F);const L={};M&25165825&&(L.$$scope={dirty:M,ctx:S}),v.$set(L)},i(S){$||(A(i.$$.fragment,S),A(o.$$.fragment,S),A(u.$$.fragment,S),A(d.$$.fragment,S),A(v.$$.fragment,S),S&&Dt(()=>{C||(C=ut(e,xt,{duration:150},!0)),C.run(1)}),$=!0)},o(S){P(i.$$.fragment,S),P(o.$$.fragment,S),P(u.$$.fragment,S),P(d.$$.fragment,S),P(v.$$.fragment,S),S&&(C||(C=ut(e,xt,{duration:150},!1)),C.run(0)),$=!1},d(S){S&&k(e),V(i),V(o),V(u),V(d),V(v),S&&C&&C.end()}}}function WT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("SMTP server host"),s=T(),l=_("input"),h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].smtp.host),r||(a=X(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&h(e,"for",i),f&8388608&&o!==(o=u[23])&&h(l,"id",o),f&1&&l.value!==u[0].smtp.host&&Ce(l,u[0].smtp.host)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function YT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Port"),s=T(),l=_("input"),h(e,"for",i=n[23]),h(l,"type","number"),h(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].smtp.port),r||(a=X(l,"input",n[15]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&h(e,"for",i),f&8388608&&o!==(o=u[23])&&h(l,"id",o),f&1&&Ot(l.value)!==u[0].smtp.port&&Ce(l,u[0].smtp.port)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function KT(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[23],items:n[5]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new rs({props:u}),he.push(()=>Ie(
the
`),r=_("strong"),u=R(a),f=R(`
to the
`),c=_("strong"),p=R(d),g=R(`.
`),v=_("br"),b=R(`
There are numerous command line tools that can help you, such as:
`),y=_("a"),y.textContent=`rclone
`,C=R(`,
`),$=_("a"),$.textContent=`s5cmd
`,S=R(", etc."),M=T(),D=_("div"),h(i,"class","icon"),h(y,"href","https://github.com/rclone/rclone"),h(y,"target","_blank"),h(y,"rel","noopener"),h(y,"class","txt-bold"),h($,"href","https://github.com/peak/s5cmd"),h($,"target","_blank"),h($,"rel","noopener"),h($,"class","txt-bold"),h(l,"class","content"),h(t,"class","alert alert-warning m-0"),h(D,"class","clearfix m-t-base")},m(F,L){w(F,e,L),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,p),m(l,g),m(l,v),m(l,b),m(l,y),m(l,C),m(l,$),m(l,S),m(e,M),m(e,D),O=!0},p(F,L){(!O||L&8)&&a!==(a=F[3]?"S3 storage":"local file system")&&me(u,a),(!O||L&1)&&d!==(d=F[0].enabled?"S3 storage":"local file system")&&me(p,d)},i(F){O||(F&&Dt(()=>{E||(E=ut(e,xt,{duration:150},!0)),E.run(1)}),O=!0)},o(F){F&&(E||(E=ut(e,xt,{duration:150},!1)),E.run(0)),O=!1},d(F){F&&k(e),F&&E&&E.end()}}}function Tp(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$,S,M,D;return i=new Le({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[nD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[iD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),u=new Le({props:{class:"form-field required",name:"s3.region",$$slots:{default:[sD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),d=new Le({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[lD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),v=new Le({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[oD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),C=new Le({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[rD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),f=T(),c=_("div"),z(d.$$.fragment),p=T(),g=_("div"),z(v.$$.fragment),b=T(),y=_("div"),z(C.$$.fragment),$=T(),S=_("div"),h(t,"class","col-lg-12"),h(l,"class","col-lg-6"),h(a,"class","col-lg-6"),h(c,"class","col-lg-6"),h(g,"class","col-lg-6"),h(y,"class","col-lg-12"),h(S,"class","col-lg-12"),h(e,"class","grid")},m(E,O){w(E,e,O),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),m(e,f),m(e,c),q(d,c,null),m(e,p),m(e,g),q(v,g,null),m(e,b),m(e,y),q(C,y,null),m(e,$),m(e,S),D=!0},p(E,O){const F={};O&1572865&&(F.$$scope={dirty:O,ctx:E}),i.$set(F);const L={};O&1572865&&(L.$$scope={dirty:O,ctx:E}),o.$set(L);const H={};O&1572865&&(H.$$scope={dirty:O,ctx:E}),u.$set(H);const j={};O&1572865&&(j.$$scope={dirty:O,ctx:E}),d.$set(j);const Q={};O&1572865&&(Q.$$scope={dirty:O,ctx:E}),v.$set(Q);const ne={};O&1572865&&(ne.$$scope={dirty:O,ctx:E}),C.$set(ne)},i(E){D||(A(i.$$.fragment,E),A(o.$$.fragment,E),A(u.$$.fragment,E),A(d.$$.fragment,E),A(v.$$.fragment,E),A(C.$$.fragment,E),E&&Dt(()=>{M||(M=ut(e,xt,{duration:150},!0)),M.run(1)}),D=!0)},o(E){P(i.$$.fragment,E),P(o.$$.fragment,E),P(u.$$.fragment,E),P(d.$$.fragment,E),P(v.$$.fragment,E),P(C.$$.fragment,E),E&&(M||(M=ut(e,xt,{duration:150},!1)),M.run(0)),D=!1},d(E){E&&k(e),V(i),V(o),V(u),V(d),V(v),V(C),E&&M&&M.end()}}}function nD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Endpoint"),s=T(),l=_("input"),h(e,"for",i=n[19]),h(l,"type","text"),h(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),Ce(l,n[0].endpoint),r||(a=X(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&h(e,"for",i),f&524288&&o!==(o=u[19])&&h(l,"id",o),f&1&&l.value!==u[0].endpoint&&Ce(l,u[0].endpoint)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function iD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Bucket"),s=T(),l=_("input"),h(e,"for",i=n[19]),h(l,"type","text"),h(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),Ce(l,n[0].bucket),r||(a=X(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&h(e,"for",i),f&524288&&o!==(o=u[19])&&h(l,"id",o),f&1&&l.value!==u[0].bucket&&Ce(l,u[0].bucket)},d(
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,g=T(),b.c(),h(o,"class","breadcrumb-item"),h(a,"class","breadcrumb-item"),h(l,"class","breadcrumbs"),h(s,"class","page-header"),h(p,"class","content txt-xl m-b-base"),h(d,"class","panel"),h(d,"autocomplete","off"),h(c,"class","wrapper"),h(i,"class","page-wrapper")},m(E,O){q(e,E,O),w(E,t,O),w(E,i,O),m(i,s),m(s,l),m(l,o),m(l,r),m(l,a),m(a,u),m(i,f),m(i,c),m(c,d),m(d,p),m(d,g),M[v].m(d,null),y=!0,C||($=X(d,"submit",Bt(n[16])),C=!0)},p(E,[O]){(!y||O&32)&&me(u,E[5]);let F=v;v=D(E),v===F?M[v].p(E,O):(De(),P(M[F],1,1,()=>{M[F]=null}),Oe(),b=M[v],b?b.p(E,O):(b=M[v]=S[v](E),b.c()),A(b,1),b.m(d,null))},i(E){y||(A(e.$$.fragment,E),A(b),y=!0)},o(E){P(e.$$.fragment,E),P(b),y=!1},d(E){V(e,E),E&&k(t),E&&k(i),M[v].d(),C=!1,$()}}}function uD(n,e,t){let i,s;At(n,Zt,D=>t(5,s=D)),bn(Zt,s="Files storage",s);let l={},o=!1,r=!1,a="",u=!1;f();async function f(){t(1,o=!0);try{const D=await we.Settings.getAll()||{};d(D)}catch(D){we.errorResponseHandler(D)}t(1,o=!1)}async function c(){if(!(r||!i)){t(2,r=!0);try{const D=await we.Settings.update(Y.filterRedactedProps({s3:l}));d(D),Ii({}),hn("Successfully saved Files storage settings.")}catch(D){we.errorResponseHandler(D)}t(2,r=!1)}}function d(D={}){t(0,l=(D==null?void 0:D.s3)||{}),t(3,u=l.enabled),t(7,a=JSON.stringify(l))}function p(){l.enabled=this.checked,t(0,l)}function g(){l.endpoint=this.value,t(0,l)}function v(){l.bucket=this.value,t(0,l)}function b(){l.region=this.value,t(0,l)}function y(){l.accessKey=this.value,t(0,l)}function C(D){n.$$.not_equal(l.secret,D)&&(l.secret=D,t(0,l))}function $(){l.forcePathStyle=this.checked,t(0,l)}const S=()=>c(),M=()=>c();return n.$$.update=()=>{n.$$.dirty&129&&t(4,i=a!=JSON.stringify(l))},[l,o,r,u,i,s,c,a,p,g,v,b,y,C,$,S,M]}class fD extends Pe{constructor(e){super(),Ae(this,e,uD,aD,Ee,{})}}function cD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[16]),h(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])&&h(e,"id",t),f&1&&(e.checked=u[0].enabled),f&65536&&o!==(o=u[16])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Dp(n){let e,t,i,s,l,o,r,a,u,f,c;return i=new Le({props:{class:"form-field required",name:"emailPassword.minPasswordLength",$$slots:{default:[dD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field "+(Y.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailPassword.exceptDomains",$$slots:{default:[hD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),u=new Le({props:{class:"form-field "+(Y.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailPassword.onlyDomains",$$slots:{default:[pD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),h(t,"class","col-sm-12 m-t-sm"),h(l,"class","col-lg-6"),h(a,"class","col-lg-6"),h(e,"class","grid")},m(d,p){w(d,e,p),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),c=!0},p(d,p){const g={};p&196609&&(g.$$scope={dirty:p,ctx:d}),i.$set(g);const v={};p&1&&(v.class="form-field "+(Y.isEmpty(d[0].onlyDomains)?"":"disabled")),p&196609&&(v.$$scope={dirty:p,ctx:d}),o.$set(v);const b={};p&1&&(b.class="form-field "+(Y.isEmpty(d[0].exceptDomains)?"":"disabled")),p&196609&&(b.$$scope={dirty:p,ctx:d}),u.$set(b)},i(d){c||(A(i.$$.fragment,d),A(o.$$.fragment,d),A(u.$$.fragment,d),d&&Dt(()=>{f||(f=ut(e,xt,{duration:150},!0)),f.run(1)}),c=!0)},o(d){P(i.$$.fragment,d),P(o.$$.fragment,d),P(u.$$.fragment,d),d&&(f||(f=ut(e,xt,{duration:150},!1)),f.run(0)),c=!1},d(d){d&&k(e),V(i),V(o),V(u),d&&f&&f.end()}}}function dD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Minimum password length"),s=T(),l=_("input"),h(e,"for",i=n[16]),h(l,"type","number"),h(l,"id",o=n[16]),l.required=!0,h(l,"min","5"),h(l,"max","200")},m(u,f){w(u,e,f)
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&65536&&l!==(l=b[16]))&&h(e,"for",l);const C={};y&65536&&(C.id=b[16]),y&1&&(C.disabled=!Y.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,C.value=b[0].exceptDomains,He(()=>a=!1)),r.$set(C)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function pD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[11](b)}let v={id:n[16]+".config.onlyDomains",disabled:!Y.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new as({props:v}),he.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[16]+".config.onlyDomains"),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=Qe(Ct.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"))&&h(e,"for",l);const C={};y&65536&&(C.id=b[16]+".config.onlyDomains"),y&1&&(C.disabled=!Y.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,C.value=b[0].onlyDomains,He(()=>a=!1)),r.$set(C)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function mD(n){let e,t,i,s;e=new Le({props:{class:"form-field form-field-toggle m-b-0",name:"emailPassword.enabled",$$slots:{default:[cD,({uniqueId:o})=>({16:o}),({uniqueId:o})=>o?65536:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&Dp(n);return{c(){z(e.$$.fragment),t=T(),l&&l.c(),i=rt()},m(o,r){q(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=Dp(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(De(),P(l,1,1,()=>{l=null}),Oe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){V(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function gD(n){let e;return{c(){e=_("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function _D(n){let e;return{c(){e=_("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Op(n){let e,t,i,s,l;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Qe(Ct.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Dt(()=>{t||(t=ut(e,zn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=ut(e,zn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function bD(n){let e,t,i,s,l,o,r;function a(d,p){return d[0].enabled?_D:gD}let u=a(n),f=u(n),c=n[2]&&Op();return{c(){e=_("div"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Email/Password</span>`,t=T(),f.c(),i=T(),s=_("div"),l=T(),c&&c.c(),o=rt(),h(e,"class","inline-flex"),h(s,"class","flex-fill")},m(d,p){w(d,e,p),w(d,t,p),f.m(d,p),w(d,i,p),w(d,s,p),w(d,l,p),c&&c.m(d,p),w(d,o,p),r=!0},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(i.parentNode,i))),d[2]?c?p&4&&A(c,1):(c=Op(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(De(),P(c,1,1,()=>{c=null}),Oe())},i(d){r||(A(c),r=!0)},o(d){P(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 vD(n){let e,t;const i=[n[3]];let s={$$slots:{header:[bD],default:[mD]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=pt(s,i[l]);return e=new za({props:s}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){z(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,[o]){const r=o&8?pn(i,[ui(l[3])]):{};o&131077&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[12](null),V(e,l)}}}function yD(n,e,t){let i;const s=["config","expand","collapse","collapseSiblings"];let l=Kt(e,s),o;At(n,ss,S=>t(7,o=S));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 p(){r.minPasswordLength=Ot(this.value),t(0,r)}function g(S){n.$$.not_equal(r.exceptDomains,S)&&(r.exceptDomains=S,t(0,r))}function v(S){n.$$.not_equal(r.onlyDomains,S)&&(r.onlyDomains=S,t(0,r))}function b(S){he[S?"unshift":"push"](()=>{a=S,t(1,a)})}function y(S){ht.call(this,n,S)}function C(S){ht.call(this,n,S)}function $(S){ht.call(this,n,S)}return n.$$set=S=>{e=pt(pt({},e),ri(S)),t(3,l=Kt(e,s)),"config"in S&&t(0,r=S.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!Y.isEmpty(o==null?void 0:o.emailPassword))},[r,a,i,l,u,f,c,o,d,p,g,v,b,y,C,$]}class kD extends Pe{constructor(e){super(),Ae(this,e,yD,vD,Ee,{config:0,expand:4,collapse:5,collapseSiblings:6})}get expand(){return this.$$.ctx[4]}get collapse(){return this.$$.ctx[5]}get collapseSiblings(){return this.$$.ctx[6]}}function wD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[22]),h(s,"for",o=n[22])},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[11]),r=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&h(e,"id",t),f&1&&(e.checked=u[0].enabled),f&4194304&&o!==(o=u[22])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Ep(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g;l=new Le({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[SD,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),a=new Le({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[$D,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),c=new Le({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[CD,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}});let v=n[4]&&Ap(n);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),z(l.$$.fragment),o=T(),r=_("div"),z(a.$$.fragment),u=T(),f=_("div"),z(c.$$.fragment),d=T(),v&&v.c(),h(t,"class","col-12 spacing"),h(s,"class","col-lg-6"),h(r,"class","col-lg-6"),h(f,"class","col-lg-12"),h(e,"class","grid")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),q(l,s,null),m(e,o),m(e,r),q(a,r,null),m(e,u),m(e,f),q(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&12582913&&(C.$$scope={dirty:y,ctx:b}),l.$set(C);const $={};y&2&&($.name=b[1]+".clientSecret"),y&12582913&&($.$$scope={dirty:y,ctx:b}),a.$set($);const S={};y&2&&(S.name=b[1]+".allowRegistrations"),y&12582913&&(S.$$scope={dirty:y,ctx:b}),c.$set(S),b[4]?v?(v.p(b,y),y&16&&A(v,1)):(v=Ap(b),v.c(),A(v,1),v.m(e,null)):v&&(De(),P(v,1,1,()=>{v=null}),Oe())},i(b){g||(A(l.$$.fragment,b),A(a.$$.fragment,b),A(c.$$.fragment,b),A(v),b&&Dt(()=>{p||(p=ut(e,xt,{duration:200},!0)),p.run(1)}),g=!0)},o(b){P(l.$$.fragment,b),P(a.$$.fragment,b),P(c.$$.fragment,b),P(v),b&&(p||(p=ut(e,xt,{duration:200},!1)),p.run(0)),g=!1},d(
<span class="txt">Manage admins</span>`,t=T(),i=_("hr"),s=T(),l=_("div"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,h(e,"href","/settings/admins"),h(e,"class","dropdown-item closable"),h(l,"tabindex","0"),h(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=[Qe($n.call(null,e)),X(l,"click",n[6])],o=!0)},p:oe,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),o=!1,st(r)}}}function oO(n){var p;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=Y.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((p=n[0])==null?void 0:p.id)&&n[1]&&Hp(n);return o=new R_({props:{routes:YD}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new xD({}),f=new sO({}),{c(){t=T(),i=_("div"),d&&d.c(),s=T(),l=_("div"),z(o.$$.fragment),r=T(),z(a.$$.fragment),u=T(),z(f.$$.fragment),h(l,"class","app-body"),h(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),q(o,l,null),w(g,r,v),q(a,g,v),w(g,u,v),q(f,g,v),c=!0},p(g,[v]){var b;(!c||v&12)&&e!==(e=Y.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=Hp(g),d.c(),A(d,1),d.m(i,s)):d&&(De(),P(d,1,1,()=>{d=null}),Oe())},i(g){c||(A(d),A(o.$$.fragment,g),A(a.$$.fragment,g),A(f.$$.fragment,g),c=!0)},o(g){P(d),P(o.$$.fragment,g),P(a.$$.fragment,g),P(f.$$.fragment,g),c=!1},d(g){g&&k(t),g&&k(i),d&&d.d(),V(o),g&&k(r),V(a,g),g&&k(u),V(f,g)}}}function rO(n,e,t){let i,s,l;At(n,_o,d=>t(2,i=d)),At(n,ba,d=>t(0,s=d)),At(n,Zt,d=>t(3,l=d));let o,r=!1;function a(d){var p,g,v,b;((p=d==null?void 0:d.detail)==null?void 0:p.location)!==o&&(t(1,r=!!((v=(g=d==null?void 0:d.detail)==null?void 0:g.userData)!=null&&v.showAppSidebar)),o=(b=d==null?void 0:d.detail)==null?void 0:b.location,bn(Zt,l="",l),Ii({}),u_())}function u(){Ms("/")}async function f(){var d;if(!!(s!=null&&s.id))try{const p=await we.Settings.getAll({$cancelKey:"loadAppName"});bn(_o,i=((d=p==null?void 0:p.meta)==null?void 0:d.appName)||"",i)}catch(p){console.warn("Failed to load app name.",p)}}function c(){we.logout()}return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&f()},[s,r,i,l,a,u,c]}class aO extends Pe{constructor(e){super(),Ae(this,e,rO,oO,Ee,{})}}new aO({target:document.getElementById("app")});export{st as A,hn as B,Y as C,Ms as D,rt as E,fg as F,At as G,Cs as H,un as I,An as J,Yn as K,he as L,Pe as S,P as a,T as b,z as c,V as d,_ as e,h as f,w as g,m as h,Ae as i,Qe as j,De as k,$n as l,q as m,Oe as n,k as o,we as p,Le as q,ee as r,Ee as s,A as t,X as u,Bt as v,R as w,me as x,oe as y,Ce as z};