pocketbase/ui/dist/assets/index.42f4af63.js

634 lines
801 KiB
JavaScript
Raw Normal View History

2022-08-09 22:17:13 +08:00
const b_=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)}};b_();function le(){}const hl=n=>n;function pt(n,e){for(const t in e)n[t]=e[t];return n}function qh(n){return n()}function Ka(){return Object.create(null)}function Qe(n){n.forEach(qh)}function Un(n){return typeof n=="function"}function De(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Al;function Gn(n,e){return Al||(Al=document.createElement("a")),Al.href=e,n===Al.href}function v_(n){return Object.keys(n).length===0}function Vh(n,...e){if(n==null)return le;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function kt(n,e,t){n.$$.on_destroy.push(Vh(e,t))}function yn(n,e,t,i){if(n){const s=zh(n,e,t,i);return n[0](s)}}function zh(n,e,t,i){return n[1]&&i?pt(t.ctx.slice(),n[1](i(e))):t.ctx}function kn(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 wn(n,e,t,i,s,l){if(s){const o=zh(e,t,i,l);n.p(o,s)}}function $n(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 fi(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Jt(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 Za(n){return n==null?"":n}function fn(n,e,t){return n.set(t),e}function Ye(n){return n&&Un(n.destroy)?n.destroy:le}const Bh=typeof window<"u";let Po=Bh?()=>window.performance.now():()=>Date.now(),sa=Bh?n=>requestAnimationFrame(n):le;const gs=new Set;function Uh(n){gs.forEach(e=>{e.c(n)||(gs.delete(e),e.f())}),gs.size!==0&&sa(Uh)}function Lo(n){let e;return gs.size===0&&sa(Uh),{promise:new Promise(t=>{gs.add(e={c:n,f:t})}),abort(){gs.delete(e)}}}function m(n,e){n.appendChild(e)}function Wh(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function y_(n){const e=_("style");return k_(Wh(n),e),e.sheet}function k_(n,e){m(n.head||n,e)}function k(n,e,t){n.insertBefore(e,t||null)}function y(n){n.parentNode.removeChild(n)}function Xn(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function _(n){return document.createElement(n)}function N(n){return document.createTextNode(n)}function T(){return N(" ")}function Xe(){return N("")}function G(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Yt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Qn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function Yh(n){return function(e){e.target===this&&n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function ai(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:p(n,i,e[i])}function At(n){return n===""?null:+n}function w_(n){return Array.from(n.childNodes)}function pe(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Me(n,e){n.value=e==null?"":e}function Ja(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function ne(n,e,t){n.classList[t?"add":"remove"](e)}function Kh(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 w=e+(t-e)*l(b);u+=b*100+`%{${o(w,1-w)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${$_(f)}_${r}`,d=Wh(n),{stylesheet:h,rules:g}=ro.get(d)||S_(d,n);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${c} ${i}ms linear ${s}ms 1 both`,ao+=1,c}function ll(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(", "),ao-=s,ao||C_())}function C_(){sa(()=>{ao||(ro.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),ro.clear())})}function M_(n,e,t,i){if(!e)return le;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return le;const{delay:l=0,duration:o=300,easing:r=hl,start:a=Po()+l,end:u=a+o,tick:f=le,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,g;function v(){c&&(g=sl(n,0,1,o,l,r,c)),l||(h=!0)}function b(){c&&ll(n,g),d=!1}return Lo(w=>{if(!h&&w>=a&&(h=!0),h&&w>=u&&(f(1,0),b()),!d)return!1;if(h){const C=w-a,S=0+1*r(C/o);f(S,1-S)}return!0}),v(),f(0,1),b}function T_(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,Zh(n,s)}}function Zh(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 ol;function Js(n){ol=n}function Fo(){if(!ol)throw new Error("Function called outside component initialization");return ol}function Wn(n){Fo().$$.on_mount.push(n)}function D_(n){Fo().$$.after_update.push(n)}function O_(n){Fo().$$.on_destroy.push(n)}function ln(){const n=Fo();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=Kh(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function ut(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Us=[],he=[],to=[],Mr=[],Jh=Promise.resolve();let Tr=!1;function Gh(){Tr||(Tr=!0,Jh.then(Xh))}function ei(){return Gh(),Jh}function Dt(n){to.push(n)}function He(n){Mr.push(n)}const Xo=new Set;let Pl=0;function Xh(){const n=ol;do{for(;Pl<Us.length;){const e=Us[Pl];Pl++,Js(e),E_(e.$$)}for(Js(null),Us.length=0,Pl=0;he.length;)he.pop()();for(let e=0;e<to.length;e+=1){const t=to[e];Xo.has(t)||(Xo.add(t),t())}to.length=0}while(Us.length);for(;Mr.length;)Mr.pop()();Tr=!1,Xo.clear(),Js(n)}function E_(n){if(n.fragment!==null){n.update(),Qe(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(Kh(`${e?"intro":"outro"}${t}`))}const no=new Set;let si;function Pe(){si={r:0,c:[],p:si}}function Le(){si.r||Qe(si.c),si=si.p}function E(n,e){n&&n.i&&(no.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(no.has(n))return;no.add(n),si.c.push(()=>{no.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const oa={duration:0};function Qh(n,e,t){let i=e(n,t),s=!1,l,o,r=0;function a(){l&&ll(n,l)}function u(){const{delay:c=0,duration:d=300,easing:h=hl,tick:g=le,css:v}=i||oa;v&&(l=sl(n,0,1,d,c,h,v,r++)),g(0,1);const b=Po()+c,w=b+d;o&&o.abort(),s=!0,Dt(()=>Qi(n,!0,"start")),o=Lo(C=>{if(s){if(C>=w)return g(1,0),Qi(n,!0,"end"),a(),s=!1;if(C>=b){const S=h((C-b)/d);g(S,1-S)}}return s})}let f=!1;return{start(){f||(f=!0,ll(n),Un(i)?(i=i(),la().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function xh(n,e,t){let i=e(n,t),s=!0,l;const o=si;o.r+=1;function r(){const{delay:a=0,duration:u=300,easing:f=hl,tick:c=le,css:d}=i||oa;d&&(l=sl(n,1,0,u,a,f,d));const h=Po()+a,g=h+u;Dt(()=>Qi(n,!1,"start")),Lo(v=>{if(s){if(v>=g)return c(0,1),Qi(n,!1,"end"),--o.r||Qe(o.c),!1;if(v>=h){const b=f((v-h)/u);c(1-b,b)}}return s})}return Un(i)?la().then(()=>{i=i(),r()}):r(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&ll(n,l),s=!1)}}}function rt(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"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){k(s,e,l),k(s,t,l),k(s,i,l)},d(s){s&&y(e),s&&y(t),s&&y(i)}}}function e1(n){let e,t,i,s=!n[0]&&Tu();const l=n[1].default,o=yn(l,n,n[2],null);return{c(){e=_("div"),s&&s.c(),t=T(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){k(r,e,a),s&&s.m(e,null),m(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Tu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&wn(o,l,r,r[2],i?kn(l,r[2],a,null):$n(r[2]),null)},i(r){i||(E(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&y(e),s&&s.d(),o&&o.d(r)}}}function t1(n){let e,t;return e=new Cn({props:{class:"full-page",center:!0,$$slots:{default:[e1]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function n1(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class ug extends Ee{constructor(e){super(),Oe(this,e,n1,t1,De,{nobranding:0})}}function Du(n,e,t){const i=n.slice();return i[11]=e[t],i}const i1=n=>({}),Ou=n=>({uniqueId:n[3]});function s1(n){let e=(n[11]||go)+"",t;return{c(){t=N(e)},m(i,s){k(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||go)+"")&&pe(t,e)},d(i){i&&y(t)}}}function l1(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=N(e)},m(l,o){k(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)+"")&&pe(t,e)},d(l){l&&y(t)}}}function Eu(n){let e,t;function i(o,r){return typeof o[11]=="object"?l1:s1}let s=i(n),l=s(n);return{c(){e=_("div"),l.c(),t=T(),p(e,"class","help-block help-block-error")},m(o,r){k(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&&y(e),l.d()}}}function o1(n){let e,t,i,s,l;const o=n[7].default,r=yn(o,n,n[6],Ou);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=Eu(Du(n,a,f));return{c(){e=_("div"),r&&r.c(),t=T();for(let f=0;f<u.length;f+=1)u[f].c();p(e,"class",n[0]),ne(e,"error",n[2].length)},m(f,c){k(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=G(e,"click",n[8]),s=!0)},p(f,[c]){if(r&&r.p&&(!i||c&64)&&wn(r,o,f,f[6],i?kn(o,f[6],c,i1):$n(f[6]),Ou),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const h=Du(f,a,d);u[d]?u[d].p(h,c):(u[d]=Eu(h),u[d].c(),u[d].m(e,null))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}(!i||c&1)&&p(e,"class",f[0]),c&5&&ne(e,"error",f[2].length)},i(f){i||(E(r,f),i=!0)},o(f){P(r,f),i=!1},d(f){f&&y(e),r&&r.d(f),Xn(u,f),n[9](null),s=!1,l()}}}const go="Invalid value";function r1(n,e,t){let i;kt(n,os,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(){ag(r)}Wn(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(g){ut.call(this,n,g)}function h(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,h]}class Ne extends Ee{constructor(e){super(),Oe(this,e,r1,o1,De,{name:4,class:0})}}function a1(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Email"),s=T(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){k(u,e,f),m(e,t),k(u,s,f),k(u,l,f),Me(l,n[0]),l.focus(),r||(a=G(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&Me(l,u[0])},d(u){u&&y(e),u&&y(s),u&&y(l),r=!1,a()}}}function u1(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=N("Password"),s=T(),l=_("input"),r=T(),a=_("div"),a.textContent="Mi
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),ne(f,"btn-disabled",n[3]),ne(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(g,v){k(g,e,v),m(e,t),m(e,i),j(s,e,null),m(e,l),j(o,e,null),m(e,r),j(a,e,null),m(e,u),m(e,f),c=!0,d||(h=G(e,"submit",Yt(n[4])),d=!0)},p(g,[v]){const b={};v&1537&&(b.$$scope={dirty:v,ctx:g}),s.$set(b);const w={};v&1538&&(w.$$scope={dirty:v,ctx:g}),o.$set(w);const C={};v&1540&&(C.$$scope={dirty:v,ctx:g}),a.$set(C),v&8&&ne(f,"btn-disabled",g[3]),v&8&&ne(f,"btn-loading",g[3])},i(g){c||(E(s.$$.fragment,g),E(o.$$.fragment,g),E(a.$$.fragment,g),c=!0)},o(g){P(s.$$.fragment,g),P(o.$$.fragment,g),P(a.$$.fragment,g),c=!1},d(g){g&&y(e),q(s),q(o),q(a),d=!1,h()}}}function d1(n,e,t){const i=ln();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await _e.admins.create({email:s,password:l,passwordConfirm:o}),await _e.admins.authViaEmail(s,l),i("submit")}catch(d){_e.errorResponseHandler(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class p1 extends Ee{constructor(e){super(),Oe(this,e,d1,c1,De,{})}}function Au(n){let e,t;return e=new ug({props:{$$slots:{default:[h1]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function h1(n){let e,t;return e=new p1({}),e.$on("submit",n[1]),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p:le,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function m1(n){let e,t,i=n[0]&&Au(n);return{c(){i&&i.c(),e=Xe()},m(s,l){i&&i.m(s,l),k(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&E(i,1)):(i=Au(s),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(Pe(),P(i,1,1,()=>{i=null}),Le())},i(s){t||(E(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&y(e)}}}function g1(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){_e.logout(!1),t(0,i=!0);return}_e.authStore.isValid?ki("/collections"):_e.logout()}return[i,async()=>{t(0,i=!1),await ei(),window.location.search=""}]}class _1 extends Ee{constructor(e){super(),Oe(this,e,g1,m1,De,{})}}const Rt=ti(""),_o=ti("");function Vo(n){const e=n-1;return e*e*e+1}function bo(n,{delay:e=0,duration:t=400,easing:i=hl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function qn(n,{delay:e=0,duration:t=400,easing:i=Vo,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 en(n,{delay:e=0,duration:t=400,easing:i=Vo}={}){const s=getComputedStyle(n),l=+s.opacity,o=parseFloat(s.height),r=parseFloat(s.paddingTop),a=parseFloat(s.paddingBottom),u=parseFloat(s.marginTop),f=parseFloat(s.marginBottom),c=parseFloat(s.borderTopWidth),d=parseFloat(s.borderBottomWidth);return{delay:e,duration:t,easing:i,css:h=>`overflow: hidden;opacity: ${Math.min(h*20,1)*l};height: ${h*o}px;padding-top: ${h*r}px;padding-bottom: ${h*a}px;margin-top: ${h*u}px;margin-bottom: ${h*f}px;border-top-width: ${h*c}px;border-bottom-width: ${h*d}px;`}}function Vn(n,{delay:e=0,duration:t=400,easing:i=Vo,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 b1(n){let e,t,i,s;return{c(){e=_("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){k(l,e,o),n[13](e),Me(e,n[7]),i||(s=G(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&Me(e,l[7])},i:le,o:le,d(l){l&&y(e),n[13](null),i=!1,s()}}}function v1(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(()=>Re(e,"value",l)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=Xe()},m(a,u){e&&j(e,a,u),k(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){Pe();const c=e;P(c.$$.fragment,1,0,()=>{q(c,1)}),Le()}o?(e=new o(r(a)),he.push(()=>Re(e,"value",l)),e.$on("submit",a[10]),V(e.$$.fragment),E(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&E(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&y(i),e&&q(e,a)}}}function Pu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Lu();return{c(){r&&r.c(),e=T(),t=_("button"),t.innerHTML='<span class="txt">Clear</span>',p(t,"type","button"),p(t,"class","btn btn-secondary btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),k(a,e,u),k(a,t,u),s=!0,l||(o=G(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&E(r,1):(r=Lu(),r.c(),E(r,1),r.m(e.parentNode,e)):r&&(Pe(),P(r,1,1,()=>{r=null}),Le())},i(a){s||(E(r),a&&Dt(()=>{i||(i=rt(t,qn,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),a&&(i||(i=rt(t,qn,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&y(e),a&&y(t),a&&i&&i.end(),l=!1,o()}}}function Lu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){k(s,e,l),i=!0},i(s){i||(s&&Dt(()=>{t||(t=rt(e,qn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=rt(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&y(e),s&&t&&t.end()}}}function y1(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[v1,b1],h=[];function g(b,w){return b[4]&&!b[5]?0:1}o=g(n),r=h[o]=d[o](n);let v=(n[0].length||n[7].length)&&Pu(n);return{c(){e=_("div"),t=_("form"),i=_("label"),s=_("i"),l=T(),r.c(),a=T(),v&&v.c(),p(s,"class","ri-search-line"),p(i,"for",n[8]),p(i,"class","m-l-10 txt-xl"),p(t,"class","searchbar"),p(e,"class","searchbar-wrapper")},m(b,w){k(b,e,w),m(e,t),m(t,i),m(i,s),m(t,l),h[o].m(t,null),m(t,a),v&&v.m(t,null),u=!0,f||(c=[G(t,"submit",Yt(n[10])),G(e,"click",Qn(n[11]))],f=!0)},p(b,[w]){let C=o;o=g(b),o===C?h[o].p(b,w):(Pe(),P(h[C],1,1,()=>{h[C]=null}),Le(),r=h[o],r?r.p(b,w):(r=h[o]=d[o](b),r.c()),E(r,1),r.m(t,a)),b[0].length||b[7].length?v?(v.p(b,w),w&129&&E(v,1)):(v=Pu(b),v.c(),E(v,1),v.m(t,null)):v&&(Pe(),P(v,1,1,()=>{v=null}),Le())},i(b){u||(E(r),E(v),u=!0)},o(b){P(r),P(v),u=!1},d(b){b&&y(e),h[o].d(),v&&v.d(),f=!1,Qe(c)}}}function k1(n,e,t){const i=ln(),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 h(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function v(){u||f||(t(5,f=!0),t(4,u=(await Ji(()=>import("./FilterAutocompleteInput.413a6b0b.js"),[],import.meta.url)).default),t(5,f=!1))}Wn(()=>{v()});function b(M){ut.call(this,n,M)}function w(M){d=M,t(7,d),t(0,l)}function C(M){he[M?"unshift":"push"](()=>{c=M,t(6,c)})}function S(){d=this.value,t(7,d),t(0,l)}const $=()=>{h(!1),g()};return n.$$set=M=>{"value"in M&&t(0,l=M.value),"placeholder"in M&&t(1,o=M.placeholder),"autocompleteCollection"in M&&t(2,r=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,h,g,b,w,C,S,$]}class zo extends Ee{constructor(e){sup
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){k(t,e,i)},p:le,d(t){t&&y(e)}}}function P1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="url",p(t,"class",Y.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){k(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&y(e)}}}function L1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="referer",p(t,"class",Y.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){k(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&y(e)}}}function F1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="status",p(t,"class",Y.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){k(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&y(e)}}}function I1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",p(t,"class",Y.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){k(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&y(e)}}}function Nu(n){let e;function t(l,o){return l[6]?R1:N1}let i=t(n),s=i(n);return{c(){s.c(),e=Xe()},m(l,o){s.m(l,o),k(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&&y(e)}}}function N1(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Ru(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No logs found.",s=T(),o&&o.c(),l=T(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){k(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=Ru(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&y(e),o&&o.d()}}}function R1(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){k(t,e,i)},p:le,d(t){t&&y(e)}}}function Ru(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){k(s,e,l),t||(i=G(e,"click",n[18]),t=!0)},p:le,d(s){s&&y(e),t=!1,i()}}}function Hu(n){let e;return{c(){e=_("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function ju(n,e){var se,ge,$e;let t,i,s,l=((se=e[21].method)==null?void 0:se.toUpperCase())+"",o,r,a,u,f,c=e[21].url+"",d,h,g,v,b,w,C=(e[21].referer||"N/A")+"",S,$,M,D,O,A=e[21].status+"",L,F,R,B,te,Z,H,J,U,Q,oe=(((ge=e[21].meta)==null?void 0:ge.errorMessage)||(($e=e[21].meta)==null?void 0:$e.errorData))&&Hu();B=new yi({props:{date:e[21].created}});function ae(){return e[16](e[21])}function be(...W){return e[17](e[21],...W)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),o=N(l),a=T(),u=_("td"),f=_("span"),d=N(c),g=T(),oe&&oe.c(),v=T(),b=_("td"),w=_("span"),S=N(C),M=T(),D=_("td"),O=_("span"),L=N(A),F=T(),R=_("td"),V(B.$$.fragment),te=T(),Z=_("td"),Z.innerHTML='<i class="ri-arrow-right-line"></i>',H=T(),p(s,"class",r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",h=e[21].url),p(u,"class","col-type-text col-field-url"),p(w,"class","txt txt-ellipsis"),p(w,"title",$=e[21].referer),ne(w,"txt-hint",!e[21].referer),p(b,"class","col-type-text col-field-referer"),p(O,"class","label"),ne(O,"label-danger",e[21].status>=400),p(D,"class","col-type-number col-field-status"),p(R,"class","col-type-date col-field-created"),p(Z,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(W,ye){k(W,t,ye),m(t,i),m(i,s),m(s,o),m(t,a),m(t,u),m(u,f),m(f,d),m(u,g),oe&&oe.m(u,null),m(t,v),m(t,b),m(b,w),m(w,S),m(t,M),m(t,D),m(D,O),m(O,L),m(t,F),m(t,R),j(B,R,null),m(t,te),m(t,Z),m(t,H),J=!0,U||(Q=[G(t,"click",ae),G(t,"keydown",be)],U=!0)},p(W,ye){var X,Se,je;e=W,(!J||ye&8)&&l!==(l=((X=e[21].method)==null?void 0:X.toUpperCase())+"")&&pe(o,l),(!J||ye&8&&r!==(r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(s,"class",r),(!J||ye&8)&&c!==(c=e[21].url+"")&&pe(d,c),(!J||ye&8&&h!==(h=e[21].url))&&p(f,"title",h),((Se=e[21].meta)==null?void 0:Se.errorMessage)||((je=e[21].meta)==null?void 0:je.errorData)?oe||(oe=Hu(),oe.c(),oe.m(u,null)):oe&&(oe.d(1),oe=null),(!J||ye&8)&&C!==(C=(e[21].referer||"N/A")+"")&&pe(S,C),(!J||ye&8&&$!==($=e[21].referer))&&p(w,"title",$),ye&8&&ne(w,"txt-hint",!e[21].referer),(!J||ye&8)&&A!==(A=e[21].status+"")&&pe(L,A),ye&8&&ne(O,"label-danger",e[21].status>=400);const ee={};ye&8&&(ee.date=e[21].created),B.$set(ee)},i(W){J||(E(B.$$.fragment,W),J=!0)},o(W){P(B.$$.fragment,W),J=!1},d(W){W&&y(t),oe&&oe.d(),q(B),U=!1,Qe(Q)}}}function qu(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),o=N(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){k(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+"")&&pe(s,i),a&16&&pe(o,r[4])},d(r){r&&y(e)}}}function Vu(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=N("Load more ("),o=N(l),r=N(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ne(t,"btn-loading",n[6]),ne(t,"btn-disabled",n[6]),p(e,"class","block txt-center m-t-xs")},m(f,c){k(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=G(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&pe(o,l),c&64&&ne(t,"btn-loading",f[6]),c&64&&ne(t,"btn-disabled",f[6])},d(f){f&&y(e),a=!1,u()}}}function H1(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,w,C,S,$,M,D,O=[],A=new Map,L,F,R,B;function te(X){n[11](X)}let Z={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[A1]},$$scope:{ctx:n}};n[1]!==void 0&&(Z.sort=n[1]),l=new nn({props:Z}),he.push(()=>Re(l,"sort",te));function H(X){n[12](X)}let J={disable:!0,class:"col-type-text col-field-url",name:"url",$$slot
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/function hi(){}const V1=function(){let n=0;return function(){return n++}}();function Mt(n){return n===null||typeof n>"u"}function It(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function dt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Wt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Fn(n,e){return Wt(n)?n:e}function _t(n,e){return typeof n>"u"?e:n}const z1=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,cg=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function zt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function Tt(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(dt(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(dt(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 dg(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function B1(n,e,t,i){if(!dg(n))return;const s=e[n],l=t[n];dt(s)&&dt(l)?rl(s,l,i):e[n]=yo(l)}function rl(n,e,t){const i=It(e)?e:[e],s=i.length;if(!dt(n))return n;t=t||{};const l=t.merger||B1;for(let o=0;o<s;++o){if(e=i[o],!dt(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 Qs(n,e){return rl(n,e,{merger:U1})}function U1(n,e,t){if(!dg(n))return;const i=e[n],s=t[n];dt(i)&&dt(s)?Qs(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=yo(s))}const zu={"":n=>n,x:n=>n.x,y:n=>n.y};function Fi(n,e){return(zu[e]||(zu[e]=W1(e)))(n)}function W1(n){const e=Y1(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Y1(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function ya(n){return n.charAt(0).toUpperCase()+n.slice(1)}const zn=n=>typeof n<"u",Ii=n=>typeof n=="function",Bu=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function K1(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Ut=Math.PI,Et=2*Ut,Z1=Et+Ut,ko=Number.POSITIVE_INFINITY,J1=Ut/180,Bt=Ut/2,Rs=Ut/4,Uu=Ut*2/3,Hn=Math.log10,oi=Math.sign;function Wu(n){const e=Math.round(n);n=xs(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Hn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function G1(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function $s(n){return!isNaN(parseFloat(n))&&isFinite(n)}function xs(n,e,t){return Math.abs(n-e)<t}function X1(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function pg(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Jn(n){return n*(Ut/180)}function ka(n){return n*(180/Ut)}function Yu(n){if(!Wt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function hg(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*Ut&&(l+=Et),{angle:l,distance:s}}function zr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Q1(n,e){return(n-e+Z1)%Et-Ut}function Dn(n){return(n%Et+Et)%Et}function al(n,e,t,i){const s=Dn(n),l=Dn(e),o=Dn(t),r=Dn(l-s),a=Dn(o-s),u=Dn(s-l),f=Dn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function an(n,e,t){return Math.max(e,Math.min(t,n))}function x1(n){return an(n,-32768,32767)}function ul(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function wa(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,l;for(;i-s>1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const Xi=(n,e,t,i)=>wa(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),ev=(n,e,t)=>wa(n,t,i=>n[i][e]>=t);function tv(n,e,
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function yl(n){return n+.5|0}const Ei=(n,e,t)=>Math.max(Math.min(n,t),e);function Ks(n){return Ei(yl(n*2.55),0,255)}function Li(n){return Ei(yl(n*255),0,255)}function _i(n){return Ei(yl(n/2.55)/100,0,1)}function Xu(n){return Ei(yl(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},Br=[..."0123456789ABCDEF"],lv=n=>Br[n&15],ov=n=>Br[(n&240)>>4]+Br[n&15],jl=n=>(n&240)>>4===(n&15),rv=n=>jl(n.r)&&jl(n.g)&&jl(n.b)&&jl(n.a);function av(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 uv=(n,e)=>n<255?e(n):"";function fv(n){var e=rv(n)?lv:ov;return n?"#"+e(n.r)+e(n.g)+e(n.b)+uv(n.a,e):void 0}const cv=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function kg(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 dv(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 pv(n,e,t){const i=kg(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 hv(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 $a(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=hv(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Sa(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Li)}function Ca(n,e,t){return Sa(kg,n,e,t)}function mv(n,e,t){return Sa(pv,n,e,t)}function gv(n,e,t){return Sa(dv,n,e,t)}function wg(n){return(n%360+360)%360}function _v(n){const e=cv.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Ks(+e[5]):Li(+e[5]));const s=wg(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=mv(s,l,o):e[1]==="hsv"?i=gv(s,l,o):i=Ca(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function bv(n,e){var t=$a(n);t[0]=wg(t[0]+e),t=Ca(t),n.r=t[0],n.g=t[1],n.b=t[2]}function vv(n){if(!n)return;const e=$a(n),t=e[0],i=Xu(e[1]),s=Xu(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${_i(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Qu={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"},xu={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class wy{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=_g.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 mi=new wy;const df="transparent",$y={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=tf(n||df),s=i.valid&&tf(e||df);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Sy{constructor(e,t,i,s){const l=t[i];s=zl([e.to,s,l,e.from]);const o=zl([e.from,l,s]);this._active=!0,this._fn=e.fn||$y[e.type||typeof o],this._easing=el[e.easing]||el.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=zl([e.to,t,s,e.from]),this._from=zl([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 Cy=["x","y","borderWidth","radius","tension"],My=["color","borderColor","backgroundColor"];bt.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 Ty=Object.keys(bt.animation);bt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});bt.set("animations",{colors:{type:"color",properties:My},numbers:{type:"number",properties:Cy}});bt.describe("animations",{_fallback:"animation"});bt.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 Rg{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!dt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!dt(s))return;const l={};for(co
`)>-1?n.split(`
`):n}function Bw(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function Bf(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=On(e.bodyFont),u=On(e.titleFont),f=On(e.footerFont),c=l.length,d=s.length,h=i.length,g=Bn(e.padding);let v=g.height,b=0,w=i.reduce(($,M)=>$+M.before.length+M.lines.length+M.after.length,0);if(w+=n.beforeBody.length+n.afterBody.length,c&&(v+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),w){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;v+=h*$+(w-h)*a.lineHeight+(w-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let C=0;const S=function($){b=Math.max(b,t.measureText($).width+C)};return t.save(),t.font=u.string,Tt(n.title,S),t.font=a.string,Tt(n.beforeBody.concat(n.afterBody),S),C=e.displayColors?o+2+e.boxPadding:0,Tt(i,$=>{Tt($.before,S),Tt($.lines,S),Tt($.after,S)}),C=0,t.font=f.string,Tt(n.footer,S),t.restore(),b+=g.width,{width:b,height:v}}function Uw(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function Ww(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 Yw(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"),Ww(u,n,e,t)&&(u="center"),u}function Uf(n,e,t){const i=t.yAlign||e.yAlign||Uw(n,t);return{xAlign:t.xAlign||e.xAlign||Yw(n,e,t,i),yAlign:i}}function Kw(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function Zw(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function Wf(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:h}=bs(o);let g=Kw(e,r);const v=Zw(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+s:r==="right"&&(g+=Math.max(c,h)+s),{x:an(g,0,i.width-e.width),y:an(v,0,i.height-e.height)}}function Jl(n,e,t){const i=Bn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Yf(n){return ii([],gi(n))}function Jw(n,e,t){return Ni(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Kf(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class Qr extends $i{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 Rg(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=Jw(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=ii(r,gi(s)),r=ii(r,gi(l)),r=ii(r,gi(o)),r}getBeforeBody(e,t){return Yf(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return Tt(e,l=>{const o={before:[],lines:[],after:[]},r=Kf(i,l);ii(o.before,gi(r.beforeLabel.call(this,l))
* chartjs-adapter-luxon v1.2.0
* https://www.chartjs.org
* (c) 2022 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const g2={datetime:Ge.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Ge.TIME_WITH_SECONDS,minute:Ge.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};zg._date.override({_id:"luxon",_create:function(n){return Ge.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return g2},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Ge.fromFormat(n,e,t):n=Ge.fromISO(n,t):n instanceof Date?n=Ge.fromJSDate(n,t):i==="object"&&!(n instanceof Ge)&&(n=Ge.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function tc(n){let e,t,i;return{c(){e=_("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){k(s,e,l),i=!0},i(s){i||(s&&Dt(()=>{t||(t=rt(e,Vn,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=rt(e,Vn,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&y(e),s&&t&&t.end()}}}function _2(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=N(n[1]),t=T(),s=N(i)},m(l,o){k(l,e,o),k(l,t,o),k(l,s,o)},p(l,o){o&2&&pe(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&pe(s,i)},d(l){l&&y(e),l&&y(t),l&&y(s)}}}function b2(n){let e;return{c(){e=N("Loading...")},m(t,i){k(t,e,i)},p:le,d(t){t&&y(e)}}}function v2(n){let e,t,i,s,l,o=n[2]&&tc();function r(f,c){return f[2]?b2:_2}let a=r(n),u=a(n);return{c(){e=_("div"),o&&o.c(),t=T(),i=_("canvas"),s=T(),l=_("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),Ja(i,"height","250px"),Ja(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),ne(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){k(f,e,c),o&&o.m(e,null),m(e,t),m(e,i),n[8](i),k(f,s,c),k(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&E(o,1):(o=tc(),o.c(),E(o,1),o.m(e,t)):o&&(Pe(),P(o,1,1,()=>{o=null}),Le()),c&4&&ne(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){E(o)},o(f){P(o)},d(f){f&&y(e),o&&o.d(),n[8](null),f&&y(s),f&&y(l),u.d()}}}function y2(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),_e.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let g of h)r.push({x:Y.getDateTime(g.date).toLocal().toJSDate(),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),_e.errorResponseHandler(h,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Wn(()=>(Oo.register(Ri,Ko,Wo,Va,Sl,zw,Gw),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,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:h=>h.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>h.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(h){he[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function C(S){return S instanceof a?new a(S.type,C(S.content),S.alias):Array.isArray(S)?S.map(C):S.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(C){return Object.prototype.toString.call(C).slice(8,-1)},objId:function(C){return C.__id||Object.defineProperty(C,"__id",{value:++l}),C.__id},clone:function C(S,$){$=$||{};var M,D;switch(r.util.type(S)){case"Object":if(D=r.util.objId(S),$[D])return $[D];M={},$[D]=M;for(var O in S)S.hasOwnProperty(O)&&(M[O]=C(S[O],$));return M;case"Array":return D=r.util.objId(S),$[D]?$[D]:(M=[],$[D]=M,S.forEach(function(A,L){M[L]=C(A,$)}),M);default:return S}},getLanguage:function(C){for(;C;){var S=s.exec(C.className);if(S)return S[1].toLowerCase();C=C.parentElement}return"none"},setLanguage:function(C,S){C.className=C.className.replace(RegExp(s,"gi"),""),C.classList.add("language-"+S)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var C=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(C){var S=document.getElementsByTagName("script");for(var $ in S)if(S[$].src==C)return S[$]}return null}},isActive:function(C,S,$){for(var M="no-"+S;C;){var D=C.classList;if(D.contains(S))return!0;if(D.contains(M))return!1;C=C.parentElement}return!!$}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(C,S){var $=r.util.clone(r.languages[C]);for(var M in S)$[M]=S[M];return $},insertBefore:function(C,S,$,M){M=M||r.languages;var D=M[C],O={};for(var A in D)if(D.hasOwnProperty(A)){if(A==S)for(var L in $)$.hasOwnProperty(L)&&(O[L]=$[L]);$.hasOwnProperty(A)||(O[A]=D[A])}var F=M[C];return M[C]=O,r.languages.DFS(r.languages,function(R,B){B===F&&R!=C&&(this[R]=O)}),O},DFS:function C(S,$,M,D){D=D||{};var O=r.util.objId;for(var A in S)if(S.hasOwnProperty(A)){$.call(S,A,S[A],M||A);var L=S[A],F=r.util.type(L);F==="Object"&&!D[O(L)]?(D[O(L)]=!0,C(L,$,null,D)):F==="Array"&&!D[O(L)]&&(D[O(L)]=!0,C(L,$,A,D))}}},plugins:{},highlightAll:function(C,S){r.highlightAllUnder(document,C,S)},highlightAllUnder:function(C,S,$){var M={callback:$,container:C,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),r.hooks.run("before-all-elements-highlight",M);for(var D=0,O;O=M.elements[D++];)r.highlightElement(O,S===!0,M.callback)},highlightElement:function(C,S,$){var M=r.util.getLanguage(C),D=r.languages[M];r.util.setLanguage(C,M);var O=C.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,M);var A=C.textContent,L={element:C,language:M,grammar:D,code:A};function F(B){L.highlightedCode=B,r.hooks.run("before-insert",L),L.element.innerHTML=L.highlightedCode,r.hooks.run("after-highlight",L),r.hooks.run("complete",L),$&&$.call(L.element)}if(r.hooks.run("before-sanity-check",L),O=L.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!L.code){r.hooks.run("complete",L),$&&$.call(L.element);return}if(r.hooks.run("before-highlight",L),!L.grammar){F(r.util.encode(L.code));return}if(S&&i.Worker){var R=new Worker(r.filename);R.onmessage=function(B){F(B.data)},R.postMessage(JSON.stringify({language:L.language,code:L.code,immediateClose:!0}))}else F(r.highlight(L.code,L.grammar,L.language))},highlight:function(C,S,$){var M={code:C,grammar:S,language:$};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function(C,S){var $=S.rest;if($){for(var M in $)S[M]=$[M];delete S.rest}var D=new c;return d(D,D.head,C),f(C,D,S,D.head,0),g(D)},hooks:{all:{},add:function
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(L+1))}w.textContent=D,t.highlightElement(w)},function(D){b.setAttribute(r,f),w.textContent=D})}}),t.plugins.fileHighlight={highlight:function(b){for(var w=(b||document).querySelectorAll(c),C=0,S;S=w[C++];)t.highlightElement(S)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(a_);const Bs=a_.exports;var w2={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(l,o){for(var r in o)o.hasOwnProperty(r)&&(l[r]=o[r]);return l};function t(l){this.defaults=e({},l)}function i(l){return l.replace(/-(\w)/g,function(o,r){return r.toUpperCase()})}function s(l){for(var o=0,r=0;r<l.length;++r)l.charCodeAt(r)==" ".charCodeAt(0)&&(o+=3);return l.length+o}t.prototype={setDefaults:function(l){this.defaults=e(this.defaults,l)},normalize:function(l,o){o=e(this.defaults,o);for(var r in o){var a=i(r);r!=="normalize"&&a!=="setDefaults"&&o[r]&&this[a]&&(l=this[a].call(this,l,o[r]))}return l},leftTrim:function(l){return l.replace(/^\s+/,"")},rightTrim:function(l){return l.replace(/\s+$/,"")},tabsToSpaces:function(l,o){return o=o|0||4,l.replace(/\t/g,new Array(++o).join(" "))},spacesToTabs:function(l,o){return o=o|0||4,l.replace(RegExp(" {"+o+"}","g")," ")},removeTrailing:function(l){return l.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(l){return l.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(l){var o=l.match(/^[^\S\n\r]*(?=\S)/gm);return!o||!o[0].length||(o.sort(function(r,a){return r.length-a.length}),!o[0].length)?l:l.replace(RegExp("^"+o[0],"gm"),"")},indent:function(l,o){return l.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++o).join(" ")+"$&")},breakLines:function(l,o){o=o===!0?80:o|0||80;for(var r=l.split(`
`),a=0;a<r.length;++a)if(!(s(r[a])<=o)){for(var u=r[a].split(/(\s+)/g),f=0,c=0;c<u.length;++c){var d=s(u[c]);f+=d,f>o&&(u[c]=`
`+u[c],f=d)}r[a]=u.join("")}return r.join(`
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(l){var o=Prism.plugins.NormalizeWhitespace;if(!(l.settings&&l.settings["whitespace-normalization"]===!1)&&!!Prism.util.isActive(l.element,"whitespace-normalization",!0)){if((!l.element||!l.element.parentNode)&&l.code){l.code=o.normalize(l.code,l.settings);return}var r=l.element.parentNode;if(!(!l.code||!r||r.nodeName.toLowerCase()!=="pre")){for(var a=r.childNodes,u="",f="",c=!1,d=0;d<a.length;++d){var h=a[d];h==l.element?c=!0:h.nodeName==="#text"&&(c?f+=h.nodeValue:u+=h.nodeValue,r.removeChild(h),--d)}if(!l.element.children.length||!Prism.plugins.KeepMarkup)l.code=u+l.code+f,l.code=o.normalize(l.code,l.settings);else{var g=u+l.element.innerHTML+f;l.element.innerHTML=o.normalize(g,l.settings),l.code=l.element.textContent}}}})})()})(w2);(function(n){var e=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],t=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,i={pattern:RegExp(t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};n.languages.dart=n.languages.extend("clike",{"class-name":[i,{pattern:RegExp(t+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:e,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function $2(n){let e,t,i;return{c(){e=_("div"),t=_("code"),p(t,"class","svelte-1ua9m3i"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-1ua9m3i")},m(s,l){k(s,e,l),m(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-1ua9m3i")&&p(e,"class",i)},i:le,o:le,d(s){s&&y(e)}}}function S2(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Bs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Bs.highlight(a,Bs.languages[l]||Bs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Bs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class hn extends Ee{constructor(e){super(),Oe(this,e,S2,$2,De,{class:0,content:2,language:3})}}const C2=n=>({}),ic=n=>({}),M2=n=>({}),sc=n=>({});function lc(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,w,C,S=n[4]&&!n[2]&&oc(n);const $=n[18].header,M=yn($,n,n[17],sc);let D=n[4]&&n[2]&&rc(n);const O=n[18].default,A=yn(O,n,n[17],null),L=n[18].footer,F=yn(L,n,n[17],ic);return{c(){e=_("div"),t=_("div"),s=T(),l=_("div"),o=_("div"),S&&S.c(),r=T(),M&&M.c(),a=T(),D&&D.c(),u=T(),f=_("div"),A&&A.c(),c=T(),d=_("div"),F&&F.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",h="overlay-panel "+n[1]+" "+n[8]),n
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,w){(!c||w&16&&l!==(l=b[4]))&&p(e,"for",l);const C={};w&16&&(C.id=b[4]),w&1&&(C.disabled=!Y.isEmpty(b[0].onlyDomains)),!a&&w&1&&(a=!0,C.value=b[0].exceptDomains,He(()=>a=!1)),r.$set(C)},i(b){c||(E(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&y(e),b&&y(o),q(r,b),b&&y(u),b&&y(f),d=!1,h()}}}function L$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[3](b)}let v={id:n[4]+".options.onlyDomains",disabled:!Y.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new us({props:v}),he.push(()=>Re(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]+".options.onlyDomains"),p(f,"class","help-block")},m(b,w){k(b,e,w),m(e,t),m(e,i),m(e,s),k(b,o,w),j(r,b,w),k(b,u,w),k(b,f,w),c=!0,d||(h=Ye(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,w){(!c||w&16&&l!==(l=b[4]+".options.onlyDomains"))&&p(e,"for",l);const C={};w&16&&(C.id=b[4]+".options.onlyDomains"),w&1&&(C.disabled=!Y.isEmpty(b[0].exceptDomains)),!a&&w&1&&(a=!0,C.value=b[0].onlyDomains,He(()=>a=!1)),r.$set(C)},i(b){c||(E(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&y(e),b&&y(o),q(r,b),b&&y(u),b&&y(f),d=!1,h()}}}function F$(n){let e,t,i,s,l,o,r;return i=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[P$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[L$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){k(a,e,u),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&y(e),q(i),q(o)}}}function I$(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 d_ extends Ee{constructor(e){super(),Oe(this,e,I$,F$,De,{key:1,options:0})}}function N$(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 d_({props:r}),he.push(()=>Re(e,"key",l)),he.push(()=>Re(e,"options",o)),{c(){V(e.$$.fragment)},m(a,u){j(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],He(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],He(()=>i=!1)),e.$set(f)},i(a){s||(E(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){q(e,a)}}}function R$(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 H$ extends Ee{constructor(e){super(),Oe(this,e,R$,N$,De,{key:0,options:1})}}var yr=["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'>
`+z.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function ae(){t.calendarContainer.classList.add("hasWeeks");var I=St("div","flatpickr-weekwrapper");I.appendChild(St("span","flatpickr-weekday",t.l10n.weekAbbreviation));var z=St("div","flatpickr-weeks");return I.appendChild(z),{weekWrapper:I,weekNumbers:z}}function be(I,z){z===void 0&&(z=!0);var x=z?I:I-t.currentMonth;x<0&&t._hidePrevMonthArrow===!0||x>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=x,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Ke("onYearChange"),te()),B(),Ke("onMonthChange"),at())}function se(I,z){if(I===void 0&&(I=!0),z===void 0&&(z=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,z===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var x=Sr(t.config),re=x.hours,Ae=x.minutes,ie=x.seconds;h(re,Ae,ie)}t.redraw(),I&&Ke("onChange")}function ge(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Ke("onClose")}function $e(){t.config!==void 0&&Ke("onDestroy");for(var I=t._handlers.length;I--;)t._handlers[I].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var z=t.calendarContainer.parentNode;if(z.lastChild&&z.removeChild(z.lastChild),z.parentNode){for(;z.firstChild;)z.parentNode.insertBefore(z.firstChild,z);z.parentNode.removeChild(z)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(x){try{delete t[x]}catch{}})}function W(I){return t.calendarContainer.contains(I)}function ye(I){if(t.isOpen&&!t.config.inline){var z=Mn(I),x=W(z),re=z===t.input||z===t.altInput||t.element.contains(z)||I.path&&I.path.indexOf&&(~I.path.indexOf(t.input)||~I.path.indexOf(t.altInput)),Ae=!re&&!x&&!W(I.relatedTarget),ie=!t.config.ignoredFocusElements.some(function(ve){return ve.contains(z)});Ae&&ie&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function ee(I){if(!(!I||t.config.minDate&&I<t.config.minDate.getFullYear()||t.config.maxDate&&I>t.config.maxDate.getFullYear())){var z=I,x=t.currentYear!==z;t.currentYear=z||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),x&&(t.redraw(),Ke("onYearChange"),te())}}function X(I,z){var x;z===void 0&&(z=!0);var re=t.parseDate(I,void 0,z);if(t.config.minDate&&re&&Tn(re,t.config.minDate,z!==void 0?z:!t.minDateHasTime)<0||t.config.maxDate&&re&&Tn(re,t.config.maxDate,z!==void 0?z:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(re===voi
`),d=_("span"),h=_("span"),h.textContent="Choose presets",g=T(),V(v.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(h,"class","txt link-primary"),p(d,"class","inline-flex"),p(f,"class","help-block")},m(M,D){k(M,e,D),m(e,t),m(e,i),m(e,s),k(M,o,D),j(r,M,D),k(M,u,D),k(M,f,D),m(f,c),m(f,d),m(d,h),m(d,g),j(v,d,null),b=!0,w||(C=Ye(Ct.call(null,s,{text:`Allow files ONLY with the listed mime types.
Leave empty for no restriction.`,position:"top"})),w=!0)},p(M,D){(!b||D&1024&&l!==(l=M[10]))&&p(e,"for",l);const O={};D&1024&&(O.id=M[10]),!a&&D&1&&(a=!0,O.value=M[0].mimeTypes,He(()=>a=!1)),r.$set(O);const A={};D&2049&&(A.$$scope={dirty:D,ctx:M}),v.$set(A)},i(M){b||(E(r.$$.fragment,M),E(v.$$.fragment,M),b=!0)},o(M){P(r.$$.fragment,M),P(v.$$.fragment,M),b=!1},d(M){M&&y(e),M&&y(o),q(r,M),M&&y(u),M&&y(f),q(v),w=!1,C()}}}function cS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;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 us({props:v}),he.push(()=>Re(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(f,"class","help-block")},m(b,w){k(b,e,w),m(e,t),m(e,i),m(e,s),k(b,o,w),j(r,b,w),k(b,u,w),k(b,f,w),c=!0,d||(h=Ye(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,w){(!c||w&1024&&l!==(l=b[10]))&&p(e,"for",l);const C={};w&1024&&(C.id=b[10]),!a&&w&1&&(a=!0,C.value=b[0].thumbs,He(()=>a=!1)),r.$set(C)},i(b){c||(E(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&y(e),b&&y(o),q(r,b),b&&y(u),b&&y(f),d=!1,h()}}}function dS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return i=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[rS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[aS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[fS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[cS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),f=T(),c=_("div"),V(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(c,"class","col-sm-12"),p(e,"class","grid")},m(g,v){k(g,e,v),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),m(e,f),m(e,c),j(d,c,null),h=!0},p(g,[v]){const b={};v&2&&(b.name="schema."+g[1]+".options.maxSize"),v&3073&&(b.$$scope={dirty:v,ctx:g}),i.$set(b);const w={};v&2&&(w.name="schema."+g[1]+".options.maxSelect"),v&3073&&(w.$$scope={dirty:v,ctx:g}),o.$set(w);const C={};v&2&&(C.name="schema."+g[1]+".options.mimeTypes"),v&3073&&(C.$$scope={dirty:v,ctx:g}),u.$set(C);const S={};v&2&&(S.name="schema."+g[1]+".options.thumbs"),v&3073&&(S.$$scope={dirty:v,ctx:g}),d.$set(S)},i(g){h||(E(i.$$.fragment,g),E(o.$$.fragment,g),E(u.$$.fragment,g),E(d.$$.fragment,g),h=!0)},o(g){P(i.$$.fragment,g),P(o.$$.fragment,g),P(u.$$.fragment,g),P(d.$$.fragment,g),h=!1},d(g){g&&y(e),q(i),q(o),q(u),q(d)}}}function pS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=At(this.value),t(0,s)}function o(){s.maxSelect=At(this.value),t(0,s)}function r(h){n.$$.not_equal(s.mimeTypes,h)&&(s.mimeTypes=h,t(0,s))}const a=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},u=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],s)},f=()=>{t(0,s.mimeTypes=["video/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(h){n.$$.not_equal(s.thumbs,h)&&(s.thumbs=h,t(0,s))}return n.$$set=h=>{"key"in h&&t(1,i=h.key),"options"in h&&t(0,s=h.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:[TS,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}});const O=[HS,RS,NS,IS,FS,LS,PS,AS,ES,OS,DS],A=[];function L(B,te){return B[0].type==="text"?0:B[0].type==="number"?1:B[0].type==="bool"?2:B[0].type==="email"?3:B[0].type==="url"?4:B[0].type==="date"?5:B[0].type==="select"?6:B[0].type==="json"?7:B[0].type==="file"?8:B[0].type==="relation"?9:B[0].type==="user"?10:-1}~(f=L(n))&&(c=A[f]=O[f](n)),g=new Ne({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[jS,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}});let F=n[0].type!=="file"&&Fc(n),R=!n[0].toDelete&&Ic(n);return{c(){e=_("form"),t=_("div"),i=_("div"),V(s.$$.fragment),l=T(),o=_("div"),V(r.$$.fragment),a=T(),u=_("div"),c&&c.c(),d=T(),h=_("div"),V(g.$$.fragment),v=T(),b=_("div"),F&&F.c(),w=T(),R&&R.c(),C=T(),S=_("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(h,"class","col-sm-4 flex"),p(b,"class","col-sm-4 flex"),p(t,"class","grid"),p(S,"type","submit"),p(S,"class","hidden"),p(S,"tabindex","-1"),p(e,"class","field-form")},m(B,te){k(B,e,te),m(e,t),m(t,i),j(s,i,null),m(t,l),m(t,o),j(r,o,null),m(t,a),m(t,u),~f&&A[f].m(u,null),m(t,d),m(t,h),j(g,h,null),m(t,v),m(t,b),F&&F.m(b,null),m(t,w),R&&R.m(t,null),m(e,C),m(e,S),$=!0,M||(D=G(e,"submit",Yt(n[31])),M=!0)},p(B,te){const Z={};te[0]&1&&(Z.class="form-field required "+(B[0].id?"disabled":"")),te[0]&2&&(Z.name="schema."+B[1]+".type"),te[0]&1|te[1]&384&&(Z.$$scope={dirty:te,ctx:B}),s.$set(Z);const H={};te[0]&33&&(H.class=`
form-field
required
`+(B[5]?"":"invalid")+`
`+(B[0].id&&B[0].system?"disabled":"")+`
`),te[0]&2&&(H.name="schema."+B[1]+".name"),te[0]&33|te[1]&384&&(H.$$scope={dirty:te,ctx:B}),r.$set(H);let J=f;f=L(B),f===J?~f&&A[f].p(B,te):(c&&(Pe(),P(A[J],1,1,()=>{A[J]=null}),Le()),~f?(c=A[f],c?c.p(B,te):(c=A[f]=O[f](B),c.c()),E(c,1),c.m(u,null)):c=null);const U={};te[0]&1|te[1]&384&&(U.$$scope={dirty:te,ctx:B}),g.$set(U),B[0].type!=="file"?F?(F.p(B,te),te[0]&1&&E(F,1)):(F=Fc(B),F.c(),E(F,1),F.m(b,null)):F&&(Pe(),P(F,1,1,()=>{F=null}),Le()),B[0].toDelete?R&&(Pe(),P(R,1,1,()=>{R=null}),Le()):R?(R.p(B,te),te[0]&1&&E(R,1)):(R=Ic(B),R.c(),E(R,1),R.m(t,null))},i(B){$||(E(s.$$.fragment,B),E(r.$$.fragment,B),E(c),E(g.$$.fragment,B),E(F),E(R),$=!0)},o(B){P(s.$$.fragment,B),P(r.$$.fragment,B),P(c),P(g.$$.fragment,B),P(F),P(R),$=!1},d(B){B&&y(e),q(s),q(r),~f&&A[f].d(),q(g),F&&F.d(),R&&R.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(),p(e,"class","inline-flex")},m(u,f){k(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&&y(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",p(e,"class","label label-danger")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function jc(n){let e;return{c(){e=_("span"),e.textContent="New",p(e,"class","label"),ne(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){k(t,e,i)},p(t,i){i[0]&257&&ne(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&y(e)}}}function qc(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function Vc(n){let e;return{c(){e=_("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function zc(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){k(o,e,r),i=!0,s||(l=Ye(Ct.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Dt(()=>{t||(t=rt(e,Vn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=rt(e,Vn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&y(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>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-secondary")},m(s,l){k(s,e,l),t||(i=G(e,"click",Qn(n[15])),t=!0)},p:le,d(s){s&&y(e),t=!1,i()}}}function BS(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,h,g,v,b,w=!n[0].toDelete&&Rc(n),C=n[7]&&!n[0].system&&zc(),S=n[0].toDelete&&Bc(n);return{c(){e=_("div"),t=_("span"),i=_("i"),l=T(),o=_("strong"),a=N(r),f=T(),w&&w.c(),c=T(),d=_("div"),h=T(),C&&C.c(),g=T(),S&&S.c(),v=Xe(),p(i,"class",s=Za(Y.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),p(t,"class","icon field-type"),p(o,"class","title field-name svelte-1tpxlm5"),p(o,"title",u=n[0].name),ne(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m($,M){k($,e,M),m(e,t),m(t,i),m(e,l),m(e,o),m(o,a),k($,f,M),w&&w.m($,M),k($,c,M),k($,d,M),k($,h,M),C&&C.m($,M),k($,g,M),S&&S.m($,M),k($,v,M),b=!0},p($,M){(!b||M[0]&1&&s!==(s=Za(Y.getFieldTypeIcon($[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!b||M[0]&1)&&r!==(r=($[0].name||"-")+"")&&pe(a,r),(!b||M[0]&1&&u!==(u=$[0].name))&&p(o,"title",u),M[0]&1&&ne(o,"txt-strikethrough",$[0].toDelete),$[0].toDelete?w&&(w.d(1),w=null):w?w.p($,M):(w=Rc($),w.c(),w.m(c.parentNode,c)),$[7]&&!$[0].system?C?M[0]&129&&E(C,1):(C=zc(),C.c(),E(C,1),C.m(g.parentNode,g)):C&&(Pe(),P(C,1,1,()=>{C=null}),Le()),$[0].toDelete?S?S.p($,M):(S=Bc($),S.c(),S.m(v.parentNode,v)):S&&(S.d(1),S=null)},i($){b||(E(C),b=!0)},o($){P(C),b=!1},d($){$&&y(e),$&&y(f),w&&w.d($),$&&y(c),$&&y(d),$&&y(h),C&&C.d($),$&&y(g),S&&S.d($),$&&y(v)}}}function US(n){let e,t,i={single:!0,interactive:n[8],class:n[2]||n
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.user.*</code>`,S=T(),$=_("hr"),M=T(),D=_("p"),D.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",O=T(),A=_("div"),A.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",L=T(),F=_("hr"),R=T(),B=_("p"),B.innerHTML=`Example rule:
<br/>
<code>@request.user.id!=&quot;&quot; &amp;&amp; created&gt;&quot;2022-01-01 00:00:00&quot;</code>`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p(C,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(D,"class","m-b-0"),p(A,"class","inline-flex flex-gap-5"),p(F,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(U,Q){k(U,e,Q),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 oe=0;oe<J.length;oe+=1)J[oe].m(o,null);m(i,h),m(i,g),m(i,v),m(i,b),m(i,w),m(i,C),m(i,S),m(i,$),m(i,M),m(i,D),m(i,O),m(i,A),m(i,L),m(i,F),m(i,R),m(i,B),Z=!0},p(U,Q){if(Q&1){H=U[0].schema;let oe;for(oe=0;oe<H.length;oe+=1){const ae=Kc(U,H,oe);J[oe]?J[oe].p(ae,Q):(J[oe]=Jc(ae),J[oe].c(),J[oe].m(o,null))}for(;oe<J.length;oe+=1)J[oe].d(1);J.length=H.length}},i(U){Z||(U&&Dt(()=>{te||(te=rt(e,en,{duration:150},!0)),te.run(1)}),Z=!0)},o(U){U&&(te||(te=rt(e,en,{duration:150},!1)),te.run(0)),Z=!1},d(U){U&&y(e),Xn(J,U),U&&te&&te.end()}}}function GS(n){let e,t=n[19].name+"",i;return{c(){e=_("code"),i=N(t)},m(s,l){k(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[19].name+"")&&pe(i,t)},d(s){s&&y(e)}}}function XS(n){let e,t=n[19].name+"",i,s;return{c(){e=_("code"),i=N(t),s=N(".*")},m(l,o){k(l,e,o),m(e,i),m(e,s)},p(l,o){o&1&&t!==(t=l[19].name+"")&&pe(i,t)},d(l){l&&y(e)}}}function Jc(n){let e;function t(l,o){return l[19].type==="relation"||l[19].type==="user"?XS:GS}let i=t(n),s=i(n);return{c(){s.c(),e=Xe()},m(l,o){s.m(l,o),k(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&&y(e)}}}function QS(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=Xe()},m(r,a){for(let u=0;u<e.length;u+=1)e[u].m(r,a);k(r,i,a),s=!0},p(r,a){a&262235&&(l=Object.entries(r[6]),Pe(),e=mt(e,a,o,1,r,l,t,i.parentNode,Gt,Gc,i,Yc),Le())},i(r){if(!s){for(let a=0;a<l.length;a+=1)E(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&&y(i)}}}function xS(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){k(t,e,i)},p:le,i:le,o:le,d(t){t&&y(e)}}}function eC(n){let e,t,i;function s(){return n[9](n[14])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(l,o){k(l,e,o),t||(i=[Ye(Ct.call(null,e,"Lock and set to Admins only")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&y(e),t=!1,Qe(i)}}}function tC(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>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(l,o){k(l,e,o),t||(i=[Ye(Ct.call(null,e,"Unlock and set custom rule")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&y(e),t=!1,Qe(i)}}}function nC(n){let e;return{c(){e=N("Leave empty to grant everyone access")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function iC(n){let e;return{c(){e=N("Only admins will be able to access (unlock to change)")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function sC(n){let e,t=n[15]+"",i,s,l=Oi(n[0][n[14]])?"Admins only":"Custom rule",o,r,a,u,f=n[14],c,d,h,g,v,b,w;function C(){return n[10](n[14])}const S=()=>n[11](u,f),$=()=>n[11](null,f);function M(R){n[12](R,n[14])}var D=n[4];function O(R){let B={baseCollection:R[0],disabled:Oi(R[0][R[14]])};return R[0][R[14]]!==void 0&&(B.value=R[0][R[14]]),{props:B}}D&&(u=new D(O(n)),S(),he.push(()=>Re(u,"value",M)));function A(R,B){return B&1&&(g=null),g==null&&(g=!!Oi(R[0][R[14]])),g?iC:nC}let L=A(n,-1),F=L(n);return{c(){e=_("label"),i=N(t),s=N(" - "),o=N(l),a=T(),u&&V(u.$$.fragment),d=T(),h=_("div"),F.c(),p(e,"for",r=n[18]),p(h,"class","help-block")},m(R,B){k(R,e,B),m(e,i),m(e,s),m(e,o),k(R,a,B),u&&j(u,R,B),k(R,d,B),k(R,h,B),F.m(h,null),v=!0,b||(w=G(e,"click",C),b=!0)},p(R,B){n=R,(!
<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=N(o),a=T(),b&&b.c(),u=T(),c.c(),d=Xe(),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex"),p(e,"class","block m-b-base")},m($,M){k($,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),k($,u,M),C[f].m($,M),k($,d,M),h=!0,g||(v=G(l,"click",n[7]),g=!0)},p($,[M]){(!h||M&4)&&o!==(o=$[2]?"Hide available fields":"Show available fields")&&pe(r,o),$[2]?b?(b.p($,M),M&4&&E(b,1)):(b=Zc($),b.c(),E(b,1),b.m(e,null)):b&&(Pe(),P(b,1,1,()=>{b=null}),Le());let D=f;f=S($),f===D?C[f].p($,M):(Pe(),P(C[D],1,1,()=>{C[D]=null}),Le(),c=C[f],c?c.p($,M):(c=C[f]=w[f]($),c.c()),E(c,1),c.m(d.parentNode,d))},i($){h||(E(b),E(c),h=!0)},o($){P(b),P(c),h=!1},d($){$&&y(e),b&&b.d(),$&&y(u),C[f].d($),$&&y(d),g=!1,v()}}}function Oi(n){return n===null}function oC(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.413a6b0b.js"),[],import.meta.url)).default)}catch(w){console.warn(w),t(4,r=null)}t(5,a=!1)}Wn(()=>{f()});const c=()=>t(2,l=!l),d=async w=>{var C;t(0,i[w]=s[w]||"",i),await ei(),(C=o[w])==null||C.focus()},h=w=>{t(1,s[w]=i[w],s),t(0,i[w]=null,i)},g=w=>{var C;return(C=o[w])==null?void 0:C.focus()};function v(w,C){he[w?"unshift":"push"](()=>{o[C]=w,t(3,o)})}function b(w,C){n.$$.not_equal(i[C],w)&&(i[C]=w,t(0,i))}return n.$$set=w=>{"collection"in w&&t(0,i=w.collection)},[i,s,l,o,r,a,u,c,d,h,g,v,b]}class rC extends Ee{constructor(e){super(),Oe(this,e,oC,lC,De,{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){k(t,e,i)},d(t){t&&y(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=N(`Renamed collection
`),s=_("strong"),o=N(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=N(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,g){k(h,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&2&&l!==(l=h[1].originalName+"")&&pe(o,l),g&2&&c!==(c=h[1].name+"")&&pe(d,c)},d(h){h&&y(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=N(`Renamed field
`),s=_("strong"),o=N(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=N(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,g){k(h,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&16&&l!==(l=h[14].originalName+"")&&pe(o,l),g&16&&c!==(c=h[14].name+"")&&pe(d,c)},d(h){h&&y(e)}}}function nd(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=_("li"),t=N("Removed field "),i=_("span"),l=N(s),o=T(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(r,a){k(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+"")&&pe(l,s)},d(r){r&&y(e)}}}function aC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[3].length&&xc(),g=n[5]&&ed(n),v=n[4],b=[];for(let S=0;S<v.length;S+=1)b[S]=td(Qc(n,v,S));let w=n[3],C=[];for(let S=0;S<w.length;S+=1)C[S]=nd(Xc(n,w,S));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(),h&&h.c(),r=T(),a=_("h6"),a.textContent="Changes:",u=T(),f=_("ul"),g&&g.c(),c=T();for(let S=0;S<b.length;S+=1)b[S].c();d=T();for(let S=0;S<C.length;S+=1)C[S].c();p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning"),p(f,"class","changes-list svelte-1ghly2p")},m(S,$){k(S,e,$),m(e,t),m(e,i),m(e,s),m(s,l),m(s,o),h&&h.m(s,null),k(S,r,$),k(S,a,$),k(S,u,$),k(S,f,$),g&&g.m(f,null),m(f,c);for(let M=0;M<b.length;M+=1)b[M].m(f,null);m(f,d);for(let M=0;M<C.length;M+=1)C[M].m(f,null)},p(S,$){if(S[3].length?h||(h=xc(),h.c(),h.m(s,null)):h&&(h.d(1),h=null),S[5]?g?g.p(S,$):(g=ed(S),g.c(),g.m(f,c)):g&&(g.d(1),g=null),$&16){v=S[4];let M;for(M=0;M<v.length;M+=1){const D=Qc(S,v,M);b[M]?b[M].p(D,$):(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($&8){w=S[3];let M;for(M=0;M<w.length;M+=1){const D=Xc(S,w,M);C[M]?C[M].p(D,$):(C[M]=nd(D),C[M].c(),C[M].m(f,null))}for(;M<C.length;M+=1)C[M].d(1);C.length=w.length}},d(S){S&&y(e),h&&h.d(),S&&y(r),S&&y(a),S&&y(u),S&&y(f),g&&g.d(),Xn(b,S),Xn(C,S)}}}function uC(n){let e;return{c(){e=_("h4"),e.textContent="Confirm collection changes"},m(t,i){k(t,e,i)},p:le,d(t){t&&y(e)}}}function fC(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,p(e,"type","button"),p(e,"class","btn btn-secondary"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){k(o,e,r),k(o,t,r),k(o,i,r),e.focus(),s||(l=[G(e,"click",n[8]),G(i,"click",n[9])],s=!0)},p:le,d(o){o&&y(e),o&&y(t),o&&y(i),s=!1,Qe(l)}}}function cC(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[fC],header:[uC],default:[aC]},$$scope:{ctx:n}};return e=new di({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&524346&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),q(e,s)}}}function dC(n,e,t){let i,s,l;const o=ln();let r,a;async function u(w){t(1,a=w),await ei(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),h=()=>c();function g(w){he[w?"unshift":"push"](()=>{r=w,t(2,r)})}function v(w){ut.call(this,n,w)}function b(w){ut.call(this,n,w)}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(w=>w.id&&!w.toDelete&&w.originalName!=w.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(w=>w.id&&w.toDelete))||[])},[f,a,r,l,s,i,c,u,d,h,g,v,b]}class pC extends Ee{constructor(e){super(),Oe(this,e,dC,cC,De,{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 rC({props:o}),he.push(()=>Re(t,"collection",l)),{c(){e=_("div"),V(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){k(r,e,a),j(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||(E(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&y(e),q(t)}}}function hC(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 JS({props:a}),he.push(()=>Re(i,"collection",r));let u=n[9]===pl&&id(n);return{c(){e=_("div"),t=_("div"),V(i.$$.fragment),l=T(),u&&u.c(),p(t,"class","tab-item"),ne(t,"active",n[9]===is),p(e,"class","tabs-content svelte-b10vi")},m(f,c){k(f,e,c),m(e,t),j(i,t,null),m(e,l),u&&u.m(e,null),o=!0},p(f,c){const d={};!s&&c[0]&4&&(s=!0,d.collection=f[2],He(()=>s=!1)),i.$set(d),c[0]&512&&ne(t,"active",f[9]===is),f[9]===pl?u?(u.p(f,c),c[0]&512&&E(u,1)):(u=id(f),u.c(),E(u,1),u.m(e,null)):u&&(Pe(),P(u,1,1,()=>{u=null}),Le())},i(f){o||(E(i.$$.fragment,f),E(u),o=!0)},o(f){P(i.$$.fragment,f),P(u),o=!1},d(f){f&&y(e),q(i),u&&u.d()}}}function sd(n){let e,t,i,s,l,o,r;return o=new Hi({props:{class:"dropdown dropdown-right m
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){k(s,e,l),t||(i=G(e,"click",n[20]),t=!0)},p:le,d(s){s&&y(e),t=!1,i()}}}function ld(n){let e;return{c(){e=_("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function gC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[2].system&&ld();return{c(){e=_("label"),t=N("Name"),s=T(),l=_("input"),u=T(),h&&h.c(),f=Xe(),p(e,"for",i=n[38]),p(l,"type","text"),p(l,"id",o=n[38]),l.required=!0,l.disabled=n[11],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",'eg. "posts"'),l.value=a=n[2].name},m(g,v){k(g,e,v),m(e,t),k(g,s,v),k(g,l,v),k(g,u,v),h&&h.m(g,v),k(g,f,v),n[2].isNew&&l.focus(),c||(d=G(l,"input",n[21]),c=!0)},p(g,v){v[1]&128&&i!==(i=g[38])&&p(e,"for",i),v[1]&128&&o!==(o=g[38])&&p(l,"id",o),v[0]&2048&&(l.disabled=g[11]),v[0]&4&&r!==(r=g[2].isNew)&&(l.autofocus=r),v[0]&4&&a!==(a=g[2].name)&&l.value!==a&&(l.value=a),g[2].system?h||(h=ld(),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},d(g){g&&y(e),g&&y(s),g&&y(l),g&&y(u),h&&h.d(g),g&&y(f),c=!1,d()}}}function od(n){let e,t,i,s,l,o;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){k(r,e,a),s=!0,l||(o=Ye(t=Ct.call(null,e,n[12])),l=!0)},p(r,a){t&&Un(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&Dt(()=>{i||(i=rt(e,Vn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=rt(e,Vn,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&y(e),r&&i&&i.end(),l=!1,o()}}}function rd(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){k(o,e,r),i=!0,s||(l=Ye(Ct.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Dt(()=>{t||(t=rt(e,Vn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=rt(e,Vn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function _C(n){var R,B,te,Z,H,J;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,h,g,v=!Y.isEmpty((R=n[4])==null?void 0:R.schema),b,w,C,S,$=!Y.isEmpty((B=n[4])==null?void 0:B.listRule)||!Y.isEmpty((te=n[4])==null?void 0:te.viewRule)||!Y.isEmpty((Z=n[4])==null?void 0:Z.createRule)||!Y.isEmpty((H=n[4])==null?void 0:H.updateRule)||!Y.isEmpty((J=n[4])==null?void 0:J.deleteRule),M,D,O,A=!n[2].isNew&&!n[2].system&&sd(n);r=new Ne({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[gC,({uniqueId:U})=>({38:U}),({uniqueId:U})=>[0,U?128:0]]},$$scope:{ctx:n}}});let L=v&&od(n),F=$&&rd();return{c(){e=_("h4"),i=N(t),s=T(),A&&A.c(),l=T(),o=_("form"),V(r.$$.fragment),a=T(),u=_("input"),f=T(),c=_("div"),d=_("button"),h=_("span"),h.textContent="Fields",g=T(),L&&L.c(),b=T(),w=_("button"),C=_("span"),C.textContent="API Rules",S=T(),F&&F.c(),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ne(d,"active",n[9]===is),p(C,"class","txt"),p(w,"type","button"),p(w,"class","tab-item"),ne(w,"active",n[9]===pl),p(c,"class","tabs-header stretched")},m(U,Q){k(U,e,Q),m(e,i),k(U,s,Q),A&&A.m(U,Q),k(U,l,Q),k(U,o,Q),j(r,o,null),m(o,a),m(o,u),k(U,f,Q),k(U,c,Q),m(c,d),m(d,h),m(d,g),L&&L.m(d,null),m(c,b),m(c,w),m(w,C),m(w,S),F&&F.m(w,null),M=!0,D||(O=[G(o,"submit",Yt(n[22])),G(d,"click",n[23]),G(w,"click",n[24])],D=!0)},p(U,Q){var ae,be,se,ge,$e,W;(!M||Q[0]&4)&&t!==(t=U[2].isNew?"New collection":"Edit collection")&&pe(i,t),!U[2].isNew&&!U[2].system?A?(A.p(U,Q),Q[0]&4&&E(A,1)):(A=sd(U),A.c(),E(A,1),A.m(l.parentNode,l)):A&&(Pe(),P(A,1,1,()=>{A=null}),Le());const oe={};Q[0]&2048&&(oe.class="form-field required m-b-0 "+(U[11]?"disabled":"")),Q[0]&2052|Q[1]&384&&(oe.$$scope={dirty:Q,ctx:U}),r.$set(oe),Q[0]&16&&(v=!Y.isEmpty((ae=U[4])==null?void 0:ae.schema)),v?L?(L.p(U,Q),Q[0]&16&&E(L,1)):(L=od(U),L.c(),E(L,1),L.m(d,null)):L&&(Pe(),P(L,1,1,()=>{L=null}),Le()),Q[0]&512&&ne(d,"active",U[9]===is),Q[0]&16&&($=!Y.isEmpty((be=U[4])==null?void 0:be.listRule)||!Y.isEmpty((se=U[4])==null?void 0:se.viewRule)||!Y.isEmpty((ge=U[4])==null?void 0:ge.createRu
<span class="txt">New collection</span>`,w=T(),V(C.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-secondary btn-circle btn-clear"),ne(l,"hidden",!n[4]),p(s,"class","form-field-addon"),p(r,"type","text"),p(r,"placeholder","Search collections..."),p(i,"class","form-field search"),ne(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),p(b,"type","button"),p(b,"class","btn btn-block btn-outline"),p(v,"class","sidebar-footer"),p(e,"class","page-sidebar collection-sidebar")},m(F,R){k(F,e,R),m(e,t),m(t,i),m(i,s),m(s,l),m(i,o),m(i,r),Me(r,n[0]),m(e,a),m(e,u),m(e,f),m(e,c);for(let B=0;B<d.length;B+=1)d[B].m(c,null);A&&A.m(c,null),m(e,g),m(e,v),m(v,b),k(F,w,R),j(C,F,R),S=!0,$||(M=[G(l,"click",n[8]),G(r,"input",n[9]),G(b,"click",n[11])],$=!0)},p(F,[R]){R&16&&ne(l,"hidden",!F[4]),R&1&&r.value!==F[0]&&Me(r,F[0]),R&16&&ne(i,"active",F[4]),R&106&&(D=F[3],d=mt(d,R,O,1,F,D,h,c,mn,cd,null,ad),!D.length&&A?A.p(F,R):D.length?A&&(A.d(1),A=null):(A=ud(F),A.c(),A.m(c,null)));const B={};C.$set(B)},i(F){S||(E(C.$$.fragment,F),S=!0)},o(F){P(C.$$.fragment,F),S=!1},d(F){F&&y(e);for(let R=0;R<d.length;R+=1)d[R].d();A&&A.d(),F&&y(w),n[12](null),q(C,F),$=!1,Qe(M)}}}function SC(n,e,t){let i,s,l,o,r;kt(n,ri,b=>t(5,o=b)),kt(n,Ms,b=>t(7,r=b));let a,u="";function f(b){fn(ri,o=b,o)}const c=()=>t(0,u="");function d(){u=this.value,t(0,u)}const h=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,h,g,v]}class CC extends Ee{constructor(e){super(),Oe(this,e,SC,$C,De,{})}}function MC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,w,C,S,$,M,D,O,A,L,F,R,B,te,Z,H,J,U,Q,oe,ae,be,se,ge,$e,W,ye,ee,X,Se,je,Ue,K,de,fe,ke,Ze;return{c(){e=_("p"),e.innerHTML=`The syntax basically follows the format
<code><span class="txt-success">OPERAND</span>
<span class="txt-danger">OPERATOR</span>
<span class="txt-success">OPERAND</span></code>, where:`,t=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=N(` - is one of:
`),u=_("br"),f=T(),c=_("ul"),d=_("li"),h=_("code"),h.textContent="=",g=T(),v=_("span"),v.textContent="Equal",b=T(),w=_("li"),C=_("code"),C.textContent="!=",S=T(),$=_("span"),$.textContent="NOT equal",M=T(),D=_("li"),O=_("code"),O.textContent=">",A=T(),L=_("span"),L.textContent="Greater than",F=T(),R=_("li"),B=_("code"),B.textContent=">=",te=T(),Z=_("span"),Z.textContent="Greater than or equal",H=T(),J=_("li"),U=_("code"),U.textContent="<",Q=T(),oe=_("span"),oe.textContent="Less than or equal",ae=T(),be=_("li"),se=_("code"),se.textContent="<=",ge=T(),$e=_("span"),$e.textContent="Less than or equal",W=T(),ye=_("li"),ee=_("code"),ee.textContent="~",X=T(),Se=_("span"),Se.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
match)`,je=T(),Ue=_("li"),K=_("code"),K.textContent="!~",de=T(),fe=_("span"),fe.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,ke=T(),Ze=_("p"),Ze.innerHTML=`To group and combine several expressions you could use brackets
<code>(...)</code>, <code>&amp;&amp;</code> (AND) and <code>||</code> (OR) tokens.`,p(r,"class","txt-danger"),p(h,"class","filter-op svelte-1w7s5nw"),p(v,"class","txt-hint"),p(C,"class","filter-op svelte-1w7s5nw"),p($,"class","txt-hint"),p(O,"class","filter-op svelte-1w7s5nw"),p(L,"class","txt-hint"),p(B,"class","filter-op svelte-1w7s5nw"),p(Z,"class","txt-hint"),p(U,"class","filter-op svelte-1w7s5nw"),p(oe,"class","txt-hint"),p(se,"class","filter-op svelte-1w7s5nw"),p($e,"class","txt-hint"),p(ee,"class","filter-op svelte-1w7s5nw"),p(Se,"class","txt-hint"),p(K,"class","filter-op svelte-1w7s5nw"),p(fe,"class","txt-hint")},m(tt,We){k(tt,e,We),k(tt,t,We),k(tt,i,We),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(c,d),m(d,h),m(d,g),m(d,v),m(c,b),m(c,w),m(w,C),m(w,S),m(w,$),m(c,M),m(c,D),m(D,O),m(D,A),m(D,L),m(c,F),m(c,R),m(R,B),m(R,te),m(R,Z),m(c,H),m(c,J),m(J,U),m(J,Q),m(J,oe),m(c,ae),m(c,be),m(be,se),m(be,ge),m(be,$e),m(c,W),m(c,ye),m(ye,ee),m(ye,X),m(ye,Se),m(c,je),m(c,Ue),m(Ue,K),m(Ue,de),m(Ue,fe),k(tt,ke,We),k(tt,Ze,We)},p:le,i:le,o:le,d(tt){tt&&y(e),tt&&y(t),tt&&y(i),tt&&y(ke),tt&&y(Ze)}}}class TC extends Ee{constructor(e){super(),Oe(this,e,null,MC,De,{})}}function dd(n,e,t){const i=n.slice();return i[5]=e[t],i}function pd(n,e,t){const i=n.slice();return i[5]=e[t],i}function hd(n,e){let t,i,s=e[5].title+"",l,o,r,a;function u(){return e[4](e[5])}return{key:n,first:null,c(){t=_("button"),i=_("div"),l=N(s),o=T(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),ne(t,"active",e[0]===e[5].language),this.first=t},m(f,c){k(f,t,c),m(t,i),m(i,l),m(t,o),r||(a=G(t,"click",u),r=!0)},p(f,c){e=f,c&2&&s!==(s=e[5].title+"")&&pe(l,s),c&3&&ne(t,"active",e[0]===e[5].language)},d(f){f&&y(t),r=!1,a()}}}function md(n,e){let t,i,s,l;return i=new hn({props:{language:e[5].language,content:e[5].content}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item svelte-1maocj6"),ne(t,"active",e[0]===e[5].language),this.first=t},m(o,r){k(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&2&&(a.language=e[5].language),r&2&&(a.content=e[5].content),i.$set(a),r&3&&ne(t,"active",e[0]===e[5].language)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&y(t),q(i)}}}function DC(n){let e,t,i=[],s=new Map,l,o,r=[],a=new Map,u,f=n[1];const c=g=>g[5].language;for(let g=0;g<f.length;g+=1){let v=pd(n,f,g),b=c(v);s.set(b,i[g]=hd(b,v))}let d=n[1];const h=g=>g[5].language;for(let g=0;g<d.length;g+=1){let v=dd(n,d,g),b=h(v);a.set(b,r[g]=md(b,v))}return{c(){e=_("div"),t=_("div");for(let g=0;g<i.length;g+=1)i[g].c();l=T(),o=_("div");for(let g=0;g<r.length;g+=1)r[g].c();p(t,"class","tabs-header compact left"),p(o,"class","tabs-content"),p(e,"class","tabs sdk-tabs m-b-lg svelte-1maocj6")},m(g,v){k(g,e,v),m(e,t);for(let b=0;b<i.length;b+=1)i[b].m(t,null);m(e,l),m(e,o);for(let b=0;b<r.length;b+=1)r[b].m(o,null);u=!0},p(g,[v]){v&3&&(f=g[1],i=mt(i,v,c,1,g,f,s,t,mn,hd,null,pd)),v&3&&(d=g[1],Pe(),r=mt(r,v,h,1,g,d,a,o,Gt,md,null,dd),Le())},i(g){if(!u){for(let v=0;v<d.length;v+=1)E(r[v]);u=!0}},o(g){for(let v=0;v<r.length;v+=1)P(r[v]);u=!1},d(g){g&&y(e);for(let v=0;v<i.length;v+=1)i[v].d();for(let v=0;v<r.length;v+=1)r[v].d()}}}const gd="pb_sdk_preference";function OC(n,e,t){let i,{js:s=""}=e,{dart:l=""}=e,o=localStorage.getItem(gd)||"javascript";const r=a=>t(0,o=a.language);return n.$$set=a=>{"js"in a&&t(2,s=a.js),"dart"in a&&t(3,l=a.dart)},n.$$.update=()=>{n.$$.dirty&1&&o&&localStorage.setItem(gd,o),n.$$.dirty&12&&t(1,i=[{title:"JavaScript",language:"javascript",content:s},{title:"Dart",language:"dart",content:l}])},[o,i,s,l,r]}class As extends Ee{constructor(e){super(),Oe(this,e,OC,DC,De,{js:2,dart:3})}}function _d(n,e,t){const i=n.slice();return i[6]=e[t],i}function bd(n,e,t){const i=n.slice();return i[6]=e[t],i}function vd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function yd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_(
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
// fetch a paginated records list
const resultList = await client.records.getList('${(pi=n[0])==null?void 0:pi.name}', 1, 50, {
filter: 'created >= '2022-01-01 00:00:00'',
});
// alternatively you can also fetch all records at once via getFullList:
const records = await client.records.getFullList('${(Cl=n[0])==null?void 0:Cl.name}', 200 /* batch size */, {
sort: '-created',
});
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
// fetch a paginated records list
final result = await client.records.getList(
'${(fs=n[0])==null?void 0:fs.name}',
page: 1,
perPage: 50,
filter: 'created >= "2022-01-01 00:00:00"',
);
// alternatively you can also fetch all records at once via getFullList:
final records = await client.records.getFullList('${(Ml=n[0])==null?void 0:Ml.name}', batch: 200, sort: '-created');
`}}),K=new hn({props:{content:`
// DESC by created and ASC by id
?sort=-created,id
`}}),ze=new hn({props:{content:`
?filter=(id='abc' && created>'2022-01-01')
`}}),st=new TC({}),wt=new hn({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let ht=n[4];const on=qe=>qe[6].code;for(let qe=0;qe<ht.length;qe+=1){let xe=bd(n,ht,qe),Xt=on(xe);Ae.set(Xt,re[qe]=yd(Xt,xe))}let qt=n[4];const Si=qe=>qe[6].code;for(let qe=0;qe<qt.length;qe+=1){let xe=_d(n,qt,qe),Xt=Si(xe);ue.set(Xt,Te[qe]=kd(Xt,xe))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records"),c=T(),Ie&&Ie.c(),d=T(),h=_("div"),g=_("p"),v=N("Fetch a paginated "),b=_("strong"),C=N(w),S=N(" records list."),$=T(),M=_("div"),M.textContent="Client SDKs example",D=T(),V(O.$$.fragment),A=T(),L=_("div"),L.textContent="Query parameters",F=T(),R=_("table"),B=_("thead"),B.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,te=T(),Z=_("tbody"),H=_("tr"),H.innerHTML=`<td>page</td>
<td><span class="label">Number</span></td>
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,J=T(),U=_("tr"),U.innerHTML=`<td>perPage</td>
<td><span class="label">Number</span></td>
<td>Specify the max returned records per page (default to 30).</td>`,Q=T(),oe=_("tr"),ae=_("td"),ae.textContent="sort",be=T(),se=_("td"),se.innerHTML='<span class="label">String</span>',ge=T(),$e=_("td"),W=N("Specify the records order attribute(s). "),ye=_("br"),ee=N(`
Add `),X=_("code"),X.textContent="-",Se=N(" / "),je=_("code"),je.textContent="+",Ue=N(` (default) in front of the attribute for DESC / ASC order.
Ex.:
`),V(K.$$.fragment),de=T(),fe=_("tr"),ke=_("td"),ke.textContent="filter",Ze=T(),tt=_("td"),tt.innerHTML='<span class="label">String</span>',We=T(),it=_("td"),Ce=N(`Filter the returned records. Ex.:
`),V(ze.$$.fragment),Je=T(),V(st.$$.fragment),ct=T(),me=_("tr"),Fe=_("td"),Fe.textContent="expand",nt=T(),ft=_("td"),ft.innerHTML='<span class="label">String</span>',vt=T(),ot=_("td"),Ot=N(`Auto expand record relations. Ex.:
`),V(wt.$$.fragment),jt=N(`
Supports up to 6-levels depth nested relations expansion. `),Nt=_("br"),Ke=N(`
The expanded relations will be appended to each individual record under the
`),we=_("code"),we.textContent="@expand",Be=N(" property (eg. "),et=_("code"),et.textContent='"@expand": {"rel1": {...}, ...}',at=N(`). Only the
relations that the user has permissions to `),Pt=_("strong"),Pt.textContent="view",Ft=N(" will be expanded."),Lt=T(),lt=_("div"),lt.textContent="Responses",I=T(),z=_("div"),x=_("div");for(let qe=0;qe<re.length;qe+=1)re[qe].c();ie=T(),ve=_("div");for(let qe=0;qe<Te.length;qe+=1)Te[qe].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(h,"class","content m-b-base"),p(M,"class","section-title"),p(L,"class","section-title"),p(R,"class","table-compact table-border m-b-lg"),p(lt,"class","section-title"),p(x,"class","tabs-header compact left"),p(ve,"class","tabs-content"),p(z,"class","tabs")},m(qe,xe){k(qe,e,xe),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),Ie&&Ie.m(e,null),k(qe,d,xe),k(qe,h,xe),m(h,g),m(g,v),m(g,b),m(b,C),m(g,S),k(qe,$,xe),k(qe,M,xe),k(qe,D,xe),j(O,qe,xe),k(qe,A,xe),k(qe,L,xe),k(qe,F,xe),k(qe,R,xe),m(R,B),m(R,te),m(R,Z),m(Z,H),m(Z,J),m(Z,U),m(Z,Q),m(Z,oe),m(oe,ae),m(oe,be),m(oe,se),m(oe,ge),m(oe,$e),m($e,W),m($e,ye),m($e,ee),m($e,X),m($e,Se),m($e,je),m($e,Ue),j(K,$e,null),m(Z,de),m(Z,fe),m(fe,ke),m(fe,Ze),m(fe,tt),m(fe,We),m(fe,it),m(it,Ce),j(ze,it,null),m(it,Je),j(st,it,null),m(Z,ct),m(Z,me),m(me,Fe),m(me,nt),m(me,ft),m(me,vt),m(me,ot),m(ot,Ot),j(wt,ot,null),m(ot,jt),m(ot,Nt),m(ot,Ke),m(ot,we),m(ot,Be),m(ot,et),m(ot,at),m(ot,Pt),m(ot,Ft),k(qe,Lt,xe),k(qe,lt,xe),k(qe,I,xe),k(qe,z,xe),m(z,x);for(let Xt=0;Xt<re.length;Xt+=1)re[Xt].m(x,null);m(z,ie),m(z,ve);for(let Xt=0;Xt<Te.length;Xt+=1)Te[Xt].m(ve,null);ce=!0},p(qe,[xe]){var Tl,Dl,Ol,El;(!ce||xe&1)&&a!==(a=qe[0].name+"")&&pe(u,a),qe[1]?Ie||(Ie=vd(),Ie.c(),Ie.m(e,null)):Ie&&(Ie.d(1),Ie=null),(!ce||xe&1)&&w!==(w=qe[0].name+"")&&pe(C,w);const Xt={};xe&9&&(Xt.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${qe[3]}');
...
// fetch a paginated records list
const resultList = await client.records.getList('${(Tl=qe[0])==null?void 0:Tl.name}', 1, 50, {
filter: 'created >= '2022-01-01 00:00:00'',
});
// alternatively you can also fetch all records at once via getFullList:
const records = await client.records.getFullList('${(Dl=qe[0])==null?void 0:Dl.name}', 200 /* batch size */, {
sort: '-created',
});
`),xe&9&&(Xt.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${qe[3]}');
...
// fetch a paginated records list
final result = await client.records.getList(
'${(Ol=qe[0])==null?void 0:Ol.name}',
page: 1,
perPage: 50,
filter: 'created >= "2022-01-01 00:00:00"',
);
// alternatively you can also fetch all records at once via getFullList:
final records = await client.records.getFullList('${(El=qe[0])==null?void 0:El.name}', batch: 200, sort: '-created');
`),O.$set(Xt),xe&20&&(ht=qe[4],re=mt(re,xe,on,1,qe,ht,Ae,x,mn,yd,null,bd)),xe&20&&(qt=qe[4],Pe(),Te=mt(Te,xe,Si,1,qe,qt,ue,ve,Gt,kd,null,_d),Le())},i(qe){if(!ce){E(O.$$.fragment,qe),E(K.$$.fragment,qe),E(ze.$$.fragment,qe),E(st.$$.fragment,qe),E(wt.$$.fragment,qe);for(let xe=0;xe<qt.length;xe+=1)E(Te[xe]);ce=!0}},o(qe){P(O.$$.fragment,qe),P(K.$$.fragment,qe),P(ze.$$.fragment,qe),P(st.$$.fragment,qe),P(wt.$$.fragment,qe);for(let xe=0;xe<Te.length;xe+=1)P(Te[xe]);ce=!1},d(qe){qe&&y(e),Ie&&Ie.d(),qe&&y(d),qe&&y(h),qe&&y($),qe&&y(M),qe&&y(D),q(O,qe),qe&&y(A),qe&&y(L),qe&&y(F),qe&&y(R),q(K),q(ze),q(st),q(wt),qe&&y(Lt),qe&&y(lt),qe&&y(I),qe&&y(z);for(let xe=0;xe<re.length;xe+=1)re[xe].d();for(let xe=0;xe<Te.length;xe+=1)Te[xe].d()}}}function AC(n,e,t){let i,s,{collection:l=new An}=e,o=200,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.listRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[Y.dummyCollectionRecord(l),Y.dummyCollectionRecord(l)]},null,2)}),r.push({code:400,body:`
{
"code": 400,
"message": "Something went wrong while processing your request. Invalid filter.",
"data": {}
}
`}),i&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},t(3,s=window.location.href.substring(0,window.location.href.indexOf("/_"))||_e.baseUrl),[l,i,o,s,r,a]}class PC extends Ee{constructor(e){super(),Oe(this,e,AC,EC,De,{collection:0})}}function wd(n,e,t){const i=n.slice();return i[6]=e[t],i}function $d(n,e,t){const i=n.slice();return i[6]=e[t],i}function Sd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function Cd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=T(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[6].code),this.first=t},m(u,f){k(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ne(t,"active",e[2]===e[6].code)},d(u){u&&y(t),o=!1,r()}}}function Md(n,e){let t,i,s,l;return i=new hn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[6].code),this.first=t},m(o,r){k(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&20&&ne(t,"active",e[2]===e[6].code)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&y(t),q(i)}}}function LC(n){var Nt,Ke;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,w,C=n[0].name+"",S,$,M,D,O,A,L,F,R,B,te,Z,H,J,U,Q,oe,ae,be,se,ge,$e,W,ye,ee,X,Se,je,Ue,K,de,fe,ke,Ze,tt,We,it,Ce,ze,Je=[],st=new Map,ct,me,Fe=[],nt=new Map,ft,vt=n[1]&&Sd();A=new As({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
const record = await client.records.getOne('${(Nt=n[0])==null?void 0:Nt.name}', 'RECORD_ID', {
expand: 'some_relation'
});
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
final record = await client.records.getOne('${(Ke=n[0])==null?void 0:Ke.name}', 'RECORD_ID', query: {
'expand': 'some_relation',
});
`}}),ee=new hn({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let ot=n[4];const Ot=we=>we[6].code;for(let we=0;we<ot.length;we+=1){let Be=$d(n,ot,we),et=Ot(Be);st.set(et,Je[we]=Cd(et,Be))}let wt=n[4];const jt=we=>we[6].code;for(let we=0;we<wt.length;we+=1){let Be=wd(n,wt,we),et=jt(Be);nt.set(et,Fe[we]=Md(et,Be))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records/"),c=_("strong"),c.textContent=":id",d=T(),vt&&vt.c(),h=T(),g=_("div"),v=_("p"),b=N("Fetch a single "),w=_("strong"),S=N(C),$=N(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",O=T(),V(A.$$.fragment),L=T(),F=_("div"),F.textContent="Path Parameters",R=T(),B=_("table"),B.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to view.</td></tr></tbody>`,te=T(),Z=_("div"),Z.textContent="Query parameters",H=T(),J=_("table"),U=_("thead"),U.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,Q=T(),oe=_("tbody"),ae=_("tr"),be=_("td"),be.textContent="expand",se=T(),ge=_("td"),ge.innerHTML='<span class="label">String</span>',$e=T(),W=_("td"),ye=N(`Auto expand record relations. Ex.:
`),V(ee.$$.fragment),X=N(`
Supports up to 6-levels depth nested relations expansion. `),Se=_("br"),je=N(`
The expanded relations will be appended to the record under the
`),Ue=_("code"),Ue.textContent="@expand",K=N(" property (eg. "),de=_("code"),de.textContent='"@expand": {"rel1": {...}, ...}',fe=N(`). Only the
relations that the user has permissions to `),ke=_("strong"),ke.textContent="view",Ze=N(" will be expanded."),tt=T(),We=_("div"),We.textContent="Responses",it=T(),Ce=_("div"),ze=_("div");for(let we=0;we<Je.length;we+=1)Je[we].c();ct=T(),me=_("div");for(let we=0;we<Fe.length;we+=1)Fe[we].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(g,"class","content m-b-base"),p(D,"class","section-title"),p(F,"class","section-title"),p(B,"class","table-compact table-border m-b-lg"),p(Z,"class","section-title"),p(J,"class","table-compact table-border m-b-lg"),p(We,"class","section-title"),p(ze,"class","tabs-header compact left"),p(me,"class","tabs-content"),p(Ce,"class","tabs")},m(we,Be){k(we,e,Be),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),vt&&vt.m(e,null),k(we,h,Be),k(we,g,Be),m(g,v),m(v,b),m(v,w),m(w,S),m(v,$),k(we,M,Be),k(we,D,Be),k(we,O,Be),j(A,we,Be),k(we,L,Be),k(we,F,Be),k(we,R,Be),k(we,B,Be),k(we,te,Be),k(we,Z,Be),k(we,H,Be),k(we,J,Be),m(J,U),m(J,Q),m(J,oe),m(oe,ae),m(ae,be),m(ae,se),m(ae,ge),m(ae,$e),m(ae,W),m(W,ye),j(ee,W,null),m(W,X),m(W,Se),m(W,je),m(W,Ue),m(W,K),m(W,de),m(W,fe),m(W,ke),m(W,Ze),k(we,tt,Be),k(we,We,Be),k(we,it,Be),k(we,Ce,Be),m(Ce,ze);for(let et=0;et<Je.length;et+=1)Je[et].m(ze,null);m(Ce,ct),m(Ce,me);for(let et=0;et<Fe.length;et+=1)Fe[et].m(me,null);ft=!0},p(we,[Be]){var at,Pt;(!ft||Be&1)&&a!==(a=we[0].name+"")&&pe(u,a),we[1]?vt||(vt=Sd(),vt.c(),vt.m(e,null)):vt&&(vt.d(1),vt=null),(!ft||Be&1)&&C!==(C=we[0].name+"")&&pe(S,C);const et={};Be&9&&(et.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${we[3]}');
...
const record = await client.records.getOne('${(at=we[0])==null?void 0:at.name}', 'RECORD_ID', {
expand: 'some_relation'
});
`),Be&9&&(et.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${we[3]}');
...
final record = await client.records.getOne('${(Pt=we[0])==null?void 0:Pt.name}', 'RECORD_ID', query: {
'expand': 'some_relation',
});
`),A.$set(et),Be&20&&(ot=we[4],Je=mt(Je,Be,Ot,1,we,ot,st,ze,mn,Cd,null,$d)),Be&20&&(wt=we[4],Pe(),Fe=mt(Fe,Be,jt,1,we,wt,nt,me,Gt,Md,null,wd),Le())},i(we){if(!ft){E(A.$$.fragment,we),E(ee.$$.fragment,we);for(let Be=0;Be<wt.length;Be+=1)E(Fe[Be]);ft=!0}},o(we){P(A.$$.fragment,we),P(ee.$$.fragment,we);for(let Be=0;Be<Fe.length;Be+=1)P(Fe[Be]);ft=!1},d(we){we&&y(e),vt&&vt.d(),we&&y(h),we&&y(g),we&&y(M),we&&y(D),we&&y(O),q(A,we),we&&y(L),we&&y(F),we&&y(R),we&&y(B),we&&y(te),we&&y(Z),we&&y(H),we&&y(J),q(ee),we&&y(tt),we&&y(We),we&&y(it),we&&y(Ce);for(let Be=0;Be<Je.length;Be+=1)Je[Be].d();for(let Be=0;Be<Fe.length;Be+=1)Fe[Be].d()}}}function FC(n,e,t){let i,s,{collection:l=new An}=e,o=200,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.viewRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify(Y.dummyCollectionRecord(l),null,2)}),i&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},t(3,s=window.location.href.substring(0,window.location.href.indexOf("/_"))||_e.baseUrl),[l,i,o,s,r,a]}class IC extends Ee{constructor(e){super(),Oe(this,e,FC,LC,De,{collection:0})}}function Td(n,e,t){const i=n.slice();return i[6]=e[t],i}function Dd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Od(n,e,t){const i=n.slice();return i[11]=e[t],i}function Ed(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function NC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function RC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function HC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("User "),i=N(t),s=N(".")},m(o,r){k(o,e,r),k(o,i,r),k(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&pe(i,t)},d(o){o&&y(e),o&&y(i),o&&y(s)}}}function jC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("Relation record "),i=N(t),s=N(".")},m(o,r){k(o,e,r),k(o,i,r),k(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&pe(i,t)},d(o){o&&y(e),o&&y(i),o&&y(s)}}}function qC(n){let e,t,i,s,l;return{c(){e=N("FormData object."),t=_("br"),i=N(`
Set to `),s=_("code"),s.textContent="null",l=N(" to delete already uploaded file(s).")},m(o,r){k(o,e,r),k(o,t,r),k(o,i,r),k(o,s,r),k(o,l,r)},p:le,d(o){o&&y(e),o&&y(t),o&&y(i),o&&y(s),o&&y(l)}}}function VC(n){let e;return{c(){e=N("URL address.")},m(t,i){k(t,e,i)},p:le,d(t){t&&y(e)}}}function zC(n){let e;return{c(){e=N("Email address.")},m(t,i){k(t,e,i)},p:le,d(t){t&&y(e)}}}function BC(n){let e;return{c(){e=N("JSON array or object.")},m(t,i){k(t,e,i)},p:le,d(t){t&&y(e)}}}function UC(n){let e;return{c(){e=N("Number value.")},m(t,i){k(t,e,i)},p:le,d(t){t&&y(e)}}}function WC(n){let e;return{c(){e=N("Plain text value.")},m(t,i){k(t,e,i)},p:le,d(t){t&&y(e)}}}function Ad(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=Y.getFieldValueType(e[11])+"",h,g,v,b;function w(O,A){return O[11].required?RC:NC}let C=w(e),S=C(e);function $(O,A){if(O[11].type==="text")return WC;if(O[11].type==="number")return UC;if(O[11].type==="json")return BC;if(O[11].type==="email")return zC;if(O[11].type==="url")return VC;if(O[11].type==="file")return qC;if(O[11].type==="relation")return jC;if(O[11].type==="user")return HC}let M=$(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),S.c(),l=T(),o=_("span"),a=N(r),u=T(),f=_("td"),c=_("span"),h=N(d),g=T(),v=_("td"),D&&D.c(),b=T(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(O,A){k(O,t,A),m(t,i),m(i,s),S.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,v),D&&D.m(v,null),m(t,b)},p(O,A){e=O,C!==(C=w(e))&&(S.d(1),S=C(e),S&&(S.c(),S.m(s,l))),A&1&&r!==(r=e[11].name+"")&&pe(a,r),A&1&&d!==(d=Y.getFieldValueType(e[11])+"")&&pe(h,d),M===(M=$(e))&&D?D.p(e,A):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(O){O&&y(t),S.d(),D&&D.d()}}}function Pd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=T(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[6].code),this.first=t},m(u,f){k(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&pe(s,i),f&6&&ne(t,"active",e[1]===e[6].code)},d(u){u&&y(t),o=!1,r()}}}function Ld(n,e){let t,i,s,l;return i=new hn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[6].code),this.first=t},m(o,r){k(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),r&6&&ne(t,"active",e[1]===e[6].code)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&y(t),q(i)}}}function YC(n){var x,re,Ae;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,w=n[0].name+"",C,S,$,M,D,O,A,L,F,R,B,te,Z,H,J,U,Q,oe,ae,be=[],se=new Map,ge,$e,W,ye,ee,X,Se,je,Ue,K,de,fe,ke,Ze,tt,We,it,Ce,ze,Je,st,ct,me,Fe,nt,ft,vt,ot,Ot,wt=[],jt=new Map,Nt,Ke,we=[],Be=new Map,et,at=n[4]&&Ed();R=new As({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
const data = { ... };
const record = await client.records.create('${(x=n[0])==null?void 0:x.name}', data);
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
final body = <String, dynamic>{ ... };
final record = await client.records.create('${(re=n[0])==null?void 0:re.name}', body: body);
`}});let Pt=(Ae=n[0])==null?void 0:Ae.schema;const Ft=ie=>ie[11].name;for(let ie=0;ie<Pt.length;ie+=1){let ve=Od(n,Pt,ie),Te=Ft(ve);se.set(Te,be[ie]=Ad(Te,ve))}tt=new hn({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let Lt=n[2];const lt=ie=>ie[6].code;for(let ie=0;ie<Lt.length;ie+=1){let ve=Dd(n,Lt,ie),Te=lt(ve);jt.set(Te,wt[ie]=Pd(Te,ve))}let I=n[2];const z=ie=>ie[6].code;for(let ie=0;ie<I.length;ie+=1){let ve=Td(n,I,ie),Te=z(ve);Be.set(Te,we[ie]=Ld(Te,ve))}return{c(){e=_("div"),t=_("strong"),t.textContent="POST",i=T(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records"),c=T(),at&&at.c(),d=T(),h=_("div"),g=_("p"),v=N("Create a new "),b=_("strong"),C=N(w),S=N(" record."),$=T(),M=_("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,D=T(),O=_("p"),O.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",A=T(),L=_("div"),L.textContent="Client SDKs example",F=T(),V(R.$$.fragment),B=T(),te=_("div"),te.textContent="Body Parameters",Z=T(),H=_("table"),J=_("thead"),J.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,U=T(),Q=_("tbody"),oe=_("tr"),oe.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>id</span></div></td>
<td><span class="label">String</span></td>
<td><strong>15 characters string</strong> to store as record ID.
<br/>
If not set, it will be auto generated.</td>`,ae=T();for(let ie=0;ie<be.length;ie+=1)be[ie].c();ge=T(),$e=_("div"),$e.textContent="Query parameters",W=T(),ye=_("table"),ee=_("thead"),ee.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,X=T(),Se=_("tbody"),je=_("tr"),Ue=_("td"),Ue.textContent="expand",K=T(),de=_("td"),de.innerHTML='<span class="label">String</span>',fe=T(),ke=_("td"),Ze=N(`Auto expand relations when returning the created record. Ex.:
`),V(tt.$$.fragment),We=N(`
Supports up to 6-levels depth nested relations expansion. `),it=_("br"),Ce=N(`
The expanded relations will be appended to the record under the
`),ze=_("code"),ze.textContent="@expand",Je=N(" property (eg. "),st=_("code"),st.textContent='"@expand": {"rel1": {...}, ...}',ct=N(`). Only the
relations that the user has permissions to `),me=_("strong"),me.textContent="view",Fe=N(" will be expanded."),nt=T(),ft=_("div"),ft.textContent="Responses",vt=T(),ot=_("div"),Ot=_("div");for(let ie=0;ie<wt.length;ie+=1)wt[ie].c();Nt=T(),Ke=_("div");for(let ie=0;ie<we.length;ie+=1)we[ie].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-success"),p(h,"class","content m-b-base"),p(L,"class","section-title"),p(te,"class","section-title"),p(H,"class","table-compact table-border m-b-lg"),p($e,"class","section-title"),p(ye,"class","table-compact table-border m-b-lg"),p(ft,"class","section-title"),p(Ot,"class","tabs-header compact left"),p(Ke,"class","tabs-content"),p(ot,"class","tabs")},m(ie,ve){k(ie,e,ve),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),at&&at.m(e,null),k(ie,d,ve),k(ie,h,ve),m(h,g),m(g,v),m(g,b),m(b,C),m(g,S),m(h,$),m(h,M),m(h,D),m(h,O),k(ie,A,ve),k(ie,L,ve),k(ie,F,ve),j(R,ie,ve),k(ie,B,ve),k(ie,te,ve),k(ie,Z,ve),k(ie,H,ve),m(H,J),m(H,U),m(H,Q),m(Q,oe),m(Q,ae);for(let Te=0;Te<be.length;Te+=1)be[Te].m(Q,null);k(ie,ge,ve),k(ie,$e,ve),k(ie,W,ve),k(ie,ye,ve),m(ye,ee),m(ye,X),m(ye,Se),m(Se,je),m(je,Ue),m(je,K),m(je,de),m(je,fe),m(je,ke),m(ke,Ze),j(tt,ke,null),m(ke,We),m(ke,it),m(ke,Ce),m(ke,ze),m(ke,Je),m(ke,st),m(ke,ct),m(ke,me),m(ke,Fe),k(ie,nt,ve),k(ie,ft,ve),k(ie,vt,ve),k(ie,ot,ve),m(ot,Ot);for(let Te=0;Te<wt.length;Te+=1)wt[Te].m(Ot,null);m(ot,Nt),m(ot,Ke);for(let Te=0;Te<we.length;Te+=1)we[Te].m(Ke,null);et=!0},p(ie,[ve]){var ue,ce,Ie;(!et||ve&1)&&a!==(a=ie[0].name+"")&&pe(u,a),ie[4]?at||(at=Ed(),at.c(),at.m(e,null)):at&&(at.d(1),at=null),(!et||ve&1)&&w!==(w=ie[0].name+"")&&pe(C,w);const Te={};ve&9&&(Te.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${ie[3]}');
...
const data = { ... };
const record = await client.records.create('${(ue=ie[0])==null?void 0:ue.name}', data);
`),ve&9&&(Te.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${ie[3]}');
...
final body = <String, dynamic>{ ... };
final record = await client.records.create('${(ce=ie[0])==null?void 0:ce.name}', body: body);
`),R.$set(Te),ve&1&&(Pt=(Ie=ie[0])==null?void 0:Ie.schema,be=mt(be,ve,Ft,1,ie,Pt,se,Q,mn,Ad,null,Od)),ve&6&&(Lt=ie[2],wt=mt(wt,ve,lt,1,ie,Lt,jt,Ot,mn,Pd,null,Dd)),ve&6&&(I=ie[2],Pe(),we=mt(we,ve,z,1,ie,I,Be,Ke,Gt,Ld,null,Td),Le())},i(ie){if(!et){E(R.$$.fragment,ie),E(tt.$$.fragment,ie);for(let ve=0;ve<I.length;ve+=1)E(we[ve]);et=!0}},o(ie){P(R.$$.fragment,ie),P(tt.$$.fragment,ie);for(let ve=0;ve<we.length;ve+=1)P(we[ve]);et=!1},d(ie){ie&&y(e),at&&at.d(),ie&&y(d),ie&&y(h),ie&&y(A),ie&&y(L),ie&&y(F),q(R,ie),ie&&y(B),ie&&y(te),ie&&y(Z),ie&&y(H);for(let ve=0;ve<be.length;ve+=1)be[ve].d();ie&&y(ge),ie&&y($e),ie&&y(W),ie&&y(ye),q(tt),ie&&y(nt),ie&&y(ft),ie&&y(vt),ie&&y(ot);for(let ve=0;ve<wt.length;ve+=1)wt[ve].d();for(let ve=0;ve<we.length;ve+=1)we[ve].d()}}}function KC(n,e,t){let i,s,{collection:l=new An}=e,o=200,r=[];const a=u=>t(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.createRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(Y.dummyCollectionRecord(l),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to create record.",
"data": {
"${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`}])},t(3,s=window.location.href.substring(0,window.location.href.indexOf("/_"))||_e.baseUrl),[l,o,r,s,i,a]}class ZC extends Ee{constructor(e){super(),Oe(this,e,KC,YC,De,{collection:0})}}function Fd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Id(n,e,t){const i=n.slice();return i[6]=e[t],i}function Nd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Rd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function JC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function GC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function XC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("User "),i=N(t),s=N(".")},m(o,r){k(o,e,r),k(o,i,r),k(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&pe(i,t)},d(o){o&&y(e),o&&y(i),o&&y(s)}}}function QC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("Relation record "),i=N(t),s=N(".")},m(o,r){k(o,e,r),k(o,i,r),k(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&pe(i,t)},d(o){o&&y(e),o&&y(i),o&&y(s)}}}function xC(n){let e,t,i,s,l;return{c(){e=N("FormData object."),t=_("br"),i=N(`
Set to `),s=_("code"),s.textContent="null",l=N(" to delete already uploaded file(s).")},m(o,r){k(o,e,r),k(o,t,r),k(o,i,r),k(o,s,r),k(o,l,r)},p:le,d(o){o&&y(e),o&&y(t),o&&y(i),o&&y(s),o&&y(l)}}}function e3(n){let e;return{c(){e=N("URL address.")},m(t,i){k(t,e,i)},p:le,d(t){t&&y(e)}}}function t3(n){let e;return{c(){e=N("Email address.")},m(t,i){k(t,e,i)},p:le,d(t){t&&y(e)}}}function n3(n){let e;return{c(){e=N("JSON array or object.")},m(t,i){k(t,e,i)},p:le,d(t){t&&y(e)}}}function i3(n){let e;return{c(){e=N("Number value.")},m(t,i){k(t,e,i)},p:le,d(t){t&&y(e)}}}function s3(n){let e;return{c(){e=N("Plain text value.")},m(t,i){k(t,e,i)},p:le,d(t){t&&y(e)}}}function Hd(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=Y.getFieldValueType(e[11])+"",h,g,v,b;function w(O,A){return O[11].required?GC:JC}let C=w(e),S=C(e);function $(O,A){if(O[11].type==="text")return s3;if(O[11].type==="number")return i3;if(O[11].type==="json")return n3;if(O[11].type==="email")return t3;if(O[11].type==="url")return e3;if(O[11].type==="file")return xC;if(O[11].type==="relation")return QC;if(O[11].type==="user")return XC}let M=$(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),S.c(),l=T(),o=_("span"),a=N(r),u=T(),f=_("td"),c=_("span"),h=N(d),g=T(),v=_("td"),D&&D.c(),b=T(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(O,A){k(O,t,A),m(t,i),m(i,s),S.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,v),D&&D.m(v,null),m(t,b)},p(O,A){e=O,C!==(C=w(e))&&(S.d(1),S=C(e),S&&(S.c(),S.m(s,l))),A&1&&r!==(r=e[11].name+"")&&pe(a,r),A&1&&d!==(d=Y.getFieldValueType(e[11])+"")&&pe(h,d),M===(M=$(e))&&D?D.p(e,A):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(O){O&&y(t),S.d(),D&&D.d()}}}function jd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=T(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[6].code),this.first=t},m(u,f){k(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&pe(s,i),f&6&&ne(t,"active",e[1]===e[6].code)},d(u){u&&y(t),o=!1,r()}}}function qd(n,e){let t,i,s,l;return i=new hn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[6].code),this.first=t},m(o,r){k(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),r&6&&ne(t,"active",e[1]===e[6].code)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&y(t),q(i)}}}function l3(n){var ie,ve,Te;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,w,C=n[0].name+"",S,$,M,D,O,A,L,F,R,B,te,Z,H,J,U,Q,oe,ae,be,se,ge,$e=[],W=new Map,ye,ee,X,Se,je,Ue,K,de,fe,ke,Ze,tt,We,it,Ce,ze,Je,st,ct,me,Fe,nt,ft,vt,ot,Ot,wt,jt,Nt,Ke=[],we=new Map,Be,et,at=[],Pt=new Map,Ft,Lt=n[4]&&Rd();B=new As({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
const data = { ... };
const record = await client.records.update('${(ie=n[0])==null?void 0:ie.name}', 'RECORD_ID', data);
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
final body = <String, dynamic>{ ... };
final record = await client.records.update('${(ve=n[0])==null?void 0:ve.name}', 'RECORD_ID', body: body);
`}});let lt=(Te=n[0])==null?void 0:Te.schema;const I=ue=>ue[11].name;for(let ue=0;ue<lt.length;ue+=1){let ce=Nd(n,lt,ue),Ie=I(ce);W.set(Ie,$e[ue]=Hd(Ie,ce))}Ce=new hn({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let z=n[2];const x=ue=>ue[6].code;for(let ue=0;ue<z.length;ue+=1){let ce=Id(n,z,ue),Ie=x(ce);we.set(Ie,Ke[ue]=jd(Ie,ce))}let re=n[2];const Ae=ue=>ue[6].code;for(let ue=0;ue<re.length;ue+=1){let ce=Fd(n,re,ue),Ie=Ae(ce);Pt.set(Ie,at[ue]=qd(Ie,ce))}return{c(){e=_("div"),t=_("strong"),t.textContent="PATCH",i=T(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records/"),c=_("strong"),c.textContent=":id",d=T(),Lt&&Lt.c(),h=T(),g=_("div"),v=_("p"),b=N("Update a single "),w=_("strong"),S=N(C),$=N(" record."),M=T(),D=_("p"),D.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,O=T(),A=_("p"),A.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",L=T(),F=_("div"),F.textContent="Client SDKs example",R=T(),V(B.$$.fragment),te=T(),Z=_("div"),Z.textContent="Path parameters",H=T(),J=_("table"),J.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>`,U=T(),Q=_("div"),Q.textContent="Body Parameters",oe=T(),ae=_("table"),be=_("thead"),be.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,se=T(),ge=_("tbody");for(let ue=0;ue<$e.length;ue+=1)$e[ue].c();ye=T(),ee=_("div"),ee.textContent="Query parameters",X=T(),Se=_("table"),je=_("thead"),je.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,Ue=T(),K=_("tbody"),de=_("tr"),fe=_("td"),fe.textContent="expand",ke=T(),Ze=_("td"),Ze.innerHTML='<span class="label">String</span>',tt=T(),We=_("td"),it=N(`Auto expand relations when returning the updated record. Ex.:
`),V(Ce.$$.fragment),ze=N(`
Supports up to 6-levels depth nested relations expansion. `),Je=_("br"),st=N(`
The expanded relations will be appended to the record under the
`),ct=_("code"),ct.textContent="@expand",me=N(" property (eg. "),Fe=_("code"),Fe.textContent='"@expand": {"rel1": {...}, ...}',nt=N(`). Only the
relations that the user has permissions to `),ft=_("strong"),ft.textContent="view",vt=N(" will be expanded."),ot=T(),Ot=_("div"),Ot.textContent="Responses",wt=T(),jt=_("div"),Nt=_("div");for(let ue=0;ue<Ke.length;ue+=1)Ke[ue].c();Be=T(),et=_("div");for(let ue=0;ue<at.length;ue+=1)at[ue].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-warning"),p(g,"class","content m-b-base"),p(F,"class","section-title"),p(Z,"class","section-title"),p(J,"class","table-compact table-border m-b-lg"),p(Q,"class","section-title"),p(ae,"class","table-compact table-border m-b-lg"),p(ee,"class","section-title"),p(Se,"class","table-compact table-border m-b-lg"),p(Ot,"class","section-title"),p(Nt,"class","tabs-header compact left"),p(et,"class","tabs-content"),p(jt,"class","tabs")},m(ue,ce){k(ue,e,ce),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),Lt&&Lt.m(e,null),k(ue,h,ce),k(ue,g,ce),m(g,v),m(v,b),m(v,w),m(w,S),m(v,$),m(g,M),m(g,D),m(g,O),m(g,A),k(ue,L,ce),k(ue,F,ce),k(ue,R,ce),j(B,ue,ce),k(ue,te,ce),k(ue,Z,ce),k(ue,H,ce),k(ue,J,ce),k(ue,U,ce),k(ue,Q,ce),k(ue,oe,ce),k(ue,ae,ce),m(ae,be),m(ae,se),m(ae,ge);for(let Ie=0;Ie<$e.length;Ie+=1)$e[Ie].m(ge,null);k(ue,ye,ce),k(ue,ee,ce),k(ue,X,ce),k(ue,Se,ce),m(Se,je),m(Se,Ue),m(Se,K),m(K,de),m(de,fe),m(de,ke),m(de,Ze),m(de,tt),m(de,We),m(We,it),j(Ce,We,null),m(We,ze),m(We,Je),m(We,st),m(We,ct),m(We,me),m(We,Fe),m(We,nt),m(We,ft),m(We,vt),k(ue,ot,ce),k(ue,Ot,ce),k(ue,wt,ce),k(ue,jt,ce),m(jt,Nt);for(let Ie=0;Ie<Ke.length;Ie+=1)Ke[Ie].m(Nt,null);m(jt,Be),m(jt,et);for(let Ie=0;Ie<at.length;Ie+=1)at[Ie].m(et,null);Ft=!0},p(ue,[ce]){var ht,on,qt;(!Ft||ce&1)&&a!==(a=ue[0].name+"")&&pe(u,a),ue[4]?Lt||(Lt=Rd(),Lt.c(),Lt.m(e,null)):Lt&&(Lt.d(1),Lt=null),(!Ft||ce&1)&&C!==(C=ue[0].name+"")&&pe(S,C);const Ie={};ce&9&&(Ie.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${ue[3]}');
...
const data = { ... };
const record = await client.records.update('${(ht=ue[0])==null?void 0:ht.name}', 'RECORD_ID', data);
`),ce&9&&(Ie.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${ue[3]}');
...
final body = <String, dynamic>{ ... };
final record = await client.records.update('${(on=ue[0])==null?void 0:on.name}', 'RECORD_ID', body: body);
`),B.$set(Ie),ce&1&&(lt=(qt=ue[0])==null?void 0:qt.schema,$e=mt($e,ce,I,1,ue,lt,W,ge,mn,Hd,null,Nd)),ce&6&&(z=ue[2],Ke=mt(Ke,ce,x,1,ue,z,we,Nt,mn,jd,null,Id)),ce&6&&(re=ue[2],Pe(),at=mt(at,ce,Ae,1,ue,re,Pt,et,Gt,qd,null,Fd),Le())},i(ue){if(!Ft){E(B.$$.fragment,ue),E(Ce.$$.fragment,ue);for(let ce=0;ce<re.length;ce+=1)E(at[ce]);Ft=!0}},o(ue){P(B.$$.fragment,ue),P(Ce.$$.fragment,ue);for(let ce=0;ce<at.length;ce+=1)P(at[ce]);Ft=!1},d(ue){ue&&y(e),Lt&&Lt.d(),ue&&y(h),ue&&y(g),ue&&y(L),ue&&y(F),ue&&y(R),q(B,ue),ue&&y(te),ue&&y(Z),ue&&y(H),ue&&y(J),ue&&y(U),ue&&y(Q),ue&&y(oe),ue&&y(ae);for(let ce=0;ce<$e.length;ce+=1)$e[ce].d();ue&&y(ye),ue&&y(ee),ue&&y(X),ue&&y(Se),q(Ce),ue&&y(ot),ue&&y(Ot),ue&&y(wt),ue&&y(jt);for(let ce=0;ce<Ke.length;ce+=1)Ke[ce].d();for(let ce=0;ce<at.length;ce+=1)at[ce].d()}}}function o3(n,e,t){let i,s,{collection:l=new An}=e,o=200,r=[];const a=u=>t(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.updateRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(Y.dummyCollectionRecord(l),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to update record.",
"data": {
"${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`},{code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}])},t(3,s=window.location.href.substring(0,window.location.href.indexOf("/_"))||_e.baseUrl),[l,o,r,s,i,a]}class r3 extends Ee{constructor(e){super(),Oe(this,e,o3,l3,De,{collection:0})}}function Vd(n,e,t){const i=n.slice();return i[6]=e[t],i}function zd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Bd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function Ud(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=T(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[6].code),this.first=t},m(u,f){k(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ne(t,"active",e[2]===e[6].code)},d(u){u&&y(t),o=!1,r()}}}function Wd(n,e){let t,i,s,l;return i=new hn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[6].code),this.first=t},m(o,r){k(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&20&&ne(t,"active",e[2]===e[6].code)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&y(t),q(i)}}}function a3(n){var je,Ue;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,w,C=n[0].name+"",S,$,M,D,O,A,L,F,R,B,te,Z,H,J,U,Q=[],oe=new Map,ae,be,se=[],ge=new Map,$e,W=n[1]&&Bd();A=new As({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
await client.records.delete('${(je=n[0])==null?void 0:je.name}', 'RECORD_ID');
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
await client.records.delete('${(Ue=n[0])==null?void 0:Ue.name}', 'RECORD_ID');
`}});let ye=n[4];const ee=K=>K[6].code;for(let K=0;K<ye.length;K+=1){let de=zd(n,ye,K),fe=ee(de);oe.set(fe,Q[K]=Ud(fe,de))}let X=n[4];const Se=K=>K[6].code;for(let K=0;K<X.length;K+=1){let de=Vd(n,X,K),fe=Se(de);ge.set(fe,se[K]=Wd(fe,de))}return{c(){e=_("div"),t=_("strong"),t.textContent="DELETE",i=T(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records/"),c=_("strong"),c.textContent=":id",d=T(),W&&W.c(),h=T(),g=_("div"),v=_("p"),b=N("Delete a single "),w=_("strong"),S=N(C),$=N(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",O=T(),V(A.$$.fragment),L=T(),F=_("div"),F.textContent="Path parameters",R=T(),B=_("table"),B.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to delete.</td></tr></tbody>`,te=T(),Z=_("div"),Z.textContent="Responses",H=T(),J=_("div"),U=_("div");for(let K=0;K<Q.length;K+=1)Q[K].c();ae=T(),be=_("div");for(let K=0;K<se.length;K+=1)se[K].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-danger"),p(g,"class","content m-b-base"),p(D,"class","section-title"),p(F,"class","section-title"),p(B,"class","table-compact table-border m-b-lg"),p(Z,"class","section-title"),p(U,"class","tabs-header compact left"),p(be,"class","tabs-content"),p(J,"class","tabs")},m(K,de){k(K,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),W&&W.m(e,null),k(K,h,de),k(K,g,de),m(g,v),m(v,b),m(v,w),m(w,S),m(v,$),k(K,M,de),k(K,D,de),k(K,O,de),j(A,K,de),k(K,L,de),k(K,F,de),k(K,R,de),k(K,B,de),k(K,te,de),k(K,Z,de),k(K,H,de),k(K,J,de),m(J,U);for(let fe=0;fe<Q.length;fe+=1)Q[fe].m(U,null);m(J,ae),m(J,be);for(let fe=0;fe<se.length;fe+=1)se[fe].m(be,null);$e=!0},p(K,[de]){var ke,Ze;(!$e||de&1)&&a!==(a=K[0].name+"")&&pe(u,a),K[1]?W||(W=Bd(),W.c(),W.m(e,null)):W&&(W.d(1),W=null),(!$e||de&1)&&C!==(C=K[0].name+"")&&pe(S,C);const fe={};de&9&&(fe.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${K[3]}');
...
await client.records.delete('${(ke=K[0])==null?void 0:ke.name}', 'RECORD_ID');
`),de&9&&(fe.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${K[3]}');
...
await client.records.delete('${(Ze=K[0])==null?void 0:Ze.name}', 'RECORD_ID');
`),A.$set(fe),de&20&&(ye=K[4],Q=mt(Q,de,ee,1,K,ye,oe,U,mn,Ud,null,zd)),de&20&&(X=K[4],Pe(),se=mt(se,de,Se,1,K,X,ge,be,Gt,Wd,null,Vd),Le())},i(K){if(!$e){E(A.$$.fragment,K);for(let de=0;de<X.length;de+=1)E(se[de]);$e=!0}},o(K){P(A.$$.fragment,K);for(let de=0;de<se.length;de+=1)P(se[de]);$e=!1},d(K){K&&y(e),W&&W.d(),K&&y(h),K&&y(g),K&&y(M),K&&y(D),K&&y(O),q(A,K),K&&y(L),K&&y(F),K&&y(R),K&&y(B),K&&y(te),K&&y(Z),K&&y(H),K&&y(J);for(let de=0;de<Q.length;de+=1)Q[de].d();for(let de=0;de<se.length;de+=1)se[de].d()}}}function u3(n,e,t){let i,s,{collection:l=new An}=e,o=204,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.deleteRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:204,body:`
null
`}),r.push({code:400,body:`
{
"code": 400,
"message": "Failed to delete record. Make sure that the record is not part of a required relation reference.",
"data": {}
}
`}),i&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},t(3,s=window.location.href.substring(0,window.location.href.indexOf("/_"))||_e.baseUrl),[l,i,o,s,r,a]}class f3 extends Ee{constructor(e){super(),Oe(this,e,u3,a3,De,{collection:0})}}function c3(n){var h,g,v,b,w,C,S,$;let e,t,i,s,l,o,r,a,u,f,c,d;return r=new As({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(h=n[0])==null?void 0:h.name}', function (e) {
console.log(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${(g=n[0])==null?void 0:g.name}/RECORD_ID', function (e) {
console.log(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(v=n[0])==null?void 0:v.name}') // remove only the collection subscription
client.realtime.unsubscribe('${(b=n[0])==null?void 0:b.name}/RECORD_ID') // remove only the record subscription
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(w=n[0])==null?void 0:w.name}', (e) {
print(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${(C=n[0])==null?void 0:C.name}/RECORD_ID', (e) {
print(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(S=n[0])==null?void 0:S.name}') // remove only the collection subscription
client.realtime.unsubscribe('${($=n[0])==null?void 0:$.name}/RECORD_ID') // remove only the record subscription
`}}),c=new hn({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(),V(r.$$.fragment),a=T(),u=_("div"),u.textContent="Event data format",f=T(),V(c.$$.fragment),p(e,"class","alert"),p(i,"class","content m-b-base"),p(l,"class","section-title"),p(u,"class","section-title")},m(M,D){k(M,e,D),k(M,t,D),k(M,i,D),k(M,s,D),k(M,l,D),k(M,o,D),j(r,M,D),k(M,a,D),k(M,u,D),k(M,f,D),j(c,M,D),d=!0},p(M,[D]){var L,F,R,B,te,Z,H,J;const O={};D&3&&(O.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${M[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(L=M[0])==null?void 0:L.name}', function (e) {
console.log(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${(F=M[0])==null?void 0:F.name}/RECORD_ID', function (e) {
console.log(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(R=M[0])==null?void 0:R.name}') // remove only the collection subscription
client.realtime.unsubscribe('${(B=M[0])==null?void 0:B.name}/RECORD_ID') // remove only the record subscription
`),D&3&&(O.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${M[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(te=M[0])==null?void 0:te.name}', (e) {
print(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${(Z=M[0])==null?void 0:Z.name}/RECORD_ID', (e) {
print(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(H=M[0])==null?void 0:H.name}') // remove only the collection subscription
client.realtime.unsubscribe('${(J=M[0])==null?void 0:J.name}/RECORD_ID') // remove only the record subscription
`),r.$set(O);const A={};D&1&&(A.content=JSON.stringify({action:"create",record:Y.dummyCollectionRecord(M[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),c.$set(A)},i(M){d||(E(r.$$.fragment,M),E(c.$$.fragment,M),d=!0)},o(M){P(r.$$.fragment,M),P(c.$$.fragment,M),d=!1},d(M){M&&y(e),M&&y(t),M&&y(i),M&&y(s),M&&y(l),M&&y(o),q(r,M),M&&y(a),M&&y(u),M&&y(f),q(c,M)}}}function d3(n,e,t){let i,{collection:s=new An}=e;return n.$$set=l=>{"collection"in l&&t(0,s=l.collection)},t(1,i=window.location.href.substring(0,window.location.href.indexOf("/_"))||_e.baseUrl),[s,i]}class p3 extends Ee{constructor(e){super(),Oe(this,e,d3,c3,De,{collection:0})}}function Yd(n,e,t){const i=n.slice();return i[14]=e[t],i}function Kd(n,e,t){const i=n.slice();return i[14]=e[t],i}function Zd(n){let e,t,i,s;var l=n[14].component;function o(r){return{props:{collection:r[3]}}}return l&&(t=new l(o(n))),{c(){e=_("div"),t&&V(t.$$.fragment),i=T(),p(e,"class","tab-item active")},m(r,a){k(r,e,a),t&&j(t,e,null),m(e,i),s=!0},p(r,a){const u={};if(a&8&&(u.collection=r[3]),l!==(l=r[14].component)){if(t){Pe();const f=t;P(f.$$.fragment,1,0,()=>{q(f,1)}),Le()}l?(t=new l(o(r)),V(t.$$.fragment),E(t.$$.fragment,1),j(t,e,i)):t=null}else l&&t.$set(u)},i(r){s||(t&&E(t.$$.fragment,r),s=!0)},o(r){t&&P(t.$$.fragment,r),s=!1},d(r){r&&y(e),t&&q(t)}}}function Jd(n,e){let t,i,s,l=e[4]===e[14].id&&Zd(e);return{key:n,first:null,c(){t=Xe(),l&&l.c(),i=Xe(),this.first=t},m(o,r){k(o,t,r),l&&l.m(o,r),k(o,i,r),s=!0},p(o,r){e=o,e[4]===e[14].id?l?(l.p(e,r),r&16&&E(l,1)):(l=Zd(e),l.c(),E(l,1),l.m(i.parentNode,i)):l&&(Pe(),P(l,1,1,()=>{l=null}),Le())},i(o){s||(E(l),s=!0)},o(o){P(l),s=!1},d(o){o&&y(t),l&&l.d(o),o&&y(i)}}}function h3(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=Yd(n,l,r),u=o(a);i.set(u,t[r]=Jd(u,a))}return{c(){e=_("div");for(let r=0;r<t.length;r+=1)t[r].c();p(e,"class","tabs-content")},m(r,a){k(r,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(r,a){a&56&&(l=r[5],Pe(),t=mt(t,a,o,1,r,l,i,e,Gt,Jd,null,Yd),Le())},i(r){if(!s){for(let a=0;a<l.length;a+=1)E(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)P(t[a]);s=!1},d(r){r&&y(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function Gd(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=N(s),o=T(),p(i,"class","txt"),p(t,"tabindex","0"),p(t,"class","tab-item"),ne(t,"active",e[4]===e[14].id),this.first=t},m(c,d){k(c,t,d),m(t,i),m(i,l),m(t,o),r||(a=[G(t,"click",u),G(t,"keydown",Yh(f))],r=!0)},p(c,d){e=c,d&48&&ne(t,"active",e[4]===e[14].id)},d(c){c&&y(t),r=!1,Qe(a)}}}function m3(n){let e,t,i=n[3].name+"",s,l,o,r,a=[],u=new Map,f=n[5];const c=d=>d[14].id;for(let d=0;d<f.length;d+=1){let h=Kd(n,f,d),g=c(h);u.set(g,a[d]=Gd(g,h))}return{c(){e=_("h4"),t=_("strong"),s=N(i),l=N(" records API"),o=T(),r=_("div");for(let d=0;d<a.length;d+=1)a[d].c();p(r,"class","tabs-header stretched")},m(d,h){k(d,e,h),m(e,t),m(t,s),m(e,l),k(d,o,h),k(d,r,h);for(let g=0;g<a.length;g+=1)a[g].m(r,null)},p(d,h){h&8&&i!==(i=d[3].name+"")&&pe(s,i),h&114&&(f=d[5],a=mt(a,h,c,1,d,f,u,r,mn,Gd,null,Kd))},d(d){d&&y(e),d&&y(o),d&&y(r);for(let h=0;h<a.length;h+=1)a[h].d()}}}function g3(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(s,l){k(s,e,l),t||(i=G(e,"click",n[8]),t=!0)},p:le,d(s){s&&y(e),t=!1,i()}}}function _3(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[g3],header:[m3],default:[h3]},$$scope:{ctx:n}};return e=new di({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&524312&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),q(e,s)}}}function b3(n,e,t){const i=[{id:"list",label:"List",component:PC},{id:"view",label:"View",component:IC},{id:"create",label:"Create",component:ZC},{id:"update",label:"
<span class="txt">Upload new file</span>`,p(t,"type","file"),p(t,"class","hidden"),t.multiple=n[5],p(s,"type","button"),p(s,"class","btn btn-secondary btn-sm btn-block"),p(e,"class","list-item btn-list-item")},m(r,a){k(r,e,a),m(e,t),n[16](t),m(e,i),m(e,s),l||(o=[G(t,"change",n[17]),G(s,"click",n[18])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&y(e),n[16](null),l=!1,Qe(o)}}}function b4(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,h,g,v,b=n[4];const w=D=>D[25];for(let D=0;D<b.length;D+=1){let O=xd(n,b,D),A=w(O);d.set(A,c[D]=ep(A,O))}let C=n[0],S=[];for(let D=0;D<C.length;D+=1)S[D]=tp(Qd(n,C,D));const $=D=>P(S[D],1,1,()=>{S[D]=null});let M=!n[8]&&np(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=N(o),u=T(),f=_("div");for(let D=0;D<c.length;D+=1)c[D].c();h=T();for(let D=0;D<S.length;D+=1)S[D].c();g=T(),M&&M.c(),p(t,"class",i=Y.getFieldTypeIcon(n[3].type)),p(l,"class","txt"),p(e,"for",a=n[21]),p(f,"class","files-list")},m(D,O){k(D,e,O),m(e,t),m(e,s),m(e,l),m(l,r),k(D,u,O),k(D,f,O);for(let A=0;A<c.length;A+=1)c[A].m(f,null);m(f,h);for(let A=0;A<S.length;A+=1)S[A].m(f,null);m(f,g),M&&M.m(f,null),n[19](f),v=!0},p(D,O){if((!v||O&8&&i!==(i=Y.getFieldTypeIcon(D[3].type)))&&p(t,"class",i),(!v||O&8)&&o!==(o=D[3].name+"")&&pe(r,o),(!v||O&2097152&&a!==(a=D[21]))&&p(e,"for",a),O&1558&&(b=D[4],Pe(),c=mt(c,O,w,1,D,b,d,f,Gt,ep,h,xd),Le()),O&2049){C=D[0];let A;for(A=0;A<C.length;A+=1){const L=Qd(D,C,A);S[A]?(S[A].p(L,O),E(S[A],1)):(S[A]=tp(L),S[A].c(),E(S[A],1),S[A].m(f,g))}for(Pe(),A=C.length;A<S.length;A+=1)$(A);Le()}D[8]?M&&(M.d(1),M=null):M?M.p(D,O):(M=np(D),M.c(),M.m(f,null))},i(D){if(!v){for(let O=0;O<b.length;O+=1)E(c[O]);for(let O=0;O<C.length;O+=1)E(S[O]);v=!0}},o(D){for(let O=0;O<c.length;O+=1)P(c[O]);S=S.filter(Boolean);for(let O=0;O<S.length;O+=1)P(S[O]);v=!1},d(D){D&&y(e),D&&y(u),D&&y(f);for(let O=0;O<c.length;O+=1)c[O].d();Xn(S,D),M&&M.d(),n[19](null)}}}function v4(n){let e,t;return e=new Ne({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[b4,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&136315391&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function y4(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new Sn}=e,c,d;function h(A){Y.removeByValue(u,A),t(1,u)}function g(A){Y.pushUnique(u,A),t(1,u)}function v(A){Y.isEmpty(a[A])||a.splice(A,1),t(0,a)}function b(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const w=A=>h(A),C=A=>g(A),S=A=>v(A);function $(A){he[A?"unshift":"push"](()=>{c=A,t(6,c)})}const M=()=>{for(let A of c.files)a.push(A);t(0,a),t(6,c.value=null,c)},D=()=>c==null?void 0:c.click();function O(A){he[A?"unshift":"push"](()=>{d=A,t(7,d)})}return n.$$set=A=>{"record"in A&&t(2,o=A.record),"value"in A&&t(12,r=A.value),"uploadedFiles"in A&&t(0,a=A.uploadedFiles),"deletedFileIndexes"in A&&t(1,u=A.deletedFileIndexes),"field"in A&&t(3,f=A.field)},n.$$.update=()=>{var A,L;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=((A=f.options)==null?void 0:A.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)&&((L=f.options)==null?void 0:L.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&b()},[a,u,o,f,s,i,c,d,l,h,g,v,r,w,C,S,$,M,D,O]}class k4 extends Ee{constructor(e){super(),Oe(this,e,y4,v4,De,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function ip(n){let e,t;return{c(){e=_("small"),t=N(n[1]),p(e,"class","block txt-hint txt-ellipsis")},m(i,s){k(i,e,s),m(e,t)},p(i,s){s&2&&pe(t,i[1])},d(i){i&&y(e)}}}function w4(n){let e,t,i,s,l,o=n[0].id
`,p(e,"class","block txt-center txt-disabled")},m(t,i){k(t,e,i)},p:le,d(t){t&&y(e)}}}function U4(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 z4({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function W4(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 P4({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function Y4(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 k4({props:u}),he.push(()=>Re(e,"value",o)),he.push(()=>Re(e,"uploadedFiles",r)),he.push(()=>Re(e,"deletedFileIndexes",a)),{c(){V(e.$$.fragment)},m(f,c){j(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[40]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[40].name],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||(E(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){q(e,f)}}}function K4(n){let e,t,i;function s(o){n[26](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new e4({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function Z4(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 G3({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(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 Y3({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function G4(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 z3({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function X4(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 H3({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function Q4(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 F3({props:l}),he.push(()=>Re(e,"value",
<span class="txt">Delete</span>`,p(e,"tabindex","0"),p(e,"class","dropdown-item closable")},m(s,l){k(s,e,l),t||(i=G(e,"click",n[18]),t=!0)},p:le,d(s){s&&y(e),t=!1,i()}}}function iM(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]&&dp(n);return{c(){e=_("h4"),i=N(t),s=T(),o=N(l),r=N(" record"),a=T(),c&&c.c(),u=Xe()},m(d,h){k(d,e,h),m(e,i),m(e,s),m(e,o),m(e,r),k(d,a,h),c&&c.m(d,h),k(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&pe(i,t),(!f||h[0]&1)&&l!==(l=d[0].name+"")&&pe(o,l),!d[2].isNew&&d[10]?c?(c.p(d,h),h[0]&1028&&E(c,1)):(c=dp(d),c.c(),E(c,1),c.m(u.parentNode,u)):c&&(Pe(),P(c,1,1,()=>{c=null}),Le())},i(d){f||(E(c),f=!0)},o(d){P(c),f=!1},d(d){d&&y(e),d&&y(a),c&&c.d(d),d&&y(u)}}}function sM(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=N(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[11]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[9]||n[7],ne(s,"btn-loading",n[7])},m(c,d){k(c,e,d),m(e,t),k(c,i,d),k(c,s,d),m(s,l),m(l,r),u||(f=G(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")&&pe(r,o),d[0]&640&&a!==(a=!c[9]||c[7])&&(s.disabled=a),d[0]&128&&ne(s,"btn-loading",c[7])},d(c){c&&y(e),c&&y(i),c&&y(s),u=!1,f()}}}function lM(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[sM],header:[iM],default:[tM]},$$scope:{ctx:n}};return e=new di({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&288&&(o.beforeHide=s[32]),l[0]&1693|l[1]&8192&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[33](null),q(e,s)}}}function pp(n){return JSON.stringify(n)}function oM(n,e,t){let i,s,l,o;const r=ln(),a="record_"+Y.randomString(5);let{collection:u}=e,f,c=null,d=new uo,h=!1,g=!1,v={},b={},w="";function C(ee){return $(ee),t(8,g=!0),f==null?void 0:f.show()}function S(){return f==null?void 0:f.hide()}async function $(ee){wi({}),c=ee||{},t(2,d=ee!=null&&ee.clone?ee.clone():new uo),t(3,v={}),t(4,b={}),await ei(),t(15,w=pp(d))}function M(){if(h||!l)return;t(7,h=!0);const ee=O();let X;d.isNew?X=_e.records.create(u==null?void 0:u.id,ee):X=_e.records.update(u==null?void 0:u.id,d.id,ee),X.then(async Se=>{un(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),S(),r("save",Se)}).catch(Se=>{_e.errorResponseHandler(Se)}).finally(()=>{t(7,h=!1)})}function D(){!(c!=null&&c.id)||ui("Do you really want to delete the selected record?",()=>_e.records.delete(c["@collectionId"],c.id).then(()=>{S(),un("Successfully deleted record."),r("delete",c)}).catch(ee=>{_e.errorResponseHandler(ee)}))}function O(){const ee=(d==null?void 0:d.export())||{},X=new FormData,Se={};for(const je of(u==null?void 0:u.schema)||[])Se[je.name]=je;for(const je in ee)!Se[je]||(typeof ee[je]>"u"&&(ee[je]=null),Y.addValueToFormData(X,je,ee[je]));for(const je in v){const Ue=Y.toArray(v[je]);for(const K of Ue)X.append(je,K)}for(const je in b){const Ue=Y.toArray(b[je]);for(const K of Ue)X.append(je+"."+K,"")}return X}const A=()=>S(),L=()=>D();function F(ee,X){n.$$.not_equal(d[X.name],ee)&&(d[X.name]=ee,t(2,d))}function R(ee,X){n.$$.not_equal(d[X.name],ee)&&(d[X.name]=ee,t(2,d))}function B(ee,X){n.$$.not_equal(d[X.name],ee)&&(d[X.name]=ee,t(2,d))}function te(ee,X){n.$$.not_equal(d[X.name],ee)&&(d[X.name]=ee,t(2,d))}function Z(ee,X){n.$$.not_equal(d[X.name],ee)&&(d[X.name]=ee,t(2,d))}function H(ee,X){n.$$.not_equal(d[X.name],ee)&&(d[X.name]=ee,t(2,d))}function J(ee,X){n.$$.not_equal(d[X.name],ee)&&(d[X.name]=ee,t(2,d))}function U(ee,X){n.$$.not_equal(d[X.name],ee)&&(d[X.name]=ee,t(2,d))}function Q(ee,X){n.$$.not_equal(d[X.name],ee)&&(d[X.name]=ee,t(2,d))}function oe(ee,X){n.$$.not_equal(v[X.name],ee)&&(v[X.name]=ee,t(3,v))}function ae(ee,X){n.$$.not_equ
`},m(t,i){k(t,e,i)},p:le,d(t){t&&y(e)}}}function Cp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){k(s,e,l),t||(i=G(e,"click",n[28]),t=!0)},p:le,d(s){s&&y(e),t=!1,i()}}}function Mp(n,e){let t,i,s;return i=new __({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=Xe(),V(i.$$.fragment),this.first=t},m(l,o){k(l,t,o),j(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&8&&(r.record=e[35]),o[0]&2048&&(r.field=e[38]),i.$set(r)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&y(t),q(i,l)}}}function Tp(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,g,v=[],b=new Map,w,C,S,$,M,D,O,A,L,F,R,B;function te(){return e[25](e[35])}h=new Go({props:{id:e[35].id}});let Z=e[11];const H=Q=>Q[38].name;for(let Q=0;Q<Z.length;Q+=1){let oe=kp(e,Z,Q),ae=H(oe);b.set(ae,v[Q]=Mp(ae,oe))}S=new yi({props:{date:e[35].created}}),D=new yi({props:{date:e[35].updated}});function J(){return e[26](e[35])}function U(...Q){return e[27](e[35],...Q)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),l=_("input"),a=T(),u=_("label"),c=T(),d=_("td"),V(h.$$.fragment),g=T();for(let Q=0;Q<v.length;Q+=1)v[Q].c();w=T(),C=_("td"),V(S.$$.fragment),$=T(),M=_("td"),V(D.$$.fragment),O=T(),A=_("td"),A.innerHTML='<i class="ri-arrow-right-line"></i>',L=T(),p(l,"type","checkbox"),p(l,"id",o="checkbox_"+e[35].id),l.checked=r=e[5][e[35].id],p(u,"for",f="checkbox_"+e[35].id),p(s,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-id"),p(C,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(A,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Q,oe){k(Q,t,oe),m(t,i),m(i,s),m(s,l),m(s,a),m(s,u),m(t,c),m(t,d),j(h,d,null),m(t,g);for(let ae=0;ae<v.length;ae+=1)v[ae].m(t,null);m(t,w),m(t,C),j(S,C,null),m(t,$),m(t,M),j(D,M,null),m(t,O),m(t,A),m(t,L),F=!0,R||(B=[G(l,"change",te),G(s,"click",Qn(e[19])),G(t,"click",J),G(t,"keydown",U)],R=!0)},p(Q,oe){e=Q,(!F||oe[0]&8&&o!==(o="checkbox_"+e[35].id))&&p(l,"id",o),(!F||oe[0]&40&&r!==(r=e[5][e[35].id]))&&(l.checked=r),(!F||oe[0]&8&&f!==(f="checkbox_"+e[35].id))&&p(u,"for",f);const ae={};oe[0]&8&&(ae.id=e[35].id),h.$set(ae),oe[0]&2056&&(Z=e[11],Pe(),v=mt(v,oe,H,1,e,Z,b,t,Gt,Mp,w,kp),Le());const be={};oe[0]&8&&(be.date=e[35].created),S.$set(be);const se={};oe[0]&8&&(se.date=e[35].updated),D.$set(se)},i(Q){if(!F){E(h.$$.fragment,Q);for(let oe=0;oe<Z.length;oe+=1)E(v[oe]);E(S.$$.fragment,Q),E(D.$$.fragment,Q),F=!0}},o(Q){P(h.$$.fragment,Q);for(let oe=0;oe<v.length;oe+=1)P(v[oe]);P(S.$$.fragment,Q),P(D.$$.fragment,Q),F=!1},d(Q){Q&&y(t),q(h);for(let oe=0;oe<v.length;oe+=1)v[oe].d();q(S),q(D),R=!1,Qe(B)}}}function Dp(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),o=N(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){k(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+"")&&pe(s,i),a[0]&16&&pe(o,r[4])},d(r){r&&y(e)}}}function Op(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=N("Load more ("),o=N(l),r=N(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ne(t,"btn-loading",n[8]),ne(t,"btn-disabled",n[8]),p(e,"class","block txt-center m-t-xs")},m(f,c){k(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=G(t,"click",n[29]),a=!0)},p(f,c){c[0]&24&&l!==(l=f[4]-f[3].length+"")&&pe(o,l),c[0]&256&&ne(t,"btn-loading",f[8]),c[0]&256&&ne(t,"btn-disabled",f[8])},d(f){f&&y(e),a=!1,u()}}}function Ep(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,h,g,v,b,w,C;return{c(){e=_("div"),t=_("div"),i=N("Selected "),s=_("strong"),l=N(n[6]),o=T(),a=N(r),u=T(),f=_("button"),f.innerHTML='<span class="txt">Reset</span>',c=T(),d=_("div"),h=T(),g=_("button"),g.innerHTML='<span class="txt">Delete selected</span>',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),ne(f,"b
<span class="txt">API Preview</span>`,b=T(),w=_("button"),w.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,C=T(),V(S.$$.fragment),$=T(),V(M.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"type","button"),p(f,"class","btn btn-secondary btn-circle"),p(u,"class","inline-flex gap-5"),p(v,"type","button"),p(v,"class","btn btn-outline"),p(w,"type","button"),p(w,"class","btn btn-expanded"),p(g,"class","btns-group"),p(e,"class","page-header")},m(Z,H){k(Z,e,H),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),m(e,u),m(u,f),m(u,c),j(d,u,null),m(e,h),m(e,g),m(g,v),m(g,b),m(g,w),k(Z,C,H),j(S,Z,H),k(Z,$,H),j(M,Z,H),A=!0,L||(F=[Ye(Ct.call(null,f,{text:"Edit collection",position:"right"})),G(f,"click",n[12]),G(v,"click",n[14]),G(w,"click",n[15])],L=!0)},p(Z,H){(!A||H&4)&&o!==(o=Z[2].name+"")&&pe(r,o);const J={};H&1&&(J.value=Z[0]),H&4&&(J.autocompleteCollection=Z[2]),S.$set(J);const U={};H&4&&(U.collection=Z[2]),!D&&H&1&&(D=!0,U.filter=Z[0],He(()=>D=!1)),!O&&H&2&&(O=!0,U.sort=Z[1],He(()=>O=!1)),M.$set(U)},i(Z){A||(E(d.$$.fragment,Z),E(S.$$.fragment,Z),E(M.$$.fragment,Z),A=!0)},o(Z){P(d.$$.fragment,Z),P(S.$$.fragment,Z),P(M.$$.fragment,Z),A=!1},d(Z){Z&&y(e),q(d),Z&&y(C),q(S,Z),Z&&y($),n[17](null),q(M,Z),L=!1,Qe(F)}}}function IM(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>`,p(t,"class","icon"),p(s,"class","m-b-10"),p(o,"type","button"),p(o,"class","btn btn-expanded-lg btn-lg"),p(e,"class","placeholder-section m-b-base")},m(u,f){k(u,e,f),m(e,t),m(e,i),m(e,s),m(e,l),m(e,o),r||(a=G(o,"click",n[11]),r=!0)},p:le,d(u){u&&y(e),r=!1,a()}}}function NM(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){k(t,e,i)},p:le,d(t){t&&y(e)}}}function RM(n){let e,t,i,s,l,o,r,a,u;const f=[LM,PM,AM],c=[];function d(b,w){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let h={};s=new Wa({props:h}),n[21](s);let g={};o=new v3({props:g}),n[22](o);let v={collection:n[2]};return a=new g_({props:v}),n[23](a),a.$on("save",n[24]),a.$on("delete",n[25]),{c(){t.c(),i=T(),V(s.$$.fragment),l=T(),V(o.$$.fragment),r=T(),V(a.$$.fragment)},m(b,w){c[e].m(b,w),k(b,i,w),j(s,b,w),k(b,l,w),j(o,b,w),k(b,r,w),j(a,b,w),u=!0},p(b,[w]){let C=e;e=d(b),e===C?c[e].p(b,w):(Pe(),P(c[C],1,1,()=>{c[C]=null}),Le(),t=c[e],t?t.p(b,w):(t=c[e]=f[e](b),t.c()),E(t,1),t.m(i.parentNode,i));const S={};s.$set(S);const $={};o.$set($);const M={};w&4&&(M.collection=b[2]),a.$set(M)},i(b){u||(E(t),E(s.$$.fragment,b),E(o.$$.fragment,b),E(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&&y(i),n[21](null),q(s,b),b&&y(l),n[22](null),q(o,b),b&&y(r),n[23](null),q(a,b)}}}function HM(n,e,t){let i,s,l,o,r,a;kt(n,ri,U=>t(2,s=U)),kt(n,Ms,U=>t(10,l=U)),kt(n,No,U=>t(26,o=U)),kt(n,Rt,U=>t(27,r=U)),kt(n,ta,U=>t(8,a=U)),fn(Rt,r="Collections",r);const u=new URLSearchParams(o);let f,c,d,h,g=u.get("filter")||"",v=u.get("sort")||"-created",b=u.get("collectionId")||"";function w(){t(9,b=s.id),t(1,v="-created"),t(0,g="")}Y2(b);const C=()=>f==null?void 0:f.show(),S=()=>f==null?void 0:f.show(s),$=()=>h==null?void 0:h.load(),M=()=>c==null?void 0:c.show(s),D=()=>d==null?void 0:d.show(),O=U=>t(0,g=U.detail);function A(U){he[U?"unshift":"push"](()=>{h=U,t(6,h)})}function L(U){g=U,t(0,g)}function F(U){v=U,t(1,v)}const R=U=>d==null?void 0:d.show(U==null?void 0:U.detail);function B(U){he[U?"unshift":"push"](()=>{f=U,t(3,f)})}function te(U){he[U?"unshift":"push"](()=>{c=U,t(4,c)})}function Z(U){he[U?"unshift":"push"](()=>{d=U,t(5,d)})}const H=()=>h==null?void 0:h.load(),J=()=>h==null?void 0:h.load();return n.$$.update=()=>{if(n.$$.dirty&1024&&t(7,i=l.filter(U=>U.name!="profiles")),n.$$.dirty&516&&(s==null?void 0:s.id)&&b!=s.id&&w(),n.$$.dirty&7&&(v||g||(s==null?void 0:s.id))){const U=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:g,sort:v}).toString();ki("/collections?"+U)}},[g,v,s,f,c,d,h,i,a,b,l,C,S,$,M,D,O,A,L,F,R,B,te,Z,H,J]}class jM extends Ee{constructor(e){super(),Oe(this,e,HM,RM,De,{})}}function Ap(n){let e,t;return e=new Ne({props:{class:"form-field disabled",name:"id",$$slots:{default:[qM,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&2|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(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"),p(t,"class",Y.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[31]),p(r,"type","text"),p(r,"id",a=n[31]),r.value=u=n[1].id,r.disabled=!0},m(f,c){k(f,e,c),m(e,t),m(e,i),m(e,s),k(f,o,c),k(f,r,c)},p(f,c){c[1]&1&&l!==(l=f[31])&&p(e,"for",l),c[1]&1&&a!==(a=f[31])&&p(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&y(e),f&&y(o),f&&y(r)}}}function Pp(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-shield-check-line"></i>',p(e,"class","form-field-addon txt-success")},m(s,l){k(s,e,l),t||(i=Ye(Ct.call(null,e,"Verified")),t=!0)},d(s){s&&y(e),t=!1,i()}}}function VM(n){let e,t,i,s,l,o,r,a,u,f,c,d=n[1].verified&&Pp();return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Email",o=T(),d&&d.c(),r=T(),a=_("input"),p(t,"class",Y.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[31]),p(a,"type","email"),p(a,"autocomplete","off"),p(a,"id",u=n[31]),a.required=!0},m(h,g){k(h,e,g),m(e,t),m(e,i),m(e,s),k(h,o,g),d&&d.m(h,g),k(h,r,g),k(h,a,g),Me(a,n[2]),f||(c=G(a,"input",n[19]),f=!0)},p(h,g){g[1]&1&&l!==(l=h[31])&&p(e,"for",l),h[1].verified?d||(d=Pp(),d.c(),d.m(r.parentNode,r)):d&&(d.d(1),d=null),g[1]&1&&u!==(
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){k(s,e,l),t||(i=G(e,"click",n[16]),t=!0)},p:le,d(s){s&&y(e),t=!1,i()}}}function ZM(n){let e,t,i,s,l=!n[1].verified&&Rp(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>`,p(t,"type","button"),p(t,"class","dropdown-item")},m(o,r){l&&l.m(o,r),k(o,e,r),k(o,t,r),i||(s=G(t,"click",n[17]),i=!0)},p(o,r){o[1].verified?l&&(l.d(1),l=null):l?l.p(o,r):(l=Rp(o),l.c(),l.m(e.parentNode,e))},d(o){l&&l.d(o),o&&y(e),o&&y(t),i=!1,s()}}}function JM(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&Np(n);return{c(){h&&h.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=N(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[5],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[5],ne(l,"btn-loading",n[5])},m(g,v){h&&h.m(g,v),k(g,e,v),k(g,t,v),m(t,i),k(g,s,v),k(g,l,v),m(l,o),m(o,a),f=!0,c||(d=G(t,"click",n[18]),c=!0)},p(g,v){g[1].isNew?h&&(Pe(),P(h,1,1,()=>{h=null}),Le()):h?(h.p(g,v),v[0]&2&&E(h,1)):(h=Np(g),h.c(),E(h,1),h.m(e.parentNode,e)),(!f||v[0]&32)&&(t.disabled=g[5]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&pe(a,r),(!f||v[0]&1056&&u!==(u=!g[10]||g[5]))&&(l.disabled=u),v[0]&32&&ne(l,"btn-loading",g[5])},i(g){f||(E(h),f=!0)},o(g){P(h),f=!1},d(g){h&&h.d(g),g&&y(e),g&&y(t),g&&y(s),g&&y(l),c=!1,d()}}}function GM(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[JM],header:[KM],default:[YM]},$$scope:{ctx:n}};return e=new di({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&1088&&(o.beforeHide=s[24]),l[0]&1966|l[1]&2&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[25](null),q(e,s)}}}function XM(n,e,t){let i;const s=ln(),l="user_"+Y.randomString(5);let o,r=new fo,a=!1,u=!1,f="",c="",d="",h=!1,g=!0;function v(Q){return w(Q),t(6,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function w(Q){wi({}),t(1,r=Q!=null&&Q.clone?Q.clone():new fo),C()}function C(){t(3,h=!1),t(9,g=!0),t(2,f=(r==null?void 0:r.email)||""),t(7,c=""),t(8,d="")}function S(){if(a||!i)return;t(5,a=!0);const Q={email:f};(r.isNew||h)&&(Q.password=c,Q.passwordConfirm=d);let oe;r.isNew?oe=_e.users.create(Q):oe=_e.users.update(r.id,Q),oe.then(async ae=>{g&&M(!1),t(6,u=!1),b(),un(r.isNew?"Successfully created user.":"Successfully updated user."),s("save",ae)}).catch(ae=>{_e.errorResponseHandler(ae)}).finally(()=>{t(5,a=!1)})}function $(){!(r!=null&&r.id)||ui("Do you really want to delete the selected user?",()=>_e.users.delete(r.id).then(()=>{t(6,u=!1),b(),un("Successfully deleted user."),s("delete",r)}).catch(Q=>{_e.errorResponseHandler(Q)}))}function M(Q=!0){return _e.users.requestVerification(r.isNew?f:r.email).then(()=>{t(6,u=!1),b(),Q&&un(`Successfully sent verification email to ${r.email}.`)}).catch(oe=>{_e.errorResponseHandler(oe)})}const D=()=>M(),O=()=>$(),A=()=>b();function L(){f=this.value,t(2,f)}function F(){h=this.checked,t(3,h)}function R(){c=this.value,t(7,c)}function B(){d=this.value,t(8,d)}function te(){g=this.checked,t(9,g)}const Z=()=>i&&u?(ui("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),b()}),!1):!0;function H(Q){he[Q?"unshift":"push"](()=>{o=Q,t(4,o)})}function J(Q){ut.call(this,n,Q)}function U(Q){ut.call(this,n,Q)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(10,i=r.isNew&&f!=""||h||f!==r.email)},[b,r,f,h,o,a,u,c,d,g,i,l,S,$,M,v,D,O,A,L,F,R,B,te,Z,H,J,U]}class QM extends Ee{constructor(e){super(),Oe(this,e,XM,GM,De,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Hp(n,e,t){const i=n.slice();return i[40]=e[t],i}function jp(n,e,t){const i=n.slice();return i[43]=e[t],i}function qp(n,e,t){const i=n.slice();return i[43]=e[t],i}function xM(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,w,C,S,$,M,D,O,A,L,F=[],R=new Map,B,te,Z,H,J,U,Q,oe,ae,be,se=[],ge=new Map,$e,W,ye,ee,X,Se;a=new Bo({}),a.$on("refresh",n[17]),g=new zo({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}}
<span class="txt">New user</span>`,h=T(),V(g.$$.fragment),v=T(),b=_("div"),w=_("table"),C=_("thead"),S=_("tr"),V($.$$.fragment),D=T(),V(O.$$.fragment),L=T();for(let me=0;me<F.length;me+=1)F[me].c();B=T(),V(te.$$.fragment),H=T(),V(J.$$.fragment),Q=T(),oe=_("th"),ae=T(),be=_("tbody");for(let me=0;me<se.length;me+=1)se[me].c();Je&&Je.c(),$e=T(),st&&st.c(),W=T(),ct&&ct.c(),ye=Xe(),p(i,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(o,"type","button"),p(o,"class","btn btn-secondary btn-circle"),p(f,"class","flex-fill"),p(d,"type","button"),p(d,"class","btn btn-expanded"),p(e,"class","page-header"),p(oe,"class","col-type-action min-width"),p(w,"class","table"),ne(w,"table-loading",n[10]),p(b,"class","table-wrapper")},m(me,Fe){k(me,e,Fe),m(e,t),m(t,i),m(i,s),m(e,l),m(e,o),m(e,r),j(a,e,null),m(e,u),m(e,f),m(e,c),m(e,d),k(me,h,Fe),j(g,me,Fe),k(me,v,Fe),k(me,b,Fe),m(b,w),m(w,C),m(C,S),j($,S,null),m(S,D),j(O,S,null),m(S,L);for(let nt=0;nt<F.length;nt+=1)F[nt].m(S,null);m(S,B),j(te,S,null),m(S,H),j(J,S,null),m(S,Q),m(S,oe),m(w,ae),m(w,be);for(let nt=0;nt<se.length;nt+=1)se[nt].m(be,null);Je&&Je.m(be,null),k(me,$e,Fe),st&&st.m(me,Fe),k(me,W,Fe),ct&&ct.m(me,Fe),k(me,ye,Fe),ee=!0,X||(Se=[Ye(Ct.call(null,o,{text:"Edit profile collection",position:"right"})),G(o,"click",n[16]),G(d,"click",n[18])],X=!0)},p(me,Fe){(!ee||Fe[0]&16384)&&pe(s,me[14]);const nt={};Fe[0]&8&&(nt.value=me[3]),g.$set(nt);const ft={};Fe[1]&131072&&(ft.$$scope={dirty:Fe,ctx:me}),!M&&Fe[0]&16&&(M=!0,ft.sort=me[4],He(()=>M=!1)),$.$set(ft);const vt={};Fe[1]&131072&&(vt.$$scope={dirty:Fe,ctx:me}),!A&&Fe[0]&16&&(A=!0,vt.sort=me[4],He(()=>A=!1)),O.$set(vt),Fe[0]&4096&&(fe=me[12],F=mt(F,Fe,ke,1,me,fe,R,S,mn,Vp,B,qp));const ot={};Fe[1]&131072&&(ot.$$scope={dirty:Fe,ctx:me}),!Z&&Fe[0]&16&&(Z=!0,ot.sort=me[4],He(()=>Z=!1)),te.$set(ot);const Ot={};Fe[1]&131072&&(Ot.$$scope={dirty:Fe,ctx:me}),!U&&Fe[0]&16&&(U=!0,Ot.sort=me[4],He(()=>U=!1)),J.$set(Ot),Fe[0]&5450&&(Ce=me[1],Pe(),se=mt(se,Fe,ze,1,me,Ce,ge,be,Gt,Wp,null,Hp),Le(),!Ce.length&&Je?Je.p(me,Fe):Ce.length?Je&&(Je.d(1),Je=null):(Je=zp(me),Je.c(),Je.m(be,null))),Fe[0]&1024&&ne(w,"table-loading",me[10]),me[1].length?st?st.p(me,Fe):(st=Yp(me),st.c(),st.m(W.parentNode,W)):st&&(st.d(1),st=null),me[1].length&&me[13]?ct?ct.p(me,Fe):(ct=Kp(me),ct.c(),ct.m(ye.parentNode,ye)):ct&&(ct.d(1),ct=null)},i(me){if(!ee){E(a.$$.fragment,me),E(g.$$.fragment,me),E($.$$.fragment,me),E(O.$$.fragment,me),E(te.$$.fragment,me),E(J.$$.fragment,me);for(let Fe=0;Fe<Ce.length;Fe+=1)E(se[Fe]);ee=!0}},o(me){P(a.$$.fragment,me),P(g.$$.fragment,me),P($.$$.fragment,me),P(O.$$.fragment,me),P(te.$$.fragment,me),P(J.$$.fragment,me);for(let Fe=0;Fe<se.length;Fe+=1)P(se[Fe]);ee=!1},d(me){me&&y(e),q(a),me&&y(h),q(g,me),me&&y(v),me&&y(b),q($),q(O);for(let Fe=0;Fe<F.length;Fe+=1)F[Fe].d();q(te),q(J);for(let Fe=0;Fe<se.length;Fe+=1)se[Fe].d();Je&&Je.d(),me&&y($e),st&&st.d(me),me&&y(W),ct&&ct.d(me),me&&y(ye),X=!1,Qe(Se)}}}function eT(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading users...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){k(t,e,i)},p:le,i:le,o:le,d(t){t&&y(e)}}}function tT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",p(t,"class",Y.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){k(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&y(e)}}}function nT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",p(t,"class",Y.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){k(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&y(e)}}}function Vp(n,e){let t,i,s,l,o,r,a,u=e[43].name+"",f,c,d;return{key:n,first:null,c(){t=_("th"),i=_("div"),s=_("i"),o=T(),r=_("span"),a=N("profile."),f=N(u),p(s,"class",l=Y.getFieldTypeIcon(e[43].type)),p(r,"class","txt"),p(i,"class","col-header-content"),p(t,"class",c="col-type-"+e[43].type+" col-field-"+e[43].name),p(t,"name",d=e[43].name),this.first=t},m(h,g){k(h,t,g),m(t,i),m(i,s),m(i,o),m(i,r),m(r,a),m(r,f)},p(h,g){e=h,g[0]&4096&&l!==(l=Y.getFieldTypeIcon(e[43].type))&&p(s,"class",l),g[0]&4096&&u!==(u=e[43].name+"")&&pe(f,u),g[0]&4096&&c!==(c="col-type-"+e[43].type+" col-field-"+e[43].name)&&p(t,"class",c),g[0]&4096&&d!==(d=e[43].name)&&p(t,"name",d)},d(h){h&&y(t)}}}function iT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",p(t,"class",Y.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){k(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&y(e)}}}function sT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",p(t,"class",Y.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){k(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&y(e)}}}function zp(n){let e;function t(l,o){return l[10]?oT:lT}let i=t(n),s=i(n);return{c(){s.c(),e=Xe()},m(l,o){s.m(l,o),k(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&&y(e)}}}function lT(n){var r;let e,t,i,s,l,o=((r=n[3])==null?void 0:r.length)&&Bp(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No users found.",s=T(),o&&o.c(),l=T(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){k(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=Bp(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&y(e),o&&o.d()}}}function oT(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){k(t,e,i)},p:le,d(t){t&&y(e)}}}function Bp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){k(s,e,l),t||(i=G(e,"click",n[26]),t=!0)},p:le,d(s){s&&y(e),t=!1,i()}}}function Up(n,e){let t,i,s;return i=new __({props:{field:e[43],record:e[40].profile||{}}}),{key:n,first:null,c(){t=Xe(),V(i.$$.fragment),this.first=t},m(l,o){k(l,t,o),j(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&4096&&(r.field=e[43]),o[0]&2&&(r.record=e[40].profile||{}),i.$set(r)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&y(t),q(i,l)}}}function Wp(n,e){let t,i,s,l,o,r,a,u=e[40].email+"",f,c,d,h,g=e[40].verified?"Verified":"Unverified",v,b,w=[],C=new Map,S,$,M,D,O,A,L,F,R,B,te,Z,H,J,U;s=new Go({props:{id:e[40].id}});let Q=e[12];const oe=se=>se[43].name;for(let se=0;se<Q.length;se+=1){let ge=jp(e,Q,se),$e=oe(ge);C.set($e,w[se]=Up($e,ge))}M=new yi({props:{date:e[40].created}}),A=new yi({props:{date:e[40].updated}});function ae(){return e[24](e[40])}function be(){return e[25](e[40])}return{key:n,first:null,c(){t=_("tr"),i=_("td"),V(s.$$.fragment),l=T(),o=_("td"),r=_("div"),a=_("span"),f=N(u),d=T(),h=_("span"),v=N(g),b=T();for(let se=0;se<w.length;se+=1)w[se].c();S=T(),$=_("td"),V(M.$$.fragment),D=T(),O=_("td"),V(A.$$.fragment),L=T(),F=_("td"),R=_("button"),R.innerHTML=`<i class="ri-user-settings-line"></i>
<span class="txt">Edit user</span>`,B=T(),te=_("button"),te.innerHTML=`<i class="ri-profile-line"></i>
<span class="txt">Edit profile</span>`,Z=T(),p(i,"class","col-type-text col-field-id"),p(a,"class","txt"),p(a,"title",c=e[40].email),p(h,"class","label"),ne(h,"label-success",e[40].verified),ne(h,"label-warning",!e[40].verified),p(r,"class","inline-flex"),p(o,"class","col-type-email col-field-email"),p($,"class","col-type-date col-field-created"),p(O,"class","col-type-date col-field-updated"),p(R,"type","button"),p(R,"class","btn btn-sm btn-outline"),p(te,"type","button"),p(te,"class","btn btn-sm m-l-10"),p(F,"class","col-type-action min-width"),this.first=t},m(se,ge){k(se,t,ge),m(t,i),j(s,i,null),m(t,l),m(t,o),m(o,r),m(r,a),m(a,f),m(r,d),m(r,h),m(h,v),m(t,b);for(let $e=0;$e<w.length;$e+=1)w[$e].m(t,null);m(t,S),m(t,$),j(M,$,null),m(t,D),m(t,O),j(A,O,null),m(t,L),m(t,F),m(F,R),m(F,B),m(F,te),m(t,Z),H=!0,J||(U=[G(R,"click",Qn(ae)),G(te,"click",Qn(be))],J=!0)},p(se,ge){e=se;const $e={};ge[0]&2&&($e.id=e[40].id),s.$set($e),(!H||ge[0]&2)&&u!==(u=e[40].email+"")&&pe(f,u),(!H||ge[0]&2&&c!==(c=e[40].email))&&p(a,"title",c),(!H||ge[0]&2)&&g!==(g=e[40].verified?"Verified":"Unverified")&&pe(v,g),ge[0]&2&&ne(h,"label-success",e[40].verified),ge[0]&2&&ne(h,"label-warning",!e[40].verified),ge[0]&4098&&(Q=e[12],Pe(),w=mt(w,ge,oe,1,e,Q,C,t,Gt,Up,S,jp),Le());const W={};ge[0]&2&&(W.date=e[40].created),M.$set(W);const ye={};ge[0]&2&&(ye.date=e[40].updated),A.$set(ye)},i(se){if(!H){E(s.$$.fragment,se);for(let ge=0;ge<Q.length;ge+=1)E(w[ge]);E(M.$$.fragment,se),E(A.$$.fragment,se),H=!0}},o(se){P(s.$$.fragment,se);for(let ge=0;ge<w.length;ge+=1)P(w[ge]);P(M.$$.fragment,se),P(A.$$.fragment,se),H=!1},d(se){se&&y(t),q(s);for(let ge=0;ge<w.length;ge+=1)w[ge].d();q(M),q(A),J=!1,Qe(U)}}}function Yp(n){let e,t,i=n[1].length+"",s,l,o;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),o=N(n[2]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){k(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+"")&&pe(s,i),a[0]&4&&pe(o,r[2])},d(r){r&&y(e)}}}function Kp(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=N("Load more ("),o=N(l),r=N(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ne(t,"btn-loading",n[10]),ne(t,"btn-disabled",n[10]),p(e,"class","block txt-center m-t-xs")},m(f,c){k(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=G(t,"click",n[27]),a=!0)},p(f,c){c[0]&6&&l!==(l=f[2]-f[1].length+"")&&pe(o,l),c[0]&1024&&ne(t,"btn-loading",f[10]),c[0]&1024&&ne(t,"btn-disabled",f[10])},d(f){f&&y(e),a=!1,u()}}}function rT(n){let e,t,i,s;const l=[eT,xM],o=[];function r(a,u){return a[11]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Xe()},m(a,u){o[e].m(a,u),k(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(Pe(),P(o[f],1,1,()=>{o[f]=null}),Le(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){s||(E(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&y(i)}}}function aT(n){let e,t,i,s,l,o,r,a;e=new Cn({props:{$$slots:{default:[rT]},$$scope:{ctx:n}}});let u={};i=new QM({props:u}),n[28](i),i.$on("save",n[29]),i.$on("delete",n[30]);let f={};l=new Wa({props:f}),n[31](l),l.$on("save",n[32]);let c={collection:n[5]};return r=new g_({props:c}),n[33](r),r.$on("save",n[34]),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment),s=T(),V(l.$$.fragment),o=T(),V(r.$$.fragment)},m(d,h){j(e,d,h),k(d,t,h),j(i,d,h),k(d,s,h),j(l,d,h),k(d,o,h),j(r,d,h),a=!0},p(d,h){const g={};h[0]&32766|h[1]&131072&&(g.$$scope={dirty:h,ctx:d}),e.$set(g);const v={};i.$set(v);const b={};l.$set(b);const w={};h[0]&32&&(w.collection=d[5]),r.$set(w)},i(d){a||(E(e.$$.fragment,d),E(i.$$.fragment,d),E(l.$$.fragment,d),E(r.$$.fragment,d),a=!0)},o(d){P(e.$$.fragment,d),P(i.$$.fragment,d),P(l.$$.fragment,d),P(r.$$.fragment,d),a=!1},d(d){q(e,d),d&&y(t),n[28](null),q(i,d),d&&y(s),n[31](null),q(l,d),d&&y(o),n[33](null),q(r,d)}}}function uT(n,e,t){let i,s,l,o;kt(n,No,ee=>t(35,l=ee)),kt(n,Rt,ee=>t(14,o=ee)),fn(Rt,o="Users",o);const r=new URLSearchParams(l),a=["id","userId","created","updated"];let u,f,c,d=[],h=1,g=0,v=!1,b=r.get("filter")||"",w
<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="Sync",d=T(),h=_("a"),h.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,g=T(),v=_("a"),v.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,b=T(),w=_("div"),w.textContent="Authentication",C=T(),S=_("a"),S.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,$=T(),M=_("a"),M.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,D=T(),O=_("a"),O.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"class","sidebar-title"),p(h,"href","/settings/export-collections"),p(h,"class","sidebar-list-item"),p(v,"href","/settings/import-collections"),p(v,"class","sidebar-list-item"),p(w,"class","sidebar-title"),p(S,"href","/settings/auth-providers"),p(S,"class","sidebar-list-item"),p(M,"href","/settings/tokens"),p(M,"class","sidebar-list-item"),p(O,"href","/settings/admins"),p(O,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(F,R){k(F,e,R),m(e,t),m(t,i),m(t,s),m(t,l),m(t,o),m(t,r),m(t,a),m(t,u),m(t,f),m(t,c),m(t,d),m(t,h),m(t,g),m(t,v),m(t,b),m(t,w),m(t,C),m(t,S),m(t,$),m(t,M),m(t,D),m(t,O),A||(L=[Ye(Nn.call(null,l,{path:"/settings"})),Ye(dn.call(null,l)),Ye(Nn.call(null,r,{path:"/settings/mail/?.*"})),Ye(dn.call(null,r)),Ye(Nn.call(null,u,{path:"/settings/storage/?.*"})),Ye(dn.call(null,u)),Ye(Nn.call(null,h,{path:"/settings/export-collections/?.*"})),Ye(dn.call(null,h)),Ye(Nn.call(null,v,{path:"/settings/import-collections/?.*"})),Ye(dn.call(null,v)),Ye(Nn.call(null,S,{path:"/settings/auth-providers/?.*"})),Ye(dn.call(null,S)),Ye(Nn.call(null,M,{path:"/settings/tokens/?.*"})),Ye(dn.call(null,M)),Ye(Nn.call(null,O,{path:"/settings/admins/?.*"})),Ye(dn.call(null,O))],A=!0)},p:le,i:le,o:le,d(F){F&&y(e),A=!1,Qe(L)}}}class ji extends Ee{constructor(e){super(),Oe(this,e,null,cT,De,{})}}function Zp(n,e,t){const i=n.slice();return i[31]=e[t],i}function Jp(n){let e,t;return e=new Ne({props:{class:"form-field disabled",name:"id",$$slots:{default:[dT,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function dT(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"),p(t,"class",Y.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","text"),p(r,"id",a=n[30]),r.value=u=n[1].id,r.disabled=!0},m(f,c){k(f,e,c),m(e,t),m(e,i),m(e,s),k(f,o,c),k(f,r,c)},p(f,c){c[0]&1073741824&&l!==(l=f[30])&&p(e,"for",l),c[0]&1073741824&&a!==(a=f[30])&&p(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&y(e),f&&y(o),f&&y(r)}}}function Gp(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(),Gn(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"tabindex","0"),p(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(f,c){k(f,e,c),m(e,t),m(e,s),o||(r=[G(e,"click",a),G(e,"keydown",u)],o=!0)},p(f,c){n=f,c[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(f){f&&y(e),o=!1,Qe(r)}}}function pT(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"),p(t,"class",Y.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){k(c,e,d),m(e,t),m(e,i),m(e,s),k(c,o,d),k(c,r,d),Me(r,n[3]),u||(f=G(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&Me(r,c[3])},d(c){c&&y(e),c&&y(o),c&&y(r),u=!1,f()}}}function Xp(n){let e,t;return e=new Ne({props:{class:"form-field form-field-toggle",$$slots:{default:[hT,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){k(s,e,l),t||(i=G(e,"click",n[15]),t=!0)},p:le,d(s){s&&y(e),t=!1,i()}}}function yT(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&xp(n);return{c(){h&&h.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=N(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[6],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],ne(l,"btn-loading",n[6])},m(g,v){h&&h.m(g,v),k(g,e,v),k(g,t,v),m(t,i),k(g,s,v),k(g,l,v),m(l,o),m(o,a),f=!0,c||(d=G(t,"click",n[16]),c=!0)},p(g,v){g[1].isNew?h&&(Pe(),P(h,1,1,()=>{h=null}),Le()):h?(h.p(g,v),v[0]&2&&E(h,1)):(h=xp(g),h.c(),E(h,1),h.m(e.parentNode,e)),(!f||v[0]&64)&&(t.disabled=g[6]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&pe(a,r),(!f||v[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),v[0]&64&&ne(l,"btn-loading",g[6])},i(g){f||(E(h),f=!0)},o(g){P(h),f=!1},d(g){h&&h.d(g),g&&y(e),g&&y(t),g&&y(s),g&&y(l),c=!1,d()}}}function kT(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[yT],header:[bT],default:[_T]},$$scope:{ctx:n}};return e=new di({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[23]),l[0]&1886|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[24](null),q(e,s)}}}function wT(n,e,t){let i;const s=ln(),l="admin_"+Y.randomString(5);let o,r=new ks,a=!1,u=!1,f=0,c="",d="",h="",g=!1;function v(U){return w(U),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function w(U){wi({}),t(1,r=U!=null&&U.clone?U.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,h="")}function S(){if(a||!i)return;t(6,a=!0);const U={email:c,avatar:f};(r.isNew||g)&&(U.password=d,U.passwordConfirm=h);let Q;r.isNew?Q=_e.admins.create(U):Q=_e.admins.update(r.id,U),Q.then(async oe=>{var ae;t(7,u=!1),b(),un(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",oe),((ae=_e.authStore.model)==null?void 0:ae.id)===oe.id&&_e.authStore.save(_e.authStore.token,oe)}).catch(oe=>{_e.errorResponseHandler(oe)}).finally(()=>{t(6,a=!1)})}function $(){!(r!=null&&r.id)||ui("Do you really want to delete the selected admin?",()=>_e.admins.delete(r.id).then(()=>{t(7,u=!1),b(),un("Successfully deleted admin."),s("delete",r)}).catch(U=>{_e.errorResponseHandler(U)}))}const M=()=>$(),D=()=>b(),O=U=>t(2,f=U),A=(U,Q)=>{(Q.code==="Enter"||Q.code==="Space")&&(Q.preventDefault(),t(2,f=U))};function L(){c=this.value,t(3,c)}function F(){g=this.checked,t(4,g)}function R(){d=this.value,t(8,d)}function B(){h=this.value,t(9,h)}const te=()=>i&&u?(ui("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function Z(U){he[U?"unshift":"push"](()=>{o=U,t(5,o)})}function H(U){ut.call(this,n,U)}function J(U){ut.call(this,n,U)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||g||c!==r.email||f!==r.avatar)},[b,r,f,c,g,o,a,u,d,h,i,l,S,$,v,M,D,O,A,L,F,R,B,te,Z,H,J]}class $T extends Ee{constructor(e){super(),Oe(this,e,wT,kT,De,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function eh(n,e,t){const i=n.slice();return i[24]=e[t],i}function ST(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",p(t,"class",Y.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){k(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&y(e)}}}function CT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",p(t,"class",Y.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){k(l,e,o),m(e,t),m(e,i),m(e,s)},p:le,d(l){l&&y(e)}}}function MT(n){let e,t,i,s;return{c(
`},m(t,i){k(t,e,i)},p:le,d(t){t&&y(e)}}}function nh(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){k(s,e,l),t||(i=G(e,"click",n[17]),t=!0)},p:le,d(s){s&&y(e),t=!1,i()}}}function ih(n){let e;return{c(){e=_("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function sh(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,g=e[24].email+"",v,b,w,C,S,$,M,D,O,A,L,F,R,B;u=new Go({props:{id:e[24].id}});let te=e[24].id===e[7].id&&ih();S=new yi({props:{date:e[24].created}}),D=new yi({props:{date:e[24].updated}});function Z(){return e[15](e[24])}function H(...J){return e[16](e[24],...J)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("figure"),l=_("img"),r=T(),a=_("td"),V(u.$$.fragment),f=T(),te&&te.c(),c=T(),d=_("td"),h=_("span"),v=N(g),w=T(),C=_("td"),V(S.$$.fragment),$=T(),M=_("td"),V(D.$$.fragment),O=T(),A=_("td"),A.innerHTML='<i class="ri-arrow-right-line"></i>',L=T(),Gn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(l,"src",o),p(l,"alt","Admin avatar"),p(s,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(a,"class","col-type-text col-field-id"),p(h,"class","txt txt-ellipsis"),p(h,"title",b=e[24].email),p(d,"class","col-type-email col-field-email"),p(C,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(A,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(J,U){k(J,t,U),m(t,i),m(i,s),m(s,l),m(t,r),m(t,a),j(u,a,null),m(a,f),te&&te.m(a,null),m(t,c),m(t,d),m(d,h),m(h,v),m(t,w),m(t,C),j(S,C,null),m(t,$),m(t,M),j(D,M,null),m(t,O),m(t,A),m(t,L),F=!0,R||(B=[G(t,"click",Z),G(t,"keydown",H)],R=!0)},p(J,U){e=J,(!F||U&16&&!Gn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const Q={};U&16&&(Q.id=e[24].id),u.$set(Q),e[24].id===e[7].id?te||(te=ih(),te.c(),te.m(a,null)):te&&(te.d(1),te=null),(!F||U&16)&&g!==(g=e[24].email+"")&&pe(v,g),(!F||U&16&&b!==(b=e[24].email))&&p(h,"title",b);const oe={};U&16&&(oe.date=e[24].created),S.$set(oe);const ae={};U&16&&(ae.date=e[24].updated),D.$set(ae)},i(J){F||(E(u.$$.fragment,J),E(S.$$.fragment,J),E(D.$$.fragment,J),F=!0)},o(J){P(u.$$.fragment,J),P(S.$$.fragment,J),P(D.$$.fragment,J),F=!1},d(J){J&&y(t),q(u),te&&te.d(),q(S),q(D),R=!1,Qe(B)}}}function lh(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),r=N(o),p(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){k(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+"")&&pe(s,i),u&16&&o!==(o=a[4].length+"")&&pe(r,o)},d(a){a&&y(e)}}}function ET(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,w,C,S,$,M,D,O,A,L,F,R,B,te,Z,H,J,U,Q,oe,ae,be=[],se=new Map,ge,$e,W,ye,ee;a=new Bo({}),a.$on("refresh",n[8]),g=new zo({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),g.$on("submit",n[10]);function X(Ce){n[11](Ce)}let Se={class:"col-type-text",name:"id",$$slots:{default:[ST]},$$scope:{ctx:n}};n[2]!==void 0&&(Se.sort=n[2]),D=new nn({props:Se}),he.push(()=>Re(D,"sort",X));function je(Ce){n[12](Ce)}let Ue={class:"col-type-email col-field-email",name:"email",$$slots:{default:[CT]},$$scope:{ctx:n}};n[2]!==void 0&&(Ue.sort=n[2]),L=new nn({props:Ue}),he.push(()=>Re(L,"sort",je));function K(Ce){n[13](Ce)}let de={class:"col-type-date col-field-created",name:"created",$$slots:{default:[MT]},$$scope:{ctx:n}};n[2]!==void 0&&(de.sort=n[2]),B=new nn({props:de}),he.push(()=>Re(B,"sort",K));function fe(Ce){n[14](Ce)}let ke={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[TT]},$$scope:{ctx:n}};n[2]!==void 0&&(ke.sort=n[2]),H=new nn({props:ke}),he.push(()=>Re(H,"sort",fe));let Ze=n[4];const tt=Ce=>Ce[24].id;for(let Ce=0;Ce<Ze.length;Ce+=1){let ze=eh(n,Ze,Ce),Je=tt(ze);se.set(Je,be[Ce]=sh(Je,ze))}let We=null;Ze.length||(We=th(n));let it=n[4].length&&lh(n);return{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent=
<span class="txt">New admin</span>`,h=T(),V(g.$$.fragment),v=T(),b=_("div"),w=_("table"),C=_("thead"),S=_("tr"),$=_("th"),M=T(),V(D.$$.fragment),A=T(),V(L.$$.fragment),R=T(),V(B.$$.fragment),Z=T(),V(H.$$.fragment),U=T(),Q=_("th"),oe=T(),ae=_("tbody");for(let Ce=0;Ce<be.length;Ce+=1)be[Ce].c();We&&We.c(),ge=T(),it&&it.c(),$e=Xe(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(d,"type","button"),p(d,"class","btn btn-expanded"),p(e,"class","page-header"),p($,"class","min-width"),p(Q,"class","col-type-action min-width"),p(w,"class","table"),ne(w,"table-loading",n[5]),p(b,"class","table-wrapper")},m(Ce,ze){k(Ce,e,ze),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(e,r),j(a,e,null),m(e,u),m(e,f),m(e,c),m(e,d),k(Ce,h,ze),j(g,Ce,ze),k(Ce,v,ze),k(Ce,b,ze),m(b,w),m(w,C),m(C,S),m(S,$),m(S,M),j(D,S,null),m(S,A),j(L,S,null),m(S,R),j(B,S,null),m(S,Z),j(H,S,null),m(S,U),m(S,Q),m(w,oe),m(w,ae);for(let Je=0;Je<be.length;Je+=1)be[Je].m(ae,null);We&&We.m(ae,null),k(Ce,ge,ze),it&&it.m(Ce,ze),k(Ce,$e,ze),W=!0,ye||(ee=G(d,"click",n[9]),ye=!0)},p(Ce,ze){(!W||ze&64)&&pe(o,Ce[6]);const Je={};ze&2&&(Je.value=Ce[1]),g.$set(Je);const st={};ze&134217728&&(st.$$scope={dirty:ze,ctx:Ce}),!O&&ze&4&&(O=!0,st.sort=Ce[2],He(()=>O=!1)),D.$set(st);const ct={};ze&134217728&&(ct.$$scope={dirty:ze,ctx:Ce}),!F&&ze&4&&(F=!0,ct.sort=Ce[2],He(()=>F=!1)),L.$set(ct);const me={};ze&134217728&&(me.$$scope={dirty:ze,ctx:Ce}),!te&&ze&4&&(te=!0,me.sort=Ce[2],He(()=>te=!1)),B.$set(me);const Fe={};ze&134217728&&(Fe.$$scope={dirty:ze,ctx:Ce}),!J&&ze&4&&(J=!0,Fe.sort=Ce[2],He(()=>J=!1)),H.$set(Fe),ze&186&&(Ze=Ce[4],Pe(),be=mt(be,ze,tt,1,Ce,Ze,se,ae,Gt,sh,null,eh),Le(),!Ze.length&&We?We.p(Ce,ze):Ze.length?We&&(We.d(1),We=null):(We=th(Ce),We.c(),We.m(ae,null))),ze&32&&ne(w,"table-loading",Ce[5]),Ce[4].length?it?it.p(Ce,ze):(it=lh(Ce),it.c(),it.m($e.parentNode,$e)):it&&(it.d(1),it=null)},i(Ce){if(!W){E(a.$$.fragment,Ce),E(g.$$.fragment,Ce),E(D.$$.fragment,Ce),E(L.$$.fragment,Ce),E(B.$$.fragment,Ce),E(H.$$.fragment,Ce);for(let ze=0;ze<Ze.length;ze+=1)E(be[ze]);W=!0}},o(Ce){P(a.$$.fragment,Ce),P(g.$$.fragment,Ce),P(D.$$.fragment,Ce),P(L.$$.fragment,Ce),P(B.$$.fragment,Ce),P(H.$$.fragment,Ce);for(let ze=0;ze<be.length;ze+=1)P(be[ze]);W=!1},d(Ce){Ce&&y(e),q(a),Ce&&y(h),q(g,Ce),Ce&&y(v),Ce&&y(b),q(D),q(L),q(B),q(H);for(let ze=0;ze<be.length;ze+=1)be[ze].d();We&&We.d(),Ce&&y(ge),it&&it.d(Ce),Ce&&y($e),ye=!1,ee()}}}function AT(n){let e,t,i,s,l,o;e=new ji({}),i=new Cn({props:{$$slots:{default:[ET]},$$scope:{ctx:n}}});let r={};return l=new $T({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment),s=T(),V(l.$$.fragment)},m(a,u){j(e,a,u),k(a,t,u),j(i,a,u),k(a,s,u),j(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){q(e,a),a&&y(t),q(i,a),a&&y(s),n[18](null),q(l,a)}}}function PT(n,e,t){let i,s,l;kt(n,No,R=>t(21,i=R)),kt(n,Rt,R=>t(6,s=R)),kt(n,va,R=>t(7,l=R)),fn(Rt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){return t(5,u=!0),t(4,a=[]),_e.admins.getFullList(100,{sort:c||"-created",filter:f}).then(R=>{t(4,a=R),t(5,u=!1)}).catch(R=>{R!=null&&R.isAbort||(t(5,u=!1),console.warn(R),h(),_e.errorResponseHandler(R,!1))})}function h(){t(4,a=[])}const g=()=>d(),v=()=>r==null?void 0:r.show(),b=R=>t(1,f=R.detail);function w(R){c=R,t(2,c)}function C(R){c=R,t(2,c)}function S(R){c=R,t(2,c)}function $(R){c=R,t(2,c)}const M=R=>r==null?void 0:r.show(R),D=(R,B)=>{(B.code==="Enter"||B.code==="Space")&&(B.preventDefault(),r==null||r.show(R))},O=()=>t(1,f="");function A(R){he[R?"unshift":"push"](()=>{r=R,t(3,r)})}const L=()=>d(),F=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const R=new URLSearchParams({filter:f,sort:c}).toString();ki("/settings/admins?"+R),d()}},[d,f,c,r,a,u,s,l,g,v,b,w,C,S,$,M,D,
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),ne(a,"btn-disabled",n[2]),ne(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){k(d,e,h),m(e,t),m(e,i),j(s,e,null),m(e,l),j(o,e,null),m(e,r),m(e,a),u=!0,f||(c=G(e,"submit",Yt(n[3])),f=!0)},p(d,h){const g={};h&769&&(g.$$scope={dirty:h,ctx:d}),s.$set(g);const v={};h&770&&(v.$$scope={dirty:h,ctx:d}),o.$set(v),h&4&&ne(a,"btn-disabled",d[2]),h&4&&ne(a,"btn-loading",d[2])},i(d){u||(E(s.$$.fragment,d),E(o.$$.fragment,d),u=!0)},o(d){P(s.$$.fragment,d),P(o.$$.fragment,d),u=!1},d(d){d&&y(e),q(s),q(o),f=!1,c()}}}function RT(n){let e,t;return e=new ug({props:{$$slots:{default:[NT]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function HT(n,e,t){let i;kt(n,No,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),_e.admins.authViaEmail(l,o).then(()=>{ki("/")}).catch(()=>{mo("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class jT extends Ee{constructor(e){super(),Oe(this,e,HT,RT,De,{})}}function qT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,w,C;return i=new Ne({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[zT,({uniqueId:S})=>({14:S}),({uniqueId:S})=>S?16384:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[BT,({uniqueId:S})=>({14:S}),({uniqueId:S})=>S?16384:0]},$$scope:{ctx:n}}}),a=new Ne({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[UT,({uniqueId:S})=>({14:S}),({uniqueId:S})=>S?16384:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),V(a.$$.fragment),u=T(),f=_("div"),c=_("div"),d=T(),h=_("button"),g=_("span"),g.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(c,"class","flex-fill"),p(g,"class","txt"),p(h,"type","submit"),p(h,"class","btn btn-expanded"),h.disabled=v=!n[3]||n[2],ne(h,"btn-loading",n[2]),p(f,"class","col-lg-12 flex"),p(e,"class","grid")},m(S,$){k(S,e,$),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),j(a,e,null),m(e,u),m(e,f),m(f,c),m(f,d),m(f,h),m(h,g),b=!0,w||(C=G(h,"click",n[9]),w=!0)},p(S,$){const M={};$&49153&&(M.$$scope={dirty:$,ctx:S}),i.$set(M);const D={};$&49153&&(D.$$scope={dirty:$,ctx:S}),o.$set(D);const O={};$&49153&&(O.$$scope={dirty:$,ctx:S}),a.$set(O),(!b||$&12&&v!==(v=!S[3]||S[2]))&&(h.disabled=v),$&4&&ne(h,"btn-loading",S[2])},i(S){b||(E(i.$$.fragment,S),E(o.$$.fragment,S),E(a.$$.fragment,S),b=!0)},o(S){P(i.$$.fragment,S),P(o.$$.fragment,S),P(a.$$.fragment,S),b=!1},d(S){S&&y(e),q(i),q(o),q(a),w=!1,C()}}}function VT(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){k(t,e,i)},p:le,i:le,o:le,d(t){t&&y(e)}}}function zT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Application name"),s=T(),l=_("input"),p(e,"for",i=n[14]),p(l,"type","text"),p(l,"id",o=n[14]),l.required=!0},m(u,f){k(u,e,f),m(e,t),k(u,s,f),k(u,l,f),Me(l,n[0].meta.appName),r||(a=G(l,"input",n[6]),r=!0)},p(u,f){f&16384&&i!==(i=u[14])&&p(e,"for",i),f&16384&&o!==(o=u[14])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appName&&Me(l,u[0].meta.appName)},d(u){u&&y(e),u&&y(s),u&&y(l),r=!1,a()}}}function BT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Application url"),s=T(),l=_("input"),p(e,"for",i=n[14]),p(l,"type","text"),p(l,"id",o=n[14]),l.required=!0},m(u,f){k(u,e,f),m(e,t),k(u,s,f),k(u,l,f),Me(l,n[0].meta.appUrl),r||(a=G(l,"input",n[7]),r=!0)},p(u,f){f&16384&&i!==(i=u[14])&&p(e,"for",i),f&16384&&o!==(o=u[14])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&Me(l,u[0].meta.appUrl)},d(u){u&&y(e),u&&y(s),u&&y(l),r=!1,a()}}}function UT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Logs max days retention"),s=T(),l=_("input"),p(e,"for",i=n[14]),p(
<div class="breadcrumb-item">Application</div></nav>`,t=T(),i=_("div"),s=_("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(h,g){k(h,e,g),k(h,t,g),k(h,i,g),m(i,s),c[l].m(s,null),r=!0,a||(u=G(s,"submit",Yt(n[4])),a=!0)},p(h,g){let v=l;l=d(h),l===v?c[l].p(h,g):(Pe(),P(c[v],1,1,()=>{c[v]=null}),Le(),o=c[l],o?o.p(h,g):(o=c[l]=f[l](h),o.c()),E(o,1),o.m(s,null))},i(h){r||(E(o),r=!0)},o(h){P(o),r=!1},d(h){h&&y(e),h&&y(t),h&&y(i),c[l].d(),a=!1,u()}}}function YT(n){let e,t,i,s;return e=new ji({}),i=new Cn({props:{$$slots:{default:[WT]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(l,o){j(e,l,o),k(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&32783&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&y(t),q(i,l)}}}function KT(n,e,t){let i,s,l;kt(n,_o,w=>t(10,s=w)),kt(n,Rt,w=>t(11,l=w)),fn(Rt,l="Application settings",l);let o={},r=!1,a=!1,u="";f();async function f(){t(1,r=!0);try{const w=await _e.settings.getAll()||{};d(w)}catch(w){_e.errorResponseHandler(w)}t(1,r=!1)}async function c(){if(!(a||!i)){t(2,a=!0);try{const w=await _e.settings.update(Y.filterRedactedProps(o));d(w),un("Successfully saved application settings.")}catch(w){_e.errorResponseHandler(w)}t(2,a=!1)}}function d(w={}){var C;fn(_o,s=(C=w==null?void 0:w.meta)==null?void 0:C.appName,s),t(0,o={meta:(w==null?void 0:w.meta)||{},logs:(w==null?void 0:w.logs)||{}}),t(5,u=JSON.stringify(o))}function h(){o.meta.appName=this.value,t(0,o)}function g(){o.meta.appUrl=this.value,t(0,o)}function v(){o.logs.maxDays=At(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,h,g,v,b]}class ZT extends Ee{constructor(e){super(),Oe(this,e,KT,YT,De,{})}}function JT(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"),ai(e,l)},m(o,r){k(o,e,r),e.autofocus&&e.focus(),n[7](e),Me(e,n[0]),t||(i=G(e,"input",n[8]),t=!0)},p(o,r){ai(e,l=gn(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&Me(e,o[0])},d(o){o&&y(e),n[7](null),t=!1,i()}}}function GT(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"),p(t,"type","button"),p(t,"class","btn btn-secondary btn-circle"),p(e,"class","form-field-addon"),ai(s,a)},m(u,f){k(u,e,f),m(e,t),k(u,i,f),k(u,s,f),s.autofocus&&s.focus(),l||(o=[Ye(Ct.call(null,t,{position:"left",text:"Set new value"})),G(t,"click",n[6])],l=!0)},p(u,f){ai(s,a=gn(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&y(e),u&&y(i),u&&y(s),l=!1,Qe(o)}}}function XT(n){let e;function t(l,o){return l[3]?GT:JT}let i=t(n),s=i(n);return{c(){s.c(),e=Xe()},m(l,o){s.m(l,o),k(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:le,o:le,d(l){s.d(l),l&&y(e)}}}function QT(n,e,t){const i=["value","mask"];let s=Jt(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await ei(),r==null||r.focus()}const f=()=>u();function c(h){he[h?"unshift":"push"](()=>{r=h,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=pt(pt({},e),fi(h)),t(5,s=Jt(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,o=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&l===o&&t(3,a=!0)},[l,o,r,a,u,s,f,c,d]}class Ya extends Ee{constructor(e){super(),Oe(this,e,QT,XT,De,{value:0,mask:1})}}function xT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,w,C,S,$,M,D,O,A,L,F,R,B,te;i=new Ne({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[tD,({uniqueId:H})=>({23:H}),({uniqueId:H})=>H?8388608:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[nD,({uniqueId:H})=>({23:H}),({uniqueId:H})=>H?8388608:0]},$$scope:{ctx:n}}}),a=new Ne({props:{class
<br/>
<strong class="txt-bold">For better emails deliverability it is recommended to enable the SMTP settings
below.</strong></p>`,w=T(),V(C.$$.fragment),S=T(),Z&&Z.c(),$=T(),M=_("div"),D=_("div"),O=T(),A=_("button"),L=_("span"),L.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid"),p(b,"class","content m-b-sm"),p(D,"class","flex-fill"),p(L,"class","txt"),p(A,"type","submit"),p(A,"class","btn btn-expanded"),A.disabled=F=!n[3]||n[2],ne(A,"btn-loading",n[2]),p(M,"class","flex")},m(H,J){k(H,e,J),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),j(a,e,null),m(e,u),j(f,e,null),m(e,c),j(d,e,null),k(H,h,J),k(H,g,J),k(H,v,J),k(H,b,J),k(H,w,J),j(C,H,J),k(H,S,J),Z&&Z.m(H,J),k(H,$,J),k(H,M,J),m(M,D),m(M,O),m(M,A),m(A,L),R=!0,B||(te=G(A,"click",n[19]),B=!0)},p(H,J){const U={};J&25165825&&(U.$$scope={dirty:J,ctx:H}),i.$set(U);const Q={};J&25165825&&(Q.$$scope={dirty:J,ctx:H}),o.$set(Q);const oe={};J&25165825&&(oe.$$scope={dirty:J,ctx:H}),a.$set(oe);const ae={};J&25165825&&(ae.$$scope={dirty:J,ctx:H}),f.$set(ae);const be={};J&25165825&&(be.$$scope={dirty:J,ctx:H}),d.$set(be);const se={};J&25165825&&(se.$$scope={dirty:J,ctx:H}),C.$set(se),H[0].smtp.enabled?Z?(Z.p(H,J),J&1&&E(Z,1)):(Z=oh(H),Z.c(),E(Z,1),Z.m($.parentNode,$)):Z&&(Pe(),P(Z,1,1,()=>{Z=null}),Le()),(!R||J&12&&F!==(F=!H[3]||H[2]))&&(A.disabled=F),J&4&&ne(A,"btn-loading",H[2])},i(H){R||(E(i.$$.fragment,H),E(o.$$.fragment,H),E(a.$$.fragment,H),E(f.$$.fragment,H),E(d.$$.fragment,H),E(C.$$.fragment,H),E(Z),R=!0)},o(H){P(i.$$.fragment,H),P(o.$$.fragment,H),P(a.$$.fragment,H),P(f.$$.fragment,H),P(d.$$.fragment,H),P(C.$$.fragment,H),P(Z),R=!1},d(H){H&&y(e),q(i),q(o),q(a),q(f),q(d),H&&y(h),H&&y(g),H&&y(v),H&&y(b),H&&y(w),q(C,H),H&&y(S),Z&&Z.d(H),H&&y($),H&&y(M),B=!1,te()}}}function eD(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){k(t,e,i)},p:le,i:le,o:le,d(t){t&&y(e)}}}function tD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Sender name"),s=T(),l=_("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){k(u,e,f),m(e,t),k(u,s,f),k(u,l,f),Me(l,n[0].meta.senderName),r||(a=G(l,"input",n[8]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&l.value!==u[0].meta.senderName&&Me(l,u[0].meta.senderName)},d(u){u&&y(e),u&&y(s),u&&y(l),r=!1,a()}}}function nD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Sender address"),s=T(),l=_("input"),p(e,"for",i=n[23]),p(l,"type","email"),p(l,"id",o=n[23]),l.required=!0},m(u,f){k(u,e,f),m(e,t),k(u,s,f),k(u,l,f),Me(l,n[0].meta.senderAddress),r||(a=G(l,"input",n[9]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&l.value!==u[0].meta.senderAddress&&Me(l,u[0].meta.senderAddress)},d(u){u&&y(e),u&&y(s),u&&y(l),r=!1,a()}}}function iD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=N("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>.`,p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0,p(a,"class","help-block")},m(c,d){k(c,e,d),m(e,t),k(c,s,d),k(c,l,d),Me(l,n[0].meta.userVerificationUrl),k(c,r,d),k(c,a,d),u||(f=G(l,"input",n[10]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&1&&l.value!==c[0].meta.userVerificationUrl&&Me(l,c[0].meta.userVerificationUrl)},d(c){c&&y(e),c&&y(s),c&&y(l),c&&y(r),c&&y(a),u=!1,f()}}}function sD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=N("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>.`,p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0,p(a,"class","help-block")},m(c,d){k(c,e,d),m(e,t),k(c,s,d),k(c,l,d),Me(l,n[0].meta.userResetPasswordUrl),k(c,r,d),k(c,a,d),u||(f=G(l,"input",n[11]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&1&&l.value!==c[0].meta.userResetPasswordUrl&&Me(l,c[0].meta.userResetPasswordUrl)},d(c){c&&y(e),c&&y(s),c&&y(l),c&&y(r),c&&y(a),u=!1,f()}}}function lD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=N("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>.`,p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0,p(a,"class","help-block")},m(c,d){k(c,e,d),m(e,t),k(c,s,d),k(c,l,d),Me(l,n[0].meta.userConfirmEmailChangeUrl),k(c,r,d),k(c,a,d),u||(f=G(l,"input",n[12]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&1&&l.value!==c[0].meta.userConfirmEmailChangeUrl&&Me(l,c[0].meta.userConfirmEmailChangeUrl)},d(c){c&&y(e),c&&y(s),c&&y(l),c&&y(r),c&&y(a),u=!1,f()}}}function oD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=N("Use SMTP mail server"),p(e,"type","checkbox"),p(e,"id",t=n[23]),e.required=!0,p(s,"for",o=n[23])},m(u,f){k(u,e,f),e.checked=n[0].smtp.enabled,k(u,i,f),k(u,s,f),m(s,l),r||(a=G(e,"change",n[13]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&1&&(e.checked=u[0].smtp.enabled),f&8388608&&o!==(o=u[23])&&p(s,"for",o)},d(u){u&&y(e),u&&y(i),u&&y(s),r=!1,a()}}}function oh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,w,C,S;return i=new Ne({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[rD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[aD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[uD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field",name:"smtp.username",$$slots:{default:[fD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),v=new Ne({props:{class:"form-field",name:"smtp.password",$$slots:{default:[cD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),f=T(),c=_("div"),V(d.$$.fragment),h=T(),g=_("div"),V(v.$$.fragment),b=T(),w=_("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(g,"class","col-lg-6"),p(w,"class","col-lg-12"),p(e,"class","grid")},m($,M){k($,e,M),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),m(e,f),m(e,c),j(d,c,null),m(e,h),m(e,g),j(v,g,null),m(e,b),m(e,w),S=!0},p($,M){const D={};M&25165825&&(D.$$scope={dirty:M,ctx:$}),i.$set(D);const O={};M&25165825&&(O.$$scope={dirty:M,ctx:$}),o.$set(O);const A={};M&25165825&&(A.$$scope={dirty:M,ctx:$}),u.$set(A);const L={};M&25165825&&(L.$$scope={dirty:M,ctx:$}),d.$set(L);const F={};M&25165825&&(F.$$scope={dirty:M,ctx:$}),v.$set(F)},i($){S||(E(i.$$.fragment,$),E(o.$$.fragment,$),E(u.$$.fragment,$),E(d.$$.fragment,$),E(v.$$.fragment,$),$&&Dt(()=>{C||(C=rt(e,en,{duration:150},!0)),C.run(1)}),S=!0)},o($){P(i.$$.fragment,$),P(o.$$.fragment,$),P(u.$$.fragment,$),P(d.$$.fragment,$),P(v.$$.fragment,$),$&&(C||(C=rt(e,en,{duration:150},!1)),C.run(0)),S=!1},d($){$&&y(e),q(i),q(o),q(u),q(d),q(v),$&&C&&C.end()}}}function rD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("SMTP server host"),s=T(),l=_("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){k(u,e,f),m(e,t),k(u,s,f),k(u,l,f),Me(l,n[0].smtp.host),r||(a=G(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&l.value!==u[0].smtp.host&&Me(l,u[0].smtp.host)},d(u){u&&y(e),u&&y(s),u&&y(l),r=!1,a()}}}function aD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Port"),s=T(),l=_("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),l.required=!0},m(u,f){k(u,e,f),m(e,t),k(u,s,f),k(u,l,f),Me(l,n[0].smtp.port),r||(a=G(l,"input",n[15]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&At(l.value)!==u[0].smtp.port&&Me(l,u[0].smtp.port)},d(u){u&&y(e),u&&y(s),u&&y(l),r=!1,a()}}}function uD(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 as({props:u}),he.push(()=>Re(
the
`),r=_("strong"),u=N(a),f=N(`
to the
`),c=_("strong"),h=N(d),g=N(`.
`),v=_("br"),b=N(`
There are numerous command line tools that can help you, such as:
`),w=_("a"),w.textContent=`rclone
`,C=N(`,
`),S=_("a"),S.textContent=`s5cmd
`,$=N(", etc."),M=T(),D=_("div"),p(i,"class","icon"),p(w,"href","https://github.com/rclone/rclone"),p(w,"target","_blank"),p(w,"rel","noopener"),p(w,"class","txt-bold"),p(S,"href","https://github.com/peak/s5cmd"),p(S,"target","_blank"),p(S,"rel","noopener"),p(S,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(D,"class","clearfix m-t-base")},m(L,F){k(L,e,F),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(c,h),m(l,g),m(l,v),m(l,b),m(l,w),m(l,C),m(l,S),m(l,$),m(e,M),m(e,D),A=!0},p(L,F){(!A||F&8)&&a!==(a=L[3]?"S3 storage":"local file system")&&pe(u,a),(!A||F&1)&&d!==(d=L[0].enabled?"S3 storage":"local file system")&&pe(h,d)},i(L){A||(L&&Dt(()=>{O||(O=rt(e,en,{duration:150},!0)),O.run(1)}),A=!0)},o(L){L&&(O||(O=rt(e,en,{duration:150},!1)),O.run(0)),A=!1},d(L){L&&y(e),L&&O&&O.end()}}}function ah(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,w,C,S,$,M,D;return i=new Ne({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[vD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[yD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field required",name:"s3.region",$$slots:{default:[kD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[wD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),v=new Ne({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[$D,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),C=new Ne({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[SD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),f=T(),c=_("div"),V(d.$$.fragment),h=T(),g=_("div"),V(v.$$.fragment),b=T(),w=_("div"),V(C.$$.fragment),S=T(),$=_("div"),p(t,"class","col-lg-12"),p(l,"class","col-lg-6"),p(a,"class","col-lg-6"),p(c,"class","col-lg-6"),p(g,"class","col-lg-6"),p(w,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid")},m(O,A){k(O,e,A),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),m(e,f),m(e,c),j(d,c,null),m(e,h),m(e,g),j(v,g,null),m(e,b),m(e,w),j(C,w,null),m(e,S),m(e,$),D=!0},p(O,A){const L={};A&1572865&&(L.$$scope={dirty:A,ctx:O}),i.$set(L);const F={};A&1572865&&(F.$$scope={dirty:A,ctx:O}),o.$set(F);const R={};A&1572865&&(R.$$scope={dirty:A,ctx:O}),u.$set(R);const B={};A&1572865&&(B.$$scope={dirty:A,ctx:O}),d.$set(B);const te={};A&1572865&&(te.$$scope={dirty:A,ctx:O}),v.$set(te);const Z={};A&1572865&&(Z.$$scope={dirty:A,ctx:O}),C.$set(Z)},i(O){D||(E(i.$$.fragment,O),E(o.$$.fragment,O),E(u.$$.fragment,O),E(d.$$.fragment,O),E(v.$$.fragment,O),E(C.$$.fragment,O),O&&Dt(()=>{M||(M=rt(e,en,{duration:150},!0)),M.run(1)}),D=!0)},o(O){P(i.$$.fragment,O),P(o.$$.fragment,O),P(u.$$.fragment,O),P(d.$$.fragment,O),P(v.$$.fragment,O),P(C.$$.fragment,O),O&&(M||(M=rt(e,en,{duration:150},!1)),M.run(0)),D=!1},d(O){O&&y(e),q(i),q(o),q(u),q(d),q(v),q(C),O&&M&&M.end()}}}function vD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Endpoint"),s=T(),l=_("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){k(u,e,f),m(e,t),k(u,s,f),k(u,l,f),Me(l,n[0].endpoint),r||(a=G(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].endpoint&&Me(l,u[0].endpoint)},d(u){u&&y(e),u&&y(s),u&&y(l),r=!1,a()}}}function yD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Bucket"),s=T(),l=_("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){k(u,e,f),m(e,t),k(u,s,f),k(u,l,f),Me(l,n[0].bucket),r||(a=G(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].bucket&&Me(l,u[0].bucket)},d(
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,c=T(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m($,M){k($,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),k($,r,M),k($,a,M),m(a,u),m(u,f),m(u,c),C[d].m(u,null),g=!0,v||(b=G(u,"submit",Yt(n[16])),v=!0)},p($,M){(!g||M&32)&&pe(o,$[5]);let D=d;d=S($),d===D?C[d].p($,M):(Pe(),P(C[D],1,1,()=>{C[D]=null}),Le(),h=C[d],h?h.p($,M):(h=C[d]=w[d]($),h.c()),E(h,1),h.m(u,null))},i($){g||(E(h),g=!0)},o($){P(h),g=!1},d($){$&&y(e),$&&y(r),$&&y(a),C[d].d(),v=!1,b()}}}function MD(n){let e,t,i,s;return e=new ji({}),i=new Cn({props:{$$slots:{default:[CD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(l,o){j(e,l,o),k(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&1048639&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&y(t),q(i,l)}}}function TD(n,e,t){let i,s;kt(n,Rt,D=>t(5,s=D)),fn(Rt,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 _e.settings.getAll()||{};d(D)}catch(D){_e.errorResponseHandler(D)}t(1,o=!1)}async function c(){if(!(r||!i)){t(2,r=!0);try{const D=await _e.settings.update(Y.filterRedactedProps({s3:l}));d(D),wi({}),un("Successfully saved Files storage settings.")}catch(D){_e.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 h(){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 w(){l.accessKey=this.value,t(0,l)}function C(D){n.$$.not_equal(l.secret,D)&&(l.secret=D,t(0,l))}function S(){l.forcePathStyle=this.checked,t(0,l)}const $=()=>c(),M=()=>c();return n.$$.update=()=>{n.$$.dirty&129&&t(4,i=a!=JSON.stringify(l))},[l,o,r,u,i,s,c,a,h,g,v,b,w,C,S,$,M]}class DD extends Ee{constructor(e){super(),Oe(this,e,TD,MD,De,{})}}function OD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=N("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[16]),p(s,"for",o=n[16])},m(u,f){k(u,e,f),e.checked=n[0].enabled,k(u,i,f),k(u,s,f),m(s,l),r||(a=G(e,"change",n[8]),r=!0)},p(u,f){f&65536&&t!==(t=u[16])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&65536&&o!==(o=u[16])&&p(s,"for",o)},d(u){u&&y(e),u&&y(i),u&&y(s),r=!1,a()}}}function uh(n){let e,t,i,s,l,o,r,a,u,f,c;return i=new Ne({props:{class:"form-field required",name:"emailPassword.minPasswordLength",$$slots:{default:[ED,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field "+(Y.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailPassword.exceptDomains",$$slots:{default:[AD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),u=new Ne({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"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),p(t,"class","col-sm-12 m-t-sm"),p(l,"class","col-lg-6"),p(a,"class","col-lg-6"),p(e,"class","grid")},m(d,h){k(d,e,h),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),c=!0},p(d,h){const g={};h&196609&&(g.$$scope={dirty:h,ctx:d}),i.$set(g);const v={};h&1&&(v.class="form-field "+(Y.isEmpty(d[0].onlyDomains)?"":"disabled")),h&196609&&(v.$$scope={dirty:h,ctx:d}),o.$set(v);const b={};h&1&&(b.class="form-field "+(Y.isEmpty(d[0].exceptDomains)?"":"disabled")),h&196609&&(b.$$scope={dirty:h,ctx:d}),u.$set(b)},i(d){c||(E(i.$$.fragment,d),E(o.$$.fragment,d),E(u.$$.fragment,d),d&&Dt(()=>{f||(f=rt(e,en,{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=rt(e,en,{du
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,w){(!c||w&65536&&l!==(l=b[16]))&&p(e,"for",l);const C={};w&65536&&(C.id=b[16]),w&1&&(C.disabled=!Y.isEmpty(b[0].onlyDomains)),!a&&w&1&&(a=!0,C.value=b[0].exceptDomains,He(()=>a=!1)),r.$set(C)},i(b){c||(E(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&y(e),b&&y(o),q(r,b),b&&y(u),b&&y(f),d=!1,h()}}}function PD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[11](b)}let v={id:n[16]+".config.onlyDomains",disabled:!Y.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new us({props:v}),he.push(()=>Re(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[16]+".config.onlyDomains"),p(f,"class","help-block")},m(b,w){k(b,e,w),m(e,t),m(e,i),m(e,s),k(b,o,w),j(r,b,w),k(b,u,w),k(b,f,w),c=!0,d||(h=Ye(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,w){(!c||w&65536&&l!==(l=b[16]+".config.onlyDomains"))&&p(e,"for",l);const C={};w&65536&&(C.id=b[16]+".config.onlyDomains"),w&1&&(C.disabled=!Y.isEmpty(b[0].exceptDomains)),!a&&w&1&&(a=!0,C.value=b[0].onlyDomains,He(()=>a=!1)),r.$set(C)},i(b){c||(E(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&y(e),b&&y(o),q(r,b),b&&y(u),b&&y(f),d=!1,h()}}}function LD(n){let e,t,i,s;e=new Ne({props:{class:"form-field form-field-toggle m-b-0",name:"emailPassword.enabled",$$slots:{default:[OD,({uniqueId:o})=>({16:o}),({uniqueId:o})=>o?65536:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&uh(n);return{c(){V(e.$$.fragment),t=T(),l&&l.c(),i=Xe()},m(o,r){j(e,o,r),k(o,t,r),l&&l.m(o,r),k(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&&E(l,1)):(l=uh(o),l.c(),E(l,1),l.m(i.parentNode,i)):l&&(Pe(),P(l,1,1,()=>{l=null}),Le())},i(o){s||(E(e.$$.fragment,o),E(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){q(e,o),o&&y(t),l&&l.d(o),o&&y(i)}}}function FD(n){let e;return{c(){e=_("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function ID(n){let e;return{c(){e=_("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function fh(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){k(o,e,r),i=!0,s||(l=Ye(Ct.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Dt(()=>{t||(t=rt(e,Vn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=rt(e,Vn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function ND(n){let e,t,i,s,l,o,r;function a(d,h){return d[0].enabled?ID:FD}let u=a(n),f=u(n),c=n[2]&&fh();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=Xe(),p(e,"class","inline-flex"),p(s,"class","flex-fill")},m(d,h){k(d,e,h),k(d,t,h),f.m(d,h),k(d,i,h),k(d,s,h),k(d,l,h),c&&c.m(d,h),k(d,o,h),r=!0},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(i.parentNode,i))),d[2]?c?h&4&&E(c,1):(c=fh(),c.c(),E(c,1),c.m(o.parentNode,o)):c&&(Pe(),P(c,1,1,()=>{c=null}),Le())},i(d){r||(E(c),r=!0)},o(d){P(c),r=!1},d(d){d&&y(e),d&&y(t),f.d(d),d&&y(i),d&&y(s),d&&y(l),c&&c.d(d),d&&y(o)}}}function RD(n){let e,t;const i=[n[3]];let s={$$slots:{header:[ND],default:[LD]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=pt(s,i[l]);return e=new Ba({props:s}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){V(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,[o]){const r=o&8?gn(i,[ci(l[3])]):{};o&131077&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[12](null),q(e,l)}}}function HD(n,e,t){let i;const s=["config","expand","collapse","collapseSiblings"];let l=Jt(e,s),o;kt(n,os,$=>t(7,o=$));let{config:r={}}=e,a;function u(){a==null||a.expand()}function f(){a==null||a.collapse()}function c(){a==null||a.collapseSiblings()}function d(){r.enabled=this.checked,t(0,r)}function h(){r.minPasswordLength=At(this.value),t(0,r)}function g($){n.$$.not_equal(r.exceptDomains,$)&&(r.exceptDomains=$,t(0,r))}function v($){n.$$.not_equal(r.onlyDomains,$)&&(r.onlyDomains=$,t(0,r))}function b($){he[$?"unshift":"push"](()=>{a=$,t(1,a)})}function w($){ut.call(this,n,$)}function C($){ut.call(this,n,$)}function S($){ut.call(this,n,$)}return n.$$set=$=>{e=pt(pt({},e),fi($)),t(3,l=Jt(e,s)),"config"in $&&t(0,r=$.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,h,g,v,b,w,C,S]}class jD extends Ee{constructor(e){super(),Oe(this,e,HD,RD,De,{config:0,expand:4,collapse:5,collapseSiblings:6})}get expand(){return this.$$.ctx[4]}get collapse(){return this.$$.ctx[5]}get collapseSiblings(){return this.$$.ctx[6]}}function qD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=N("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(s,"for",o=n[22])},m(u,f){k(u,e,f),e.checked=n[0].enabled,k(u,i,f),k(u,s,f),m(s,l),r||(a=G(e,"change",n[11]),r=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&4194304&&o!==(o=u[22])&&p(s,"for",o)},d(u){u&&y(e),u&&y(i),u&&y(s),r=!1,a()}}}function ch(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;l=new Ne({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[VD,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),a=new Ne({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[zD,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),c=new Ne({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[BD,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}});let v=n[4]&&dh(n);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),V(l.$$.fragment),o=T(),r=_("div"),V(a.$$.fragment),u=T(),f=_("div"),V(c.$$.fragment),d=T(),v&&v.c(),p(t,"class","col-12 spacing"),p(s,"class","col-lg-6"),p(r,"class","col-lg-6"),p(f,"class","col-lg-12"),p(e,"class","grid")},m(b,w){k(b,e,w),m(e,t),m(e,i),m(e,s),j(l,s,null),m(e,o),m(e,r),j(a,r,null),m(e,u),m(e,f),j(c,f,null),m(e,d),v&&v.m(e,null),g=!0},p(b,w){const C={};w&2&&(C.name=b[1]+".clientId"),w&12582913&&(C.$$scope={dirty:w,ctx:b}),l.$set(C);const S={};w&2&&(S.name=b[1]+".clientSecret"),w&12582913&&(S.$$scope={dirty:w,ctx:b}),a.$set(S);const $={};w&2&&($.name=b[1]+".allowRegistrations"),w&12582913&&($.$$scope={dirty:w,ctx:b}),c.$set($),b[4]?v?(v.p(b,w),w&16&&E(v,1)):(v=dh(b),v.c(),E(v,1),v.m(e,null)):v&&(Pe(),P(v,1,1,()=>{v=null}),Le())},i(b){g||(E(l.$$.fragment,b),E(a.$$.fragment,b),E(c.$$.fragment,b),E(v),b&&Dt(()=>{h||(h=rt(e,en,{duration:200},!0)),h.run(1)}),g=!0)},o(b){P(l.$$.fragment,b),P(a.$$.fragment,b),P(c.$$.fragment,b),P(v),b&&(h||(h=rt(e,en,{duration:200},!1)),h.run(0)),g=!1},d(
another PocketBase environment.</p>`,t=T(),i=_("div"),s=_("button"),s.innerHTML='<span class="txt">Copy</span>',l=T(),V(o.$$.fragment),r=T(),a=_("div"),u=_("div"),f=T(),c=_("button"),c.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-secondary fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(v,b){k(v,e,b),k(v,t,b),k(v,i,b),m(i,s),m(i,l),j(o,i,null),n[8](i),k(v,r,b),k(v,a,b),m(a,u),m(a,f),m(a,c),d=!0,h||(g=[G(s,"click",n[7]),G(i,"keydown",n[9]),G(c,"click",n[10])],h=!0)},p(v,b){const w={};b&4&&(w.content=v[2]),o.$set(w)},i(v){d||(E(o.$$.fragment,v),d=!0)},o(v){P(o.$$.fragment,v),d=!1},d(v){v&&y(e),v&&y(t),v&&y(i),q(o),n[8](null),v&&y(r),v&&y(a),h=!1,Qe(g)}}}function pO(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){k(t,e,i)},p:le,i:le,o:le,d(t){t&&y(e)}}}function hO(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[pO,dO],g=[];function v(b,w){return b[1]?0:1}return f=v(n),c=g[f]=h[f](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=T(),l=_("div"),o=N(n[3]),r=T(),a=_("div"),u=_("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(b,w){k(b,e,w),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),k(b,r,w),k(b,a,w),m(a,u),g[f].m(u,null),d=!0},p(b,w){(!d||w&8)&&pe(o,b[3]);let C=f;f=v(b),f===C?g[f].p(b,w):(Pe(),P(g[C],1,1,()=>{g[C]=null}),Le(),c=g[f],c?c.p(b,w):(c=g[f]=h[f](b),c.c()),E(c,1),c.m(u,null))},i(b){d||(E(c),d=!0)},o(b){P(c),d=!1},d(b){b&&y(e),b&&y(r),b&&y(a),g[f].d()}}}function mO(n){let e,t,i,s;return e=new ji({}),i=new Cn({props:{$$slots:{default:[hO]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(l,o){j(e,l,o),k(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&y(t),q(i,l)}}}function gO(n,e,t){let i,s;kt(n,Rt,b=>t(3,s=b)),fn(Rt,s="Export collections",s);const l="export_"+Y.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await _e.collections.getFullList(100,{$cancelKey:l}));for(let b of r)delete b.created,delete b.updated}catch(b){_e.errorResponseHandler(b)}t(1,a=!1)}function f(){Y.downloadJson(r,"pb_schema")}function c(){Y.copyToClipboard(i),G0("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function h(b){he[b?"unshift":"push"](()=>{o=b,t(0,o)})}const g=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const w=window.getSelection(),C=document.createRange();C.selectNodeContents(o),w.removeAllRanges(),w.addRange(C)}},v=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,2))},[o,a,i,s,f,c,r,d,h,g,v]}class _O extends Ee{constructor(e){super(),Oe(this,e,gO,mO,De,{})}}function _h(n,e,t){const i=n.slice();return i[17]=e[t],i}function bO(n){let e,t,i,s,l,o=n[17].new.name+"",r,a=n[17].old.name!==n[17].new.name&&bh(n);return{c(){e=_("span"),e.textContent="Modified",t=T(),i=_("div"),a&&a.c(),s=T(),l=_("strong"),r=N(o),p(e,"class","label label-warning"),p(l,"class","txt"),p(i,"class","inline-flex fleg-gap-5")},m(u,f){k(u,e,f),k(u,t,f),k(u,i,f),a&&a.m(i,null),m(i,s),m(i,l),m(l,r)},p(u,f){u[17].old.name!==u[17].new.name?a?a.p(u,f):(a=bh(u),a.c(),a.m(i,s)):a&&(a.d(1),a=null),f&4&&o!==(o=u[17].new.name+"")&&pe(r,o)},d(u){u&&y(e),u&&y(t),u&&y(i),a&&a.d()}}}function vO(n){var o;let e,t,i,s=((o=n[17].old)==null?void 0:o.name)+"",l;return{c(){e=_("span"),e.textContent="Deleted",t=T(),i=_("strong"),l=N(s),p(e,"class","label label-danger")},m(r,a){k(r,e,a),k(r,t,a),k(r,i,a),m(i,l)},p(r,a){var u;a&4&&s!==(s=((u=r[17].old)==null?void 0:u.name)+"")&&pe(l,s)},d(r){r&&y(e),r&&y(t),r&&y(i)}}}function yO(n){var o;let e,t,i,s=((o=n[17].new)==null?void 0:o.name)+"",l;return{c(){e=_("span"),e.textContent="New",t=T(),i=_("strong"),l=N(s),p(e,"class","label label-success")},m(r,a){k(r,e,a),k(r,t,a),k(r,i,a),m(i,l)},p(r,a){var u;a&4&&s!==(s=((u=r[17].new)==null?void 0:u.name)+"")&&pe(l,s)},
- ${$.join(`
- `)}?`,()=>{g()})}else g()}async function g(){if(!u){t(3,u=!0);try{await _e.collections.import(r,!0),un("Successfully imported the collections configuration."),s("submit")}catch($){_e.errorResponseHandler($)}t(3,u=!1),c()}}const v=()=>h(),b=()=>!u;function w($){he[$?"unshift":"push"](()=>{l=$,t(1,l)})}function C($){ut.call(this,n,$)}function S($){ut.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&192&&Array.isArray(o)&&Array.isArray(r)&&d(),n.$$.dirty&192&&(i=o.filter($=>{var M;return!((M=Y.findByKey(r,"id",$.id))!=null&&M.id)}))},[c,l,a,u,h,f,o,r,v,b,w,C,S]}class TO extends Ee{constructor(e){super(),Oe(this,e,MO,SO,De,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function yh(n,e,t){const i=n.slice();return i[27]=e[t],i}function kh(n,e,t){const i=n.slice();return i[30]=e[t],i}function wh(n,e,t){const i=n.slice();return i[27]=e[t],i}function DO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,w,C,S,$,M;a=new Ne({props:{class:"form-field "+(n[5]?"":"field-error"),name:"collections",$$slots:{default:[EO,({uniqueId:L})=>({35:L}),({uniqueId:L})=>[0,L?16:0]]},$$scope:{ctx:n}}});let D=n[5]&&n[1].length&&!n[6]&&Sh(),O=n[5]&&n[1].length&&n[6]&&Ch(n),A=!!n[0]&&Nh(n);return{c(){e=_("input"),t=T(),i=_("div"),s=_("p"),l=N(`Paste below the collections configuration you want to import or
`),o=_("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=T(),V(a.$$.fragment),u=T(),D&&D.c(),f=T(),O&&O.c(),c=T(),d=_("div"),A&&A.c(),h=T(),g=_("div"),v=T(),b=_("button"),w=_("span"),w.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),ne(o,"btn-loading",n[11]),p(i,"class","content txt-xl m-b-base"),p(g,"class","flex-fill"),p(w,"class","txt"),p(b,"type","button"),p(b,"class","btn btn-expanded btn-warning m-l-auto"),b.disabled=C=!n[12],p(d,"class","flex m-t-base")},m(L,F){k(L,e,F),n[16](e),k(L,t,F),k(L,i,F),m(i,s),m(s,l),m(s,o),k(L,r,F),j(a,L,F),k(L,u,F),D&&D.m(L,F),k(L,f,F),O&&O.m(L,F),k(L,c,F),k(L,d,F),A&&A.m(d,null),m(d,h),m(d,g),m(d,v),m(d,b),m(b,w),S=!0,$||(M=[G(e,"change",n[17]),G(o,"click",n[18]),G(b,"click",n[21])],$=!0)},p(L,F){F[0]&2048&&ne(o,"btn-loading",L[11]);const R={};F[0]&32&&(R.class="form-field "+(L[5]?"":"field-error")),F[0]&33|F[1]&48&&(R.$$scope={dirty:F,ctx:L}),a.$set(R),L[5]&&L[1].length&&!L[6]?D||(D=Sh(),D.c(),D.m(f.parentNode,f)):D&&(D.d(1),D=null),L[5]&&L[1].length&&L[6]?O?O.p(L,F):(O=Ch(L),O.c(),O.m(c.parentNode,c)):O&&(O.d(1),O=null),L[0]?A?A.p(L,F):(A=Nh(L),A.c(),A.m(d,h)):A&&(A.d(1),A=null),(!S||F[0]&4096&&C!==(C=!L[12]))&&(b.disabled=C)},i(L){S||(E(a.$$.fragment,L),S=!0)},o(L){P(a.$$.fragment,L),S=!1},d(L){L&&y(e),n[16](null),L&&y(t),L&&y(i),L&&y(r),q(a,L),L&&y(u),D&&D.d(L),L&&y(f),O&&O.d(L),L&&y(c),L&&y(d),A&&A.d(),$=!1,Qe(M)}}}function OO(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){k(t,e,i)},p:le,i:le,o:le,d(t){t&&y(e)}}}function $h(n){let e;return{c(){e=_("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function EO(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[5]&&$h();return{c(){e=_("label"),t=N("Collections"),s=T(),l=_("textarea"),r=T(),c&&c.c(),a=Xe(),p(e,"for",i=n[35]),p(e,"class","p-b-10"),p(l,"id",o=n[35]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,h){k(d,e,h),m(e,t),k(d,s,h),k(d,l,h),Me(l,n[0]),k(d,r,h),c&&c.m(d,h),k(d,a,h),u||(f=G(l,"input",n[19]),u=!0)},p(d,h){h[1]&16&&i!==(i=d[35])&&p(e,"for",i),h[1]&16&&o!==(o=d[35])&&p(l,"id",o),h[0]&1&&Me(l,d[0]),!!d[0]&&!d[5]?c||(c=$h(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&y(e),d&&y(s),d&&y(l),d&&y(r),c&&c.d(d),d&&y(a),u=!1,f()}}}function Sh(n){let e;return{c(){e=_("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,p(e,"class","alert alert-info")},m(t,i){k(t,e,i)},d(t){t&&y(e)}}}function Ch(n){let e,t,i,s,l,o=n[8].length&&Mh(n),r=n[3].length&&Oh(n),a=n[7].length&&Lh(n);return{c(){e=_("h5"),e.textContent="Detected changes",t=T(),i=_("div"),o&&o.c(),s=T(),r&&r.c(),l=T(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){k(u,e,f),k(u,t,f),k(u,i,f),o&&o.m(i,null),m(i,s),r&&r.m(i,null),m(i,l),a&&a.m(i,null)},p(u,f){u[8].length?o?o.p(u,f):(o=Mh(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[3].length?r?r.p(u,f):(r=Oh(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[7].length?a?a.p(u,f):(a=Lh(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&y(e),u&&y(t),u&&y(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function Mh(n){let e=[],t=new Map,i,s=n[8];const l=o=>o[27].id;for(let o=0;o<s.length;o+=1){let r=wh(n,s,o),a=l(r);t.set(a,e[o]=Dh(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Xe()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);k(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=mt(e,r,l,1,o,s,t,i.parentNode,mn,Dh,i,wh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&y(i)}}}function Th(n){let e,t,i=n[27].id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){k(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&256&&i!==(i=o[27].id+"")&&pe(s,i)},d(o){o&&y(e)}}}function Dh(n,e){let t,i,s,l,o=e[27].name+"",r,a,u,f=e[27].id&&Th(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Deleted",s=T(),l=_("strong"),r=N(o),a=T(),f&&f.c(),u=T(),p(i,"class","label label-danger list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){k(c,t,d),m(t,i),m(t,s),m(t,l),m(l,r),m(t,a),f&&f.m(t,null),m(t,u)},p(c,d){e=c,d[0]&256&&o!==(o=e[27].name+"")&&pe(r,o),e[27].id?f?f.p(e,d):(f=Th(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&y(t),f&&f.d()}}}function Oh(n){let e=[],t=new Map,i,s=n[3];const l=o=>o[30].old.id+o[30].new.id;for(let o=0;o<s.length;o+=1){let r=kh(n,s,o),a=l(r);t.set(a,e[o]=Ph(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Xe()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);k(o,i,r)},p(o,r){r[0]&8&&(s=o[3],e=mt(e,r,l,1,o,s,t,i.parentNode,mn,Ph,i,kh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&y(i)}}}function Eh(n){let e,t=n[30].old.name+"",i,s;return{c(){e=_("span"),i=N(t),s=N(" -"),p(e,"class","txt-strikethrough txt-hint")},m(l,o){k(l,e,o),m(e,i),k(l,s,o)},p(l,o){o[0]&8&&t!==(t=l[30].old.name+"")&&pe(i,t)},d(l){l&&y(e),l&&y(s)}}}function Ah(n){let e,t,i=n[30].new.id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){k(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&8&&i!==(i=o[30].new.id+"")&&pe(s,i)},d(o){o&&y(e)}}}function Ph(n,e){let t,i,s,l,o,r=e[30].new.name+"",a,u,f,c=e[30].old.name!==e[30].new.name&&Eh(e),d=e[30].new.id&&Ah(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Modified",s=T(),l=_("strong"),c&&c.c(),o=T(),a=N(r),u=T(),d&&d.c(),f=T(),p(i,"class","label label-warning list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(h,g){k(h,t,g),m(t,i),m(t,s),m(t,l),c&&c.m(l,null),m(l,o),m(l,a),m(t,u),d&&d.m(t,null),m(t,f)},p(h,g){e=h,e[30].old.name!==e[30].new.name?c?c.p(e,g):(c=Eh(e),c.c(),c.m(l,o)):c&&(c.d(1),c=null),g[0]&8&&r!==(r=e[30].new.name+"")&&pe(a,r),e[30].new.id?d?d.p(e,g):(d=Ah(e),d.c(),d.m(t,f)):d&&(d.d(1),d=null)},d(h){h&&y(t),c&&c.d(),d&&d.d()}}}function Lh(n){let e=[],t=new Map,i,s=n[7];const l=o=>o[27].id;for(let o=0;o<s.length;o+=1){let r=yh(n,s,o),a=l(r);t.set(a,e[o]=Ih(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Xe()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);k(o,i,r)},p(o,r){r[0]&128&&(s=o[7],e=mt(e,r,l,1,o,s,t,i.parentNode,mn,Ih,i,yh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&y(i)}}}function Fh(n){let e,t,i=n[27].id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){k(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&128&&i!==(i=o[27].id+"")&&pe(s,i)},d(o){o&&y(e)}}}function Ih(n,e){let t,i,s,l,o=e[27].name+"",r,a,u,f=e[27].id&&F
<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>`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"tabindex","0"),p(l,"class","dropdown-item closable")},m(a,u){k(a,e,u),k(a,t,u),k(a,i,u),k(a,s,u),k(a,l,u),o||(r=[Ye(dn.call(null,e)),G(l,"click",n[6])],o=!0)},p:le,d(a){a&&y(e),a&&y(t),a&&y(i),a&&y(s),a&&y(l),o=!1,Qe(r)}}}function JO(n){var h;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=Y.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((h=n[0])==null?void 0:h.id)&&n[1]&&jh(n);return o=new j_({props:{routes:IO}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new zO({}),f=new KO({}),{c(){t=T(),i=_("div"),d&&d.c(),s=T(),l=_("div"),V(o.$$.fragment),r=T(),V(a.$$.fragment),u=T(),V(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(g,v){k(g,t,v),k(g,i,v),d&&d.m(i,null),m(i,s),m(i,l),j(o,l,null),m(l,r),j(a,l,null),k(g,u,v),j(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&&E(d,1)):(d=jh(g),d.c(),E(d,1),d.m(i,s)):d&&(Pe(),P(d,1,1,()=>{d=null}),Le())},i(g){c||(E(d),E(o.$$.fragment,g),E(a.$$.fragment,g),E(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&&y(t),g&&y(i),d&&d.d(),q(o),q(a),g&&y(u),q(f,g)}}}function GO(n,e,t){let i,s,l;kt(n,_o,d=>t(2,i=d)),kt(n,va,d=>t(0,s=d)),kt(n,Rt,d=>t(3,l=d));let o,r=!1;function a(d){var h,g,v,b;((h=d==null?void 0:d.detail)==null?void 0:h.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,fn(Rt,l="",l),wi({}),f_())}function u(){ki("/")}async function f(){var d;if(!!(s!=null&&s.id))try{const h=await _e.settings.getAll({$cancelKey:"loadAppName"});fn(_o,i=((d=h==null?void 0:h.meta)==null?void 0:d.appName)||"",i)}catch(h){console.warn("Failed to load app name.",h)}}function c(){_e.logout()}return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&f()},[s,r,i,l,a,u,c]}class XO extends Ee{constructor(e){super(),Oe(this,e,GO,JO,De,{})}}new XO({target:document.getElementById("app")});export{Qe as A,un as B,Y as C,ki as D,Xe as E,ug as F,kt as G,Ms as H,ln as I,An as J,Wn as K,he as L,Ee as S,P as a,T as b,V as c,q as d,_ as e,p as f,k as g,m as h,Oe as i,Ye as j,Pe as k,dn as l,j as m,Le as n,y as o,_e as p,Ne as q,ne as r,De as s,E as t,G as u,Yt as v,N as w,pe as x,le as y,Me as z};