652 lines
822 KiB
JavaScript
652 lines
822 KiB
JavaScript
|
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerpolicy&&(l.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?l.credentials="include":s.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function oe(){}const gl=n=>n;function ft(n,e){for(const t in e)n[t]=e[t];return n}function pm(n){return n()}function Ga(){return Object.create(null)}function Xe(n){n.forEach(pm)}function Kn(n){return typeof n=="function"}function De(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ll;function xn(n,e){return Ll||(Ll=document.createElement("a")),Ll.href=e,n===Ll.href}function W_(n){return Object.keys(n).length===0}function hm(n,...e){if(n==null)return oe;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function _t(n,e,t){n.$$.on_destroy.push(hm(e,t))}function wn(n,e,t,i){if(n){const s=mm(n,e,t,i);return n[0](s)}}function mm(n,e,t,i){return n[1]&&i?ft(t.ctx.slice(),n[1](i(e))):t.ctx}function $n(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r<o;r+=1)l[r]=e.dirty[r]|s[r];return l}return e.dirty|s}return e.dirty}function Sn(n,e,t,i,s,l){if(s){const o=mm(e,t,i,l);n.p(o,s)}}function Cn(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function ni(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Ut(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 Xa(n){return n==null?"":n}function dn(n,e,t){return n.set(t),e}function Ye(n){return n&&Kn(n.destroy)?n.destroy:oe}const gm=typeof window<"u";let Lo=gm?()=>window.performance.now():()=>Date.now(),ra=gm?n=>requestAnimationFrame(n):oe;const bs=new Set;function _m(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&ra(_m)}function Io(n){let e;return bs.size===0&&ra(_m),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function m(n,e){n.appendChild(e)}function bm(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_(bm(n),e),e.sheet}function K_(n,e){m(n.head||n,e)}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function xt(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 Je(){return N("")}function X(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Kt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function ei(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function vm(n){return function(e){e.target===this&&n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function di(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:p(n,i,e[i])}function At(n){return n===""?null:+n}function J_(n){return Array.from(n.childNodes)}function ae(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Me(n,e){n.value=e==null?"":e}function Qa(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function ie(n,e,t){n.classList[t?"add":"remove"](e)}function ym(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEve
|
||
|
`;for(let b=0;b<=1;b+=a){const y=e+(t-e)*l(b);u+=b*100+`%{${o(y,1-y)}}
|
||
|
`}const f=u+`100% {${o(t,1-t)}}
|
||
|
}`,c=`__svelte_${Z_(f)}_${r}`,d=bm(n),{stylesheet:h,rules:g}=ao.get(d)||G_(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`,uo+=1,c}function rl(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),uo-=s,uo||X_())}function X_(){ra(()=>{uo||(ao.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),ao.clear())})}function Q_(n,e,t,i){if(!e)return oe;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return oe;const{delay:l=0,duration:o=300,easing:r=gl,start:a=Lo()+l,end:u=a+o,tick:f=oe,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,g;function v(){c&&(g=ol(n,0,1,o,l,r,c)),l||(h=!0)}function b(){c&&rl(n,g),d=!1}return Io(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),b()),!d)return!1;if(h){const C=y-a,S=0+1*r(C/o);f(S,1-S)}return!0}),v(),f(0,1),b}function x_(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,km(n,s)}}function km(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let al;function Xs(n){al=n}function Fo(){if(!al)throw new Error("Function called outside component initialization");return al}function Jn(n){Fo().$$.on_mount.push(n)}function eb(n){Fo().$$.after_update.push(n)}function tb(n){Fo().$$.on_destroy.push(n)}function on(){const n=Fo();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=ym(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function rt(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Ys=[],de=[],no=[],Or=[],wm=Promise.resolve();let Er=!1;function $m(){Er||(Er=!0,wm.then(Sm))}function ii(){return $m(),wm}function Tt(n){no.push(n)}function He(n){Or.push(n)}const xo=new Set;let Il=0;function Sm(){const n=al;do{for(;Il<Ys.length;){const e=Ys[Il];Il++,Xs(e),nb(e.$$)}for(Xs(null),Ys.length=0,Il=0;de.length;)de.pop()();for(let e=0;e<no.length;e+=1){const t=no[e];xo.has(t)||(xo.add(t),t())}no.length=0}while(Ys.length);for(;Or.length;)Or.pop()();Er=!1,xo.clear(),Xs(n)}function nb(n){if(n.fragment!==null){n.update(),Xe(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Tt)}}let Is;function aa(){return Is||(Is=Promise.resolve(),Is.then(()=>{Is=null})),Is}function ts(n,e,t){n.dispatchEvent(ym(`${e?"intro":"outro"}${t}`))}const io=new Set;let ai;function Ae(){ai={r:0,c:[],p:ai}}function Pe(){ai.r||Xe(ai.c),ai=ai.p}function E(n,e){n&&n.i&&(io.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(io.has(n))return;io.add(n),ai.c.push(()=>{io.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ua={duration:0};function Cm(n,e,t){let i=e(n,t),s=!1,l,o,r=0;function a(){l&&rl(n,l)}function u(){const{delay:c=0,duration:d=300,easing:h=gl,tick:g=oe,css:v}=i||ua;v&&(l=ol(n,0,1,d,c,h,v,r++)),g(0,1);const b=Lo()+c,y=b+d;o&&o.abort(),s=!0,Tt(()=>ts(n,!0,"start")),o=Io(C=>{if(s){if(C>=y)return g(1,0),ts(n,!0,"end"),a(),s=!1;if(C>=b){const S=h((C-b)/d);g(S,1-S)}}return s})}let f=!1;return{start(){f||(f=!0,rl(n),Kn(i)?(i=i(),aa().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function Mm(n,e,t){let i=e(n,t),s=!0,l;const o=ai;o.r+=1;function r(){const{delay:a=0,duration:u=300,easing:f=gl,tick:c=oe,css:d}=i||ua;d&&(l=ol(n,1,0,u,a,f,d));const h=Lo()+a,g=h+u;Tt(()=>ts(n,!1,"start")),Io(v=>{if(s){if(v>=g)return c(0,1),ts(n,!1,"end"),--o.r||Xe(o.c),!1;if(v>=h){const b=f((v-h)/u);c(1-b,b)}}return s})}return Kn(i)?aa().then(()=>{i=i(),r()}):r(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&rl(n,l),s=!1)}}}function ot(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){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function C1(n){let e,t,i,s=!n[0]&&Eu();const l=n[1].default,o=wn(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){w(r,e,a),s&&s.m(e,null),m(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Eu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Sn(o,l,r,r[2],i?$n(l,r[2],a,null):Cn(r[2]),null)},i(r){i||(E(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function M1(n){let e,t;return e=new On({props:{class:"full-page",center:!0,$$slots:{default:[C1]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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){j(e,i)}}}function T1(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 Ng extends Ee{constructor(e){super(),Oe(this,e,T1,M1,De,{nobranding:0})}}function Au(n,e,t){const i=n.slice();return i[11]=e[t],i}const D1=n=>({}),Pu=n=>({uniqueId:n[3]});function O1(n){let e=(n[11]||_o)+"",t;return{c(){t=N(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||_o)+"")&&ae(t,e)},d(i){i&&k(t)}}}function E1(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||_o)+"",i;return{c(){e=_("pre"),i=N(t)},m(o,r){w(o,e,r),m(e,i)},p(o,r){var a,u;r&4&&t!==(t=(((a=o[11])==null?void 0:a.message)||((u=o[11])==null?void 0:u.code)||_o)+"")&&ae(i,t)},d(o){o&&k(e)}}}function Lu(n){let e,t;function i(o,r){return typeof o[11]=="object"?E1:O1}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){w(o,e,r),l.m(e,null),m(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&k(e),l.d()}}}function A1(n){let e,t,i,s,l;const o=n[7].default,r=wn(o,n,n[6],Pu);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=Lu(Au(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]),ie(e,"error",n[2].length)},m(f,c){w(f,e,c),r&&r.m(e,null),m(e,t);for(let d=0;d<u.length;d+=1)u[d].m(e,null);n[9](e),i=!0,s||(l=X(e,"click",n[8]),s=!0)},p(f,[c]){if(r&&r.p&&(!i||c&64)&&Sn(r,o,f,f[6],i?$n(o,f[6],c,D1):Cn(f[6]),Pu),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const h=Au(f,a,d);u[d]?u[d].p(h,c):(u[d]=Lu(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&&ie(e,"error",f[2].length)},i(f){i||(E(r,f),i=!0)},o(f){P(r,f),i=!1},d(f){f&&k(e),r&&r.d(f),xt(u,f),n[9](null),s=!1,l()}}}const _o="Invalid value";function P1(n,e,t){let i;_t(n,Hi,g=>t(5,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+W.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){wa(r)}Jn(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(g){rt.call(this,n,g)}function h(g){de[g?"unshift":"push"](()=>{u=g,t(1,u)})}return n.$$set=g=>{"name"in g&&t(4,r=g.name),"class"in g&&t(0,a=g.class),"$$scope"in g&&t(6,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=W.toArray(W.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,h]}class Re extends Ee{constructor(e){super(),Oe(this,e,P1,A1,De,{name:4,class:0})}}function L1(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){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0]),l.focus(),r||(a=X(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&Me(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function I1(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
|
||
|
<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"),ie(f,"btn-disabled",n[3]),ie(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(g,v){w(g,e,v),m(e,t),m(e,i),H(s,e,null),m(e,l),H(o,e,null),m(e,r),H(a,e,null),m(e,u),m(e,f),c=!0,d||(h=X(e,"submit",Kt(n[4])),d=!0)},p(g,[v]){const b={};v&1537&&(b.$$scope={dirty:v,ctx:g}),s.$set(b);const y={};v&1538&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const C={};v&1540&&(C.$$scope={dirty:v,ctx:g}),a.$set(C),v&8&&ie(f,"btn-disabled",g[3]),v&8&&ie(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&&k(e),j(s),j(o),j(a),d=!1,h()}}}function R1(n,e,t){const i=on();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ve.admins.create({email:s,password:l,passwordConfirm:o}),await ve.admins.authViaEmail(s,l),i("submit")}catch(d){ve.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 H1 extends Ee{constructor(e){super(),Oe(this,e,R1,N1,De,{})}}function Iu(n){let e,t;return e=new Ng({props:{$$slots:{default:[j1]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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){j(e,i)}}}function j1(n){let e,t;return e=new H1({}),e.$on("submit",n[1]),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p:oe,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function q1(n){let e,t,i=n[0]&&Iu(n);return{c(){i&&i.c(),e=Je()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&E(i,1)):(i=Iu(s),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(Ae(),P(i,1,1,()=>{i=null}),Pe())},i(s){t||(E(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function V1(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ve.logout(!1),t(0,i=!0);return}ve.authStore.isValid?Si("/collections"):ve.logout()}return[i,async()=>{t(0,i=!1),await ii(),window.location.search=""}]}class z1 extends Ee{constructor(e){super(),Oe(this,e,V1,q1,De,{})}}const Rt=li(""),bo=li("");function zo(n){const e=n-1;return e*e*e+1}function vo(n,{delay:e=0,duration:t=400,easing:i=gl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function Un(n,{delay:e=0,duration:t=400,easing:i=zo,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 tn(n,{delay:e=0,duration:t=400,easing:i=zo}={}){const s=getComputedStyle(n),l=+s.opacity,o=parseFloat(s.height),r=parseFloat(s.paddingTop),a=parseFloat(s.paddingBottom),u=parseFloat(s.marginTop),f=parseFloat(s.marginBottom),c=parseFloat(s.borderTopWidth),d=parseFloat(s.borderBottomWidth);return{delay:e,duration:t,easing:i,css:h=>`overflow: hidden;opacity: ${Math.min(h*20,1)*l};height: ${h*o}px;padding-top: ${h*r}px;padding-bottom: ${h*a}px;margin-top: ${h*u}px;margin-bottom: ${h*f}px;border-top-width: ${h*c}px;border-bottom-width: ${h*d}px;`}}function Tn(n,{delay:e=0,duration:t=400,easing:i=zo,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){w(l,e,o),n[13](e),Me(e,n[7]),i||(s=X(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&Me(e,l[7])},i:oe,o:oe,d(l){l&&k(e),n[13](null),i=!1,s()}}}function U1(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)),de.push(()=>Fe(e,"value",l)),e.$on("submit",n[10])),{c(){e&&q(e.$$.fragment),i=Je()},m(a,u){e&&H(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],He(()=>t=!1)),o!==(o=a[4])){if(e){Ae();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),Pe()}o?(e=new o(r(a)),de.push(()=>Fe(e,"value",l)),e.$on("submit",a[10]),q(e.$$.fragment),E(e.$$.fragment,1),H(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&&k(i),e&&j(e,a)}}}function Fu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Nu();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),w(a,e,u),w(a,t,u),s=!0,l||(o=X(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&E(r,1):(r=Nu(),r.c(),E(r,1),r.m(e.parentNode,e)):r&&(Ae(),P(r,1,1,()=>{r=null}),Pe())},i(a){s||(E(r),a&&Tt(()=>{i||(i=ot(t,Un,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),a&&(i||(i=ot(t,Un,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),l=!1,o()}}}function Nu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Tt(()=>{t||(t=ot(e,Un,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=ot(e,Un,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function W1(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[U1,B1],h=[];function g(b,y){return b[4]&&!b[5]?0:1}o=g(n),r=h[o]=d[o](n);let v=(n[0].length||n[7].length)&&Fu(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,y){w(b,e,y),m(e,t),m(t,i),m(i,s),m(t,l),h[o].m(t,null),m(t,a),v&&v.m(t,null),u=!0,f||(c=[X(t,"submit",Kt(n[10])),X(e,"click",ei(n[11]))],f=!0)},p(b,[y]){let C=o;o=g(b),o===C?h[o].p(b,y):(Ae(),P(h[C],1,1,()=>{h[C]=null}),Pe(),r=h[o],r?r.p(b,y):(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,y),y&129&&E(v,1)):(v=Fu(b),v.c(),E(v,1),v.m(t,null)):v&&(Ae(),P(v,1,1,()=>{v=null}),Pe())},i(b){u||(E(r),E(v),u=!0)},o(b){P(r),P(v),u=!1},d(b){b&&k(e),h[o].d(),v&&v.d(),f=!1,Xe(c)}}}function Y1(n,e,t){const i=on(),s="search_"+W.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new fn}=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 Qi(()=>import("./FilterAutocompleteInput.7c46ad8a.js"),[],import.meta.url)).default),t(5,f=!1))}Jn(()=>{v()});function b(M){rt.call(this,n,M)}function y(M){d=M,t(7,d),t(0,l)}function C(M){de[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,y,C,S,$]}class Bo extends Ee{constructor(e){sup
|
||
|
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function iv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="url",p(t,"class",W.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function sv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="referer",p(t,"class",W.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function lv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="status",p(t,"class",W.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function ov(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function ju(n){let e;function t(l,o){return l[6]?av:rv}let i=t(n),s=i(n);return{c(){s.c(),e=Je()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function rv(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&qu(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){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=qu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function av(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||
|
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function qu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Vu(n){let e;return{c(){e=_("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function zu(n,e){var Q,ce,ye;let t,i,s,l=((Q=e[21].method)==null?void 0:Q.toUpperCase())+"",o,r,a,u,f,c=e[21].url+"",d,h,g,v,b,y,C=(e[21].referer||"N/A")+"",S,$,M,D,O,A=e[21].status+"",L,I,F,V,J,x,B,se,K,te,ee=(((ce=e[21].meta)==null?void 0:ce.errorMessage)||((ye=e[21].meta)==null?void 0:ye.errorData))&&Vu();V=new $i({props:{date:e[21].created}});function me(){return e[16](e[21])}function ge(...Y){return e[17](e[21],...Y)}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(),ee&&ee.c(),v=T(),b=_("td"),y=_("span"),S=N(C),M=T(),D=_("td"),O=_("span"),L=N(A),I=T(),F=_("td"),q(V.$$.fragment),J=T(),x=_("td"),x.innerHTML='<i class="ri-arrow-right-line"></i>',B=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(y,"class","txt txt-ellipsis"),p(y,"title",$=e[21].referer),ie(y,"txt-hint",!e[21].referer),p(b,"class","col-type-text col-field-referer"),p(O,"class","label"),ie(O,"label-danger",e[21].status>=400),p(D,"class","col-type-number col-field-status"),p(F,"class","col-type-date col-field-created"),p(x,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Y,_e){w(Y,t,_e),m(t,i),m(i,s),m(s,o),m(t,a),m(t,u),m(u,f),m(f,d),m(u,g),ee&&ee.m(u,null),m(t,v),m(t,b),m(b,y),m(y,S),m(t,M),m(t,D),m(D,O),m(O,L),m(t,I),m(t,F),H(V,F,null),m(t,J),m(t,x),m(t,B),se=!0,K||(te=[X(t,"click",me),X(t,"keydown",ge)],K=!0)},p(Y,_e){var Z,$e,je;e=Y,(!se||_e&8)&&l!==(l=((Z=e[21].method)==null?void 0:Z.toUpperCase())+"")&&ae(o,l),(!se||_e&8&&r!==(r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(s,"class",r),(!se||_e&8)&&c!==(c=e[21].url+"")&&ae(d,c),(!se||_e&8&&h!==(h=e[21].url))&&p(f,"title",h),(($e=e[21].meta)==null?void 0:$e.errorMessage)||((je=e[21].meta)==null?void 0:je.errorData)?ee||(ee=Vu(),ee.c(),ee.m(u,null)):ee&&(ee.d(1),ee=null),(!se||_e&8)&&C!==(C=(e[21].referer||"N/A")+"")&&ae(S,C),(!se||_e&8&&$!==($=e[21].referer))&&p(y,"title",$),_e&8&&ie(y,"txt-hint",!e[21].referer),(!se||_e&8)&&A!==(A=e[21].status+"")&&ae(L,A),_e&8&&ie(O,"label-danger",e[21].status>=400);const U={};_e&8&&(U.date=e[21].created),V.$set(U)},i(Y){se||(E(V.$$.fragment,Y),se=!0)},o(Y){P(V.$$.fragment,Y),se=!1},d(Y){Y&&k(t),ee&&ee.d(),j(V),K=!1,Xe(te)}}}function Bu(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){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a&8&&i!==(i=r[3].length+"")&&ae(s,i),a&16&&ae(o,r[4])},d(r){r&&k(e)}}}function Uu(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"),ie(t,"btn-loading",n[6]),ie(t,"btn-disabled",n[6]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=X(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&ae(o,l),c&64&&ie(t,"btn-loading",f[6]),c&64&&ie(t,"btn-disabled",f[6])},d(f){f&&k(e),a=!1,u()}}}function uv(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,O=[],A=new Map,L,I,F,V;function J(Z){n[11](Z)}let x={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[nv]},$$scope:{ctx:n}};n[1]!==void 0&&(x.sort=n[1]),l=new sn({props:x}),de.push(()=>Fe(l,"sort",J));function B(Z){n[12](Z)}let se={disable:!0,class:"col-type-text col-field-url",name:"url",$
|
||
|
* Chart.js v3.9.1
|
||
|
* https://www.chartjs.org
|
||
|
* (c) 2022 Chart.js Contributors
|
||
|
* Released under the MIT License
|
||
|
*/function _i(){}const dv=function(){let n=0;return function(){return n++}}();function Mt(n){return n===null||typeof n>"u"}function Ft(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 pt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Yt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Rn(n,e){return Yt(n)?n:e}function gt(n,e){return typeof n>"u"?e:n}const pv=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Hg=(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 Dt(n,e,t,i){let s,l,o;if(Ft(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(pt(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function yo(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 ko(n){if(Ft(n))return n.map(ko);if(pt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=ko(n[t[s]]);return e}return n}function jg(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function hv(n,e,t,i){if(!jg(n))return;const s=e[n],l=t[n];pt(s)&&pt(l)?ul(s,l,i):e[n]=ko(l)}function ul(n,e,t){const i=Ft(e)?e:[e],s=i.length;if(!pt(n))return n;t=t||{};const l=t.merger||hv;for(let o=0;o<s;++o){if(e=i[o],!pt(e))continue;const r=Object.keys(e);for(let a=0,u=r.length;a<u;++a)l(r[a],n,e,t)}return n}function el(n,e){return ul(n,e,{merger:mv})}function mv(n,e,t){if(!jg(n))return;const i=e[n],s=t[n];pt(i)&&pt(s)?el(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=ko(s))}const Wu={"":n=>n,x:n=>n.x,y:n=>n.y};function Ni(n,e){return(Wu[e]||(Wu[e]=gv(e)))(n)}function gv(n){const e=_v(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function _v(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 Sa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Wn=n=>typeof n<"u",Ri=n=>typeof n=="function",Yu=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function bv(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Wt=Math.PI,Et=2*Wt,vv=Et+Wt,wo=Number.POSITIVE_INFINITY,yv=Wt/180,Bt=Wt/2,js=Wt/4,Ku=Wt*2/3,zn=Math.log10,fi=Math.sign;function Ju(n){const e=Math.round(n);n=tl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(zn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function kv(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 Cs(n){return!isNaN(parseFloat(n))&&isFinite(n)}function tl(n,e,t){return Math.abs(n-e)<t}function wv(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function qg(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Qn(n){return n*(Wt/180)}function Ca(n){return n*(180/Wt)}function Zu(n){if(!Yt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function Vg(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*Wt&&(l+=Et),{angle:l,distance:s}}function Wr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function $v(n,e){return(n-e+vv)%Et-Wt}function Pn(n){return(n%Et+Et)%Et}function fl(n,e,t,i){const s=Pn(n),l=Pn(e),o=Pn(t),r=Pn(l-s),a=Pn(o-s),u=Pn(s-l),f=Pn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function un(n,e,t){return Math.max(e,Math.min(t,n))}function Sv(n){return un(n,-32768,32767)}function cl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ma(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,l;for(;i-s>1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const es=(n,e,t,i)=>Ma(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),Cv=(n,e,t)=>Ma(n,t,i=>n[i][e]>=t);function Mv(n,e,
|
||
|
* @kurkle/color v0.2.1
|
||
|
* https://github.com/kurkle/color#readme
|
||
|
* (c) 2022 Jukka Kurkela
|
||
|
* Released under the MIT License
|
||
|
*/function wl(n){return n+.5|0}const Pi=(n,e,t)=>Math.max(Math.min(n,t),e);function Zs(n){return Pi(wl(n*2.55),0,255)}function Fi(n){return Pi(wl(n*255),0,255)}function yi(n){return Pi(wl(n/2.55)/100,0,1)}function ef(n){return Pi(wl(n*100),0,100)}const Nn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Yr=[..."0123456789ABCDEF"],Ev=n=>Yr[n&15],Av=n=>Yr[(n&240)>>4]+Yr[n&15],Vl=n=>(n&240)>>4===(n&15),Pv=n=>Vl(n.r)&&Vl(n.g)&&Vl(n.b)&&Vl(n.a);function Lv(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Nn[n[1]]*17,g:255&Nn[n[2]]*17,b:255&Nn[n[3]]*17,a:e===5?Nn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Nn[n[1]]<<4|Nn[n[2]],g:Nn[n[3]]<<4|Nn[n[4]],b:Nn[n[5]]<<4|Nn[n[6]],a:e===9?Nn[n[7]]<<4|Nn[n[8]]:255})),t}const Iv=(n,e)=>n<255?e(n):"";function Fv(n){var e=Pv(n)?Ev:Av;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Iv(n.a,e):void 0}const Nv=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Jg(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 Rv(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 Hv(n,e,t){const i=Jg(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 jv(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 Ta(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=jv(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Da(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Fi)}function Oa(n,e,t){return Da(Jg,n,e,t)}function qv(n,e,t){return Da(Hv,n,e,t)}function Vv(n,e,t){return Da(Rv,n,e,t)}function Zg(n){return(n%360+360)%360}function zv(n){const e=Nv.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Zs(+e[5]):Fi(+e[5]));const s=Zg(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=qv(s,l,o):e[1]==="hsv"?i=Vv(s,l,o):i=Oa(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function Bv(n,e){var t=Ta(n);t[0]=Zg(t[0]+e),t=Oa(t),n.r=t[0],n.g=t[1],n.b=t[2]}function Uv(n){if(!n)return;const e=Ta(n),t=e[0],i=ef(e[1]),s=ef(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${yi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const tf={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"},nf={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 Ky{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=Ug.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);!t||(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var bi=new Ky;const mf="transparent",Jy={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=lf(n||mf),s=i.valid&&lf(e||mf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Zy{constructor(e,t,i,s){const l=t[i];s=Ul([e.to,s,l,e.from]);const o=Ul([e.from,l,s]);this._active=!0,this._fn=e.fn||Jy[e.type||typeof o],this._easing=nl[e.easing]||nl.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Ul([e.to,t,s,e.from]),this._from=Ul([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t<i),!this._active){this._target[s]=r,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][t]()}}const Gy=["x","y","borderWidth","radius","tension"],Xy=["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 Qy=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:Xy},numbers:{type:"number",properties:Gy}});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 f_{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!pt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!pt(s))return;const l={};for(co
|
||
|
`)>-1?n.split(`
|
||
|
`):n}function hw(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 Yf(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Ln(e.bodyFont),u=Ln(e.titleFont),f=Ln(e.footerFont),c=l.length,d=s.length,h=i.length,g=Yn(e.padding);let v=g.height,b=0,y=i.reduce(($,M)=>$+M.before.length+M.lines.length+M.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(v+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;v+=h*$+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let C=0;const S=function($){b=Math.max(b,t.measureText($).width+C)};return t.save(),t.font=u.string,Dt(n.title,S),t.font=a.string,Dt(n.beforeBody.concat(n.afterBody),S),C=e.displayColors?o+2+e.boxPadding:0,Dt(i,$=>{Dt($.before,S),Dt($.lines,S),Dt($.after,S)}),C=0,t.font=f.string,Dt(n.footer,S),t.restore(),b+=g.width,{width:b,height:v}}function mw(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function gw(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 _w(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"),gw(u,n,e,t)&&(u="center"),u}function Kf(n,e,t){const i=t.yAlign||e.yAlign||mw(n,t);return{xAlign:t.xAlign||e.xAlign||_w(n,e,t,i),yAlign:i}}function bw(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function vw(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function Jf(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}=ys(o);let g=bw(e,r);const v=vw(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:un(g,0,i.width-e.width),y:un(v,0,i.height-e.height)}}function Xl(n,e,t){const i=Yn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Zf(n){return ri([],vi(n))}function yw(n,e,t){return ji(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Gf(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ta extends Ci{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new f_(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=yw(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=ri(r,vi(s)),r=ri(r,vi(l)),r=ri(r,vi(o)),r}getBeforeBody(e,t){return Zf(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return Dt(e,l=>{const o={before:[],lines:[],after:[]},r=Gf(i,l);ri(o.before,vi(r.beforeLabel.call(this,l))
|
||
|
* chartjs-adapter-luxon v1.2.0
|
||
|
* https://www.chartjs.org
|
||
|
* (c) 2022 chartjs-adapter-luxon Contributors
|
||
|
* Released under the MIT license
|
||
|
*/const Vw={datetime:Qe.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Qe.TIME_WITH_SECONDS,minute:Qe.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};m_._date.override({_id:"luxon",_create:function(n){return Qe.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return Vw},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Qe.fromFormat(n,e,t):n=Qe.fromISO(n,t):n instanceof Date?n=Qe.fromJSDate(n,t):i==="object"&&!(n instanceof Qe)&&(n=Qe.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function sc(n){let e,t,i;return{c(){e=_("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Tt(()=>{t||(t=ot(e,Tn,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=ot(e,Tn,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function zw(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){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&ae(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&ae(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function Bw(n){let e;return{c(){e=N("Loading...")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Uw(n){let e,t,i,s,l,o=n[2]&&sc();function r(f,c){return f[2]?Bw:zw}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"),Qa(i,"height","250px"),Qa(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),ie(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){w(f,e,c),o&&o.m(e,null),m(e,t),m(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&E(o,1):(o=sc(),o.c(),E(o,1),o.m(e,t)):o&&(Ae(),P(o,1,1,()=>{o=null}),Pe()),c&4&&ie(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&&k(e),o&&o.d(),n[8](null),f&&k(s),f&&k(l),u.d()}}}function Ww(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),ve.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let g of h)r.push({x:W.getDateTime(g.date).toLocal().toJSDate(),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),ve.errorResponseHandler(h,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Jn(()=>(Eo.register(qi,Jo,Yo,Wa,Ml,pw,kw),t(6,o=new Eo(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){de[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,"&").replace(/</g,"<").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 I=M[C];return M[C]=O,r.languages.DFS(r.languages,function(F,V){V===I&&F!=C&&(this[F]=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],I=r.util.type(L);I==="Object"&&!D[O(L)]?(D[O(L)]=!0,C(L,$,null,D)):I==="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 I(V){L.highlightedCode=V,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){I(r.util.encode(L.code));return}if(S&&i.Worker){var F=new Worker(r.filename);F.onmessage=function(V){I(V.data)},F.postMessage(JSON.stringify({language:L.language,code:L.code,immediateClose:!0}))}else I(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))}y.textContent=D,t.highlightElement(y)},function(D){b.setAttribute(r,f),y.textContent=D})}}),t.plugins.fileHighlight={highlight:function(b){for(var y=(b||document).querySelectorAll(c),C=0,S;S=y[C++];)t.highlightElement(S)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(F_);const Ws=F_.exports;var Kw={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}}}})})()})(Kw);(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 Jw(n){let e,t,i;return{c(){e=_("div"),t=_("code"),p(t,"class","svelte-1ua9m3i"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-1ua9m3i")},m(s,l){w(s,e,l),m(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-1ua9m3i")&&p(e,"class",i)},i:oe,o:oe,d(s){s&&k(e)}}}function Zw(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=Ws.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Ws.highlight(a,Ws.languages[l]||Ws.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 Ws<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class _n extends Ee{constructor(e){super(),Oe(this,e,Zw,Jw,De,{class:0,content:2,language:3})}}const Gw=n=>({}),oc=n=>({}),Xw=n=>({}),rc=n=>({});function ac(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S=n[4]&&!n[2]&&uc(n);const $=n[18].header,M=wn($,n,n[17],rc);let D=n[4]&&n[2]&&fc(n);const O=n[18].default,A=wn(O,n,n[17],null),L=n[18].footer,I=wn(L,n,n[17],oc);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"),I&&I.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",h="overlay-panel "+n[1]+" "+n[8]),i
|
||
|
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]))&&p(e,"for",l);const C={};y&16&&(C.id=b[4]),y&1&&(C.disabled=!W.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,C.value=b[0].exceptDomains,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&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function sS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[3](b)}let v={id:n[4]+".options.onlyDomains",disabled:!W.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new cs({props:v}),de.push(()=>Fe(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),q(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,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),H(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye($t.call(null,s,{text:`List of domains that are ONLY allowed.
|
||
|
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]+".options.onlyDomains"))&&p(e,"for",l);const C={};y&16&&(C.id=b[4]+".options.onlyDomains"),y&1&&(C.disabled=!W.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,C.value=b[0].onlyDomains,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&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function lS(n){let e,t,i,s,l,o,r;return i=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[iS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[sS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=T(),l=_("div"),q(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),H(i,t,null),m(e,s),m(e,l),H(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&&k(e),j(i),j(o)}}}function oS(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 j_ extends Ee{constructor(e){super(),Oe(this,e,oS,lS,De,{key:1,options:0})}}function rS(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 j_({props:r}),de.push(()=>Fe(e,"key",l)),de.push(()=>Fe(e,"options",o)),{c(){q(e.$$.fragment)},m(a,u){H(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){j(e,a)}}}function aS(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 uS extends Ee{constructor(e){super(),Oe(this,e,aS,rS,De,{key:0,options:1})}}var wr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ks={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],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 me(){t.calendarContainer.classList.add("hasWeeks");var R=Ct("div","flatpickr-weekwrapper");R.appendChild(Ct("span","flatpickr-weekday",t.l10n.weekAbbreviation));var z=Ct("div","flatpickr-weeks");return R.appendChild(z),{weekWrapper:R,weekNumbers:z}}function ge(R,z){z===void 0&&(z=!0);var ne=z?R:R-t.currentMonth;ne<0&&t._hidePrevMonthArrow===!0||ne>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ne,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Ke("onYearChange"),J()),V(),Ke("onMonthChange"),ut())}function Q(R,z){if(R===void 0&&(R=!0),z===void 0&&(z=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,z===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Mr(t.config),re=ne.hours,Le=ne.minutes,le=ne.seconds;h(re,Le,le)}t.redraw(),R&&Ke("onChange")}function ce(){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 ye(){t.config!==void 0&&Ke("onDestroy");for(var R=t._handlers.length;R--;)t._handlers[R].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var z=t.calendarContainer.parentNode;if(z.lastChild&&z.removeChild(z.lastChild),z.parentNode){for(;z.firstChild;)z.parentNode.insertBefore(z.firstChild,z);z.parentNode.removeChild(z)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ne){try{delete t[ne]}catch{}})}function Y(R){return t.calendarContainer.contains(R)}function _e(R){if(t.isOpen&&!t.config.inline){var z=En(R),ne=Y(z),re=z===t.input||z===t.altInput||t.element.contains(z)||R.path&&R.path.indexOf&&(~R.path.indexOf(t.input)||~R.path.indexOf(t.altInput)),Le=!re&&!ne&&!Y(R.relatedTarget),le=!t.config.ignoredFocusElements.some(function(ke){return ke.contains(z)});Le&&le&&(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 U(R){if(!(!R||t.config.minDate&&R<t.config.minDate.getFullYear()||t.config.maxDate&&R>t.config.maxDate.getFullYear())){var z=R,ne=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)),ne&&(t.redraw(),Ke("onYearChange"),J())}}function Z(R,z){var ne;z===void 0&&(z=!0);var re=t.parseDate(R,void 0,z);if(t.config.minDate&&re&&An(re,t.config.minDate,z!==void 0?z:!t.minDateHasTime)<0||t.config.maxDate&&re&&An(re,t.config.maxDate,z!==void 0?z:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;
|
||
|
`),d=_("span"),h=_("span"),h.textContent="Choose presets",g=T(),q(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){w(M,e,D),m(e,t),m(e,i),m(e,s),w(M,o,D),H(r,M,D),w(M,u,D),w(M,f,D),m(f,c),m(f,d),m(d,h),m(d,g),H(v,d,null),b=!0,y||(C=Ye($t.call(null,s,{text:`Allow files ONLY with the listed mime types.
|
||
|
Leave empty for no restriction.`,position:"top"})),y=!0)},p(M,D){(!b||D&1024&&l!==(l=M[10]))&&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&&k(e),M&&k(o),j(r,M),M&&k(u),M&&k(f),j(v),y=!1,C()}}}function NS(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 cs({props:v}),de.push(()=>Fe(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=T(),s=_("i"),o=T(),q(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,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),H(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye($t.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs will be generated lazily on first access.",position:"top"})),d=!0)},p(b,y){(!c||y&1024&&l!==(l=b[10]))&&p(e,"for",l);const C={};y&1024&&(C.id=b[10]),!a&&y&1&&(a=!0,C.value=b[0].thumbs,He(()=>a=!1)),r.$set(C)},i(b){c||(E(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function RS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return i=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[PS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[LS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[FS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),d=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[NS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=T(),l=_("div"),q(o.$$.fragment),r=T(),a=_("div"),q(u.$$.fragment),f=T(),c=_("div"),q(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(c,"class","col-sm-12"),p(e,"class","grid")},m(g,v){w(g,e,v),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),m(e,a),H(u,a,null),m(e,f),m(e,c),H(d,c,null),h=!0},p(g,[v]){const b={};v&2&&(b.name="schema."+g[1]+".options.maxSize"),v&3073&&(b.$$scope={dirty:v,ctx:g}),i.$set(b);const y={};v&2&&(y.name="schema."+g[1]+".options.maxSelect"),v&3073&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const C={};v&2&&(C.name="schema."+g[1]+".options.mimeTypes"),v&3073&&(C.$$scope={dirty:v,ctx:g}),u.$set(C);const S={};v&2&&(S.name="schema."+g[1]+".options.thumbs"),v&3073&&(S.$$scope={dirty:v,ctx:g}),d.$set(S)},i(g){h||(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&&k(e),j(i),j(o),j(u),j(d)}}}function HS(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.opt
|
||
|
form-field
|
||
|
required
|
||
|
`+(n[5]?"":"invalid")+`
|
||
|
`+(n[0].id&&n[0].system?"disabled":"")+`
|
||
|
`,name:"schema."+n[1]+".name",$$slots:{default:[QS,({uniqueId:V})=>({38:V}),({uniqueId:V})=>[0,V?128:0]]},$$scope:{ctx:n}}});const O=[u3,a3,r3,o3,l3,s3,i3,n3,t3,e3,xS],A=[];function L(V,J){return V[0].type==="text"?0:V[0].type==="number"?1:V[0].type==="bool"?2:V[0].type==="email"?3:V[0].type==="url"?4:V[0].type==="date"?5:V[0].type==="select"?6:V[0].type==="json"?7:V[0].type==="file"?8:V[0].type==="relation"?9:V[0].type==="user"?10:-1}~(f=L(n))&&(c=A[f]=O[f](n)),g=new Re({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[f3,({uniqueId:V})=>({38:V}),({uniqueId:V})=>[0,V?128:0]]},$$scope:{ctx:n}}});let I=n[0].type!=="file"&&Rc(n),F=!n[0].toDelete&&Hc(n);return{c(){e=_("form"),t=_("div"),i=_("div"),q(s.$$.fragment),l=T(),o=_("div"),q(r.$$.fragment),a=T(),u=_("div"),c&&c.c(),d=T(),h=_("div"),q(g.$$.fragment),v=T(),b=_("div"),I&&I.c(),y=T(),F&&F.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(V,J){w(V,e,J),m(e,t),m(t,i),H(s,i,null),m(t,l),m(t,o),H(r,o,null),m(t,a),m(t,u),~f&&A[f].m(u,null),m(t,d),m(t,h),H(g,h,null),m(t,v),m(t,b),I&&I.m(b,null),m(t,y),F&&F.m(t,null),m(e,C),m(e,S),$=!0,M||(D=X(e,"submit",Kt(n[31])),M=!0)},p(V,J){const x={};J[0]&1&&(x.class="form-field required "+(V[0].id?"disabled":"")),J[0]&2&&(x.name="schema."+V[1]+".type"),J[0]&1|J[1]&384&&(x.$$scope={dirty:J,ctx:V}),s.$set(x);const B={};J[0]&33&&(B.class=`
|
||
|
form-field
|
||
|
required
|
||
|
`+(V[5]?"":"invalid")+`
|
||
|
`+(V[0].id&&V[0].system?"disabled":"")+`
|
||
|
`),J[0]&2&&(B.name="schema."+V[1]+".name"),J[0]&33|J[1]&384&&(B.$$scope={dirty:J,ctx:V}),r.$set(B);let se=f;f=L(V),f===se?~f&&A[f].p(V,J):(c&&(Ae(),P(A[se],1,1,()=>{A[se]=null}),Pe()),~f?(c=A[f],c?c.p(V,J):(c=A[f]=O[f](V),c.c()),E(c,1),c.m(u,null)):c=null);const K={};J[0]&1|J[1]&384&&(K.$$scope={dirty:J,ctx:V}),g.$set(K),V[0].type!=="file"?I?(I.p(V,J),J[0]&1&&E(I,1)):(I=Rc(V),I.c(),E(I,1),I.m(b,null)):I&&(Ae(),P(I,1,1,()=>{I=null}),Pe()),V[0].toDelete?F&&(Ae(),P(F,1,1,()=>{F=null}),Pe()):F?(F.p(V,J),J[0]&1&&E(F,1)):(F=Hc(V),F.c(),E(F,1),F.m(t,null))},i(V){$||(E(s.$$.fragment,V),E(r.$$.fragment,V),E(c),E(g.$$.fragment,V),E(I),E(F),$=!0)},o(V){P(s.$$.fragment,V),P(r.$$.fragment,V),P(c),P(g.$$.fragment,V),P(I),P(F),$=!1},d(V){V&&k(e),j(s),j(r),~f&&A[f].d(),j(g),I&&I.d(),F&&F.d(),M=!1,D()}}}function qc(n){let e,t,i,s,l=n[0].system&&Vc(),o=!n[0].id&&zc(n),r=n[0].required&&Bc(),a=n[0].unique&&Uc();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){w(u,e,f),l&&l.m(e,null),m(e,t),o&&o.m(e,null),m(e,i),r&&r.m(e,null),m(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=Vc(),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=zc(u),o.c(),o.m(e,i)),u[0].required?r||(r=Bc(),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=Uc(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function Vc(n){let e;return{c(){e=_("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function zc(n){let e;return{c(){e=_("span"),e.textContent="New",p(e,"class","label"),ie(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){w(t,e,i)},p(t,i){i[0]&257&&ie(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&k(e)}}}function Bc(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Uc(n){let e;return{c(){e=_("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Wc(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye($t.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=ot(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=ot(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function Yc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-secondary")},m(s,l){w(s,e,l),t||(i=X(e,"click",ei(n[15])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function h3(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,h,g,v,b,y=!n[0].toDelete&&qc(n),C=n[7]&&!n[0].system&&Wc(),S=n[0].toDelete&&Yc(n);return{c(){e=_("div"),t=_("span"),i=_("i"),l=T(),o=_("strong"),a=N(r),f=T(),y&&y.c(),c=T(),d=_("div"),h=T(),C&&C.c(),g=T(),S&&S.c(),v=Je(),p(i,"class",s=Xa(W.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),p(t,"class","icon field-type"),p(o,"class","title field-name svelte-1tpxlm5"),p(o,"title",u=n[0].name),ie(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m($,M){w($,e,M),m(e,t),m(t,i),m(e,l),m(e,o),m(o,a),w($,f,M),y&&y.m($,M),w($,c,M),w($,d,M),w($,h,M),C&&C.m($,M),w($,g,M),S&&S.m($,M),w($,v,M),b=!0},p($,M){(!b||M[0]&1&&s!==(s=Xa(W.getFieldTypeIcon($[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!b||M[0]&1)&&r!==(r=($[0].name||"-")+"")&&ae(a,r),(!b||M[0]&1&&u!==(u=$[0].name))&&p(o,"title",u),M[0]&1&&ie(o,"txt-strikethrough",$[0].toDelete),$[0].toDelete?y&&(y.d(1),y=null):y?y.p($,M):(y=qc($),y.c(),y.m(c.parentNode,c)),$[7]&&!$[0].system?C?M[0]&129&&E(C,1):(C=Wc(),C.c(),E(C,1),C.m(g.parentNode,g)):C&&(Ae(),P(C,1,1,()=>{C=null}),Pe()),$[0].toDelete?S?S.p($,M):(S=Yc($),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($){$&&k(e),$&&k(f),y&&y.d($),$&&k(c),$&&k(d),$&&k(h),C&&C.d($),$&&k(g),S&&S.d($),$&&k(v)}}}function m3(n){let e,t,i={single:!0,interactive:n[8],class:n[2]||n[0].toDel
|
||
|
<code>@request.query.*</code>
|
||
|
<code>@request.data.*</code>
|
||
|
<code>@request.user.*</code>`,S=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(),I=_("hr"),F=T(),V=_("p"),V.innerHTML=`Example rule:
|
||
|
<br/>
|
||
|
<code>@request.user.id!="" && created>"2022-01-01 00:00:00"</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(I,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(K,te){w(K,e,te),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 ee=0;ee<se.length;ee+=1)se[ee].m(o,null);m(i,h),m(i,g),m(i,v),m(i,b),m(i,y),m(i,C),m(i,S),m(i,$),m(i,M),m(i,D),m(i,O),m(i,A),m(i,L),m(i,I),m(i,F),m(i,V),x=!0},p(K,te){if(te&1){B=K[0].schema;let ee;for(ee=0;ee<B.length;ee+=1){const me=Gc(K,B,ee);se[ee]?se[ee].p(me,te):(se[ee]=Qc(me),se[ee].c(),se[ee].m(o,null))}for(;ee<se.length;ee+=1)se[ee].d(1);se.length=B.length}},i(K){x||(K&&Tt(()=>{J||(J=ot(e,tn,{duration:150},!0)),J.run(1)}),x=!0)},o(K){K&&(J||(J=ot(e,tn,{duration:150},!1)),J.run(0)),x=!1},d(K){K&&k(e),xt(se,K),K&&J&&J.end()}}}function k3(n){let e,t=n[19].name+"",i;return{c(){e=_("code"),i=N(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[19].name+"")&&ae(i,t)},d(s){s&&k(e)}}}function w3(n){let e,t=n[19].name+"",i,s;return{c(){e=_("code"),i=N(t),s=N(".*")},m(l,o){w(l,e,o),m(e,i),m(e,s)},p(l,o){o&1&&t!==(t=l[19].name+"")&&ae(i,t)},d(l){l&&k(e)}}}function Qc(n){let e;function t(l,o){return l[19].type==="relation"||l[19].type==="user"?w3:k3}let i=t(n),s=i(n);return{c(){s.c(),e=Je()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function $3(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=Zc(n,l,r),u=o(a);t.set(u,e[r]=xc(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=Je()},m(r,a){for(let u=0;u<e.length;u+=1)e[u].m(r,a);w(r,i,a),s=!0},p(r,a){a&262235&&(l=Object.entries(r[6]),Ae(),e=vt(e,a,o,1,r,l,t,i.parentNode,Gt,xc,i,Zc),Pe())},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&&k(i)}}}function S3(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function C3(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){w(l,e,o),t||(i=[Ye($t.call(null,e,"Lock and set to Admins only")),X(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Xe(i)}}}function M3(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){w(l,e,o),t||(i=[Ye($t.call(null,e,"Unlock and set custom rule")),X(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Xe(i)}}}function T3(n){let e;return{c(){e=N("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function D3(n){let e;return{c(){e=N("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function O3(n){let e,t=n[15]+"",i,s,l=Ai(n[0][n[14]])?"Admins only":"Custom rule",o,r,a,u,f=n[14],c,d,h,g,v,b,y;function C(){return n[10](n[14])}const S=()=>n[11](u,f),$=()=>n[11](null,f);function M(F){n[12](F,n[14])}var D=n[4];function O(F){let V={baseCollection:F[0],disabled:Ai(F[0][F[14]])};return F[0][F[14]]!==void 0&&(V.value=F[0][F[14]]),{props:V}}D&&(u=new D(O(n)),S(),de.push(()=>Fe(u,"value",M)));function A(F,V){return V&1&&(g=null),g==null&&(g=!!Ai(F[0][F[14]])),g?D3:T3}let L=A(n,-1),I=L(n);return{c(){e=_("label"),i=N(t),s=N(" - "),o=N(l),a=T(),u&&q(u.$$.fragment),d=T(),h=_("div"),I.c(),p(e,"for",r=n[18]),p(h,"class","help-block")},m(F,V){w(F,e,V),m(e,i),m(e,s),m(e,o),w(F,a,V),u&&H(u,F,V),w(F,d,V),w(F,h,V),I.m(h,null),v=!0,b||(y=X(e,"click",C),b=!0)},p(F,V
|
||
|
<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=Je(),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex"),p(e,"class","block m-b-base")},m($,M){w($,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),b&&b.m(e,null),w($,u,M),C[f].m($,M),w($,d,M),h=!0,g||(v=X(l,"click",n[7]),g=!0)},p($,[M]){(!h||M&4)&&o!==(o=$[2]?"Hide available fields":"Show available fields")&&ae(r,o),$[2]?b?(b.p($,M),M&4&&E(b,1)):(b=Xc($),b.c(),E(b,1),b.m(e,null)):b&&(Ae(),P(b,1,1,()=>{b=null}),Pe());let D=f;f=S($),f===D?C[f].p($,M):(Ae(),P(C[D],1,1,()=>{C[D]=null}),Pe(),c=C[f],c?c.p($,M):(c=C[f]=y[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($){$&&k(e),b&&b.d(),$&&k(u),C[f].d($),$&&k(d),g=!1,v()}}}function Ai(n){return n===null}function A3(n,e,t){let{collection:i=new fn}=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 Qi(()=>import("./FilterAutocompleteInput.7c46ad8a.js"),[],import.meta.url)).default)}catch(y){console.warn(y),t(4,r=null)}t(5,a=!1)}Jn(()=>{f()});const c=()=>t(2,l=!l),d=async y=>{var C;t(0,i[y]=s[y]||"",i),await ii(),(C=o[y])==null||C.focus()},h=y=>{t(1,s[y]=i[y],s),t(0,i[y]=null,i)},g=y=>{var C;return(C=o[y])==null?void 0:C.focus()};function v(y,C){de[y?"unshift":"push"](()=>{o[C]=y,t(3,o)})}function b(y,C){n.$$.not_equal(i[C],y)&&(i[C]=y,t(0,i))}return n.$$set=y=>{"collection"in y&&t(0,i=y.collection)},[i,s,l,o,r,a,u,c,d,h,g,v,b]}class P3 extends Ee{constructor(e){super(),Oe(this,e,A3,E3,De,{collection:0})}}function ed(n,e,t){const i=n.slice();return i[14]=e[t],i}function td(n,e,t){const i=n.slice();return i[14]=e[t],i}function nd(n){let e;return{c(){e=_("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function id(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){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&2&&l!==(l=h[1].originalName+"")&&ae(o,l),g&2&&c!==(c=h[1].name+"")&&ae(d,c)},d(h){h&&k(e)}}}function sd(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){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&16&&l!==(l=h[14].originalName+"")&&ae(o,l),g&16&&c!==(c=h[14].name+"")&&ae(d,c)},d(h){h&&k(e)}}}function ld(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){w(r,e,a),m(e,t),m(e,i),m(i,l),m(e,o)},p(r,a){a&8&&s!==(s=r[14].name+"")&&ae(l,s)},d(r){r&&k(e)}}}function L3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[3].length&&nd(),g=n[5]&&id(n),v=n[4],b=[];for(let S=0;S<v.length;S+=1)b[S]=sd(td(n,v,S));let y=n[3],C=[];for(let S=0;S<y.length;S+=1)C[S]=ld(ed(n,y,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,$){w(S,e,$),m(e,t),m(e,i),m(e,s),m(s,l),m(s,o),h&&h.m(s,null),w(S,r,$),w(S,a,$),w(S,u,$),w(S,f,$),g&&g.m(f,null),m(f,c);for(let M=0;M<b.length;M+=1)b[M].m(f,null);m(f,d);for(let M=0;M<C.length;M+=1)C[M].m(f,null)},p(S,$){if(S[3].length?h||(h=nd(),h.c(),h.m(s,null)):h&&(h.d(1),h=null),S[5]?g?g.p(S,$):(g=id(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=td(S,v,M);b[M]?b[M].p(D,$):(b[M]=sd(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){y=S[3];let M;for(M=0;M<y.length;M+=1){const D=ed(S,y,M);C[M]?C[M].p(D,$):(C[M]=ld(D),C[M].c(),C[M].m(f,null))}for(;M<C.length;M+=1)C[M].d(1);C.length=y.length}},d(S){S&&k(e),h&&h.d(),S&&k(r),S&&k(a),S&&k(u),S&&k(f),g&&g.d(),xt(b,S),xt(C,S)}}}function I3(n){let e;return{c(){e=_("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function F3(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){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[X(e,"click",n[8]),X(i,"click",n[9])],s=!0)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Xe(l)}}}function N3(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[F3],header:[I3],default:[L3]},$$scope:{ctx:n}};return e=new mi({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){q(e.$$.fragment)},m(s,l){H(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),j(e,s)}}}function R3(n,e,t){let i,s,l;const o=on();let r,a;async function u(y){t(1,a=y),await ii(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),h=()=>c();function g(y){de[y?"unshift":"push"](()=>{r=y,t(2,r)})}function v(y){rt.call(this,n,y)}function b(y){rt.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=(a==null?void 0:a.originalName)!=(a==null?void 0:a.name)),n.$$.dirty&2&&t(4,s=(a==null?void 0:a.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(y=>y.id&&y.toDelete))||[])},[f,a,r,l,s,i,c,u,d,h,g,v,b]}class H3 extends Ee{constructor(e){super(),Oe(this,e,R3,N3,De,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function od(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 P3({props:o}),de.push(()=>Fe(t,"collection",l)),{c(){e=_("div"),q(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),H(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&&k(e),j(t)}}}function j3(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 y3({props:a}),de.push(()=>Fe(i,"collection",r));let u=n[9]===ml&&od(n);return{c(){e=_("div"),t=_("div"),q(i.$$.fragment),l=T(),u&&u.c(),p(t,"class","tab-item"),ie(t,"active",n[9]===os),p(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),m(e,t),H(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&&ie(t,"active",f[9]===os),f[9]===ml?u?(u.p(f,c),c[0]&512&&E(u,1)):(u=od(f),u.c(),E(u,1),u.m(e,null)):u&&(Ae(),P(u,1,1,()=>{u=null}),Pe())},i(f){o||(E(i.$$.fragment,f),E(u),o=!0)},o(f){P(i.$$.fragment,f),P(u),o=!1},d(f){f&&k(e),j(i),u&&u.d()}}}function rd(n){let e,t,i,s,l,o,r;return o=new Vi({props:{class:"dropdown dropdown-right m
|
||
|
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[20]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function ad(n){let e;return{c(){e=_("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function V3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[2].system&&ad();return{c(){e=_("label"),t=N("Name"),s=T(),l=_("input"),u=T(),h&&h.c(),f=Je(),p(e,"for",i=n[38]),p(l,"type","text"),p(l,"id",o=n[38]),l.required=!0,l.disabled=n[11],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",'eg. "posts"'),l.value=a=n[2].name},m(g,v){w(g,e,v),m(e,t),w(g,s,v),w(g,l,v),w(g,u,v),h&&h.m(g,v),w(g,f,v),n[2].isNew&&l.focus(),c||(d=X(l,"input",n[21]),c=!0)},p(g,v){v[1]&128&&i!==(i=g[38])&&p(e,"for",i),v[1]&128&&o!==(o=g[38])&&p(l,"id",o),v[0]&2048&&(l.disabled=g[11]),v[0]&4&&r!==(r=g[2].isNew)&&(l.autofocus=r),v[0]&4&&a!==(a=g[2].name)&&l.value!==a&&(l.value=a),g[2].system?h||(h=ad(),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},d(g){g&&k(e),g&&k(s),g&&k(l),g&&k(u),h&&h.d(g),g&&k(f),c=!1,d()}}}function ud(n){let e,t,i,s,l,o;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=Ye(t=$t.call(null,e,n[12])),l=!0)},p(r,a){t&&Kn(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&Tt(()=>{i||(i=ot(e,Tn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=ot(e,Tn,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function fd(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye($t.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Tt(()=>{t||(t=ot(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=ot(e,Tn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function z3(n){var F,V,J,x,B,se;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,h,g,v=!W.isEmpty((F=n[4])==null?void 0:F.schema),b,y,C,S,$=!W.isEmpty((V=n[4])==null?void 0:V.listRule)||!W.isEmpty((J=n[4])==null?void 0:J.viewRule)||!W.isEmpty((x=n[4])==null?void 0:x.createRule)||!W.isEmpty((B=n[4])==null?void 0:B.updateRule)||!W.isEmpty((se=n[4])==null?void 0:se.deleteRule),M,D,O,A=!n[2].isNew&&!n[2].system&&rd(n);r=new Re({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[V3,({uniqueId:K})=>({38:K}),({uniqueId:K})=>[0,K?128:0]]},$$scope:{ctx:n}}});let L=v&&ud(n),I=$&&fd();return{c(){e=_("h4"),i=N(t),s=T(),A&&A.c(),l=T(),o=_("form"),q(r.$$.fragment),a=T(),u=_("input"),f=T(),c=_("div"),d=_("button"),h=_("span"),h.textContent="Fields",g=T(),L&&L.c(),b=T(),y=_("button"),C=_("span"),C.textContent="API Rules",S=T(),I&&I.c(),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ie(d,"active",n[9]===os),p(C,"class","txt"),p(y,"type","button"),p(y,"class","tab-item"),ie(y,"active",n[9]===ml),p(c,"class","tabs-header stretched")},m(K,te){w(K,e,te),m(e,i),w(K,s,te),A&&A.m(K,te),w(K,l,te),w(K,o,te),H(r,o,null),m(o,a),m(o,u),w(K,f,te),w(K,c,te),m(c,d),m(d,h),m(d,g),L&&L.m(d,null),m(c,b),m(c,y),m(y,C),m(y,S),I&&I.m(y,null),M=!0,D||(O=[X(o,"submit",Kt(n[22])),X(d,"click",n[23]),X(y,"click",n[24])],D=!0)},p(K,te){var me,ge,Q,ce,ye,Y;(!M||te[0]&4)&&t!==(t=K[2].isNew?"New collection":"Edit collection")&&ae(i,t),!K[2].isNew&&!K[2].system?A?(A.p(K,te),te[0]&4&&E(A,1)):(A=rd(K),A.c(),E(A,1),A.m(l.parentNode,l)):A&&(Ae(),P(A,1,1,()=>{A=null}),Pe());const ee={};te[0]&2048&&(ee.class="form-field required m-b-0 "+(K[11]?"disabled":"")),te[0]&2052|te[1]&384&&(ee.$$scope={dirty:te,ctx:K}),r.$set(ee),te[0]&16&&(v=!W.isEmpty((me=K[4])==null?void 0:me.schema)),v?L?(L.p(K,te),te[0]&16&&E(L,1)):(L=ud(K),L.c(),E(L,1),L.m(d,null)):L&&(Ae(),P(L,1,1,()=>{L=null}),Pe()),te[0]&512&&ie(d,"active",K[9]===os),te[0]&16&&($=!W.isEmpty((ge=K[4])==null?void 0:ge.listRule)||!W.isEmpty((Q=K[4])==null?void 0:Q.viewRule)||!W.isEmpty((ce=K[4])==null?
|
||
|
<span class="txt">New collection</span>`,y=T(),q(C.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-secondary btn-circle btn-clear"),ie(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"),ie(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(I,F){w(I,e,F),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 V=0;V<d.length;V+=1)d[V].m(c,null);A&&A.m(c,null),m(e,g),m(e,v),m(v,b),w(I,y,F),H(C,I,F),S=!0,$||(M=[X(l,"click",n[8]),X(r,"input",n[9]),X(b,"click",n[11])],$=!0)},p(I,[F]){F&16&&ie(l,"hidden",!I[4]),F&1&&r.value!==I[0]&&Me(r,I[0]),F&16&&ie(i,"active",I[4]),F&106&&(D=I[3],d=vt(d,F,O,1,I,D,h,c,Mn,hd,null,cd),!D.length&&A?A.p(I,F):D.length?A&&(A.d(1),A=null):(A=dd(I),A.c(),A.m(c,null)));const V={};C.$set(V)},i(I){S||(E(C.$$.fragment,I),S=!0)},o(I){P(C.$$.fragment,I),S=!1},d(I){I&&k(e);for(let F=0;F<d.length;F+=1)d[F].d();A&&A.d(),I&&k(y),n[12](null),j(C,I),$=!1,Xe(M)}}}function Z3(n,e,t){let i,s,l,o,r;_t(n,ci,b=>t(5,o=b)),_t(n,Ds,b=>t(7,r=b));let a,u="";function f(b){dn(ci,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){de[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 G3 extends Ee{constructor(e){super(),Oe(this,e,Z3,J3,De,{})}}function X3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,O,A,L,I,F,V,J,x,B,se,K,te,ee,me,ge,Q,ce,ye,Y,_e,U,Z,$e,je,Be,G,pe,ue,we,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(),y=_("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",I=T(),F=_("li"),V=_("code"),V.textContent=">=",J=T(),x=_("span"),x.textContent="Greater than or equal",B=T(),se=_("li"),K=_("code"),K.textContent="<",te=T(),ee=_("span"),ee.textContent="Less than or equal",me=T(),ge=_("li"),Q=_("code"),Q.textContent="<=",ce=T(),ye=_("span"),ye.textContent="Less than or equal",Y=T(),_e=_("li"),U=_("code"),U.textContent="~",Z=T(),$e=_("span"),$e.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
|
||
|
match)`,je=T(),Be=_("li"),G=_("code"),G.textContent="!~",pe=T(),ue=_("span"),ue.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
|
||
|
wildcard match)`,we=T(),Ze=_("p"),Ze.innerHTML=`To group and combine several expressions you could use brackets
|
||
|
<code>(...)</code>, <code>&&</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(V,"class","filter-op svelte-1w7s5nw"),p(x,"class","txt-hint"),p(K,"class","filter-op svelte-1w7s5nw"),p(ee,"class","txt-hint"),p(Q,"class","filter-op svelte-1w7s5nw"),p(ye,"class","txt-hint"),p(U,"class","filter-op svelte-1w7s5nw"),p($e,"class","txt-hint"),p(G,"class","filter-op svelte-1w7s5nw"),p(ue,"class","txt-hint")},m(tt,We){w(tt,e,We),w(tt,t,We),w(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,y),m(y,C),m(y,S),m(y,$),m(c,M),m(c,D),m(D,O),m(D,A),m(D,L),m(c,I),m(c,F),m(F,V),m(F,J),m(F,x),m(c,B),m(c,se),m(se,K),m(se,te),m(se,ee),m(c,me),m(c,ge),m(ge,Q),m(ge,ce),m(ge,ye),m(c,Y),m(c,_e),m(_e,U),m(_e,Z),m(_e,$e),m(c,je),m(c,Be),m(Be,G),m(Be,pe),m(Be,ue),w(tt,we,We),w(tt,Ze,We)},p:oe,i:oe,o:oe,d(tt){tt&&k(e),tt&&k(t),tt&&k(i),tt&&k(we),tt&&k(Ze)}}}class Q3 extends Ee{constructor(e){super(),Oe(this,e,null,X3,De,{})}}function md(n,e,t){const i=n.slice();return i[5]=e[t],i}function gd(n,e,t){const i=n.slice();return i[5]=e[t],i}function _d(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"),ie(t,"active",e[0]===e[5].language),this.first=t},m(f,c){w(f,t,c),m(t,i),m(i,l),m(t,o),r||(a=X(t,"click",u),r=!0)},p(f,c){e=f,c&2&&s!==(s=e[5].title+"")&&ae(l,s),c&3&&ie(t,"active",e[0]===e[5].language)},d(f){f&&k(t),r=!1,a()}}}function bd(n,e){let t,i,s,l;return i=new _n({props:{language:e[5].language,content:e[5].content}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=T(),p(t,"class","tab-item svelte-1maocj6"),ie(t,"active",e[0]===e[5].language),this.first=t},m(o,r){w(o,t,r),H(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&&ie(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&&k(t),j(i)}}}function x3(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=gd(n,f,g),b=c(v);s.set(b,i[g]=_d(b,v))}let d=n[1];const h=g=>g[5].language;for(let g=0;g<d.length;g+=1){let v=md(n,d,g),b=h(v);a.set(b,r[g]=bd(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){w(g,e,v),m(e,t);for(let b=0;b<i.length;b+=1)i[b].m(t,null);m(e,l),m(e,o);for(let b=0;b<r.length;b+=1)r[b].m(o,null);u=!0},p(g,[v]){v&3&&(f=g[1],i=vt(i,v,c,1,g,f,s,t,Mn,_d,null,gd)),v&3&&(d=g[1],Ae(),r=vt(r,v,h,1,g,d,a,o,Gt,bd,null,md),Pe())},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&&k(e);for(let v=0;v<i.length;v+=1)i[v].d();for(let v=0;v<r.length;v+=1)r[v].d()}}}const vd="pb_sdk_preference";function eC(n,e,t){let i,{js:s=""}=e,{dart:l=""}=e,o=localStorage.getItem(vd)||"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(vd,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 Ls extends Ee{constructor(e){super(),Oe(this,e,eC,x3,De,{js:2,dart:3})}}function yd(n,e,t){const i=n.slice();return i[6]=e[t],i}function kd(n,e,t){const i=n.slice();return i[6]=e[t],i}function wd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function $d(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_(
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase('${n[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
// fetch a paginated records list
|
||
|
const resultList = await client.records.getList('${(gi=n[0])==null?void 0:gi.name}', 1, 50, {
|
||
|
filter: 'created >= "2022-01-01 00:00:00"',
|
||
|
});
|
||
|
|
||
|
// alternatively you can also fetch all records at once via getFullList:
|
||
|
const records = await client.records.getFullList('${(Tl=n[0])==null?void 0:Tl.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(
|
||
|
'${(ds=n[0])==null?void 0:ds.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('${(Dl=n[0])==null?void 0:Dl.name}', batch: 200, sort: '-created');
|
||
|
`}}),G=new _n({props:{content:`
|
||
|
// DESC by created and ASC by id
|
||
|
?sort=-created,id
|
||
|
`}}),ze=new _n({props:{content:`
|
||
|
?filter=(id='abc' && created>'2022-01-01')
|
||
|
`}}),st=new Q3({}),wt=new _n({props:{content:`
|
||
|
?expand=rel1,rel2.subrel21.subrel22
|
||
|
`}});let ht=n[4];const rn=qe=>qe[6].code;for(let qe=0;qe<ht.length;qe+=1){let xe=kd(n,ht,qe),Xt=rn(xe);Le.set(Xt,re[qe]=$d(Xt,xe))}let qt=n[4];const Mi=qe=>qe[6].code;for(let qe=0;qe<qt.length;qe+=1){let xe=yd(n,qt,qe),Xt=Mi(xe);fe.set(Xt,Te[qe]=Sd(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(),Ne&&Ne.c(),d=T(),h=_("div"),g=_("p"),v=N("Fetch a paginated "),b=_("strong"),C=N(y),S=N(" records list."),$=T(),M=_("div"),M.textContent="Client SDKs example",D=T(),q(O.$$.fragment),A=T(),L=_("div"),L.textContent="Query parameters",I=T(),F=_("table"),V=_("thead"),V.innerHTML=`<tr><th>Param</th>
|
||
|
<th>Type</th>
|
||
|
<th width="60%">Description</th></tr>`,J=T(),x=_("tbody"),B=_("tr"),B.innerHTML=`<td>page</td>
|
||
|
<td><span class="label">Number</span></td>
|
||
|
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,se=T(),K=_("tr"),K.innerHTML=`<td>perPage</td>
|
||
|
<td><span class="label">Number</span></td>
|
||
|
<td>Specify the max returned records per page (default to 30).</td>`,te=T(),ee=_("tr"),me=_("td"),me.textContent="sort",ge=T(),Q=_("td"),Q.innerHTML='<span class="label">String</span>',ce=T(),ye=_("td"),Y=N("Specify the records order attribute(s). "),_e=_("br"),U=N(`
|
||
|
Add `),Z=_("code"),Z.textContent="-",$e=N(" / "),je=_("code"),je.textContent="+",Be=N(` (default) in front of the attribute for DESC / ASC order.
|
||
|
Ex.:
|
||
|
`),q(G.$$.fragment),pe=T(),ue=_("tr"),we=_("td"),we.textContent="filter",Ze=T(),tt=_("td"),tt.innerHTML='<span class="label">String</span>',We=T(),it=_("td"),Ce=N(`Filter the returned records. Ex.:
|
||
|
`),q(ze.$$.fragment),Ge=T(),q(st.$$.fragment),dt=T(),be=_("tr"),Ie=_("td"),Ie.textContent="expand",nt=T(),ct=_("td"),ct.innerHTML='<span class="label">String</span>',yt=T(),at=_("td"),Ot=N(`Auto expand record relations. Ex.:
|
||
|
`),q(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
|
||
|
`),Se=_("code"),Se.textContent="@expand",Ue=N(" property (eg. "),et=_("code"),et.textContent='"@expand": {"rel1": {...}, ...}',ut=N(`). Only the
|
||
|
relations that the user has permissions to `),Pt=_("strong"),Pt.textContent="view",It=N(" will be expanded."),Lt=T(),lt=_("div"),lt.textContent="Responses",R=T(),z=_("div"),ne=_("div");for(let qe=0;qe<re.length;qe+=1)re[qe].c();le=T(),ke=_("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(F,"class","table-compact table-border m-b-lg"),p(lt,"class","section-title"),p(ne,"class","tabs-header compact left"),p(ke,"class","tabs-content"),p(z,"class","tabs")},m(qe,xe){w(qe,e,xe),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),Ne&&Ne.m(e,null),w(qe,d,xe),w(qe,h,xe),m(h,g),m(g,v),m(g,b),m(b,C),m(g,S),w(qe,$,xe),w(qe,M,xe),w(qe,D,xe),H(O,qe,xe),w(qe,A,xe),w(qe,L,xe),w(qe,I,xe),w(qe,F,xe),m(F,V),m(F,J),m(F,x),m(x,B),m(x,se),m(x,K),m(x,te),m(x,ee),m(ee,me),m(ee,ge),m(ee,Q),m(ee,ce),m(ee,ye),m(ye,Y),m(ye,_e),m(ye,U),m(ye,Z),m(ye,$e),m(ye,je),m(ye,Be),H(G,ye,null),m(x,pe),m(x,ue),m(ue,we),m(ue,Ze),m(ue,tt),m(ue,We),m(ue,it),m(it,Ce),H(ze,it,null),m(it,Ge),H(st,it,null),m(x,dt),m(x,be),m(be,Ie),m(be,nt),m(be,ct),m(be,yt),m(be,at),m(at,Ot),H(wt,at,null),m(at,jt),m(at,Nt),m(at,Ke),m(at,Se),m(at,Ue),m(at,et),m(at,ut),m(at,Pt),m(at,It),w(qe,Lt,xe),w(qe,lt,xe),w(qe,R,xe),w(qe,z,xe),m(z,ne);for(let Xt=0;Xt<re.length;Xt+=1)re[Xt].m(ne,null);m(z,le),m(z,ke);for(let Xt=0;Xt<Te.length;Xt+=1)Te[Xt].m(ke,null);he=!0},p(qe,[xe]){var Ol,El,Al,Pl;(!he||xe&1)&&a!==(a=qe[0].name+"")&&ae(u,a),qe[1]?Ne||(Ne=wd(),Ne.c(),Ne.m(e,null)):Ne&&(Ne.d(1),Ne=null),(!he||xe&1)&&y!==(y=qe[0].name+"")&&ae(C,y);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('${(Ol=qe[0])==null?void 0:Ol.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('${(El=qe[0])==null?void 0:El.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(
|
||
|
'${(Al=qe[0])==null?void 0:Al.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('${(Pl=qe[0])==null?void 0:Pl.name}', batch: 200, sort: '-created');
|
||
|
`),O.$set(Xt),xe&20&&(ht=qe[4],re=vt(re,xe,rn,1,qe,ht,Le,ne,Mn,$d,null,kd)),xe&20&&(qt=qe[4],Ae(),Te=vt(Te,xe,Mi,1,qe,qt,fe,ke,Gt,Sd,null,yd),Pe())},i(qe){if(!he){E(O.$$.fragment,qe),E(G.$$.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]);he=!0}},o(qe){P(O.$$.fragment,qe),P(G.$$.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]);he=!1},d(qe){qe&&k(e),Ne&&Ne.d(),qe&&k(d),qe&&k(h),qe&&k($),qe&&k(M),qe&&k(D),j(O,qe),qe&&k(A),qe&&k(L),qe&&k(I),qe&&k(F),j(G),j(ze),j(st),j(wt),qe&&k(Lt),qe&&k(lt),qe&&k(R),qe&&k(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 nC(n,e,t){let i,s,{collection:l=new fn}=e,o=200,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.listRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[W.dummyCollectionRecord(l),W.dummyCollectionRecord(l)]},null,2)}),r.push({code:400,body:`
|
||
|
{
|
||
|
"code": 400,
|
||
|
"message": "Something went wrong while processing your request. Invalid filter.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`}),i&&r.push({code:403,body:`
|
||
|
{
|
||
|
"code": 403,
|
||
|
"message": "Only admins can access this action.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`}),r.push({code:404,body:`
|
||
|
{
|
||
|
"code": 404,
|
||
|
"message": "The requested resource wasn't found.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`}))},t(3,s=W.getApiExampleUrl(ve.baseUrl)),[l,i,o,s,r,a]}class iC extends Ee{constructor(e){super(),Oe(this,e,nC,tC,De,{collection:0})}}function Cd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Md(n,e,t){const i=n.slice();return i[6]=e[t],i}function Td(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Dd(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"),ie(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ie(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Od(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&20&&ie(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&&k(t),j(i)}}}function sC(n){var Nt,Ke;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,C=n[0].name+"",S,$,M,D,O,A,L,I,F,V,J,x,B,se,K,te,ee,me,ge,Q,ce,ye,Y,_e,U,Z,$e,je,Be,G,pe,ue,we,Ze,tt,We,it,Ce,ze,Ge=[],st=new Map,dt,be,Ie=[],nt=new Map,ct,yt=n[1]&&Td();A=new Ls({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',
|
||
|
});
|
||
|
`}}),U=new _n({props:{content:`
|
||
|
?expand=rel1,rel2.subrel21.subrel22
|
||
|
`}});let at=n[4];const Ot=Se=>Se[6].code;for(let Se=0;Se<at.length;Se+=1){let Ue=Md(n,at,Se),et=Ot(Ue);st.set(et,Ge[Se]=Dd(et,Ue))}let wt=n[4];const jt=Se=>Se[6].code;for(let Se=0;Se<wt.length;Se+=1){let Ue=Cd(n,wt,Se),et=jt(Ue);nt.set(et,Ie[Se]=Od(et,Ue))}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(),yt&&yt.c(),h=T(),g=_("div"),v=_("p"),b=N("Fetch a single "),y=_("strong"),S=N(C),$=N(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",O=T(),q(A.$$.fragment),L=T(),I=_("div"),I.textContent="Path Parameters",F=T(),V=_("table"),V.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>`,J=T(),x=_("div"),x.textContent="Query parameters",B=T(),se=_("table"),K=_("thead"),K.innerHTML=`<tr><th>Param</th>
|
||
|
<th>Type</th>
|
||
|
<th width="60%">Description</th></tr>`,te=T(),ee=_("tbody"),me=_("tr"),ge=_("td"),ge.textContent="expand",Q=T(),ce=_("td"),ce.innerHTML='<span class="label">String</span>',ye=T(),Y=_("td"),_e=N(`Auto expand record relations. Ex.:
|
||
|
`),q(U.$$.fragment),Z=N(`
|
||
|
Supports up to 6-levels depth nested relations expansion. `),$e=_("br"),je=N(`
|
||
|
The expanded relations will be appended to the record under the
|
||
|
`),Be=_("code"),Be.textContent="@expand",G=N(" property (eg. "),pe=_("code"),pe.textContent='"@expand": {"rel1": {...}, ...}',ue=N(`). Only the
|
||
|
relations that the user has permissions to `),we=_("strong"),we.textContent="view",Ze=N(" will be expanded."),tt=T(),We=_("div"),We.textContent="Responses",it=T(),Ce=_("div"),ze=_("div");for(let Se=0;Se<Ge.length;Se+=1)Ge[Se].c();dt=T(),be=_("div");for(let Se=0;Se<Ie.length;Se+=1)Ie[Se].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(I,"class","section-title"),p(V,"class","table-compact table-border m-b-lg"),p(x,"class","section-title"),p(se,"class","table-compact table-border m-b-lg"),p(We,"class","section-title"),p(ze,"class","tabs-header compact left"),p(be,"class","tabs-content"),p(Ce,"class","tabs")},m(Se,Ue){w(Se,e,Ue),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),yt&&yt.m(e,null),w(Se,h,Ue),w(Se,g,Ue),m(g,v),m(v,b),m(v,y),m(y,S),m(v,$),w(Se,M,Ue),w(Se,D,Ue),w(Se,O,Ue),H(A,Se,Ue),w(Se,L,Ue),w(Se,I,Ue),w(Se,F,Ue),w(Se,V,Ue),w(Se,J,Ue),w(Se,x,Ue),w(Se,B,Ue),w(Se,se,Ue),m(se,K),m(se,te),m(se,ee),m(ee,me),m(me,ge),m(me,Q),m(me,ce),m(me,ye),m(me,Y),m(Y,_e),H(U,Y,null),m(Y,Z),m(Y,$e),m(Y,je),m(Y,Be),m(Y,G),m(Y,pe),m(Y,ue),m(Y,we),m(Y,Ze),w(Se,tt,Ue),w(Se,We,Ue),w(Se,it,Ue),w(Se,Ce,Ue),m(Ce,ze);for(let et=0;et<Ge.length;et+=1)Ge[et].m(ze,null);m(Ce,dt),m(Ce,be);for(let et=0;et<Ie.length;et+=1)Ie[et].m(be,null);ct=!0},p(Se,[Ue]){var ut,Pt;(!ct||Ue&1)&&a!==(a=Se[0].name+"")&&ae(u,a),Se[1]?yt||(yt=Td(),yt.c(),yt.m(e,null)):yt&&(yt.d(1),yt=null),(!ct||Ue&1)&&C!==(C=Se[0].name+"")&&ae(S,C);const et={};Ue&9&&(et.js=`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase('${Se[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
const record = await client.records.getOne('${(ut=Se[0])==null?void 0:ut.name}', 'RECORD_ID', {
|
||
|
expand: 'some_relation'
|
||
|
});
|
||
|
`),Ue&9&&(et.dart=`
|
||
|
import 'package:pocketbase/pocketbase.dart';
|
||
|
|
||
|
final client = PocketBase('${Se[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
final record = await client.records.getOne('${(Pt=Se[0])==null?void 0:Pt.name}', 'RECORD_ID', query: {
|
||
|
'expand': 'some_relation',
|
||
|
});
|
||
|
`),A.$set(et),Ue&20&&(at=Se[4],Ge=vt(Ge,Ue,Ot,1,Se,at,st,ze,Mn,Dd,null,Md)),Ue&20&&(wt=Se[4],Ae(),Ie=vt(Ie,Ue,jt,1,Se,wt,nt,be,Gt,Od,null,Cd),Pe())},i(Se){if(!ct){E(A.$$.fragment,Se),E(U.$$.fragment,Se);for(let Ue=0;Ue<wt.length;Ue+=1)E(Ie[Ue]);ct=!0}},o(Se){P(A.$$.fragment,Se),P(U.$$.fragment,Se);for(let Ue=0;Ue<Ie.length;Ue+=1)P(Ie[Ue]);ct=!1},d(Se){Se&&k(e),yt&&yt.d(),Se&&k(h),Se&&k(g),Se&&k(M),Se&&k(D),Se&&k(O),j(A,Se),Se&&k(L),Se&&k(I),Se&&k(F),Se&&k(V),Se&&k(J),Se&&k(x),Se&&k(B),Se&&k(se),j(U),Se&&k(tt),Se&&k(We),Se&&k(it),Se&&k(Ce);for(let Ue=0;Ue<Ge.length;Ue+=1)Ge[Ue].d();for(let Ue=0;Ue<Ie.length;Ue+=1)Ie[Ue].d()}}}function lC(n,e,t){let i,s,{collection:l=new fn}=e,o=200,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.viewRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify(W.dummyCollectionRecord(l),null,2)}),i&&r.push({code:403,body:`
|
||
|
{
|
||
|
"code": 403,
|
||
|
"message": "Only admins can access this action.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`}),r.push({code:404,body:`
|
||
|
{
|
||
|
"code": 404,
|
||
|
"message": "The requested resource wasn't found.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`}))},t(3,s=W.getApiExampleUrl(ve.baseUrl)),[l,i,o,s,r,a]}class oC extends Ee{constructor(e){super(),Oe(this,e,lC,sC,De,{collection:0})}}function Ed(n,e,t){const i=n.slice();return i[6]=e[t],i}function Ad(n,e,t){const i=n.slice();return i[6]=e[t],i}function Pd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Ld(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function rC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function aC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function uC(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){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ae(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function fC(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){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ae(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function cC(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){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function dC(n){let e;return{c(){e=N("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function pC(n){let e;return{c(){e=N("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function hC(n){let e;return{c(){e=N("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function mC(n){let e;return{c(){e=N("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function gC(n){let e;return{c(){e=N("Plain text value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Id(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=W.getFieldValueType(e[11])+"",h,g,v,b;function y(O,A){return O[11].required?aC:rC}let C=y(e),S=C(e);function $(O,A){if(O[11].type==="text")return gC;if(O[11].type==="number")return mC;if(O[11].type==="json")return hC;if(O[11].type==="email")return pC;if(O[11].type==="url")return dC;if(O[11].type==="file")return cC;if(O[11].type==="relation")return fC;if(O[11].type==="user")return uC}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){w(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=y(e))&&(S.d(1),S=C(e),S&&(S.c(),S.m(s,l))),A&1&&r!==(r=e[11].name+"")&&ae(a,r),A&1&&d!==(d=W.getFieldValueType(e[11])+"")&&ae(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&&k(t),S.d(),D&&D.d()}}}function Fd(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"),ie(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ae(s,i),f&6&&ie(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Nd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(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&&ie(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&&k(t),j(i)}}}function _C(n){var ne,re,Le;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y=n[0].name+"",C,S,$,M,D,O,A,L,I,F,V,J,x,B,se,K,te,ee,me,ge=[],Q=new Map,ce,ye,Y,_e,U,Z,$e,je,Be,G,pe,ue,we,Ze,tt,We,it,Ce,ze,Ge,st,dt,be,Ie,nt,ct,yt,at,Ot,wt=[],jt=new Map,Nt,Ke,Se=[],Ue=new Map,et,ut=n[4]&&Ld();F=new Ls({props:{js:`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase('${n[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
const data = { ... };
|
||
|
|
||
|
const record = await client.records.create('${(ne=n[0])==null?void 0:ne.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=(Le=n[0])==null?void 0:Le.schema;const It=le=>le[11].name;for(let le=0;le<Pt.length;le+=1){let ke=Pd(n,Pt,le),Te=It(ke);Q.set(Te,ge[le]=Id(Te,ke))}tt=new _n({props:{content:`
|
||
|
?expand=rel1,rel2.subrel21.subrel22
|
||
|
`}});let Lt=n[2];const lt=le=>le[6].code;for(let le=0;le<Lt.length;le+=1){let ke=Ad(n,Lt,le),Te=lt(ke);jt.set(Te,wt[le]=Fd(Te,ke))}let R=n[2];const z=le=>le[6].code;for(let le=0;le<R.length;le+=1){let ke=Ed(n,R,le),Te=z(ke);Ue.set(Te,Se[le]=Nd(Te,ke))}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(),ut&&ut.c(),d=T(),h=_("div"),g=_("p"),v=N("Create a new "),b=_("strong"),C=N(y),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",I=T(),q(F.$$.fragment),V=T(),J=_("div"),J.textContent="Body Parameters",x=T(),B=_("table"),se=_("thead"),se.innerHTML=`<tr><th>Param</th>
|
||
|
<th>Type</th>
|
||
|
<th width="50%">Description</th></tr>`,K=T(),te=_("tbody"),ee=_("tr"),ee.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>`,me=T();for(let le=0;le<ge.length;le+=1)ge[le].c();ce=T(),ye=_("div"),ye.textContent="Query parameters",Y=T(),_e=_("table"),U=_("thead"),U.innerHTML=`<tr><th>Param</th>
|
||
|
<th>Type</th>
|
||
|
<th width="60%">Description</th></tr>`,Z=T(),$e=_("tbody"),je=_("tr"),Be=_("td"),Be.textContent="expand",G=T(),pe=_("td"),pe.innerHTML='<span class="label">String</span>',ue=T(),we=_("td"),Ze=N(`Auto expand relations when returning the created record. Ex.:
|
||
|
`),q(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",Ge=N(" property (eg. "),st=_("code"),st.textContent='"@expand": {"rel1": {...}, ...}',dt=N(`). Only the
|
||
|
relations that the user has permissions to `),be=_("strong"),be.textContent="view",Ie=N(" will be expanded."),nt=T(),ct=_("div"),ct.textContent="Responses",yt=T(),at=_("div"),Ot=_("div");for(let le=0;le<wt.length;le+=1)wt[le].c();Nt=T(),Ke=_("div");for(let le=0;le<Se.length;le+=1)Se[le].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(J,"class","section-title"),p(B,"class","table-compact table-border m-b-lg"),p(ye,"class","section-title"),p(_e,"class","table-compact table-border m-b-lg"),p(ct,"class","section-title"),p(Ot,"class","tabs-header compact left"),p(Ke,"class","tabs-content"),p(at,"class","tabs")},m(le,ke){w(le,e,ke),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),ut&&ut.m(e,null),w(le,d,ke),w(le,h,ke),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),w(le,A,ke),w(le,L,ke),w(le,I,ke),H(F,le,ke),w(le,V,ke),w(le,J,ke),w(le,x,ke),w(le,B,ke),m(B,se),m(B,K),m(B,te),m(te,ee),m(te,me);for(let Te=0;Te<ge.length;Te+=1)ge[Te].m(te,null);w(le,ce,ke),w(le,ye,ke),w(le,Y,ke),w(le,_e,ke),m(_e,U),m(_e,Z),m(_e,$e),m($e,je),m(je,Be),m(je,G),m(je,pe),m(je,ue),m(je,we),m(we,Ze),H(tt,we,null),m(we,We),m(we,it),m(we,Ce),m(we,ze),m(we,Ge),m(we,st),m(we,dt),m(we,be),m(we,Ie),w(le,nt,ke),w(le,ct,ke),w(le,yt,ke),w(le,at,ke),m(at,Ot);for(let Te=0;Te<wt.length;Te+=1)wt[Te].m(Ot,null);m(at,Nt),m(at,Ke);for(let Te=0;Te<Se.length;Te+=1)Se[Te].m(Ke,null);et=!0},p(le,[ke]){var fe,he,Ne;(!et||ke&1)&&a!==(a=le[0].name+"")&&ae(u,a),le[4]?ut||(ut=Ld(),ut.c(),ut.m(e,null)):ut&&(ut.d(1),ut=null),(!et||ke&1)&&y!==(y=le[0].name+"")&&ae(C,y);const Te={};ke&9&&(Te.js=`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase('${le[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
const data = { ... };
|
||
|
|
||
|
const record = await client.records.create('${(fe=le[0])==null?void 0:fe.name}', data);
|
||
|
`),ke&9&&(Te.dart=`
|
||
|
import 'package:pocketbase/pocketbase.dart';
|
||
|
|
||
|
final client = PocketBase('${le[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
final body = <String, dynamic>{ ... };
|
||
|
|
||
|
final record = await client.records.create('${(he=le[0])==null?void 0:he.name}', body: body);
|
||
|
`),F.$set(Te),ke&1&&(Pt=(Ne=le[0])==null?void 0:Ne.schema,ge=vt(ge,ke,It,1,le,Pt,Q,te,Mn,Id,null,Pd)),ke&6&&(Lt=le[2],wt=vt(wt,ke,lt,1,le,Lt,jt,Ot,Mn,Fd,null,Ad)),ke&6&&(R=le[2],Ae(),Se=vt(Se,ke,z,1,le,R,Ue,Ke,Gt,Nd,null,Ed),Pe())},i(le){if(!et){E(F.$$.fragment,le),E(tt.$$.fragment,le);for(let ke=0;ke<R.length;ke+=1)E(Se[ke]);et=!0}},o(le){P(F.$$.fragment,le),P(tt.$$.fragment,le);for(let ke=0;ke<Se.length;ke+=1)P(Se[ke]);et=!1},d(le){le&&k(e),ut&&ut.d(),le&&k(d),le&&k(h),le&&k(A),le&&k(L),le&&k(I),j(F,le),le&&k(V),le&&k(J),le&&k(x),le&&k(B);for(let ke=0;ke<ge.length;ke+=1)ge[ke].d();le&&k(ce),le&&k(ye),le&&k(Y),le&&k(_e),j(tt),le&&k(nt),le&&k(ct),le&&k(yt),le&&k(at);for(let ke=0;ke<wt.length;ke+=1)wt[ke].d();for(let ke=0;ke<Se.length;ke+=1)Se[ke].d()}}}function bC(n,e,t){let i,s,{collection:l=new fn}=e,o=200,r=[];const a=u=>t(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.createRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(W.dummyCollectionRecord(l),null,2)},{code:400,body:`
|
||
|
{
|
||
|
"code": 400,
|
||
|
"message": "Failed to create record.",
|
||
|
"data": {
|
||
|
"${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.name}": {
|
||
|
"code": "validation_required",
|
||
|
"message": "Missing required value."
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
`},{code:403,body:`
|
||
|
{
|
||
|
"code": 403,
|
||
|
"message": "You are not allowed to perform this request.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`}])},t(3,s=W.getApiExampleUrl(ve.baseUrl)),[l,o,r,s,i,a]}class vC extends Ee{constructor(e){super(),Oe(this,e,bC,_C,De,{collection:0})}}function Rd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Hd(n,e,t){const i=n.slice();return i[6]=e[t],i}function jd(n,e,t){const i=n.slice();return i[11]=e[t],i}function qd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function yC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function kC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function wC(n){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){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ae(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function $C(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){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ae(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function SC(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){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function CC(n){let e;return{c(){e=N("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function MC(n){let e;return{c(){e=N("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function TC(n){let e;return{c(){e=N("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function DC(n){let e;return{c(){e=N("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function OC(n){let e;return{c(){e=N("Plain text value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Vd(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=W.getFieldValueType(e[11])+"",h,g,v,b;function y(O,A){return O[11].required?kC:yC}let C=y(e),S=C(e);function $(O,A){if(O[11].type==="text")return OC;if(O[11].type==="number")return DC;if(O[11].type==="json")return TC;if(O[11].type==="email")return MC;if(O[11].type==="url")return CC;if(O[11].type==="file")return SC;if(O[11].type==="relation")return $C;if(O[11].type==="user")return wC}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){w(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=y(e))&&(S.d(1),S=C(e),S&&(S.c(),S.m(s,l))),A&1&&r!==(r=e[11].name+"")&&ae(a,r),A&1&&d!==(d=W.getFieldValueType(e[11])+"")&&ae(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&&k(t),S.d(),D&&D.d()}}}function zd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ae(s,i),f&6&&ie(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Bd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(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&&ie(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&&k(t),j(i)}}}function EC(n){var le,ke,Te;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,C=n[0].name+"",S,$,M,D,O,A,L,I,F,V,J,x,B,se,K,te,ee,me,ge,Q,ce,ye=[],Y=new Map,_e,U,Z,$e,je,Be,G,pe,ue,we,Ze,tt,We,it,Ce,ze,Ge,st,dt,be,Ie,nt,ct,yt,at,Ot,wt,jt,Nt,Ke=[],Se=new Map,Ue,et,ut=[],Pt=new Map,It,Lt=n[4]&&qd();V=new Ls({props:{js:`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase('${n[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
const data = { ... };
|
||
|
|
||
|
const record = await client.records.update('${(le=n[0])==null?void 0:le.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('${(ke=n[0])==null?void 0:ke.name}', 'RECORD_ID', body: body);
|
||
|
`}});let lt=(Te=n[0])==null?void 0:Te.schema;const R=fe=>fe[11].name;for(let fe=0;fe<lt.length;fe+=1){let he=jd(n,lt,fe),Ne=R(he);Y.set(Ne,ye[fe]=Vd(Ne,he))}Ce=new _n({props:{content:`
|
||
|
?expand=rel1,rel2.subrel21.subrel22
|
||
|
`}});let z=n[2];const ne=fe=>fe[6].code;for(let fe=0;fe<z.length;fe+=1){let he=Hd(n,z,fe),Ne=ne(he);Se.set(Ne,Ke[fe]=zd(Ne,he))}let re=n[2];const Le=fe=>fe[6].code;for(let fe=0;fe<re.length;fe+=1){let he=Rd(n,re,fe),Ne=Le(he);Pt.set(Ne,ut[fe]=Bd(Ne,he))}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 "),y=_("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(),I=_("div"),I.textContent="Client SDKs example",F=T(),q(V.$$.fragment),J=T(),x=_("div"),x.textContent="Path parameters",B=T(),se=_("table"),se.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>`,K=T(),te=_("div"),te.textContent="Body Parameters",ee=T(),me=_("table"),ge=_("thead"),ge.innerHTML=`<tr><th>Param</th>
|
||
|
<th>Type</th>
|
||
|
<th width="50%">Description</th></tr>`,Q=T(),ce=_("tbody");for(let fe=0;fe<ye.length;fe+=1)ye[fe].c();_e=T(),U=_("div"),U.textContent="Query parameters",Z=T(),$e=_("table"),je=_("thead"),je.innerHTML=`<tr><th>Param</th>
|
||
|
<th>Type</th>
|
||
|
<th width="60%">Description</th></tr>`,Be=T(),G=_("tbody"),pe=_("tr"),ue=_("td"),ue.textContent="expand",we=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.:
|
||
|
`),q(Ce.$$.fragment),ze=N(`
|
||
|
Supports up to 6-levels depth nested relations expansion. `),Ge=_("br"),st=N(`
|
||
|
The expanded relations will be appended to the record under the
|
||
|
`),dt=_("code"),dt.textContent="@expand",be=N(" property (eg. "),Ie=_("code"),Ie.textContent='"@expand": {"rel1": {...}, ...}',nt=N(`). Only the
|
||
|
relations that the user has permissions to `),ct=_("strong"),ct.textContent="view",yt=N(" will be expanded."),at=T(),Ot=_("div"),Ot.textContent="Responses",wt=T(),jt=_("div"),Nt=_("div");for(let fe=0;fe<Ke.length;fe+=1)Ke[fe].c();Ue=T(),et=_("div");for(let fe=0;fe<ut.length;fe+=1)ut[fe].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-warning"),p(g,"class","content m-b-base"),p(I,"class","section-title"),p(x,"class","section-title"),p(se,"class","table-compact table-border m-b-lg"),p(te,"class","section-title"),p(me,"class","table-compact table-border m-b-lg"),p(U,"class","section-title"),p($e,"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(fe,he){w(fe,e,he),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),Lt&&Lt.m(e,null),w(fe,h,he),w(fe,g,he),m(g,v),m(v,b),m(v,y),m(y,S),m(v,$),m(g,M),m(g,D),m(g,O),m(g,A),w(fe,L,he),w(fe,I,he),w(fe,F,he),H(V,fe,he),w(fe,J,he),w(fe,x,he),w(fe,B,he),w(fe,se,he),w(fe,K,he),w(fe,te,he),w(fe,ee,he),w(fe,me,he),m(me,ge),m(me,Q),m(me,ce);for(let Ne=0;Ne<ye.length;Ne+=1)ye[Ne].m(ce,null);w(fe,_e,he),w(fe,U,he),w(fe,Z,he),w(fe,$e,he),m($e,je),m($e,Be),m($e,G),m(G,pe),m(pe,ue),m(pe,we),m(pe,Ze),m(pe,tt),m(pe,We),m(We,it),H(Ce,We,null),m(We,ze),m(We,Ge),m(We,st),m(We,dt),m(We,be),m(We,Ie),m(We,nt),m(We,ct),m(We,yt),w(fe,at,he),w(fe,Ot,he),w(fe,wt,he),w(fe,jt,he),m(jt,Nt);for(let Ne=0;Ne<Ke.length;Ne+=1)Ke[Ne].m(Nt,null);m(jt,Ue),m(jt,et);for(let Ne=0;Ne<ut.length;Ne+=1)ut[Ne].m(et,null);It=!0},p(fe,[he]){var ht,rn,qt;(!It||he&1)&&a!==(a=fe[0].name+"")&&ae(u,a),fe[4]?Lt||(Lt=qd(),Lt.c(),Lt.m(e,null)):Lt&&(Lt.d(1),Lt=null),(!It||he&1)&&C!==(C=fe[0].name+"")&&ae(S,C);const Ne={};he&9&&(Ne.js=`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase('${fe[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
const data = { ... };
|
||
|
|
||
|
const record = await client.records.update('${(ht=fe[0])==null?void 0:ht.name}', 'RECORD_ID', data);
|
||
|
`),he&9&&(Ne.dart=`
|
||
|
import 'package:pocketbase/pocketbase.dart';
|
||
|
|
||
|
final client = PocketBase('${fe[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
final body = <String, dynamic>{ ... };
|
||
|
|
||
|
final record = await client.records.update('${(rn=fe[0])==null?void 0:rn.name}', 'RECORD_ID', body: body);
|
||
|
`),V.$set(Ne),he&1&&(lt=(qt=fe[0])==null?void 0:qt.schema,ye=vt(ye,he,R,1,fe,lt,Y,ce,Mn,Vd,null,jd)),he&6&&(z=fe[2],Ke=vt(Ke,he,ne,1,fe,z,Se,Nt,Mn,zd,null,Hd)),he&6&&(re=fe[2],Ae(),ut=vt(ut,he,Le,1,fe,re,Pt,et,Gt,Bd,null,Rd),Pe())},i(fe){if(!It){E(V.$$.fragment,fe),E(Ce.$$.fragment,fe);for(let he=0;he<re.length;he+=1)E(ut[he]);It=!0}},o(fe){P(V.$$.fragment,fe),P(Ce.$$.fragment,fe);for(let he=0;he<ut.length;he+=1)P(ut[he]);It=!1},d(fe){fe&&k(e),Lt&&Lt.d(),fe&&k(h),fe&&k(g),fe&&k(L),fe&&k(I),fe&&k(F),j(V,fe),fe&&k(J),fe&&k(x),fe&&k(B),fe&&k(se),fe&&k(K),fe&&k(te),fe&&k(ee),fe&&k(me);for(let he=0;he<ye.length;he+=1)ye[he].d();fe&&k(_e),fe&&k(U),fe&&k(Z),fe&&k($e),j(Ce),fe&&k(at),fe&&k(Ot),fe&&k(wt),fe&&k(jt);for(let he=0;he<Ke.length;he+=1)Ke[he].d();for(let he=0;he<ut.length;he+=1)ut[he].d()}}}function AC(n,e,t){let i,s,{collection:l=new fn}=e,o=200,r=[];const a=u=>t(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.updateRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(W.dummyCollectionRecord(l),null,2)},{code:400,body:`
|
||
|
{
|
||
|
"code": 400,
|
||
|
"message": "Failed to update record.",
|
||
|
"data": {
|
||
|
"${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.name}": {
|
||
|
"code": "validation_required",
|
||
|
"message": "Missing required value."
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
`},{code:403,body:`
|
||
|
{
|
||
|
"code": 403,
|
||
|
"message": "You are not allowed to perform this request.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`},{code:404,body:`
|
||
|
{
|
||
|
"code": 404,
|
||
|
"message": "The requested resource wasn't found.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`}])},t(3,s=W.getApiExampleUrl(ve.baseUrl)),[l,o,r,s,i,a]}class PC extends Ee{constructor(e){super(),Oe(this,e,AC,EC,De,{collection:0})}}function Ud(n,e,t){const i=n.slice();return i[6]=e[t],i}function Wd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Yd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Kd(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"),ie(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ie(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Jd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&20&&ie(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&&k(t),j(i)}}}function LC(n){var je,Be;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,C=n[0].name+"",S,$,M,D,O,A,L,I,F,V,J,x,B,se,K,te=[],ee=new Map,me,ge,Q=[],ce=new Map,ye,Y=n[1]&&Yd();A=new Ls({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('${(Be=n[0])==null?void 0:Be.name}', 'RECORD_ID');
|
||
|
`}});let _e=n[4];const U=G=>G[6].code;for(let G=0;G<_e.length;G+=1){let pe=Wd(n,_e,G),ue=U(pe);ee.set(ue,te[G]=Kd(ue,pe))}let Z=n[4];const $e=G=>G[6].code;for(let G=0;G<Z.length;G+=1){let pe=Ud(n,Z,G),ue=$e(pe);ce.set(ue,Q[G]=Jd(ue,pe))}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(),Y&&Y.c(),h=T(),g=_("div"),v=_("p"),b=N("Delete a single "),y=_("strong"),S=N(C),$=N(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",O=T(),q(A.$$.fragment),L=T(),I=_("div"),I.textContent="Path parameters",F=T(),V=_("table"),V.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>`,J=T(),x=_("div"),x.textContent="Responses",B=T(),se=_("div"),K=_("div");for(let G=0;G<te.length;G+=1)te[G].c();me=T(),ge=_("div");for(let G=0;G<Q.length;G+=1)Q[G].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(I,"class","section-title"),p(V,"class","table-compact table-border m-b-lg"),p(x,"class","section-title"),p(K,"class","tabs-header compact left"),p(ge,"class","tabs-content"),p(se,"class","tabs")},m(G,pe){w(G,e,pe),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),Y&&Y.m(e,null),w(G,h,pe),w(G,g,pe),m(g,v),m(v,b),m(v,y),m(y,S),m(v,$),w(G,M,pe),w(G,D,pe),w(G,O,pe),H(A,G,pe),w(G,L,pe),w(G,I,pe),w(G,F,pe),w(G,V,pe),w(G,J,pe),w(G,x,pe),w(G,B,pe),w(G,se,pe),m(se,K);for(let ue=0;ue<te.length;ue+=1)te[ue].m(K,null);m(se,me),m(se,ge);for(let ue=0;ue<Q.length;ue+=1)Q[ue].m(ge,null);ye=!0},p(G,[pe]){var we,Ze;(!ye||pe&1)&&a!==(a=G[0].name+"")&&ae(u,a),G[1]?Y||(Y=Yd(),Y.c(),Y.m(e,null)):Y&&(Y.d(1),Y=null),(!ye||pe&1)&&C!==(C=G[0].name+"")&&ae(S,C);const ue={};pe&9&&(ue.js=`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase('${G[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
await client.records.delete('${(we=G[0])==null?void 0:we.name}', 'RECORD_ID');
|
||
|
`),pe&9&&(ue.dart=`
|
||
|
import 'package:pocketbase/pocketbase.dart';
|
||
|
|
||
|
final client = PocketBase('${G[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
await client.records.delete('${(Ze=G[0])==null?void 0:Ze.name}', 'RECORD_ID');
|
||
|
`),A.$set(ue),pe&20&&(_e=G[4],te=vt(te,pe,U,1,G,_e,ee,K,Mn,Kd,null,Wd)),pe&20&&(Z=G[4],Ae(),Q=vt(Q,pe,$e,1,G,Z,ce,ge,Gt,Jd,null,Ud),Pe())},i(G){if(!ye){E(A.$$.fragment,G);for(let pe=0;pe<Z.length;pe+=1)E(Q[pe]);ye=!0}},o(G){P(A.$$.fragment,G);for(let pe=0;pe<Q.length;pe+=1)P(Q[pe]);ye=!1},d(G){G&&k(e),Y&&Y.d(),G&&k(h),G&&k(g),G&&k(M),G&&k(D),G&&k(O),j(A,G),G&&k(L),G&&k(I),G&&k(F),G&&k(V),G&&k(J),G&&k(x),G&&k(B),G&&k(se);for(let pe=0;pe<te.length;pe+=1)te[pe].d();for(let pe=0;pe<Q.length;pe+=1)Q[pe].d()}}}function IC(n,e,t){let i,s,{collection:l=new fn}=e,o=204,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.deleteRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:204,body:`
|
||
|
null
|
||
|
`}),r.push({code:400,body:`
|
||
|
{
|
||
|
"code": 400,
|
||
|
"message": "Failed to delete record. Make sure that the record is not part of a required relation reference.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`}),i&&r.push({code:403,body:`
|
||
|
{
|
||
|
"code": 403,
|
||
|
"message": "Only admins can access this action.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`}),r.push({code:404,body:`
|
||
|
{
|
||
|
"code": 404,
|
||
|
"message": "The requested resource wasn't found.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`}))},t(3,s=W.getApiExampleUrl(ve.baseUrl)),[l,i,o,s,r,a]}class FC extends Ee{constructor(e){super(),Oe(this,e,IC,LC,De,{collection:0})}}function NC(n){var h,g,v,b,y,C,S,$;let e,t,i,s,l,o,r,a,u,f,c,d;return r=new Ls({props:{js:`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase('${n[1]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
// (Optionally) authenticate
|
||
|
client.users.authViaEmail('test@example.com', '123456');
|
||
|
|
||
|
// Subscribe to changes in any record from the collection
|
||
|
client.realtime.subscribe('${(h=n[0])==null?void 0:h.name}', function (e) {
|
||
|
console.log(e.record);
|
||
|
});
|
||
|
|
||
|
// Subscribe to changes in a single record
|
||
|
client.realtime.subscribe('${(g=n[0])==null?void 0:g.name}/RECORD_ID', function (e) {
|
||
|
console.log(e.record);
|
||
|
});
|
||
|
|
||
|
// Unsubscribe
|
||
|
client.realtime.unsubscribe() // remove all subscriptions
|
||
|
client.realtime.unsubscribe('${(v=n[0])==null?void 0:v.name}') // remove only the collection subscription
|
||
|
client.realtime.unsubscribe('${(b=n[0])==null?void 0:b.name}/RECORD_ID') // remove only the record subscription
|
||
|
`,dart:`
|
||
|
import 'package:pocketbase/pocketbase.dart';
|
||
|
|
||
|
final client = PocketBase('${n[1]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
// (Optionally) authenticate
|
||
|
client.users.authViaEmail('test@example.com', '123456');
|
||
|
|
||
|
// Subscribe to changes in any record from the collection
|
||
|
client.realtime.subscribe('${(y=n[0])==null?void 0:y.name}', (e) {
|
||
|
print(e.record);
|
||
|
});
|
||
|
|
||
|
// Subscribe to changes in a single record
|
||
|
client.realtime.subscribe('${(C=n[0])==null?void 0:C.name}/RECORD_ID', (e) {
|
||
|
print(e.record);
|
||
|
});
|
||
|
|
||
|
// Unsubscribe
|
||
|
client.realtime.unsubscribe() // remove all subscriptions
|
||
|
client.realtime.unsubscribe('${(S=n[0])==null?void 0:S.name}') // remove only the collection subscription
|
||
|
client.realtime.unsubscribe('${($=n[0])==null?void 0:$.name}/RECORD_ID') // remove only the record subscription
|
||
|
`}}),c=new _n({props:{content:JSON.stringify({action:"create",record:W.dummyCollectionRecord(n[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')}}),{c(){e=_("div"),e.innerHTML=`<strong class="label label-primary">SSE</strong>
|
||
|
<div class="content"><p>/api/realtime</p></div>`,t=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 "Event data format" 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'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'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(),q(r.$$.fragment),a=T(),u=_("div"),u.textContent="Event data format",f=T(),q(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){w(M,e,D),w(M,t,D),w(M,i,D),w(M,s,D),w(M,l,D),w(M,o,D),H(r,M,D),w(M,a,D),w(M,u,D),w(M,f,D),H(c,M,D),d=!0},p(M,[D]){var L,I,F,V,J,x,B,se;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('${(I=M[0])==null?void 0:I.name}/RECORD_ID', function (e) {
|
||
|
console.log(e.record);
|
||
|
});
|
||
|
|
||
|
// Unsubscribe
|
||
|
client.realtime.unsubscribe() // remove all subscriptions
|
||
|
client.realtime.unsubscribe('${(F=M[0])==null?void 0:F.name}') // remove only the collection subscription
|
||
|
client.realtime.unsubscribe('${(V=M[0])==null?void 0:V.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('${(J=M[0])==null?void 0:J.name}', (e) {
|
||
|
print(e.record);
|
||
|
});
|
||
|
|
||
|
// Subscribe to changes in a single record
|
||
|
client.realtime.subscribe('${(x=M[0])==null?void 0:x.name}/RECORD_ID', (e) {
|
||
|
print(e.record);
|
||
|
});
|
||
|
|
||
|
// Unsubscribe
|
||
|
client.realtime.unsubscribe() // remove all subscriptions
|
||
|
client.realtime.unsubscribe('${(B=M[0])==null?void 0:B.name}') // remove only the collection subscription
|
||
|
client.realtime.unsubscribe('${(se=M[0])==null?void 0:se.name}/RECORD_ID') // remove only the record subscription
|
||
|
`),r.$set(O);const A={};D&1&&(A.content=JSON.stringify({action:"create",record:W.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&&k(e),M&&k(t),M&&k(i),M&&k(s),M&&k(l),M&&k(o),j(r,M),M&&k(a),M&&k(u),M&&k(f),j(c,M)}}}function RC(n,e,t){let i,{collection:s=new fn}=e;return n.$$set=l=>{"collection"in l&&t(0,s=l.collection)},t(1,i=W.getApiExampleUrl(ve.baseUrl)),[s,i]}class HC extends Ee{constructor(e){super(),Oe(this,e,RC,NC,De,{collection:0})}}function Zd(n,e,t){const i=n.slice();return i[14]=e[t],i}function Gd(n,e,t){const i=n.slice();return i[14]=e[t],i}function Xd(n){let e,t,i,s;var l=n[14].component;function o(r){return{props:{collection:r[3]}}}return l&&(t=new l(o(n))),{c(){e=_("div"),t&&q(t.$$.fragment),i=T(),p(e,"class","tab-item active")},m(r,a){w(r,e,a),t&&H(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){Ae();const f=t;P(f.$$.fragment,1,0,()=>{j(f,1)}),Pe()}l?(t=new l(o(r)),q(t.$$.fragment),E(t.$$.fragment,1),H(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&&k(e),t&&j(t)}}}function Qd(n,e){let t,i,s,l=e[4]===e[14].id&&Xd(e);return{key:n,first:null,c(){t=Je(),l&&l.c(),i=Je(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[4]===e[14].id?l?(l.p(e,r),r&16&&E(l,1)):(l=Xd(e),l.c(),E(l,1),l.m(i.parentNode,i)):l&&(Ae(),P(l,1,1,()=>{l=null}),Pe())},i(o){s||(E(l),s=!0)},o(o){P(l),s=!1},d(o){o&&k(t),l&&l.d(o),o&&k(i)}}}function jC(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=Zd(n,l,r),u=o(a);i.set(u,t[r]=Qd(u,a))}return{c(){e=_("div");for(let r=0;r<t.length;r+=1)t[r].c();p(e,"class","tabs-content")},m(r,a){w(r,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(r,a){a&56&&(l=r[5],Ae(),t=vt(t,a,o,1,r,l,i,e,Gt,Qd,null,Zd),Pe())},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&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function xd(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"),ie(t,"active",e[4]===e[14].id),this.first=t},m(c,d){w(c,t,d),m(t,i),m(i,l),m(t,o),r||(a=[X(t,"click",u),X(t,"keydown",vm(f))],r=!0)},p(c,d){e=c,d&48&&ie(t,"active",e[4]===e[14].id)},d(c){c&&k(t),r=!1,Xe(a)}}}function qC(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=Gd(n,f,d),g=c(h);u.set(g,a[d]=xd(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){w(d,e,h),m(e,t),m(t,s),m(e,l),w(d,o,h),w(d,r,h);for(let g=0;g<a.length;g+=1)a[g].m(r,null)},p(d,h){h&8&&i!==(i=d[3].name+"")&&ae(s,i),h&114&&(f=d[5],a=vt(a,h,c,1,d,f,u,r,Mn,xd,null,Gd))},d(d){d&&k(e),d&&k(o),d&&k(r);for(let h=0;h<a.length;h+=1)a[h].d()}}}function VC(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[8]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function zC(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[VC],header:[qC],default:[jC]},$$scope:{ctx:n}};return e=new mi({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){q(e.$$.fragment)},m(s,l){H(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),j(e,s)}}}function BC(n,e,t){const i=[{id:"list",label:"List",component:iC},{id:"view",label:"View",component:oC},{id:"create",label:"Create",component:vC},{id:"update",label:"Update",component:PC},{id:"delete",label:"Delete",
|
||
|
<span class="txt">Upload new file</span>`,p(t,"type","file"),p(t,"class","hidden"),t.multiple=n[5],p(s,"type","button"),p(s,"class","btn btn-secondary btn-sm btn-block"),p(e,"class","list-item btn-list-item")},m(r,a){w(r,e,a),m(e,t),n[16](t),m(e,i),m(e,s),l||(o=[X(t,"change",n[17]),X(s,"click",n[18])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&k(e),n[16](null),l=!1,Xe(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 y=D=>D[25];for(let D=0;D<b.length;D+=1){let O=np(n,b,D),A=y(O);d.set(A,c[D]=ip(A,O))}let C=n[0],S=[];for(let D=0;D<C.length;D+=1)S[D]=sp(tp(n,C,D));const $=D=>P(S[D],1,1,()=>{S[D]=null});let M=!n[8]&&lp(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=W.getFieldTypeIcon(n[3].type)),p(l,"class","txt"),p(e,"for",a=n[21]),p(f,"class","files-list")},m(D,O){w(D,e,O),m(e,t),m(e,s),m(e,l),m(l,r),w(D,u,O),w(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=W.getFieldTypeIcon(D[3].type)))&&p(t,"class",i),(!v||O&8)&&o!==(o=D[3].name+"")&&ae(r,o),(!v||O&2097152&&a!==(a=D[21]))&&p(e,"for",a),O&1558&&(b=D[4],Ae(),c=vt(c,O,y,1,D,b,d,f,Gt,ip,h,np),Pe()),O&2049){C=D[0];let A;for(A=0;A<C.length;A+=1){const L=tp(D,C,A);S[A]?(S[A].p(L,O),E(S[A],1)):(S[A]=sp(L),S[A].c(),E(S[A],1),S[A].m(f,g))}for(Ae(),A=C.length;A<S.length;A+=1)$(A);Pe()}D[8]?M&&(M.d(1),M=null):M?M.p(D,O):(M=lp(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&&k(e),D&&k(u),D&&k(f);for(let O=0;O<c.length;O+=1)c[O].d();xt(S,D),M&&M.d(),n[19](null)}}}function U4(n){let e,t;return e=new Re({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[B4,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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){j(e,i)}}}function W4(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new Dn}=e,c,d;function h(A){W.removeByValue(u,A),t(1,u)}function g(A){W.pushUnique(u,A),t(1,u)}function v(A){W.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 y=A=>h(A),C=A=>g(A),S=A=>v(A);function $(A){de[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){de[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=W.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=W.toArray(u))),n.$$.dirty&8&&t(5,i=((A=f.options)==null?void 0:A.maxSelect)>1),n.$$.dirty&4128&&W.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=W.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((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,y,C,S,$,M,D,O]}class Y4 extends Ee{constructor(e){super(),Oe(this,e,W4,U4,De,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function op(n){let e,t;return{c(){e=_("small"),t=N(n[1]),p(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&ae(t,i[1])},d(i){i&&k(e)}}}function K4(n){let e,t,i,s,l,o=n[0].id
|
||
|
`,p(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function mM(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 pM({props:l}),de.push(()=>Fe(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(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){j(e,o)}}}function gM(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 iM({props:l}),de.push(()=>Fe(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(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){j(e,o)}}}function _M(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 Y4({props:u}),de.push(()=>Fe(e,"value",o)),de.push(()=>Fe(e,"uploadedFiles",r)),de.push(()=>Fe(e,"deletedFileIndexes",a)),{c(){q(e.$$.fragment)},m(f,c){H(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){j(e,f)}}}function bM(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 C4({props:l}),de.push(()=>Fe(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(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){j(e,o)}}}function vM(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 k4({props:l}),de.push(()=>Fe(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(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){j(e,o)}}}function yM(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 _4({props:l}),de.push(()=>Fe(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(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){j(e,o)}}}function kM(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 p4({props:l}),de.push(()=>Fe(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(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){j(e,o)}}}function wM(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 u4({props:l}),de.push(()=>Fe(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(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){j(e,o)}}}function $M(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 l4({props:l}),de.push(()=>Fe(e,"value",
|
||
|
<span class="txt">Delete</span>`,p(e,"tabindex","0"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function DM(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]&&mp(n);return{c(){e=_("h4"),i=N(t),s=T(),o=N(l),r=N(" record"),a=T(),c&&c.c(),u=Je()},m(d,h){w(d,e,h),m(e,i),m(e,s),m(e,o),m(e,r),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&ae(i,t),(!f||h[0]&1)&&l!==(l=d[0].name+"")&&ae(o,l),!d[2].isNew&&d[10]?c?(c.p(d,h),h[0]&1028&&E(c,1)):(c=mp(d),c.c(),E(c,1),c.m(u.parentNode,u)):c&&(Ae(),P(c,1,1,()=>{c=null}),Pe())},i(d){f||(E(c),f=!0)},o(d){P(c),f=!1},d(d){d&&k(e),d&&k(a),c&&c.d(d),d&&k(u)}}}function OM(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],ie(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,r),u||(f=X(e,"click",n[17]),u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&ae(r,o),d[0]&640&&a!==(a=!c[9]||c[7])&&(s.disabled=a),d[0]&128&&ie(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function EM(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[OM],header:[DM],default:[MM]},$$scope:{ctx:n}};return e=new mi({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){q(e.$$.fragment)},m(s,l){H(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),j(e,s)}}}function gp(n){return JSON.stringify(n)}function AM(n,e,t){let i,s,l,o;const r=on(),a="record_"+W.randomString(5);let{collection:u}=e,f,c=null,d=new fo,h=!1,g=!1,v={},b={},y="";function C(U){return $(U),t(8,g=!0),f==null?void 0:f.show()}function S(){return f==null?void 0:f.hide()}async function $(U){hi({}),c=U||{},t(2,d=U!=null&&U.clone?U.clone():new fo),t(3,v={}),t(4,b={}),await ii(),t(15,y=gp(d))}function M(){if(h||!l)return;t(7,h=!0);const U=O();let Z;d.isNew?Z=ve.records.create(u==null?void 0:u.id,U):Z=ve.records.update(u==null?void 0:u.id,d.id,U),Z.then(async $e=>{cn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),S(),r("save",$e)}).catch($e=>{ve.errorResponseHandler($e)}).finally(()=>{t(7,h=!1)})}function D(){!(c!=null&&c.id)||pi("Do you really want to delete the selected record?",()=>ve.records.delete(c["@collectionId"],c.id).then(()=>{S(),cn("Successfully deleted record."),r("delete",c)}).catch(U=>{ve.errorResponseHandler(U)}))}function O(){const U=(d==null?void 0:d.export())||{},Z=new FormData,$e={};for(const je of(u==null?void 0:u.schema)||[])$e[je.name]=je;for(const je in U)!$e[je]||(typeof U[je]>"u"&&(U[je]=null),W.addValueToFormData(Z,je,U[je]));for(const je in v){const Be=W.toArray(v[je]);for(const G of Be)Z.append(je,G)}for(const je in b){const Be=W.toArray(b[je]);for(const G of Be)Z.append(je+"."+G,"")}return Z}const A=()=>S(),L=()=>D();function I(U,Z){n.$$.not_equal(d[Z.name],U)&&(d[Z.name]=U,t(2,d))}function F(U,Z){n.$$.not_equal(d[Z.name],U)&&(d[Z.name]=U,t(2,d))}function V(U,Z){n.$$.not_equal(d[Z.name],U)&&(d[Z.name]=U,t(2,d))}function J(U,Z){n.$$.not_equal(d[Z.name],U)&&(d[Z.name]=U,t(2,d))}function x(U,Z){n.$$.not_equal(d[Z.name],U)&&(d[Z.name]=U,t(2,d))}function B(U,Z){n.$$.not_equal(d[Z.name],U)&&(d[Z.name]=U,t(2,d))}function se(U,Z){n.$$.not_equal(d[Z.name],U)&&(d[Z.name]=U,t(2,d))}function K(U,Z){n.$$.not_equal(d[Z.name],U)&&(d[Z.name]=U,t(2,d))}function te(U,Z){n.$$.not_equal(d[Z.name],U)&&(d[Z.name]=U,t(2,d))}function ee(U,Z){n.$$.not_equal(v[Z.name],U)&&(v[Z.name]=U,t(3,v))}function me(U,Z){n.$$.not_equal(b[Z.name],U)&&(b[Z.name]=U,t(4,b))}function
|
||
|
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Dp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[28]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Op(n,e){let t,i,s;return i=new U_({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=Je(),q(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),H(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&&k(t),j(i,l)}}}function Ep(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,g,v=[],b=new Map,y,C,S,$,M,D,O,A,L,I,F,V;function J(){return e[25](e[35])}h=new Qo({props:{id:e[35].id}});let x=e[11];const B=te=>te[38].name;for(let te=0;te<x.length;te+=1){let ee=Sp(e,x,te),me=B(ee);b.set(me,v[te]=Op(me,ee))}S=new $i({props:{date:e[35].created}}),D=new $i({props:{date:e[35].updated}});function se(){return e[26](e[35])}function K(...te){return e[27](e[35],...te)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),l=_("input"),a=T(),u=_("label"),c=T(),d=_("td"),q(h.$$.fragment),g=T();for(let te=0;te<v.length;te+=1)v[te].c();y=T(),C=_("td"),q(S.$$.fragment),$=T(),M=_("td"),q(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(te,ee){w(te,t,ee),m(t,i),m(i,s),m(s,l),m(s,a),m(s,u),m(t,c),m(t,d),H(h,d,null),m(t,g);for(let me=0;me<v.length;me+=1)v[me].m(t,null);m(t,y),m(t,C),H(S,C,null),m(t,$),m(t,M),H(D,M,null),m(t,O),m(t,A),m(t,L),I=!0,F||(V=[X(l,"change",J),X(s,"click",ei(e[19])),X(t,"click",se),X(t,"keydown",K)],F=!0)},p(te,ee){e=te,(!I||ee[0]&8&&o!==(o="checkbox_"+e[35].id))&&p(l,"id",o),(!I||ee[0]&40&&r!==(r=e[5][e[35].id]))&&(l.checked=r),(!I||ee[0]&8&&f!==(f="checkbox_"+e[35].id))&&p(u,"for",f);const me={};ee[0]&8&&(me.id=e[35].id),h.$set(me),ee[0]&2056&&(x=e[11],Ae(),v=vt(v,ee,B,1,e,x,b,t,Gt,Op,y,Sp),Pe());const ge={};ee[0]&8&&(ge.date=e[35].created),S.$set(ge);const Q={};ee[0]&8&&(Q.date=e[35].updated),D.$set(Q)},i(te){if(!I){E(h.$$.fragment,te);for(let ee=0;ee<x.length;ee+=1)E(v[ee]);E(S.$$.fragment,te),E(D.$$.fragment,te),I=!0}},o(te){P(h.$$.fragment,te);for(let ee=0;ee<v.length;ee+=1)P(v[ee]);P(S.$$.fragment,te),P(D.$$.fragment,te),I=!1},d(te){te&&k(t),j(h);for(let ee=0;ee<v.length;ee+=1)v[ee].d();j(S),j(D),F=!1,Xe(V)}}}function Ap(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){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&8&&i!==(i=r[3].length+"")&&ae(s,i),a[0]&16&&ae(o,r[4])},d(r){r&&k(e)}}}function Pp(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"),ie(t,"btn-loading",n[8]),ie(t,"btn-disabled",n[8]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=X(t,"click",n[29]),a=!0)},p(f,c){c[0]&24&&l!==(l=f[4]-f[3].length+"")&&ae(o,l),c[0]&256&&ie(t,"btn-loading",f[8]),c[0]&256&&ie(t,"btn-disabled",f[8])},d(f){f&&k(e),a=!1,u()}}}function Lp(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,h,g,v,b,y,C;return{c(){e=_("div"),t=_("div"),i=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-outli
|
||
|
<span class="txt">API Preview</span>`,b=T(),y=_("button"),y.innerHTML=`<i class="ri-add-line"></i>
|
||
|
<span class="txt">New record</span>`,C=T(),q(S.$$.fragment),$=T(),q(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(y,"type","button"),p(y,"class","btn btn-expanded"),p(g,"class","btns-group"),p(e,"class","page-header")},m(x,B){w(x,e,B),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),H(d,u,null),m(e,h),m(e,g),m(g,v),m(g,b),m(g,y),w(x,C,B),H(S,x,B),w(x,$,B),H(M,x,B),A=!0,L||(I=[Ye($t.call(null,f,{text:"Edit collection",position:"right"})),X(f,"click",n[12]),X(v,"click",n[14]),X(y,"click",n[15])],L=!0)},p(x,B){(!A||B&4)&&o!==(o=x[2].name+"")&&ae(r,o);const se={};B&1&&(se.value=x[0]),B&4&&(se.autocompleteCollection=x[2]),S.$set(se);const K={};B&4&&(K.collection=x[2]),!D&&B&1&&(D=!0,K.filter=x[0],He(()=>D=!1)),!O&&B&2&&(O=!0,K.sort=x[1],He(()=>O=!1)),M.$set(K)},i(x){A||(E(d.$$.fragment,x),E(S.$$.fragment,x),E(M.$$.fragment,x),A=!0)},o(x){P(d.$$.fragment,x),P(S.$$.fragment,x),P(M.$$.fragment,x),A=!1},d(x){x&&k(e),j(d),x&&k(C),j(S,x),x&&k($),n[17](null),j(M,x),L=!1,Xe(I)}}}function oT(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){w(u,e,f),m(e,t),m(e,i),m(e,s),m(e,l),m(e,o),r||(a=X(o,"click",n[11]),r=!0)},p:oe,d(u){u&&k(e),r=!1,a()}}}function rT(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||
|
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function aT(n){let e,t,i,s,l,o,r,a,u;const f=[sT,iT,nT],c=[];function d(b,y){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let h={};s=new Ja({props:h}),n[21](s);let g={};o=new UC({props:g}),n[22](o);let v={collection:n[2]};return a=new B_({props:v}),n[23](a),a.$on("save",n[24]),a.$on("delete",n[25]),{c(){t.c(),i=T(),q(s.$$.fragment),l=T(),q(o.$$.fragment),r=T(),q(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),H(s,b,y),w(b,l,y),H(o,b,y),w(b,r,y),H(a,b,y),u=!0},p(b,[y]){let C=e;e=d(b),e===C?c[e].p(b,y):(Ae(),P(c[C],1,1,()=>{c[C]=null}),Pe(),t=c[e],t?t.p(b,y):(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={};y&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&&k(i),n[21](null),j(s,b),b&&k(l),n[22](null),j(o,b),b&&k(r),n[23](null),j(a,b)}}}function uT(n,e,t){let i,s,l,o,r,a;_t(n,ci,K=>t(2,s=K)),_t(n,Ds,K=>t(10,l=K)),_t(n,Ro,K=>t(26,o=K)),_t(n,Rt,K=>t(27,r=K)),_t(n,sa,K=>t(8,a=K)),dn(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 y(){t(9,b=s.id),t(1,v="-created"),t(0,g="")}_$(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=K=>t(0,g=K.detail);function A(K){de[K?"unshift":"push"](()=>{h=K,t(6,h)})}function L(K){g=K,t(0,g)}function I(K){v=K,t(1,v)}const F=K=>d==null?void 0:d.show(K==null?void 0:K.detail);function V(K){de[K?"unshift":"push"](()=>{f=K,t(3,f)})}function J(K){de[K?"unshift":"push"](()=>{c=K,t(4,c)})}function x(K){de[K?"unshift":"push"](()=>{d=K,t(5,d)})}const B=()=>h==null?void 0:h.load(),se=()=>h==null?void 0:h.load();return n.$$.update=()=>{if(n.$$.dirty&1024&&t(7,i=l.filter(K=>K.name!="profiles")),n.$$.dirty&516&&(s==null?void 0:s.id)&&b!=s.id&&y(),n.$$.dirty&7&&(v||g||(s==null?void 0:s.id))){const K=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:g,sort:v}).toString();Si("/collections?"+K)}},[g,v,s,f,c,d,h,i,a,b,l,C,S,$,M,D,O,A,L,I,F,V,J,x,B,se]}class fT extends Ee{constructor(e){super(),Oe(this,e,uT,aT,De,{})}}function Ip(n){let e,t;return e=new Re({props:{class:"form-field disabled",name:"id",$$slots:{default:[cT,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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){j(e,i)}}}function cT(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",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[31]),p(r,"type","text"),p(r,"id",a=n[31]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[1]&1&&l!==(l=f[31])&&p(e,"for",l),c[1]&1&&a!==(a=f[31])&&p(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function Fp(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-shield-check-line"></i>',p(e,"class","form-field-addon txt-success")},m(s,l){w(s,e,l),t||(i=Ye($t.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function dT(n){let e,t,i,s,l,o,r,a,u,f,c,d=n[1].verified&&Fp();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",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[31]),p(a,"type","email"),p(a,"autocomplete","off"),p(a,"id",u=n[31]),a.required=!0},m(h,g){w(h,e,g),m(e,t),m(e,i),m(e,s),w(h,o,g),d&&d.m(h,g),w(h,r,g),w(h,a,g),Me(a,n[2]),f||(c=X(a,"input",n[19]),f=!0)},p(h,g){g[1]&1&&l!==(l=h[31])&&p(e,"for",l),h[1].verified?d||(d=Fp(),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){w(s,e,l),t||(i=X(e,"click",n[16]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function vT(n){let e,t,i,s,l=!n[1].verified&&qp(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),w(o,e,r),w(o,t,r),i||(s=X(t,"click",n[17]),i=!0)},p(o,r){o[1].verified?l&&(l.d(1),l=null):l?l.p(o,r):(l=qp(o),l.c(),l.m(e.parentNode,e))},d(o){l&&l.d(o),o&&k(e),o&&k(t),i=!1,s()}}}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&&jp(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],ie(l,"btn-loading",n[5])},m(g,v){h&&h.m(g,v),w(g,e,v),w(g,t,v),m(t,i),w(g,s,v),w(g,l,v),m(l,o),m(o,a),f=!0,c||(d=X(t,"click",n[18]),c=!0)},p(g,v){g[1].isNew?h&&(Ae(),P(h,1,1,()=>{h=null}),Pe()):h?(h.p(g,v),v[0]&2&&E(h,1)):(h=jp(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")&&ae(a,r),(!f||v[0]&1056&&u!==(u=!g[10]||g[5]))&&(l.disabled=u),v[0]&32&&ie(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&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function kT(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[yT],header:[bT],default:[_T]},$$scope:{ctx:n}};return e=new mi({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){q(e.$$.fragment)},m(s,l){H(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),j(e,s)}}}function wT(n,e,t){let i;const s=on(),l="user_"+W.randomString(5);let o,r=new co,a=!1,u=!1,f="",c="",d="",h=!1,g=!0;function v(te){return y(te),t(6,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(te){hi({}),t(1,r=te!=null&&te.clone?te.clone():new co),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 te={email:f};(r.isNew||h)&&(te.password=c,te.passwordConfirm=d);let ee;r.isNew?ee=ve.users.create(te):ee=ve.users.update(r.id,te),ee.then(async me=>{g&&M(!1),t(6,u=!1),b(),cn(r.isNew?"Successfully created user.":"Successfully updated user."),s("save",me)}).catch(me=>{ve.errorResponseHandler(me)}).finally(()=>{t(5,a=!1)})}function $(){!(r!=null&&r.id)||pi("Do you really want to delete the selected user?",()=>ve.users.delete(r.id).then(()=>{t(6,u=!1),b(),cn("Successfully deleted user."),s("delete",r)}).catch(te=>{ve.errorResponseHandler(te)}))}function M(te=!0){return ve.users.requestVerification(r.isNew?f:r.email).then(()=>{t(6,u=!1),b(),te&&cn(`Successfully sent verification email to ${r.email}.`)}).catch(ee=>{ve.errorResponseHandler(ee)})}const D=()=>M(),O=()=>$(),A=()=>b();function L(){f=this.value,t(2,f)}function I(){h=this.checked,t(3,h)}function F(){c=this.value,t(7,c)}function V(){d=this.value,t(8,d)}function J(){g=this.checked,t(9,g)}const x=()=>i&&u?(pi("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),b()}),!1):!0;function B(te){de[te?"unshift":"push"](()=>{o=te,t(4,o)})}function se(te){rt.call(this,n,te)}function K(te){rt.call(this,n,te)}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,I,F,V,J,x,B,se,K]}class $T extends Ee{constructor(e){super(),Oe(this,e,wT,kT,De,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Vp(n,e,t){const i=n.slice();return i[40]=e[t],i}function zp(n,e,t){const i=n.slice();return i[43]=e[t],i}function Bp(n,e,t){const i=n.slice();return i[43]=e[t],i}function ST(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,O,A,L,I=[],F=new Map,V,J,x,B,se,K,te,ee,me,ge,Q=[],ce=new Map,ye,Y,_e,U,Z,$e;a=new Uo({}),a.$on("refresh",n[17]),g=new Bo({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:[
|
||
|
<span class="txt">New user</span>`,h=T(),q(g.$$.fragment),v=T(),b=_("div"),y=_("table"),C=_("thead"),S=_("tr"),q($.$$.fragment),D=T(),q(O.$$.fragment),L=T();for(let be=0;be<I.length;be+=1)I[be].c();V=T(),q(J.$$.fragment),B=T(),q(se.$$.fragment),te=T(),ee=_("th"),me=T(),ge=_("tbody");for(let be=0;be<Q.length;be+=1)Q[be].c();Ge&&Ge.c(),ye=T(),st&&st.c(),Y=T(),dt&&dt.c(),_e=Je(),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(ee,"class","col-type-action min-width"),p(y,"class","table"),ie(y,"table-loading",n[10]),p(b,"class","table-wrapper")},m(be,Ie){w(be,e,Ie),m(e,t),m(t,i),m(i,s),m(e,l),m(e,o),m(e,r),H(a,e,null),m(e,u),m(e,f),m(e,c),m(e,d),w(be,h,Ie),H(g,be,Ie),w(be,v,Ie),w(be,b,Ie),m(b,y),m(y,C),m(C,S),H($,S,null),m(S,D),H(O,S,null),m(S,L);for(let nt=0;nt<I.length;nt+=1)I[nt].m(S,null);m(S,V),H(J,S,null),m(S,B),H(se,S,null),m(S,te),m(S,ee),m(y,me),m(y,ge);for(let nt=0;nt<Q.length;nt+=1)Q[nt].m(ge,null);Ge&&Ge.m(ge,null),w(be,ye,Ie),st&&st.m(be,Ie),w(be,Y,Ie),dt&&dt.m(be,Ie),w(be,_e,Ie),U=!0,Z||($e=[Ye($t.call(null,o,{text:"Edit profile collection",position:"right"})),X(o,"click",n[16]),X(d,"click",n[18])],Z=!0)},p(be,Ie){(!U||Ie[0]&16384)&&ae(s,be[14]);const nt={};Ie[0]&8&&(nt.value=be[3]),g.$set(nt);const ct={};Ie[1]&131072&&(ct.$$scope={dirty:Ie,ctx:be}),!M&&Ie[0]&16&&(M=!0,ct.sort=be[4],He(()=>M=!1)),$.$set(ct);const yt={};Ie[1]&131072&&(yt.$$scope={dirty:Ie,ctx:be}),!A&&Ie[0]&16&&(A=!0,yt.sort=be[4],He(()=>A=!1)),O.$set(yt),Ie[0]&4096&&(ue=be[12],I=vt(I,Ie,we,1,be,ue,F,S,Mn,Up,V,Bp));const at={};Ie[1]&131072&&(at.$$scope={dirty:Ie,ctx:be}),!x&&Ie[0]&16&&(x=!0,at.sort=be[4],He(()=>x=!1)),J.$set(at);const Ot={};Ie[1]&131072&&(Ot.$$scope={dirty:Ie,ctx:be}),!K&&Ie[0]&16&&(K=!0,Ot.sort=be[4],He(()=>K=!1)),se.$set(Ot),Ie[0]&5450&&(Ce=be[1],Ae(),Q=vt(Q,Ie,ze,1,be,Ce,ce,ge,Gt,Jp,null,Vp),Pe(),!Ce.length&&Ge?Ge.p(be,Ie):Ce.length?Ge&&(Ge.d(1),Ge=null):(Ge=Wp(be),Ge.c(),Ge.m(ge,null))),Ie[0]&1024&&ie(y,"table-loading",be[10]),be[1].length?st?st.p(be,Ie):(st=Zp(be),st.c(),st.m(Y.parentNode,Y)):st&&(st.d(1),st=null),be[1].length&&be[13]?dt?dt.p(be,Ie):(dt=Gp(be),dt.c(),dt.m(_e.parentNode,_e)):dt&&(dt.d(1),dt=null)},i(be){if(!U){E(a.$$.fragment,be),E(g.$$.fragment,be),E($.$$.fragment,be),E(O.$$.fragment,be),E(J.$$.fragment,be),E(se.$$.fragment,be);for(let Ie=0;Ie<Ce.length;Ie+=1)E(Q[Ie]);U=!0}},o(be){P(a.$$.fragment,be),P(g.$$.fragment,be),P($.$$.fragment,be),P(O.$$.fragment,be),P(J.$$.fragment,be),P(se.$$.fragment,be);for(let Ie=0;Ie<Q.length;Ie+=1)P(Q[Ie]);U=!1},d(be){be&&k(e),j(a),be&&k(h),j(g,be),be&&k(v),be&&k(b),j($),j(O);for(let Ie=0;Ie<I.length;Ie+=1)I[Ie].d();j(J),j(se);for(let Ie=0;Ie<Q.length;Ie+=1)Q[Ie].d();Ge&&Ge.d(),be&&k(ye),st&&st.d(be),be&&k(Y),dt&&dt.d(be),be&&k(_e),Z=!1,Xe($e)}}}function CT(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||
|
<h1>Loading users...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function MT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function TT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",p(t,"class",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function Up(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=W.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){w(h,t,g),m(t,i),m(i,s),m(i,o),m(i,r),m(r,a),m(r,f)},p(h,g){e=h,g[0]&4096&&l!==(l=W.getFieldTypeIcon(e[43].type))&&p(s,"class",l),g[0]&4096&&u!==(u=e[43].name+"")&&ae(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&&k(t)}}}function DT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function OT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function Wp(n){let e;function t(l,o){return l[10]?AT:ET}let i=t(n),s=i(n);return{c(){s.c(),e=Je()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function ET(n){var r;let e,t,i,s,l,o=((r=n[3])==null?void 0:r.length)&&Yp(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){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[3])!=null&&f.length?o?o.p(a,u):(o=Yp(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function AT(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||
|
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Yp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[26]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Kp(n,e){let t,i,s;return i=new U_({props:{field:e[43],record:e[40].profile||{}}}),{key:n,first:null,c(){t=Je(),q(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),H(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&&k(t),j(i,l)}}}function Jp(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,y=[],C=new Map,S,$,M,D,O,A,L,I,F,V,J,x,B,se,K;s=new Qo({props:{id:e[40].id}});let te=e[12];const ee=Q=>Q[43].name;for(let Q=0;Q<te.length;Q+=1){let ce=zp(e,te,Q),ye=ee(ce);C.set(ye,y[Q]=Kp(ye,ce))}M=new $i({props:{date:e[40].created}}),A=new $i({props:{date:e[40].updated}});function me(){return e[24](e[40])}function ge(){return e[25](e[40])}return{key:n,first:null,c(){t=_("tr"),i=_("td"),q(s.$$.fragment),l=T(),o=_("td"),r=_("div"),a=_("span"),f=N(u),d=T(),h=_("span"),v=N(g),b=T();for(let Q=0;Q<y.length;Q+=1)y[Q].c();S=T(),$=_("td"),q(M.$$.fragment),D=T(),O=_("td"),q(A.$$.fragment),L=T(),I=_("td"),F=_("button"),F.innerHTML=`<i class="ri-user-settings-line"></i>
|
||
|
<span class="txt">Edit user</span>`,V=T(),J=_("button"),J.innerHTML=`<i class="ri-profile-line"></i>
|
||
|
<span class="txt">Edit profile</span>`,x=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"),ie(h,"label-success",e[40].verified),ie(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(F,"type","button"),p(F,"class","btn btn-sm btn-outline"),p(J,"type","button"),p(J,"class","btn btn-sm m-l-10"),p(I,"class","col-type-action min-width"),this.first=t},m(Q,ce){w(Q,t,ce),m(t,i),H(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 ye=0;ye<y.length;ye+=1)y[ye].m(t,null);m(t,S),m(t,$),H(M,$,null),m(t,D),m(t,O),H(A,O,null),m(t,L),m(t,I),m(I,F),m(I,V),m(I,J),m(t,x),B=!0,se||(K=[X(F,"click",ei(me)),X(J,"click",ei(ge))],se=!0)},p(Q,ce){e=Q;const ye={};ce[0]&2&&(ye.id=e[40].id),s.$set(ye),(!B||ce[0]&2)&&u!==(u=e[40].email+"")&&ae(f,u),(!B||ce[0]&2&&c!==(c=e[40].email))&&p(a,"title",c),(!B||ce[0]&2)&&g!==(g=e[40].verified?"Verified":"Unverified")&&ae(v,g),ce[0]&2&&ie(h,"label-success",e[40].verified),ce[0]&2&&ie(h,"label-warning",!e[40].verified),ce[0]&4098&&(te=e[12],Ae(),y=vt(y,ce,ee,1,e,te,C,t,Gt,Kp,S,zp),Pe());const Y={};ce[0]&2&&(Y.date=e[40].created),M.$set(Y);const _e={};ce[0]&2&&(_e.date=e[40].updated),A.$set(_e)},i(Q){if(!B){E(s.$$.fragment,Q);for(let ce=0;ce<te.length;ce+=1)E(y[ce]);E(M.$$.fragment,Q),E(A.$$.fragment,Q),B=!0}},o(Q){P(s.$$.fragment,Q);for(let ce=0;ce<y.length;ce+=1)P(y[ce]);P(M.$$.fragment,Q),P(A.$$.fragment,Q),B=!1},d(Q){Q&&k(t),j(s);for(let ce=0;ce<y.length;ce+=1)y[ce].d();j(M),j(A),se=!1,Xe(K)}}}function Zp(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){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&2&&i!==(i=r[1].length+"")&&ae(s,i),a[0]&4&&ae(o,r[2])},d(r){r&&k(e)}}}function Gp(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"),ie(t,"btn-loading",n[10]),ie(t,"btn-disabled",n[10]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=X(t,"click",n[27]),a=!0)},p(f,c){c[0]&6&&l!==(l=f[2]-f[1].length+"")&&ae(o,l),c[0]&1024&&ie(t,"btn-loading",f[10]),c[0]&1024&&ie(t,"btn-disabled",f[10])},d(f){f&&k(e),a=!1,u()}}}function PT(n){let e,t,i,s;const l=[CT,ST],o=[];function r(a,u){return a[11]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Je()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(Ae(),P(o[f],1,1,()=>{o[f]=null}),Pe(),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&&k(i)}}}function LT(n){let e,t,i,s,l,o,r,a;e=new On({props:{$$slots:{default:[PT]},$$scope:{ctx:n}}});let u={};i=new $T({props:u}),n[28](i),i.$on("save",n[29]),i.$on("delete",n[30]);let f={};l=new Ja({props:f}),n[31](l),l.$on("save",n[32]);let c={collection:n[5]};return r=new B_({props:c}),n[33](r),r.$on("save",n[34]),{c(){q(e.$$.fragment),t=T(),q(i.$$.fragment),s=T(),q(l.$$.fragment),o=T(),q(r.$$.fragment)},m(d,h){H(e,d,h),w(d,t,h),H(i,d,h),w(d,s,h),H(l,d,h),w(d,o,h),H(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 y={};h[0]&32&&(y.collection=d[5]),r.$set(y)},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){j(e,d),d&&k(t),n[28](null),j(i,d),d&&k(s),n[31](null),j(l,d),d&&k(o),n[33](null),j(r,d)}}}function IT(n,e,t){let i,s,l,o;_t(n,Ro,U=>t(35,l=U)),_t(n,Rt,U=>t(14,o=U)),dn(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")||"",y=r.get("sort")||
|
||
|
<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.innerHTML=`<span class="txt">Sync</span>
|
||
|
<small class="label label-danger label-sm">Experimental</small>`,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(),y=_("div"),y.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(y,"class","sidebar-title"),p(S,"href","/settings/auth-providers"),p(S,"class","sidebar-list-item"),p(M,"href","/settings/tokens"),p(M,"class","sidebar-list-item"),p(O,"href","/settings/admins"),p(O,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(I,F){w(I,e,F),m(e,t),m(t,i),m(t,s),m(t,l),m(t,o),m(t,r),m(t,a),m(t,u),m(t,f),m(t,c),m(t,d),m(t,h),m(t,g),m(t,v),m(t,b),m(t,y),m(t,C),m(t,S),m(t,$),m(t,M),m(t,D),m(t,O),A||(L=[Ye(jn.call(null,l,{path:"/settings"})),Ye(mn.call(null,l)),Ye(jn.call(null,r,{path:"/settings/mail/?.*"})),Ye(mn.call(null,r)),Ye(jn.call(null,u,{path:"/settings/storage/?.*"})),Ye(mn.call(null,u)),Ye(jn.call(null,h,{path:"/settings/export-collections/?.*"})),Ye(mn.call(null,h)),Ye(jn.call(null,v,{path:"/settings/import-collections/?.*"})),Ye(mn.call(null,v)),Ye(jn.call(null,S,{path:"/settings/auth-providers/?.*"})),Ye(mn.call(null,S)),Ye(jn.call(null,M,{path:"/settings/tokens/?.*"})),Ye(mn.call(null,M)),Ye(jn.call(null,O,{path:"/settings/admins/?.*"})),Ye(mn.call(null,O))],A=!0)},p:oe,i:oe,o:oe,d(I){I&&k(e),A=!1,Xe(L)}}}class zi extends Ee{constructor(e){super(),Oe(this,e,null,NT,De,{})}}function Xp(n,e,t){const i=n.slice();return i[31]=e[t],i}function Qp(n){let e,t;return e=new Re({props:{class:"form-field disabled",name:"id",$$slots:{default:[RT,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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){j(e,i)}}}function RT(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",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","text"),p(r,"id",a=n[30]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[0]&1073741824&&l!==(l=f[30])&&p(e,"for",l),c[0]&1073741824&&a!==(a=f[30])&&p(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function xp(n){let e,t,i,s,l,o,r;function a(){return n[17](n[31])}function u(...f){return n[18](n[31],...f)}return{c(){e=_("figure"),t=_("img"),s=T(),xn(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"tabindex","0"),p(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(f,c){w(f,e,c),m(e,t),m(e,s),o||(r=[X(e,"click",a),X(e,"keydown",u)],o=!0)},p(f,c){n=f,c[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(f){f&&k(e),o=!1,Xe(r)}}}function HT(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",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Me(r,n[3]),u||(f=X(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&Me(r,c[3])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function eh(n){let e,t;return e=new Re({props:{class:"form-field form-field-toggle",$$slots:{default:[jT,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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){j(e,i)}}}
|
||
|
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[15]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function WT(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&nh(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],ie(l,"btn-loading",n[6])},m(g,v){h&&h.m(g,v),w(g,e,v),w(g,t,v),m(t,i),w(g,s,v),w(g,l,v),m(l,o),m(o,a),f=!0,c||(d=X(t,"click",n[16]),c=!0)},p(g,v){g[1].isNew?h&&(Ae(),P(h,1,1,()=>{h=null}),Pe()):h?(h.p(g,v),v[0]&2&&E(h,1)):(h=nh(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")&&ae(a,r),(!f||v[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),v[0]&64&&ie(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&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function YT(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[WT],header:[BT],default:[zT]},$$scope:{ctx:n}};return e=new mi({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){q(e.$$.fragment)},m(s,l){H(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),j(e,s)}}}function KT(n,e,t){let i;const s=on(),l="admin_"+W.randomString(5);let o,r=new $s,a=!1,u=!1,f=0,c="",d="",h="",g=!1;function v(K){return y(K),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(K){hi({}),t(1,r=K!=null&&K.clone?K.clone():new $s),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 K={email:c,avatar:f};(r.isNew||g)&&(K.password=d,K.passwordConfirm=h);let te;r.isNew?te=ve.admins.create(K):te=ve.admins.update(r.id,K),te.then(async ee=>{var me;t(7,u=!1),b(),cn(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ee),((me=ve.authStore.model)==null?void 0:me.id)===ee.id&&ve.authStore.save(ve.authStore.token,ee)}).catch(ee=>{ve.errorResponseHandler(ee)}).finally(()=>{t(6,a=!1)})}function $(){!(r!=null&&r.id)||pi("Do you really want to delete the selected admin?",()=>ve.admins.delete(r.id).then(()=>{t(7,u=!1),b(),cn("Successfully deleted admin."),s("delete",r)}).catch(K=>{ve.errorResponseHandler(K)}))}const M=()=>$(),D=()=>b(),O=K=>t(2,f=K),A=(K,te)=>{(te.code==="Enter"||te.code==="Space")&&(te.preventDefault(),t(2,f=K))};function L(){c=this.value,t(3,c)}function I(){g=this.checked,t(4,g)}function F(){d=this.value,t(8,d)}function V(){h=this.value,t(9,h)}const J=()=>i&&u?(pi("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function x(K){de[K?"unshift":"push"](()=>{o=K,t(5,o)})}function B(K){rt.call(this,n,K)}function se(K){rt.call(this,n,K)}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,I,F,V,J,x,B,se]}class JT extends Ee{constructor(e){super(),Oe(this,e,KT,YT,De,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function ih(n,e,t){const i=n.slice();return i[24]=e[t],i}function ZT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function GT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",p(t,"class",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function XT(n){let e,t,i,s;r
|
||
|
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function lh(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[17]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function oh(n){let e;return{c(){e=_("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function rh(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,g=e[24].email+"",v,b,y,C,S,$,M,D,O,A,L,I,F,V;u=new Qo({props:{id:e[24].id}});let J=e[24].id===e[7].id&&oh();S=new $i({props:{date:e[24].created}}),D=new $i({props:{date:e[24].updated}});function x(){return e[15](e[24])}function B(...se){return e[16](e[24],...se)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("figure"),l=_("img"),r=T(),a=_("td"),q(u.$$.fragment),f=T(),J&&J.c(),c=T(),d=_("td"),h=_("span"),v=N(g),y=T(),C=_("td"),q(S.$$.fragment),$=T(),M=_("td"),q(D.$$.fragment),O=T(),A=_("td"),A.innerHTML='<i class="ri-arrow-right-line"></i>',L=T(),xn(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(se,K){w(se,t,K),m(t,i),m(i,s),m(s,l),m(t,r),m(t,a),H(u,a,null),m(a,f),J&&J.m(a,null),m(t,c),m(t,d),m(d,h),m(h,v),m(t,y),m(t,C),H(S,C,null),m(t,$),m(t,M),H(D,M,null),m(t,O),m(t,A),m(t,L),I=!0,F||(V=[X(t,"click",x),X(t,"keydown",B)],F=!0)},p(se,K){e=se,(!I||K&16&&!xn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const te={};K&16&&(te.id=e[24].id),u.$set(te),e[24].id===e[7].id?J||(J=oh(),J.c(),J.m(a,null)):J&&(J.d(1),J=null),(!I||K&16)&&g!==(g=e[24].email+"")&&ae(v,g),(!I||K&16&&b!==(b=e[24].email))&&p(h,"title",b);const ee={};K&16&&(ee.date=e[24].created),S.$set(ee);const me={};K&16&&(me.date=e[24].updated),D.$set(me)},i(se){I||(E(u.$$.fragment,se),E(S.$$.fragment,se),E(D.$$.fragment,se),I=!0)},o(se){P(u.$$.fragment,se),P(S.$$.fragment,se),P(D.$$.fragment,se),I=!1},d(se){se&&k(t),j(u),J&&J.d(),j(S),j(D),F=!1,Xe(V)}}}function ah(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){w(a,e,u),m(e,t),m(e,s),m(e,l),m(e,r)},p(a,u){u&16&&i!==(i=a[4].length+"")&&ae(s,i),u&16&&o!==(o=a[4].length+"")&&ae(r,o)},d(a){a&&k(e)}}}function tD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,O,A,L,I,F,V,J,x,B,se,K,te,ee,me,ge=[],Q=new Map,ce,ye,Y,_e,U;a=new Uo({}),a.$on("refresh",n[8]),g=new Bo({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),g.$on("submit",n[10]);function Z(Ce){n[11](Ce)}let $e={class:"col-type-text",name:"id",$$slots:{default:[ZT]},$$scope:{ctx:n}};n[2]!==void 0&&($e.sort=n[2]),D=new sn({props:$e}),de.push(()=>Fe(D,"sort",Z));function je(Ce){n[12](Ce)}let Be={class:"col-type-email col-field-email",name:"email",$$slots:{default:[GT]},$$scope:{ctx:n}};n[2]!==void 0&&(Be.sort=n[2]),L=new sn({props:Be}),de.push(()=>Fe(L,"sort",je));function G(Ce){n[13](Ce)}let pe={class:"col-type-date col-field-created",name:"created",$$slots:{default:[XT]},$$scope:{ctx:n}};n[2]!==void 0&&(pe.sort=n[2]),V=new sn({props:pe}),de.push(()=>Fe(V,"sort",G));function ue(Ce){n[14](Ce)}let we={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[QT]},$$scope:{ctx:n}};n[2]!==void 0&&(we.sort=n[2]),B=new sn({props:we}),de.push(()=>Fe(B,"sort",ue));let Ze=n[4];const tt=Ce=>Ce[24].id;for(let Ce=0;Ce<Ze.length;Ce+=1){let ze=ih(n,Ze,Ce),Ge=tt(ze);Q.set(Ge,ge[Ce]=rh(Ge,ze))}let We=null;Ze.length||(We=sh(n));let it=n[4].length&&ah(n);return{c(){e=_("header"),t=_("nav"),i=_("div"),i.textConte
|
||
|
<span class="txt">New admin</span>`,h=T(),q(g.$$.fragment),v=T(),b=_("div"),y=_("table"),C=_("thead"),S=_("tr"),$=_("th"),M=T(),q(D.$$.fragment),A=T(),q(L.$$.fragment),F=T(),q(V.$$.fragment),x=T(),q(B.$$.fragment),K=T(),te=_("th"),ee=T(),me=_("tbody");for(let Ce=0;Ce<ge.length;Ce+=1)ge[Ce].c();We&&We.c(),ce=T(),it&&it.c(),ye=Je(),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(te,"class","col-type-action min-width"),p(y,"class","table"),ie(y,"table-loading",n[5]),p(b,"class","table-wrapper")},m(Ce,ze){w(Ce,e,ze),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(e,r),H(a,e,null),m(e,u),m(e,f),m(e,c),m(e,d),w(Ce,h,ze),H(g,Ce,ze),w(Ce,v,ze),w(Ce,b,ze),m(b,y),m(y,C),m(C,S),m(S,$),m(S,M),H(D,S,null),m(S,A),H(L,S,null),m(S,F),H(V,S,null),m(S,x),H(B,S,null),m(S,K),m(S,te),m(y,ee),m(y,me);for(let Ge=0;Ge<ge.length;Ge+=1)ge[Ge].m(me,null);We&&We.m(me,null),w(Ce,ce,ze),it&&it.m(Ce,ze),w(Ce,ye,ze),Y=!0,_e||(U=X(d,"click",n[9]),_e=!0)},p(Ce,ze){(!Y||ze&64)&&ae(o,Ce[6]);const Ge={};ze&2&&(Ge.value=Ce[1]),g.$set(Ge);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 dt={};ze&134217728&&(dt.$$scope={dirty:ze,ctx:Ce}),!I&&ze&4&&(I=!0,dt.sort=Ce[2],He(()=>I=!1)),L.$set(dt);const be={};ze&134217728&&(be.$$scope={dirty:ze,ctx:Ce}),!J&&ze&4&&(J=!0,be.sort=Ce[2],He(()=>J=!1)),V.$set(be);const Ie={};ze&134217728&&(Ie.$$scope={dirty:ze,ctx:Ce}),!se&&ze&4&&(se=!0,Ie.sort=Ce[2],He(()=>se=!1)),B.$set(Ie),ze&186&&(Ze=Ce[4],Ae(),ge=vt(ge,ze,tt,1,Ce,Ze,Q,me,Gt,rh,null,ih),Pe(),!Ze.length&&We?We.p(Ce,ze):Ze.length?We&&(We.d(1),We=null):(We=sh(Ce),We.c(),We.m(me,null))),ze&32&&ie(y,"table-loading",Ce[5]),Ce[4].length?it?it.p(Ce,ze):(it=ah(Ce),it.c(),it.m(ye.parentNode,ye)):it&&(it.d(1),it=null)},i(Ce){if(!Y){E(a.$$.fragment,Ce),E(g.$$.fragment,Ce),E(D.$$.fragment,Ce),E(L.$$.fragment,Ce),E(V.$$.fragment,Ce),E(B.$$.fragment,Ce);for(let ze=0;ze<Ze.length;ze+=1)E(ge[ze]);Y=!0}},o(Ce){P(a.$$.fragment,Ce),P(g.$$.fragment,Ce),P(D.$$.fragment,Ce),P(L.$$.fragment,Ce),P(V.$$.fragment,Ce),P(B.$$.fragment,Ce);for(let ze=0;ze<ge.length;ze+=1)P(ge[ze]);Y=!1},d(Ce){Ce&&k(e),j(a),Ce&&k(h),j(g,Ce),Ce&&k(v),Ce&&k(b),j(D),j(L),j(V),j(B);for(let ze=0;ze<ge.length;ze+=1)ge[ze].d();We&&We.d(),Ce&&k(ce),it&&it.d(Ce),Ce&&k(ye),_e=!1,U()}}}function nD(n){let e,t,i,s,l,o;e=new zi({}),i=new On({props:{$$slots:{default:[tD]},$$scope:{ctx:n}}});let r={};return l=new JT({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){q(e.$$.fragment),t=T(),q(i.$$.fragment),s=T(),q(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(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){j(e,a),a&&k(t),j(i,a),a&&k(s),n[18](null),j(l,a)}}}function iD(n,e,t){let i,s,l;_t(n,Ro,F=>t(21,i=F)),_t(n,Rt,F=>t(6,s=F)),_t(n,$a,F=>t(7,l=F)),dn(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=[]),ve.admins.getFullList(100,{sort:c||"-created",filter:f}).then(F=>{t(4,a=F),t(5,u=!1)}).catch(F=>{F!=null&&F.isAbort||(t(5,u=!1),console.warn(F),h(),ve.errorResponseHandler(F,!1))})}function h(){t(4,a=[])}const g=()=>d(),v=()=>r==null?void 0:r.show(),b=F=>t(1,f=F.detail);function y(F){c=F,t(2,c)}function C(F){c=F,t(2,c)}function S(F){c=F,t(2,c)}function $(F){c=F,t(2,c)}const M=F=>r==null?void 0:r.show(F),D=(F,V)=>{(V.code==="Enter"||V.code==="Space")&&(V.preventDefault(),r==null||r.show(F))},O=()=>t(1,f="");function A(F){de[F?"unshift":"push"](()=>{r=F,t(3,r)})}const L=()=>d(),I=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const F=new URLSearchParams({filter:f,sort:c}).toString();Si("/settings/admins?"+F),d()}},[d,f,c,r,a,u,s,l,g,v,b,y,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"),ie(a,"btn-disabled",n[2]),ie(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){w(d,e,h),m(e,t),m(e,i),H(s,e,null),m(e,l),H(o,e,null),m(e,r),m(e,a),u=!0,f||(c=X(e,"submit",Kt(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&&ie(a,"btn-disabled",d[2]),h&4&&ie(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&&k(e),j(s),j(o),f=!1,c()}}}function aD(n){let e,t;return e=new Ng({props:{$$slots:{default:[rD]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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){j(e,i)}}}function uD(n,e,t){let i;_t(n,Ro,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),ve.admins.authViaEmail(l,o).then(()=>{Si("/")}).catch(()=>{go("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 fD extends Ee{constructor(e){super(),Oe(this,e,uD,aD,De,{})}}function cD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S;i=new Re({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[pD,({uniqueId:M})=>({17:M}),({uniqueId:M})=>M?131072:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[hD,({uniqueId:M})=>({17:M}),({uniqueId:M})=>M?131072:0]},$$scope:{ctx:n}}}),a=new Re({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[mD,({uniqueId:M})=>({17:M}),({uniqueId:M})=>M?131072:0]},$$scope:{ctx:n}}});let $=n[3]&&uh(n);return{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=T(),l=_("div"),q(o.$$.fragment),r=T(),q(a.$$.fragment),u=T(),f=_("div"),c=_("div"),d=T(),$&&$.c(),h=T(),g=_("button"),v=_("span"),v.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(c,"class","flex-fill"),p(v,"class","txt"),p(g,"type","submit"),p(g,"class","btn btn-expanded"),g.disabled=b=!n[3]||n[2],ie(g,"btn-loading",n[2]),p(f,"class","col-lg-12 flex"),p(e,"class","grid")},m(M,D){w(M,e,D),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),H(a,e,null),m(e,u),m(e,f),m(f,c),m(f,d),$&&$.m(f,null),m(f,h),m(f,g),m(g,v),y=!0,C||(S=X(g,"click",n[12]),C=!0)},p(M,D){const O={};D&393217&&(O.$$scope={dirty:D,ctx:M}),i.$set(O);const A={};D&393217&&(A.$$scope={dirty:D,ctx:M}),o.$set(A);const L={};D&393217&&(L.$$scope={dirty:D,ctx:M}),a.$set(L),M[3]?$?$.p(M,D):($=uh(M),$.c(),$.m(f,h)):$&&($.d(1),$=null),(!y||D&12&&b!==(b=!M[3]||M[2]))&&(g.disabled=b),D&4&&ie(g,"btn-loading",M[2])},i(M){y||(E(i.$$.fragment,M),E(o.$$.fragment,M),E(a.$$.fragment,M),y=!0)},o(M){P(i.$$.fragment,M),P(o.$$.fragment,M),P(a.$$.fragment,M),y=!1},d(M){M&&k(e),j(i),j(o),j(a),$&&$.d(),C=!1,S()}}}function dD(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function pD(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[17]),p(l,"type","text"),p(l,"id",o=n[17]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].meta.appName),r||(a=X(l,"input",n[8]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&p(e,"for",i),f&131072&&o!==(o=u[17])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appName&&Me(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function hD(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[17]),p(l,"type","text"),p(l,"id",o=n[17]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].meta.appUrl),r||(a=X(l,"input",n[9]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&p(e,"for",i),f&131072&&o!==(o=u[17])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&Me(l,u[0].meta.appUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,
|
||
|
<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){w(h,e,g),w(h,t,g),w(h,i,g),m(i,s),c[l].m(s,null),r=!0,a||(u=X(s,"submit",Kt(n[4])),a=!0)},p(h,g){let v=l;l=d(h),l===v?c[l].p(h,g):(Ae(),P(c[v],1,1,()=>{c[v]=null}),Pe(),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&&k(e),h&&k(t),h&&k(i),c[l].d(),a=!1,u()}}}function _D(n){let e,t,i,s;return e=new zi({}),i=new On({props:{$$slots:{default:[gD]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=T(),q(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&262159&&(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){j(e,l),l&&k(t),j(i,l)}}}function bD(n,e,t){let i,s,l;_t(n,bo,$=>t(13,s=$)),_t(n,Rt,$=>t(14,l=$)),dn(Rt,l="Application settings",l);let o={},r={},a=!1,u=!1,f="";c();async function c(){t(1,a=!0);try{const $=await ve.settings.getAll()||{};h($)}catch($){ve.errorResponseHandler($)}t(1,a=!1)}async function d(){if(!(u||!i)){t(2,u=!0);try{const $=await ve.settings.update(W.filterRedactedProps(r));h($),cn("Successfully saved application settings.")}catch($){ve.errorResponseHandler($)}t(2,u=!1)}}function h($={}){var M;dn(bo,s=(M=$==null?void 0:$.meta)==null?void 0:M.appName,s),t(0,r={meta:($==null?void 0:$.meta)||{},logs:($==null?void 0:$.logs)||{}}),t(6,o=JSON.parse(JSON.stringify(r)))}function g(){t(0,r=JSON.parse(JSON.stringify(o||{})))}function v(){r.meta.appName=this.value,t(0,r)}function b(){r.meta.appUrl=this.value,t(0,r)}function y(){r.logs.maxDays=At(this.value),t(0,r)}const C=()=>g(),S=()=>d();return n.$$.update=()=>{n.$$.dirty&64&&t(7,f=JSON.stringify(o)),n.$$.dirty&129&&t(3,i=f!=JSON.stringify(r))},[r,a,u,i,d,g,o,f,v,b,y,C,S]}class vD extends Ee{constructor(e){super(),Oe(this,e,bD,_D,De,{})}}function yD(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=ft(l,s[o]);return{c(){e=_("input"),di(e,l)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[7](e),Me(e,n[0]),t||(i=X(e,"input",n[8]),t=!0)},p(o,r){di(e,l=pn(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&Me(e,o[0])},d(o){o&&k(e),n[7](null),t=!1,i()}}}function kD(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=ft(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"),di(s,a)},m(u,f){w(u,e,f),m(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[Ye($t.call(null,t,{position:"left",text:"Set new value"})),X(t,"click",n[6])],l=!0)},p(u,f){di(s,a=pn(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&k(e),u&&k(i),u&&k(s),l=!1,Xe(o)}}}function wD(n){let e;function t(l,o){return l[3]?kD:yD}let i=t(n),s=i(n);return{c(){s.c(),e=Je()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function $D(n,e,t){const i=["value","mask"];let s=Ut(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await ii(),r==null||r.focus()}const f=()=>u();function c(h){de[h?"unshift":"push"](()=>{r=h,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=ft(ft({},e),ni(h)),t(5,s=Ut(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 Za extends Ee{constructor(e){super(),Oe(this,e,$D,wD,De,{value:0,mask:1})}}function SD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v;return{c(){e=_("label"),t=N("Subject"),s=T(),l=_("input"),r=T(),a=_("div"),u=N(`Available placeholder parameters:
|
||
|
`),f=_("span"),f.textContent=`{APP_NAME}
|
||
|
`,c=N(`,
|
||
|
`),d=_("span"),d.textContent=`{APP_URL}
|
||
|
`,h=N("."),p(e,"for",i=n[27]),p(l,"type","text"),p(l,"id",o=n[27]),p(l,"spellcheck","false"),l.required=!0,p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(b,y){w(b,e,y),m(e,t),w(b,s,y),w(b,l,y),Me(l,n[0].subject),w(b,r,y),w(b,a,y),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),g||(v=[X(l,"input",n[11]),X(f,"click",n[12]),X(d,"click",n[13])],g=!0)},p(b,y){y&134217728&&i!==(i=b[27])&&p(e,"for",i),y&134217728&&o!==(o=b[27])&&p(l,"id",o),y&1&&l.value!==b[0].subject&&Me(l,b[0].subject)},d(b){b&&k(e),b&&k(s),b&&k(l),b&&k(r),b&&k(a),g=!1,Xe(v)}}}function CD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y;return{c(){e=_("label"),t=N("Action URL"),s=T(),l=_("input"),r=T(),a=_("div"),u=N(`Available placeholder parameters:
|
||
|
`),f=_("span"),f.textContent=`{APP_NAME}
|
||
|
`,c=N(`,
|
||
|
`),d=_("span"),d.textContent=`{APP_URL}
|
||
|
`,h=N(`,
|
||
|
`),g=_("span"),g.textContent="{TOKEN}",v=N("."),p(e,"for",i=n[27]),p(l,"type","text"),p(l,"id",o=n[27]),p(l,"spellcheck","false"),l.required=!0,p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(C,S){w(C,e,S),m(e,t),w(C,s,S),w(C,l,S),Me(l,n[0].actionUrl),w(C,r,S),w(C,a,S),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),m(a,g),m(a,v),b||(y=[X(l,"input",n[14]),X(f,"click",n[15]),X(d,"click",n[16]),X(g,"click",n[17])],b=!0)},p(C,S){S&134217728&&i!==(i=C[27])&&p(e,"for",i),S&134217728&&o!==(o=C[27])&&p(l,"id",o),S&1&&l.value!==C[0].actionUrl&&Me(l,C[0].actionUrl)},d(C){C&&k(e),C&&k(s),C&&k(l),C&&k(r),C&&k(a),b=!1,Xe(y)}}}function MD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S;return{c(){e=_("label"),t=N("Body (HTML)"),s=T(),l=_("textarea"),r=T(),a=_("div"),u=N(`Available placeholder parameters:
|
||
|
`),f=_("span"),f.textContent=`{APP_NAME}
|
||
|
`,c=N(`,
|
||
|
`),d=_("span"),d.textContent=`{APP_URL}
|
||
|
`,h=N(`,
|
||
|
`),g=_("span"),g.textContent=`{TOKEN}
|
||
|
`,v=N(`,
|
||
|
`),b=_("span"),b.textContent=`{ACTION_URL}
|
||
|
`,y=N("."),p(e,"for",i=n[27]),p(l,"id",o=n[27]),p(l,"class","txt-mono"),p(l,"spellcheck","false"),p(l,"rows","12"),l.required=!0,p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"class","label label-sm link-primary txt-mono"),p(b,"class","label label-sm link-primary txt-mono"),p(b,"title","Required parameter"),p(a,"class","help-block")},m($,M){w($,e,M),m(e,t),w($,s,M),w($,l,M),Me(l,n[0].body),w($,r,M),w($,a,M),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),m(a,g),m(a,v),m(a,b),m(a,y),C||(S=[X(l,"input",n[18]),X(f,"click",n[19]),X(d,"click",n[20]),X(g,"click",n[21]),X(b,"click",n[22])],C=!0)},p($,M){M&134217728&&i!==(i=$[27])&&p(e,"for",i),M&134217728&&o!==(o=$[27])&&p(l,"id",o),M&1&&Me(l,$[0].body)},d($){$&&k(e),$&&k(s),$&&k(l),$&&k(r),$&&k(a),C=!1,Xe(S)}}}function TD(n){let e,t,i,s,l,o;return e=new Re({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[SD,({uniqueId:r})=>({27:r}),({uniqueId:r})=>r?134217728:0]},$$scope:{ctx:n}}}),i=new Re({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[CD,({uniqueId:r})=>({27:r}),({uniqueId:r})=>r?134217728:0]},$$scope:{ctx:n}}}),l=new Re({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[MD,({uniqueId:r})=>({27:r}),({uniqueId:r})=>r?134217728:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=T(),q(i.$$.fragment),s=T(),q(l.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),w(r,s,a),H(l,r,a),o=!0},p(r,a){const u={};a&2&&(u.name=r[1]+".subject"),a&402653185&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&2&&(f.name=r[1]+".actionUrl"),a&402653185&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a&2&&(c.name=r[1]+".body"),a&402653185&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(E(e.$$.fragment,r),E(i.$$.fragment,r),E(l.$$.fragment,r),o=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){j(e,r),r&&k(t),j(i,r),r&&k(s),j(l,r)}}}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){w(o,e,r),i=!0,s||(l=Ye($t.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=ot(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=ot(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function DD(n){let e,t,i,s,l,o,r,a,u,f,c=n[4]&&fh();return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),l=N(n[2]),o=T(),r=_("div"),a=T(),c&&c.c(),u=Je(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,s),m(s,l),w(d,o,h),w(d,r,h),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h&4)&&ae(l,d[2]),d[4]?c?h&16&&E(c,1):(c=fh(),c.c(),E(c,1),c.m(u.parentNode,u)):c&&(Ae(),P(c,1,1,()=>{c=null}),Pe())},i(d){f||(E(c),f=!0)},o(d){P(c),f=!1},d(d){d&&k(e),d&&k(o),d&&k(r),d&&k(a),c&&c.d(d),d&&k(u)}}}function OD(n){let e,t;const i=[n[6]];let s={$$slots:{header:[DD],default:[TD]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=ft(s,i[l]);return e=new Xo({props:s}),n[23](e),e.$on("expand",n[24]),e.$on("collapse",n[25]),e.$on("toggle",n[26]),{c(){q(e.$$.fragment)},m(l,o){H(e,l,o),t=!0},p(l,[o]){const r=o&64?pn(i,[si(l[6])]):{};o&268435479&&(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[23](null),j(e,l)}}}function ED(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Ut(e,s),o;_t(n,Hi,B=>t(10,o=B));let{key:r}=e,{title:a}=e,{config:u={}}=e,f;function c(){f==null||f.expand()}function d(){f==null||f.collapse()}function h(){f==null||f.collapseSiblings()}function g(B){W.copyToClipboard(B),Lg(`Copied ${B} to clipboard`,2e3)}function v(){u.subject=this.value,t(0,u)}const b=()=>g("{APP_NAME}"),y=()=>g("{APP_URL}");function C(){u.actionUrl=this.value,t(0,u)}const S=()=>g("{APP_NAME}"),$=()=>g("{APP_URL}"),M=()=>g("{TOKEN}");function D(){u.body=this.value,t(0,u)}const O=()=>g("{APP_NAME}"),A=()=>g("{APP_URL}"),L=()=>g("{TOKEN}"),I=()=>g("{ACTION_URL}");function F(B){de[B?"unshift":"push"](()=>{f
|
||
|
<br/>
|
||
|
<strong class="txt-bold">For better emails deliverability it is recommended to enable the SMTP settings
|
||
|
below.</strong></p>`,M=T(),q(D.$$.fragment),O=T(),Y&&Y.c(),A=T(),L=_("div"),I=_("div"),F=T(),_e&&_e.c(),V=T(),J=_("button"),x=_("span"),x.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p($,"class","content m-b-sm"),p(I,"class","flex-fill"),p(x,"class","txt"),p(J,"type","submit"),p(J,"class","btn btn-expanded"),J.disabled=B=!n[4]||n[3],ie(J,"btn-loading",n[3]),p(L,"class","flex")},m(U,Z){w(U,e,Z),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),w(U,r,Z),w(U,a,Z),H(u,a,null),m(a,c),H(d,a,null),m(a,g),H(v,a,null),w(U,y,Z),w(U,C,Z),w(U,S,Z),w(U,$,Z),w(U,M,Z),H(D,U,Z),w(U,O,Z),Y&&Y.m(U,Z),w(U,A,Z),w(U,L,Z),m(L,I),m(L,F),_e&&_e.m(L,null),m(L,V),m(L,J),m(J,x),se=!0,K||(te=X(J,"click",n[24]),K=!0)},p(U,Z){const $e={};Z&805306369&&($e.$$scope={dirty:Z,ctx:U}),i.$set($e);const je={};Z&805306369&&(je.$$scope={dirty:Z,ctx:U}),o.$set(je);const Be={};!f&&Z&1&&(f=!0,Be.config=U[0].meta.verificationTemplate,He(()=>f=!1)),u.$set(Be);const G={};!h&&Z&1&&(h=!0,G.config=U[0].meta.resetPasswordTemplate,He(()=>h=!1)),d.$set(G);const pe={};!b&&Z&1&&(b=!0,pe.config=U[0].meta.confirmEmailChangeTemplate,He(()=>b=!1)),v.$set(pe);const ue={};Z&805306369&&(ue.$$scope={dirty:Z,ctx:U}),D.$set(ue),U[0].smtp.enabled?Y?(Y.p(U,Z),Z&1&&E(Y,1)):(Y=ch(U),Y.c(),E(Y,1),Y.m(A.parentNode,A)):Y&&(Ae(),P(Y,1,1,()=>{Y=null}),Pe()),U[4]?_e?_e.p(U,Z):(_e=dh(U),_e.c(),_e.m(L,V)):_e&&(_e.d(1),_e=null),(!se||Z&24&&B!==(B=!U[4]||U[3]))&&(J.disabled=B),Z&8&&ie(J,"btn-loading",U[3])},i(U){se||(E(i.$$.fragment,U),E(o.$$.fragment,U),E(u.$$.fragment,U),E(d.$$.fragment,U),E(v.$$.fragment,U),E(D.$$.fragment,U),E(Y),se=!0)},o(U){P(i.$$.fragment,U),P(o.$$.fragment,U),P(u.$$.fragment,U),P(d.$$.fragment,U),P(v.$$.fragment,U),P(D.$$.fragment,U),P(Y),se=!1},d(U){U&&k(e),j(i),j(o),U&&k(r),U&&k(a),n[13](null),j(u),j(d),j(v),U&&k(y),U&&k(C),U&&k(S),U&&k($),U&&k(M),j(D,U),U&&k(O),Y&&Y.d(U),U&&k(A),U&&k(L),_e&&_e.d(),K=!1,te()}}}function PD(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function LD(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[28]),p(l,"type","text"),p(l,"id",o=n[28]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].meta.senderName),r||(a=X(l,"input",n[11]),r=!0)},p(u,f){f&268435456&&i!==(i=u[28])&&p(e,"for",i),f&268435456&&o!==(o=u[28])&&p(l,"id",o),f&1&&l.value!==u[0].meta.senderName&&Me(l,u[0].meta.senderName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function ID(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Sender address"),s=T(),l=_("input"),p(e,"for",i=n[28]),p(l,"type","email"),p(l,"id",o=n[28]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].meta.senderAddress),r||(a=X(l,"input",n[12]),r=!0)},p(u,f){f&268435456&&i!==(i=u[28])&&p(e,"for",i),f&268435456&&o!==(o=u[28])&&p(l,"id",o),f&1&&l.value!==u[0].meta.senderAddress&&Me(l,u[0].meta.senderAddress)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function FD(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[28]),e.required=!0,p(s,"for",o=n[28])},m(u,f){w(u,e,f),e.checked=n[0].smtp.enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[17]),r=!0)},p(u,f){f&268435456&&t!==(t=u[28])&&p(e,"id",t),f&1&&(e.checked=u[0].smtp.enabled),f&268435456&&o!==(o=u[28])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function ch(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S;return i=new Re({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[ND,({uniqueId:$})=>({28:$}),({uniqueId:$})=>$?268435456:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[RD,({uniqueId:$})=>({28:$}),({uniqueId:$})=>$?268435456:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[HD,({uniqueId:$})=>({28:$}),({uniqueId:$})=>$?268435456:0]},$$scope:{ctx:n}}}),d=new Re({props:{class:"form-field",name:"smtp.username",$$
|
||
|
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:
|
||
|
`),y=_("a"),y.textContent=`rclone
|
||
|
`,C=N(`,
|
||
|
`),S=_("a"),S.textContent=`s5cmd
|
||
|
`,$=N(", etc."),M=T(),D=_("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener"),p(y,"class","txt-bold"),p(S,"href","https://github.com/peak/s5cmd"),p(S,"target","_blank"),p(S,"rel","noopener"),p(S,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(D,"class","clearfix m-t-base")},m(I,F){w(I,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,y),m(l,C),m(l,S),m(l,$),m(e,M),m(e,D),A=!0},p(I,F){var V;(!A||F&1)&&a!==(a=(V=I[0].s3)!=null&&V.enabled?"S3 storage":"local file system")&&ae(u,a),(!A||F&2)&&d!==(d=I[1].s3.enabled?"S3 storage":"local file system")&&ae(h,d)},i(I){A||(I&&Tt(()=>{O||(O=ot(e,tn,{duration:150},!0)),O.run(1)}),A=!0)},o(I){I&&(O||(O=ot(e,tn,{duration:150},!1)),O.run(0)),A=!1},d(I){I&&k(e),I&&O&&O.end()}}}function hh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D;return i=new Re({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[JD,({uniqueId:O})=>({21:O}),({uniqueId:O})=>O?2097152:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[ZD,({uniqueId:O})=>({21:O}),({uniqueId:O})=>O?2097152:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field required",name:"s3.region",$$slots:{default:[GD,({uniqueId:O})=>({21:O}),({uniqueId:O})=>O?2097152:0]},$$scope:{ctx:n}}}),d=new Re({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[XD,({uniqueId:O})=>({21:O}),({uniqueId:O})=>O?2097152:0]},$$scope:{ctx:n}}}),v=new Re({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[QD,({uniqueId:O})=>({21:O}),({uniqueId:O})=>O?2097152:0]},$$scope:{ctx:n}}}),C=new Re({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[xD,({uniqueId:O})=>({21:O}),({uniqueId:O})=>O?2097152:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=T(),l=_("div"),q(o.$$.fragment),r=T(),a=_("div"),q(u.$$.fragment),f=T(),c=_("div"),q(d.$$.fragment),h=T(),g=_("div"),q(v.$$.fragment),b=T(),y=_("div"),q(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(y,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid")},m(O,A){w(O,e,A),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),m(e,a),H(u,a,null),m(e,f),m(e,c),H(d,c,null),m(e,h),m(e,g),H(v,g,null),m(e,b),m(e,y),H(C,y,null),m(e,S),m(e,$),D=!0},p(O,A){const L={};A&6291458&&(L.$$scope={dirty:A,ctx:O}),i.$set(L);const I={};A&6291458&&(I.$$scope={dirty:A,ctx:O}),o.$set(I);const F={};A&6291458&&(F.$$scope={dirty:A,ctx:O}),u.$set(F);const V={};A&6291458&&(V.$$scope={dirty:A,ctx:O}),d.$set(V);const J={};A&6291458&&(J.$$scope={dirty:A,ctx:O}),v.$set(J);const x={};A&6291458&&(x.$$scope={dirty:A,ctx:O}),C.$set(x)},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&&Tt(()=>{M||(M=ot(e,tn,{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=ot(e,tn,{duration:150},!1)),M.run(0)),D=!1},d(O){O&&k(e),j(i),j(o),j(u),j(d),j(v),j(C),O&&M&&M.end()}}}function JD(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[21]),p(l,"type","text"),p(l,"id",o=n[21]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[1].s3.endpoint),r||(a=X(l,"input",n[10]),r=!0)},p(u,f){f&2097152&&i!==(i=u[21])&&p(e,"for",i),f&2097152&&o!==(o=u[21])&&p(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&Me(l,u[1].s3.endpoint)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function ZD(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[21]),p(l,"type","text"),p(l,"id",o=n[21]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[1].s3.bucket),r||(a=X(l,"input",n[11]),r=!0)},p(u,f){f&2097152&&i!==(i=u[21])&&p(e,"for",i),f&2097152&&o!==(o=u[21])&&p(l,"id"
|
||
|
<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){w($,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w($,r,M),w($,a,M),m(a,u),m(u,f),m(u,c),C[d].m(u,null),g=!0,v||(b=X(u,"submit",Kt(n[18])),v=!0)},p($,M){(!g||M&32)&&ae(o,$[5]);let D=d;d=S($),d===D?C[d].p($,M):(Ae(),P(C[D],1,1,()=>{C[D]=null}),Pe(),h=C[d],h?h.p($,M):(h=C[d]=y[d]($),h.c()),E(h,1),h.m(u,null))},i($){g||(E(h),g=!0)},o($){P(h),g=!1},d($){$&&k(e),$&&k(r),$&&k(a),C[d].d(),v=!1,b()}}}function tO(n){let e,t,i,s;return e=new zi({}),i=new On({props:{$$slots:{default:[eO]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=T(),q(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&4194367&&(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){j(e,l),l&&k(t),j(i,l)}}}function nO(n,e,t){let i,s,l;_t(n,Rt,A=>t(5,l=A)),dn(Rt,l="Files storage",l);let o={},r={},a=!1,u=!1;f();async function f(){t(2,a=!0);try{const A=await ve.settings.getAll()||{};d(A)}catch(A){ve.errorResponseHandler(A)}t(2,a=!1)}async function c(){if(!(u||!s)){t(3,u=!0);try{const A=await ve.settings.update(W.filterRedactedProps(r));d(A),hi({}),cn("Successfully saved files storage settings.")}catch(A){ve.errorResponseHandler(A)}t(3,u=!1)}}function d(A={}){t(1,r={s3:(A==null?void 0:A.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}function h(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function g(){r.s3.enabled=this.checked,t(1,r)}function v(){r.s3.endpoint=this.value,t(1,r)}function b(){r.s3.bucket=this.value,t(1,r)}function y(){r.s3.region=this.value,t(1,r)}function C(){r.s3.accessKey=this.value,t(1,r)}function S(A){n.$$.not_equal(r.s3.secret,A)&&(r.s3.secret=A,t(1,r))}function $(){r.s3.forcePathStyle=this.checked,t(1,r)}const M=()=>h(),D=()=>c(),O=()=>c();return n.$$.update=()=>{n.$$.dirty&1&&t(8,i=JSON.stringify(o)),n.$$.dirty&258&&t(4,s=i!=JSON.stringify(r))},[o,r,a,u,s,l,c,h,i,g,v,b,y,C,S,$,M,D,O]}class iO extends Ee{constructor(e){super(),Oe(this,e,nO,tO,De,{})}}function sO(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){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[8]),r=!0)},p(u,f){f&65536&&t!==(t=u[16])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&65536&&o!==(o=u[16])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function gh(n){let e,t,i,s,l,o,r,a,u,f,c;return i=new Re({props:{class:"form-field required",name:"emailAuth.minPasswordLength",$$slots:{default:[lO,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field "+(W.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailAuth.exceptDomains",$$slots:{default:[oO,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field "+(W.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailAuth.onlyDomains",$$slots:{default:[rO,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=T(),l=_("div"),q(o.$$.fragment),r=T(),a=_("div"),q(u.$$.fragment),p(t,"class","col-sm-12 m-t-sm"),p(l,"class","col-lg-6"),p(a,"class","col-lg-6"),p(e,"class","grid")},m(d,h){w(d,e,h),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),m(e,a),H(u,a,null),c=!0},p(d,h){const g={};h&196609&&(g.$$scope={dirty:h,ctx:d}),i.$set(g);const v={};h&1&&(v.class="form-field "+(W.isEmpty(d[0].onlyDomains)?"":"disabled")),h&196609&&(v.$$scope={dirty:h,ctx:d}),o.$set(v);const b={};h&1&&(b.class="form-field "+(W.isEmpty(d[0].exceptDomains)?"":"disabled")),h&196609&&(b.$$scope={dirty:h,ctx:d}),u.$set(b)},i(d){c||(E(i.$$.fragment,d),E(o.$$.fragment,d),E(u.$$.fragment,d),d&&Tt(()=>{f||(f=ot(e,tn,{duration:
|
||
|
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&65536&&l!==(l=b[16]))&&p(e,"for",l);const C={};y&65536&&(C.id=b[16]),y&1&&(C.disabled=!W.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,C.value=b[0].exceptDomains,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&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function rO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[11](b)}let v={id:n[16]+".config.onlyDomains",disabled:!W.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new cs({props:v}),de.push(()=>Fe(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),q(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,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),H(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye($t.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
|
||
|
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&65536&&l!==(l=b[16]+".config.onlyDomains"))&&p(e,"for",l);const C={};y&65536&&(C.id=b[16]+".config.onlyDomains"),y&1&&(C.disabled=!W.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,C.value=b[0].onlyDomains,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&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function aO(n){let e,t,i,s;e=new Re({props:{class:"form-field form-field-toggle m-b-0",name:"emailAuth.enabled",$$slots:{default:[sO,({uniqueId:o})=>({16:o}),({uniqueId:o})=>o?65536:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&gh(n);return{c(){q(e.$$.fragment),t=T(),l&&l.c(),i=Je()},m(o,r){H(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&196609&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].enabled?l?(l.p(o,r),r&1&&E(l,1)):(l=gh(o),l.c(),E(l,1),l.m(i.parentNode,i)):l&&(Ae(),P(l,1,1,()=>{l=null}),Pe())},i(o){s||(E(e.$$.fragment,o),E(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function uO(n){let e;return{c(){e=_("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function fO(n){let e;return{c(){e=_("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function _h(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye($t.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=ot(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=ot(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function cO(n){let e,t,i,s,l,o,r;function a(d,h){return d[0].enabled?fO:uO}let u=a(n),f=u(n),c=n[2]&&_h();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=Je(),p(e,"class","inline-flex"),p(s,"class","flex-fill")},m(d,h){w(d,e,h),w(d,t,h),f.m(d,h),w(d,i,h),w(d,s,h),w(d,l,h),c&&c.m(d,h),w(d,o,h),r=!0},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(i.parentNode,i))),d[2]?c?h&4&&E(c,1):(c=_h(),c.c(),E(c,1),c.m(o.parentNode,o)):c&&(Ae(),P(c,1,1,()=>{c=null}),Pe())},i(d){r||(E(c),r=!0)},o(d){P(c),r=!1},d(d){d&&k(e),d&&k(t),f.d(d),d&&k(i),d&&k(s),d&&k(l),c&&c.d(d),d&&k(o)}}}function dO(n){let e,t;const i=[n[3]];let s={$$slots:{header:[cO],default:[aO]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=ft(s,i[l]);return e=new Xo({props:s}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){q(e.$$.fragment)},m(l,o){H(e,l,o),t=!0},p(l,[o]){const r=o&8?pn(i,[si(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),j(e,l)}}}function pO(n,e,t){let i;const s=["config","expand","collapse","collapseSiblings"];let l=Ut(e,s),o;_t(n,Hi,$=>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($){de[$?"unshift":"push"](()=>{a=$,t(1,a)})}function y($){rt.call(this,n,$)}function C($){rt.call(this,n,$)}function S($){rt.call(this,n,$)}return n.$$set=$=>{e=ft(ft({},e),ni($)),t(3,l=Ut(e,s)),"config"in $&&t(0,r=$.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!W.isEmpty(o==null?void 0:o.emailAuth))},[r,a,i,l,u,f,c,o,d,h,g,v,b,y,C,S]}class hO extends Ee{constructor(e){super(),Oe(this,e,pO,dO,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 mO(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[23]),p(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[12]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&8388608&&o!==(o=u[23])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function bh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;l=new Re({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[gO,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}}),a=new Re({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[_O,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}}),c=new Re({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[bO,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}});let v=n[4]&&vh(n);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),q(l.$$.fragment),o=T(),r=_("div"),q(a.$$.fragment),u=T(),f=_("div"),q(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,y){w(b,e,y),m(e,t),m(e,i),m(e,s),H(l,s,null),m(e,o),m(e,r),H(a,r,null),m(e,u),m(e,f),H(c,f,null),m(e,d),v&&v.m(e,null),g=!0},p(b,y){const C={};y&2&&(C.name=b[1]+".clientId"),y&25165825&&(C.$$scope={dirty:y,ctx:b}),l.$set(C);const S={};y&2&&(S.name=b[1]+".clientSecret"),y&25165825&&(S.$$scope={dirty:y,ctx:b}),a.$set(S);const $={};y&2&&($.name=b[1]+".allowRegistrations"),y&25165825&&($.$$scope={dirty:y,ctx:b}),c.$set($),b[4]?v?(v.p(b,y),y&16&&E(v,1)):(v=vh(b),v.c(),E(v,1),v.m(e,null)):v&&(Ae(),P(v,1,1,()=>{v=null}),Pe())},i(b){g||(E(l.$$.fragment,b),E(a.$$.fragment,b),E(c.$$.fragment,b),E(v),b&&Tt(()=>{h||(h=ot(e,tn,{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=ot(e,tn,{duration:200},!1)),h.run(0)),g=!1},d(b){b
|
||
|
another PocketBase environment.</p>`,t=T(),i=_("div"),s=_("button"),s.innerHTML='<span class="txt">Copy</span>',l=T(),q(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){w(v,e,b),w(v,t,b),w(v,i,b),m(i,s),m(i,l),H(o,i,null),n[8](i),w(v,r,b),w(v,a,b),m(a,u),m(a,f),m(a,c),d=!0,h||(g=[X(s,"click",n[7]),X(i,"keydown",n[9]),X(c,"click",n[10])],h=!0)},p(v,b){const y={};b&4&&(y.content=v[2]),o.$set(y)},i(v){d||(E(o.$$.fragment,v),d=!0)},o(v){P(o.$$.fragment,v),d=!1},d(v){v&&k(e),v&&k(t),v&&k(i),j(o),n[8](null),v&&k(r),v&&k(a),h=!1,Xe(g)}}}function zO(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function BO(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[zO,VO],g=[];function v(b,y){return b[1]?0:1}return f=v(n),c=g[f]=h[f](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=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,y){w(b,e,y),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(b,r,y),w(b,a,y),m(a,u),g[f].m(u,null),d=!0},p(b,y){(!d||y&8)&&ae(o,b[3]);let C=f;f=v(b),f===C?g[f].p(b,y):(Ae(),P(g[C],1,1,()=>{g[C]=null}),Pe(),c=g[f],c?c.p(b,y):(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&&k(e),b&&k(r),b&&k(a),g[f].d()}}}function UO(n){let e,t,i,s;return e=new zi({}),i=new On({props:{$$slots:{default:[BO]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=T(),q(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(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){j(e,l),l&&k(t),j(i,l)}}}function WO(n,e,t){let i,s;_t(n,Rt,b=>t(3,s=b)),dn(Rt,s="Export collections",s);const l="export_"+W.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await ve.collections.getFullList(100,{$cancelKey:l}));for(let b of r)delete b.created,delete b.updated}catch(b){ve.errorResponseHandler(b)}t(1,a=!1)}function f(){W.downloadJson(r,"pb_schema")}function c(){W.copyToClipboard(i),Lg("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function h(b){de[b?"unshift":"push"](()=>{o=b,t(0,o)})}const g=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const y=window.getSelection(),C=document.createRange();C.selectNodeContents(o),y.removeAllRanges(),y.addRange(C)}},v=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,h,g,v]}class YO extends Ee{constructor(e){super(),Oe(this,e,WO,UO,De,{})}}function Mh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Th(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Dh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Oh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Eh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Ah(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Ph(n,e,t){const i=n.slice();return i[30]=e[t],i}function KO(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Lh(),a=n[0].name!==n[1].name&&Ih(n);return{c(){e=_("div"),r&&r.c(),t=T(),a&&a.c(),i=T(),s=_("strong"),o=N(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),m(e,t),a&&a.m(e,null),m(e,i),m(e,s),m(s,o)},p(u,f){u[9]?r||(r=Lh(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Ih(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&ae(o,l)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function JO(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=_("span"),e.textContent="Deleted",t=T(),i=_("strong"),l=N(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),m(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?vo
|
||
|
<th width="10%" class="svelte-lmkr38">Old</th>
|
||
|
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=T(),o=_("tbody");for(let $=0;$<g.length;$+=1)g[$].c();r=T(),v&&v.c(),a=T();for(let $=0;$<y.length;$+=1)y[$].c();u=T();for(let $=0;$<S.length;$+=1)S[$].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m($,M){w($,e,M),d.m(e,null),w($,t,M),w($,i,M),m(i,s),m(i,l),m(i,o);for(let D=0;D<g.length;D+=1)g[D].m(o,null);m(o,r),v&&v.m(o,null),m(o,a);for(let D=0;D<y.length;D+=1)y[D].m(o,null);m(o,u);for(let D=0;D<S.length;D+=1)S[D].m(o,null)},p($,M){if(c===(c=f($))&&d?d.p($,M):(d.d(1),d=c($),d&&(d.c(),d.m(e,null))),M[0]&7203){h=$[11];let D;for(D=0;D<h.length;D+=1){const O=Ph($,h,D);g[D]?g[D].p(O,M):(g[D]=Fh(O),g[D].c(),g[D].m(o,r))}for(;D<g.length;D+=1)g[D].d(1);g.length=h.length}if($[2]||$[5]?v?v.p($,M):(v=Nh($),v.c(),v.m(o,a)):v&&(v.d(1),v=null),M[0]&4248){b=$[7];let D;for(D=0;D<b.length;D+=1){const O=Dh($,b,D);y[D]?y[D].p(O,M):(y[D]=Vh(O),y[D].c(),y[D].m(o,u))}for(;D<y.length;D+=1)y[D].d(1);y.length=b.length}if(M[0]&4352){C=$[8];let D;for(D=0;D<C.length;D+=1){const O=Mh($,C,D);S[D]?S[D].p(O,M):(S[D]=Bh(O),S[D].c(),S[D].m(o,null))}for(;D<S.length;D+=1)S[D].d(1);S.length=C.length}},i:oe,o:oe,d($){$&&k(e),d.d(),$&&k(t),$&&k(i),xt(g,$),v&&v.d(),xt(y,$),xt(S,$)}}}function qn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function vn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function XO(n,e,t){let i,s,l,{collectionA:o=new fn}=e,{collectionB:r=new fn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],h=[];const g=Object.keys(new fn().export()).filter(y=>!["schema","created","updated"].includes(y));function v(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(y=>!f.find(C=>y.id==C.id))))}function b(y){return typeof y>"u"?"":W.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&v(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find(C=>y.id==C.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find(C=>C.id==y.id))),n.$$.dirty[0]&24&&t(8,h=f.filter(y=>!u.find(C=>C.id==y.id))),n.$$.dirty[0]&7&&t(9,l=W.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,h,l,s,g,b]}class QO extends Ee{constructor(e){super(),Oe(this,e,XO,GO,De,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Uh(n,e,t){const i=n.slice();return i[17]=e[t],i}function Wh(n){let e,t;return e=new QO({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function xO(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=Wh(Uh(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Je()},m(o,r){for(let a=0;a<s.length;a+=1)s[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=Uh(o,i,a);s[a]?(s[a].p(u,r),E(s[a],1)):(s[a]=Wh(u),s[a].c(),E(s[a],1),s[a].m(e.parentNode,e))}for(Ae(),a=i.length;a<s.length;a+=1)l(a);Pe()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)E(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){xt(s,o),o&&k(e)}}}function eE(n){let e;return{c(){e=_("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function tE(n){let e,t,i,s,l,o,r;return{c(){e=_("button"),t=N("Close"),i=T(),s=_("button"),l=_("span"),l.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=
|
||
|
- ${$.join(`
|
||
|
- `)}`,()=>{g()}):g()}async function g(){if(!u){t(4,u=!0);try{await ve.collections.import(o,a),cn("Successfully imported collections configuration."),i("submit")}catch($){ve.errorResponseHandler($)}t(4,u=!1),c()}}const v=()=>h(),b=()=>!u;function y($){de[$?"unshift":"push"](()=>{s=$,t(1,s)})}function C($){rt.call(this,n,$)}function S($){rt.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,h,f,l,o,v,b,y,C,S]}class sE extends Ee{constructor(e){super(),Oe(this,e,iE,nE,De,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function Yh(n,e,t){const i=n.slice();return i[32]=e[t],i}function Kh(n,e,t){const i=n.slice();return i[35]=e[t],i}function Jh(n,e,t){const i=n.slice();return i[32]=e[t],i}function lE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,O;a=new Re({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[rE,({uniqueId:J})=>({40:J}),({uniqueId:J})=>[0,J?512:0]]},$$scope:{ctx:n}}});let A=!1,L=n[6]&&n[1].length&&!n[7]&&Gh(),I=n[6]&&n[1].length&&n[7]&&Xh(n),F=n[13].length&&am(n),V=!!n[0]&&um(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(),q(a.$$.fragment),u=T(),f=T(),L&&L.c(),c=T(),I&&I.c(),d=T(),F&&F.c(),h=T(),g=_("div"),V&&V.c(),v=T(),b=_("div"),y=T(),C=_("button"),S=_("span"),S.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),ie(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(b,"class","flex-fill"),p(S,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-expanded btn-warning m-l-auto"),C.disabled=$=!n[14],p(g,"class","flex m-t-base")},m(J,x){w(J,e,x),n[19](e),w(J,t,x),w(J,i,x),m(i,s),m(s,l),m(s,o),w(J,r,x),H(a,J,x),w(J,u,x),w(J,f,x),L&&L.m(J,x),w(J,c,x),I&&I.m(J,x),w(J,d,x),F&&F.m(J,x),w(J,h,x),w(J,g,x),V&&V.m(g,null),m(g,v),m(g,b),m(g,y),m(g,C),m(C,S),M=!0,D||(O=[X(e,"change",n[20]),X(o,"click",n[21]),X(C,"click",n[26])],D=!0)},p(J,x){x[0]&4096&&ie(o,"btn-loading",J[12]);const B={};x[0]&64&&(B.class="form-field "+(J[6]?"":"field-error")),x[0]&65|x[1]&1536&&(B.$$scope={dirty:x,ctx:J}),a.$set(B),J[6]&&J[1].length&&!J[7]?L||(L=Gh(),L.c(),L.m(c.parentNode,c)):L&&(L.d(1),L=null),J[6]&&J[1].length&&J[7]?I?I.p(J,x):(I=Xh(J),I.c(),I.m(d.parentNode,d)):I&&(I.d(1),I=null),J[13].length?F?F.p(J,x):(F=am(J),F.c(),F.m(h.parentNode,h)):F&&(F.d(1),F=null),J[0]?V?V.p(J,x):(V=um(J),V.c(),V.m(g,v)):V&&(V.d(1),V=null),(!M||x[0]&16384&&$!==($=!J[14]))&&(C.disabled=$)},i(J){M||(E(a.$$.fragment,J),E(A),M=!0)},o(J){P(a.$$.fragment,J),P(A),M=!1},d(J){J&&k(e),n[19](null),J&&k(t),J&&k(i),J&&k(r),j(a,J),J&&k(u),J&&k(f),L&&L.d(J),J&&k(c),I&&I.d(J),J&&k(d),F&&F.d(J),J&&k(h),J&&k(g),V&&V.d(),D=!1,Xe(O)}}}function oE(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function Zh(n){let e;return{c(){e=_("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function rE(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&Zh();return{c(){e=_("label"),t=N("Collections"),s=T(),l=_("textarea"),r=T(),c&&c.c(),a=Je(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,h){w(d,e,h),m(e,t),w(d,s,h),w(d,l,h),Me(l,n[0]),w(d,r,h),c&&c.m(d,h),w(d,a,h),u||(f=X(l,"input",n[22]),u=!0)},p(d,h){h[1]&512&&i!==(i=d[40])&&p(e,"for",i),h[1]&512&&o!==(o=d[40])&&p(l,"id",o),h[0]&1&&Me(l,d[0]),!!d[0]&&!d[6]?c||(c=Zh(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),c&&c.d(d),d&&k(a),u=!1,f()}}}function Gh(n){let e;return{c(){e=_("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
|
||
|
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Xh(n){let e,t,i,s,l,o=n[9].length&&Qh(n),r=n[4].length&&tm(n),a=n[8].length&&lm(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){w(u,e,f),w(u,t,f),w(u,i,f),o&&o.m(i,null),m(i,s),r&&r.m(i,null),m(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=Qh(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=tm(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=lm(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),u&&k(t),u&&k(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function Qh(n){let e=[],t=new Map,i,s=n[9];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=Jh(n,s,o),a=l(r);t.set(a,e[o]=em(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Je()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=vt(e,r,l,1,o,s,t,i.parentNode,Mn,em,i,Jh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function xh(n){let e,t,i=n[32].id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&ae(s,i)},d(o){o&&k(e)}}}function em(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&xh(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){w(c,t,d),m(t,i),m(t,s),m(t,l),m(l,r),m(t,a),f&&f.m(t,null),m(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&ae(r,o),e[32].id?f?f.p(e,d):(f=xh(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&k(t),f&&f.d()}}}function tm(n){let e=[],t=new Map,i,s=n[4];const l=o=>o[35].old.id+o[35].new.id;for(let o=0;o<s.length;o+=1){let r=Kh(n,s,o),a=l(r);t.set(a,e[o]=sm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Je()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=vt(e,r,l,1,o,s,t,i.parentNode,Mn,sm,i,Kh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function nm(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=_("strong"),i=N(t),s=T(),l=_("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),m(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&ae(i,t)},d(o){o&&k(e),o&&k(s),o&&k(l)}}}function im(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&ae(s,i)},d(o){o&&k(e)}}}function sm(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,c,d=e[35].old.name!==e[35].new.name&&nm(e),h=e[35].new.id&&im(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Changed",s=T(),l=_("div"),d&&d.c(),o=T(),r=_("strong"),u=N(a),f=T(),h&&h.c(),c=T(),p(i,"class","label label-warning list-label svelte-1jx20fl"),p(l,"class","inline-flex flex-gap-5"),p(t,"class","list-item"),this.first=t},m(g,v){w(g,t,v),m(t,i),m(t,s),m(t,l),d&&d.m(l,null),m(l,o),m(l,r),m(r,u),m(l,f),h&&h.m(l,null),m(t,c)},p(g,v){e=g,e[35].old.name!==e[35].new.name?d?d.p(e,v):(d=nm(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),v[0]&16&&a!==(a=e[35].new.name+"")&&ae(u,a),e[35].new.id?h?h.p(e,v):(h=im(e),h.c(),h.m(l,null)):h&&(h.d(1),h=null)},d(g){g&&k(t),d&&d.d(),h&&h.d()}}}function lm(n){let e=[],t=new Map,i,s=n[8];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=Yh(n,s,o),a=l(r);t.set(a,e[o]=rm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Je()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=vt(e,r,l,1,o,s,t,i.parentNode,Mn,rm,i,Yh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function om(n){let e,t,i=n[32].id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(
|
||
|
imported with different IDs. You can replace them in the import if you want
|
||
|
to.</string>`,l=T(),o=_("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){w(u,e,f),m(e,t),m(e,i),m(e,s),m(e,l),m(e,o),r||(a=X(o,"click",n[24]),r=!0)},p:oe,d(u){u&&k(e),r=!1,a()}}}function um(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-secondary link-hint")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[25]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function aE(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[oE,lE],g=[];function v(b,y){return b[5]?0:1}return f=v(n),c=g[f]=h[f](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=T(),l=_("div"),o=N(n[15]),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,y){w(b,e,y),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(b,r,y),w(b,a,y),m(a,u),g[f].m(u,null),d=!0},p(b,y){(!d||y[0]&32768)&&ae(o,b[15]);let C=f;f=v(b),f===C?g[f].p(b,y):(Ae(),P(g[C],1,1,()=>{g[C]=null}),Pe(),c=g[f],c?c.p(b,y):(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&&k(e),b&&k(r),b&&k(a),g[f].d()}}}function uE(n){let e,t,i,s,l,o;e=new zi({}),i=new On({props:{$$slots:{default:[aE]},$$scope:{ctx:n}}});let r={};return l=new sE({props:r}),n[27](l),l.$on("submit",n[28]),{c(){q(e.$$.fragment),t=T(),q(i.$$.fragment),s=T(),q(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(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){j(e,a),a&&k(t),j(i,a),a&&k(s),n[27](null),j(l,a)}}}function fE(n,e,t){let i,s,l,o,r,a,u;_t(n,Rt,ee=>t(15,u=ee)),dn(Rt,u="Import collections",u);let f,c,d="",h=!1,g=[],v=[],b=!0,y=[],C=!1;S();async function S(){t(5,C=!0);try{t(2,v=await ve.collections.getFullList(200));for(let ee of v)delete ee.created,delete ee.updated}catch(ee){ve.errorResponseHandler(ee)}t(5,C=!1)}function $(){if(t(4,y=[]),!!i)for(let ee of g){const me=W.findByKey(v,"id",ee.id);!(me!=null&&me.id)||!W.hasCollectionChanges(me,ee,b)||y.push({new:ee,old:me})}}function M(){t(1,g=[]);try{t(1,g=JSON.parse(d))}catch{}Array.isArray(g)?t(1,g=W.filterDuplicatesByKey(g)):t(1,g=[]);for(let ee of g)delete ee.created,delete ee.updated,ee.schema=W.filterDuplicatesByKey(ee.schema)}function D(){var ee,me;for(let ge of g){const Q=W.findByKey(v,"name",ge.name)||W.findByKey(v,"id",ge.id);if(!Q)continue;const ce=ge.id,ye=Q.id;ge.id=ye;const Y=Array.isArray(Q.schema)?Q.schema:[],_e=Array.isArray(ge.schema)?ge.schema:[];for(const U of _e){const Z=W.findByKey(Y,"name",U.name);Z&&Z.id&&(U.id=Z.id)}for(let U of g)if(!!Array.isArray(U.schema))for(let Z of U.schema)((ee=Z.options)==null?void 0:ee.collectionId)&&((me=Z.options)==null?void 0:me.collectionId)===ce&&(Z.options.collectionId=ye)}t(0,d=JSON.stringify(g,null,4))}function O(ee){t(12,h=!0);const me=new FileReader;me.onload=async ge=>{t(12,h=!1),t(10,f.value="",f),t(0,d=ge.target.result),await ii(),g.length||(go("Invalid collections configuration."),A())},me.onerror=ge=>{console.warn(ge),go("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},me.readAsText(ee)}function A(){t(0,d=""),t(10,f.value="",f),hi({})}function L(ee){de[ee?"unshift":"push"](()=>{f=ee,t(10,f)})}const I=()=>{f.files.length&&O(f.files[0])},F=()=>{f.click()};function V(){d=this.value,t(0,d)}function J(){b=this.checked,t(3,b)}const x=()=>D(),B=()=>A(),se=()=>c==null?void 0:c.show(v,g,b);function K(ee){de[ee?"unshift":"push"](()=>{c=ee,t(11,c)})}const te=()=>A();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&g.length&&g.length===g.filter(ee=>!!ee.id&&!!ee.name).length),n.$$.dirty[0]&78&&t(9,s=v.filte
|
||
|
<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){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[Ye(mn.call(null,e)),X(l,"click",n[6])],o=!0)},p:oe,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),o=!1,Xe(r)}}}function TE(n){var h;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=W.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((h=n[0])==null?void 0:h.id)&&n[1]&&dm(n);return o=new cb({props:{routes:dE}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new yE({}),f=new CE({}),{c(){t=T(),i=_("div"),d&&d.c(),s=T(),l=_("div"),q(o.$$.fragment),r=T(),q(a.$$.fragment),u=T(),q(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(g,v){w(g,t,v),w(g,i,v),d&&d.m(i,null),m(i,s),m(i,l),H(o,l,null),m(l,r),H(a,l,null),w(g,u,v),H(f,g,v),c=!0},p(g,[v]){var b;(!c||v&12)&&e!==(e=W.joinNonEmpty([g[3],g[2],"PocketBase"]," - "))&&(document.title=e),((b=g[0])==null?void 0:b.id)&&g[1]?d?(d.p(g,v),v&3&&E(d,1)):(d=dm(g),d.c(),E(d,1),d.m(i,s)):d&&(Ae(),P(d,1,1,()=>{d=null}),Pe())},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&&k(t),g&&k(i),d&&d.d(),j(o),j(a),g&&k(u),j(f,g)}}}function DE(n,e,t){let i,s,l;_t(n,bo,d=>t(2,i=d)),_t(n,$a,d=>t(0,s=d)),_t(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,dn(Rt,l="",l),hi({}),R_())}function u(){Si("/")}async function f(){var d;if(!!(s!=null&&s.id))try{const h=await ve.settings.getAll({$cancelKey:"loadAppName"});dn(bo,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(){ve.logout()}return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&f()},[s,r,i,l,a,u,c]}class OE extends Ee{constructor(e){super(),Oe(this,e,DE,TE,De,{})}}new OE({target:document.getElementById("app")});export{Xe as A,cn as B,W as C,Si as D,Je as E,Ng as F,_t as G,Ds as H,on as I,fn as J,Jn as K,de as L,Ee as S,P as a,T as b,q as c,j as d,_ as e,p as f,w as g,m as h,Oe as i,Ye as j,Ae as k,mn as l,H as m,Pe as n,k as o,ve as p,Re as q,ie as r,De as s,E as t,X as u,Kt as v,N as w,ae as x,oe as y,Me as z};
|