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

659 lines
826 KiB
JavaScript
Raw Normal View History

(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerpolicy&&(l.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?l.credentials="include":s.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function oe(){}const gl=n=>n;function at(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 Ge(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 bt(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?at(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 Bt(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function 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 Qt(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function _(n){return document.createElement(n)}function F(n){return document.createTextNode(n)}function T(){return F(" ")}function Ke(){return F("")}function G(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Yt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function 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 Pt(n){return n===""?null:+n}function J_(n){return Array.from(n.childNodes)}function ue(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Te(n,e){n.value=e==null?"":e}function 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
2022-08-16 12:36:15 +08:00
`;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 st(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Ys=[],pe=[],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;pe.length;)pe.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(),Ge(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Tt)}}let 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 Pe(){ai={r:0,c:[],p:ai}}function Le(){ai.r||Ge(ai.c),ai=ai.p}function A(n,e){n&&n.i&&(io.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(io.has(n))return;io.add(n),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||Ge(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 it(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||(A(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(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(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=F(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||_o)+"")&&ue(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=F(t)},m(o,r){w(o,e,r),m(e,i)},p(o,r){var a,u;r&4&&t!==(t=(((a=o[11])==null?void 0:a.message)||((u=o[11])==null?void 0:u.code)||_o)+"")&&ue(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=G(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||(A(r,f),i=!0)},o(f){P(r,f),i=!1},d(f){f&&k(e),r&&r.d(f),Qt(u,f),n[9](null),s=!1,l()}}}const _o="Invalid value";function P1(n,e,t){let i;bt(n,qi,g=>t(5,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+W.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){wa(r)}Jn(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(g){st.call(this,n,g)}function h(g){pe[g?"unshift":"push"](()=>{u=g,t(1,u)})}return n.$$set=g=>{"name"in g&&t(4,r=g.name),"class"in g&&t(0,a=g.class),"$$scope"in g&&t(6,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=W.toArray(W.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,h]}class Re extends Ee{constructor(e){super(),Oe(this,e,P1,A1,De,{name:4,class:0})}}function L1(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("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),Te(l,n[0]),l.focus(),r||(a=G(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&Te(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=F("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),j(s,e,null),m(e,l),j(o,e,null),m(e,r),j(a,e,null),m(e,u),m(e,f),c=!0,d||(h=G(e,"submit",Yt(n[4])),d=!0)},p(g,[v]){const b={};v&1537&&(b.$$scope={dirty:v,ctx:g}),s.$set(b);const 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||(A(s.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){P(s.$$.fragment,g),P(o.$$.fragment,g),P(a.$$.fragment,g),c=!1},d(g){g&&k(e),q(s),q(o),q(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 we.admins.create({email:s,password:l,passwordConfirm:o}),await we.admins.authViaEmail(s,l),i("submit")}catch(d){we.errorResponseHandler(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class 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(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function j1(n){let e,t;return e=new H1({}),e.$on("submit",n[1]),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p:oe,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function q1(n){let e,t,i=n[0]&&Iu(n);return{c(){i&&i.c(),e=Ke()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Iu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(Pe(),P(i,1,1,()=>{i=null}),Le())},i(s){t||(A(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")){we.logout(!1),t(0,i=!0);return}we.authStore.isValid?Si("/collections"):we.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 Ft=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)=>`
2022-08-16 12:36:15 +08:00
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),Te(e,n[7]),i||(s=G(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&Te(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={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=new o(r(n)),pe.push(()=>Fe(e,"value",l)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=Ke()},m(a,u){e&&j(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],He(()=>t=!1)),o!==(o=a[4])){if(e){Pe();const c=e;P(c.$$.fragment,1,0,()=>{q(c,1)}),Le()}o?(e=new o(r(a)),pe.push(()=>Fe(e,"value",l)),e.$on("submit",a[10]),V(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&q(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=G(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&A(r,1):(r=Nu(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(Pe(),P(r,1,1,()=>{r=null}),Le())},i(a){s||(A(r),a&&Tt(()=>{i||(i=it(t,Un,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),a&&(i||(i=it(t,Un,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),l=!1,o()}}}function 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=it(e,Un,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=it(e,Un,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function 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=[G(t,"submit",Yt(n[10])),G(e,"click",ei(n[11]))],f=!0)},p(b,[y]){let C=o;o=g(b),o===C?h[o].p(b,y):(Pe(),P(h[C],1,1,()=>{h[C]=null}),Le(),r=h[o],r?r.p(b,y):(r=h[o]=d[o](b),r.c()),A(r,1),r.m(t,a)),b[0].length||b[7].length?v?(v.p(b,y),y&129&&A(v,1)):(v=Fu(b),v.c(),A(v,1),v.m(t,null)):v&&(Pe(),P(v,1,1,()=>{v=null}),Le())},i(b){u||(A(r),A(v),u=!0)},o(b){P(r),P(v),u=!1},d(b){b&&k(e),h[o].d(),v&&v.d(),f=!1,Ge(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 Ai(()=>import("./FilterAutocompleteInput.9df887af.js"),["FilterAutocompleteInput.9df887af.js","index.afc1faa1.js"],import.meta.url)).default),t(5,f=!1))}Jn(()=>{v()});function b(M){st.call(this,n,M)}function y(M){d=M,t(7,d),t(0,l)}function C(M){pe[M?"unshift":"push"](()=>{c=M,t(6,c)})}function S(){d=this.value,t(7,d),t(0,l)}const $=()=>{h(!1),g()};return n.$$set=M=>{"value"in M&&t(0,l=M.value),"placeholder"in M&&t(1,o=M.placeholder),"autocompleteCollection"in M&&t(2,r=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,
2022-08-16 12:36:15 +08:00
<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=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function 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=G(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 X,ae,ve;let t,i,s,l=((X=e[21].method)==null?void 0:X.toUpperCase())+"",o,r,a,u,f,c=e[21].url+"",d,h,g,v,b,y,C=(e[21].referer||"N/A")+"",S,$,M,D,E,O=e[21].status+"",L,I,N,B,U,ee,K,se,Y,te,J=(((ae=e[21].meta)==null?void 0:ae.errorMessage)||((ve=e[21].meta)==null?void 0:ve.errorData))&&Vu();B=new $i({props:{date:e[21].created}});function _e(){return e[16](e[21])}function be(...H){return e[17](e[21],...H)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),o=F(l),a=T(),u=_("td"),f=_("span"),d=F(c),g=T(),J&&J.c(),v=T(),b=_("td"),y=_("span"),S=F(C),M=T(),D=_("td"),E=_("span"),L=F(O),I=T(),N=_("td"),V(B.$$.fragment),U=T(),ee=_("td"),ee.innerHTML='<i class="ri-arrow-right-line"></i>',K=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(E,"class","label"),ie(E,"label-danger",e[21].status>=400),p(D,"class","col-type-number col-field-status"),p(N,"class","col-type-date col-field-created"),p(ee,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(H,me){w(H,t,me),m(t,i),m(i,s),m(s,o),m(t,a),m(t,u),m(u,f),m(f,d),m(u,g),J&&J.m(u,null),m(t,v),m(t,b),m(b,y),m(y,S),m(t,M),m(t,D),m(D,E),m(E,L),m(t,I),m(t,N),j(B,N,null),m(t,U),m(t,ee),m(t,K),se=!0,Y||(te=[G(t,"click",_e),G(t,"keydown",be)],Y=!0)},p(H,me){var Q,Se,je;e=H,(!se||me&8)&&l!==(l=((Q=e[21].method)==null?void 0:Q.toUpperCase())+"")&&ue(o,l),(!se||me&8&&r!==(r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(s,"class",r),(!se||me&8)&&c!==(c=e[21].url+"")&&ue(d,c),(!se||me&8&&h!==(h=e[21].url))&&p(f,"title",h),((Se=e[21].meta)==null?void 0:Se.errorMessage)||((je=e[21].meta)==null?void 0:je.errorData)?J||(J=Vu(),J.c(),J.m(u,null)):J&&(J.d(1),J=null),(!se||me&8)&&C!==(C=(e[21].referer||"N/A")+"")&&ue(S,C),(!se||me&8&&$!==($=e[21].referer))&&p(y,"title",$),me&8&&ie(y,"txt-hint",!e[21].referer),(!se||me&8)&&O!==(O=e[21].status+"")&&ue(L,O),me&8&&ie(E,"label-danger",e[21].status>=400);const x={};me&8&&(x.date=e[21].created),B.$set(x)},i(H){se||(A(B.$$.fragment,H),se=!0)},o(H){P(B.$$.fragment,H),se=!1},d(H){H&&k(t),J&&J.d(),q(B),Y=!1,Ge(te)}}}function Bu(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=F("Showing "),s=F(i),l=F(" of "),o=F(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a&8&&i!==(i=r[3].length+"")&&ue(s,i),a&16&&ue(o,r[4])},d(r){r&&k(e)}}}function 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=F("Load more ("),o=F(l),r=F(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),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=G(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&ue(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,E=[],O=new Map,L,I,N,B;function U(Q){n[11](Q)}let ee={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[nv]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),l=new sn({props:ee}),pe.push(()=>Fe(l,"sort",U));function K(Q){n[12](Q)}let se={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots
2022-08-16 12:36:15 +08:00
* 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 It(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function pt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Wt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Rn(n,e){return Wt(n)?n:e}function _t(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 Vt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function Et(n,e,t,i){let s,l,o;if(It(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(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(It(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=It(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 Hi(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",ji=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 Ut=Math.PI,At=2*Ut,vv=At+Ut,wo=Number.POSITIVE_INFINITY,yv=Ut/180,zt=Ut/2,js=Ut/4,Ku=Ut*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*(Ut/180)}function Ca(n){return n*(180/Ut)}function Zu(n){if(!Wt(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*Ut&&(l+=At),{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)%At-Ut}function Pn(n){return(n%At+At)%At}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,
2022-08-16 12:36:15 +08:00
* @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 Ii=(n,e,t)=>Math.max(Math.min(n,t),e);function Zs(n){return Ii(wl(n*2.55),0,255)}function Ri(n){return Ii(wl(n*255),0,255)}function yi(n){return Ii(wl(n/2.55)/100,0,1)}function ef(n){return Ii(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(Ri)}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]):Ri(+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:"
2022-08-16 12:36:15 +08:00
* 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"];vt.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const Qy=Object.keys(vt.animation);vt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});vt.set("animations",{colors:{type:"color",properties:Xy},numbers:{type:"number",properties:Gy}});vt.describe("animations",{_fallback:"animation"});vt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class 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
2022-08-16 12:36:15 +08:00
`)>-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,Et(n.title,S),t.font=a.string,Et(n.beforeBody.concat(n.afterBody),S),C=e.displayColors?o+2+e.boxPadding:0,Et(i,$=>{Et($.before,S),Et($.lines,S),Et($.after,S)}),C=0,t.font=f.string,Et(n.footer,S),t.restore(),b+=g.width,{width:b,height:v}}function 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 Vi(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 Et(e,l=>{const o={before:[],lines:[],after:[]},r=Gf(i,l);ri(o.before,vi(r.beforeLabel.call(this,l))
2022-08-16 12:36:15 +08:00
* 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=it(e,Tn,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=it(e,Tn,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function zw(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=F(n[1]),t=T(),s=F(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&ue(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&ue(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function Bw(n){let e;return{c(){e=F("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&&A(o,1):(o=sc(),o.c(),A(o,1),o.m(e,t)):o&&(Pe(),P(o,1,1,()=>{o=null}),Le()),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){A(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),we.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),we.errorResponseHandler(h,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Jn(()=>(Eo.register(zi,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){pe[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o
2022-08-16 12:36:15 +08:00
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function C(S){return S instanceof a?new a(S.type,C(S.content),S.alias):Array.isArray(S)?S.map(C):S.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(C){return Object.prototype.toString.call(C).slice(8,-1)},objId:function(C){return C.__id||Object.defineProperty(C,"__id",{value:++l}),C.__id},clone:function C(S,$){$=$||{};var M,D;switch(r.util.type(S)){case"Object":if(D=r.util.objId(S),$[D])return $[D];M={},$[D]=M;for(var E in S)S.hasOwnProperty(E)&&(M[E]=C(S[E],$));return M;case"Array":return D=r.util.objId(S),$[D]?$[D]:(M=[],$[D]=M,S.forEach(function(O,L){M[L]=C(O,$)}),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],E={};for(var O in D)if(D.hasOwnProperty(O)){if(O==S)for(var L in $)$.hasOwnProperty(L)&&(E[L]=$[L]);$.hasOwnProperty(O)||(E[O]=D[O])}var I=M[C];return M[C]=E,r.languages.DFS(r.languages,function(N,B){B===I&&N!=C&&(this[N]=E)}),E},DFS:function C(S,$,M,D){D=D||{};var E=r.util.objId;for(var O in S)if(S.hasOwnProperty(O)){$.call(S,O,S[O],M||O);var L=S[O],I=r.util.type(L);I==="Object"&&!D[E(L)]?(D[E(L)]=!0,C(L,$,null,D)):I==="Array"&&!D[E(L)]&&(D[E(L)]=!0,C(L,$,O,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,E;E=M.elements[D++];)r.highlightElement(E,S===!0,M.callback)},highlightElement:function(C,S,$){var M=r.util.getLanguage(C),D=r.languages[M];r.util.setLanguage(C,M);var E=C.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(E,M);var O=C.textContent,L={element:C,language:M,grammar:D,code:O};function I(B){L.highlightedCode=B,r.hooks.run("before-insert",L),L.element.innerHTML=L.highlightedCode,r.hooks.run("after-highlight",L),r.hooks.run("complete",L),$&&$.call(L.element)}if(r.hooks.run("before-sanity-check",L),E=L.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.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 N=new Worker(r.filename);N.onmessage=function(B){I(B.data)},N.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
2022-08-16 12:36:15 +08:00
`),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 E=n[18].default,O=wn(E,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"),O&&O.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||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function 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}),pe.push(()=>Fe(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]+".options.onlyDomains"),p(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(wt.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||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function 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"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(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}),pe.push(()=>Fe(e,"key",l)),pe.push(()=>Fe(e,"options",o)),{c(){V(e.$$.fragment)},m(a,u){j(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],He(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],He(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){q(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
2022-08-16 12:36:15 +08:00
<span class='flatpickr-weekday'>
`+z.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function _e(){t.calendarContainer.classList.add("hasWeeks");var R=St("div","flatpickr-weekwrapper");R.appendChild(St("span","flatpickr-weekday",t.l10n.weekAbbreviation));var z=St("div","flatpickr-weeks");return R.appendChild(z),{weekWrapper:R,weekNumbers:z}}function be(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,Je("onYearChange"),U()),B(),Je("onMonthChange"),rt())}function X(R,z){if(R===void 0&&(R=!0),z===void 0&&(z=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,z===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Mr(t.config),re=ne.hours,Ae=ne.minutes,le=ne.seconds;h(re,Ae,le)}t.redraw(),R&&Je("onChange")}function ae(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Je("onClose")}function ve(){t.config!==void 0&&Je("onDestroy");for(var R=t._handlers.length;R--;)t._handlers[R].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var z=t.calendarContainer.parentNode;if(z.lastChild&&z.removeChild(z.lastChild),z.parentNode){for(;z.firstChild;)z.parentNode.insertBefore(z.firstChild,z);z.parentNode.removeChild(z)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ne){try{delete t[ne]}catch{}})}function H(R){return t.calendarContainer.contains(R)}function me(R){if(t.isOpen&&!t.config.inline){var z=En(R),ne=H(z),re=z===t.input||z===t.altInput||t.element.contains(z)||R.path&&R.path.indexOf&&(~R.path.indexOf(t.input)||~R.path.indexOf(t.altInput)),Ae=!re&&!ne&&!H(R.relatedTarget),le=!t.config.ignoredFocusElements.some(function(de){return de.contains(z)});Ae&&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 x(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(),Je("onYearChange"),U())}}function Q(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;
2022-08-18 03:29:11 +08:00
Leave empty for no restriction.`,position:"top"})),$=!0)},p(O,L){(!S||L&1024&&l!==(l=O[10]))&&p(e,"for",l);const I={};L&1024&&(I.id=O[10]),!a&&L&1&&(a=!0,I.value=O[0].mimeTypes,He(()=>a=!1)),r.$set(I);const N={};L&2049&&(N.$$scope={dirty:L,ctx:O}),C.$set(N)},i(O){S||(A(r.$$.fragment,O),A(C.$$.fragment,O),S=!0)},o(O){P(r.$$.fragment,O),P(C.$$.fragment,O),S=!1},d(O){O&&k(e),O&&k(o),q(r,O),O&&k(u),O&&k(f),q(C),$=!1,M()}}}function NS(n){let e;return{c(){e=_("ul"),e.innerHTML=`<li><strong>WxH</strong>
(eg. 100x50) - crop to WxH viewbox (from center)</li>
<li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li>
<li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li>
<li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li>
<li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li>
<li><strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function RS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M;function D(O){n[9](O)}let E={id:n[10],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(E.value=n[0].thumbs),r=new cs({props:E}),pe.push(()=>Fe(r,"value",D)),C=new Mi({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[NS]},$$scope:{ctx:n}}}),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),c=_("span"),c.textContent="Use comma as separator.",d=T(),h=_("button"),g=_("span"),g.textContent="Supported formats",v=T(),b=_("i"),y=T(),V(C.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(b,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(O,L){w(O,e,L),m(e,t),m(e,i),m(e,s),w(O,o,L),j(r,O,L),w(O,u,L),w(O,f,L),m(f,c),m(f,d),m(f,h),m(h,g),m(h,v),m(h,b),m(h,y),j(C,h,null),S=!0,$||(M=Ye(wt.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),$=!0)},p(O,L){(!S||L&1024&&l!==(l=O[10]))&&p(e,"for",l);const I={};L&1024&&(I.id=O[10]),!a&&L&1&&(a=!0,I.value=O[0].thumbs,He(()=>a=!1)),r.$set(I);const N={};L&2048&&(N.$$scope={dirty:L,ctx:O}),C.$set(N)},i(O){S||(A(r.$$.fragment,O),A(C.$$.fragment,O),S=!0)},o(O){P(r.$$.fragment,O),P(C.$$.fragment,O),S=!1},d(O){O&&k(e),O&&k(o),q(r,O),O&&k(u),O&&k(f),q(C),$=!1,M()}}}function HS(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:[RS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),f=T(),c=_("div"),V(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(c,"class","col-sm-12"),p(e,"class","grid")},m(g,v){w(g,e,v),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),m(e,f),m(e,c),j(d,c,null),h=!0},p(g,[v]){const b={};v&2&&(b.name="schema."+g[1]+".options.maxSize"),v&3073&&(b.$$scope={dirty:v,ctx:g}),i.$set(b);const y={};v&2&&(y.name="schema."+g[1]+".options.maxSelect"),v&3073&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const C={};v&2&&(C.name="schema."+g[1]+".options.mimeTypes"),v&3073&&(C.$$scope={dirty:v,ctx:g}),u.$set(C);const S={};v&2&&(S.name="schema."+g[1]+".options.thumbs"),v&3073&&(S.$$scope={dirty:v,ctx:g}),d.$set(S)},i(g){h||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),h=!0)},o(g){P(i.$$.fragment,g),P(o.$$.fragment,g),P(u.$$.fragment,g),P(d.$$.fragment,g),h=!1},d(g){g&&k(e),q(i),q(o),q(u),q(d)}}}function jS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=Pt(this.value),t(0,s)}function o(){s.maxSelect=Pt(this.value),t(0,s)}function r(h){n.$$.not_equal(s.mimeTypes,h)&&(s.mimeTypes=h,t(0,s))}const a=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},u=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],s)},f=()=>{t(0,s.mimeTypes=["video/
2022-08-16 12:36:15 +08:00
form-field
required
`+(n[5]?"":"invalid")+`
`+(n[0].id&&n[0].system?"disabled":"")+`
`,name:"schema."+n[1]+".name",$$slots:{default:[xS,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}});const E=[f3,u3,a3,r3,o3,l3,s3,i3,n3,t3,e3],O=[];function L(B,U){return B[0].type==="text"?0:B[0].type==="number"?1:B[0].type==="bool"?2:B[0].type==="email"?3:B[0].type==="url"?4:B[0].type==="date"?5:B[0].type==="select"?6:B[0].type==="json"?7:B[0].type==="file"?8:B[0].type==="relation"?9:B[0].type==="user"?10:-1}~(f=L(n))&&(c=O[f]=E[f](n)),g=new Re({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[c3,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}});let I=n[0].type!=="file"&&Rc(n),N=!n[0].toDelete&&Hc(n);return{c(){e=_("form"),t=_("div"),i=_("div"),V(s.$$.fragment),l=T(),o=_("div"),V(r.$$.fragment),a=T(),u=_("div"),c&&c.c(),d=T(),h=_("div"),V(g.$$.fragment),v=T(),b=_("div"),I&&I.c(),y=T(),N&&N.c(),C=T(),S=_("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(h,"class","col-sm-4 flex"),p(b,"class","col-sm-4 flex"),p(t,"class","grid"),p(S,"type","submit"),p(S,"class","hidden"),p(S,"tabindex","-1"),p(e,"class","field-form")},m(B,U){w(B,e,U),m(e,t),m(t,i),j(s,i,null),m(t,l),m(t,o),j(r,o,null),m(t,a),m(t,u),~f&&O[f].m(u,null),m(t,d),m(t,h),j(g,h,null),m(t,v),m(t,b),I&&I.m(b,null),m(t,y),N&&N.m(t,null),m(e,C),m(e,S),$=!0,M||(D=G(e,"submit",Yt(n[31])),M=!0)},p(B,U){const ee={};U[0]&1&&(ee.class="form-field required "+(B[0].id?"disabled":"")),U[0]&2&&(ee.name="schema."+B[1]+".type"),U[0]&1|U[1]&384&&(ee.$$scope={dirty:U,ctx:B}),s.$set(ee);const K={};U[0]&33&&(K.class=`
2022-08-16 12:36:15 +08:00
form-field
required
`+(B[5]?"":"invalid")+`
`+(B[0].id&&B[0].system?"disabled":"")+`
`),U[0]&2&&(K.name="schema."+B[1]+".name"),U[0]&33|U[1]&384&&(K.$$scope={dirty:U,ctx:B}),r.$set(K);let se=f;f=L(B),f===se?~f&&O[f].p(B,U):(c&&(Pe(),P(O[se],1,1,()=>{O[se]=null}),Le()),~f?(c=O[f],c?c.p(B,U):(c=O[f]=E[f](B),c.c()),A(c,1),c.m(u,null)):c=null);const Y={};U[0]&1|U[1]&384&&(Y.$$scope={dirty:U,ctx:B}),g.$set(Y),B[0].type!=="file"?I?(I.p(B,U),U[0]&1&&A(I,1)):(I=Rc(B),I.c(),A(I,1),I.m(b,null)):I&&(Pe(),P(I,1,1,()=>{I=null}),Le()),B[0].toDelete?N&&(Pe(),P(N,1,1,()=>{N=null}),Le()):N?(N.p(B,U),U[0]&1&&A(N,1)):(N=Hc(B),N.c(),A(N,1),N.m(t,null))},i(B){$||(A(s.$$.fragment,B),A(r.$$.fragment,B),A(c),A(g.$$.fragment,B),A(I),A(N),$=!0)},o(B){P(s.$$.fragment,B),P(r.$$.fragment,B),P(c),P(g.$$.fragment,B),P(I),P(N),$=!1},d(B){B&&k(e),q(s),q(r),~f&&O[f].d(),q(g),I&&I.d(),N&&N.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(wt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=it(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=it(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function 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=G(e,"click",ei(n[15])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function m3(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=F(r),f=T(),y&&y.c(),c=T(),d=_("div"),h=T(),C&&C.c(),g=T(),S&&S.c(),v=Ke(),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||"-")+"")&&ue(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&&A(C,1):(C=Wc(),C.c(),A(C,1),C.m(g.parentNode,g)):C&&(Pe(),P(C,1,1,()=>{C=null}),Le()),$[0].toDelete?S?S.p($,M):(S=Yc($),S.c(),S.m(v.parentNode,v)):S&&(S.d(1),S=null)},i($){b||(A(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 g3(n){let e,t,i={single:!0,interactive:n[8],class:n[2]||n[0].toDel
2022-08-16 12:36:15 +08:00
<code>@request.query.*</code>
<code>@request.data.*</code>
2022-08-18 03:29:11 +08:00
<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:",E=T(),O=_("div"),O.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",L=T(),I=_("hr"),N=T(),B=_("p"),B.innerHTML=`Example rule:
2022-08-16 12:36:15 +08:00
<br/>
<code>@request.user.id!=&quot;&quot; &amp;&amp; created&gt;&quot;2022-01-01 00:00:00&quot;</code>`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p(C,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(D,"class","m-b-0"),p(O,"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(Y,te){w(Y,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 J=0;J<se.length;J+=1)se[J].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,E),m(i,O),m(i,L),m(i,I),m(i,N),m(i,B),ee=!0},p(Y,te){if(te&1){K=Y[0].schema;let J;for(J=0;J<K.length;J+=1){const _e=Gc(Y,K,J);se[J]?se[J].p(_e,te):(se[J]=Qc(_e),se[J].c(),se[J].m(o,null))}for(;J<se.length;J+=1)se[J].d(1);se.length=K.length}},i(Y){ee||(Y&&Tt(()=>{U||(U=it(e,tn,{duration:150},!0)),U.run(1)}),ee=!0)},o(Y){Y&&(U||(U=it(e,tn,{duration:150},!1)),U.run(0)),ee=!1},d(Y){Y&&k(e),Qt(se,Y),Y&&U&&U.end()}}}function w3(n){let e,t=n[18].name+"",i;return{c(){e=_("code"),i=F(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[18].name+"")&&ue(i,t)},d(s){s&&k(e)}}}function $3(n){let e,t=n[18].name+"",i,s;return{c(){e=_("code"),i=F(t),s=F(".*")},m(l,o){w(l,e,o),m(e,i),m(e,s)},p(l,o){o&1&&t!==(t=l[18].name+"")&&ue(i,t)},d(l){l&&k(e)}}}function Qc(n){let e;function t(l,o){return l[18].type==="relation"||l[18].type==="user"?$3:w3}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function S3(n){let e=[],t=new Map,i,s,l=Object.entries(n[6]);const o=r=>r[13];for(let r=0;r<l.length;r+=1){let a=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=Ke()},m(r,a){for(let u=0;u<e.length;u+=1)e[u].m(r,a);w(r,i,a),s=!0},p(r,a){a&131163&&(l=Object.entries(r[6]),Pe(),e=yt(e,a,o,1,r,l,t,i.parentNode,Zt,xc,i,Zc),Le())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(e[a]);s=!0}},o(r){for(let a=0;a<e.length;a+=1)P(e[a]);s=!1},d(r){for(let a=0;a<e.length;a+=1)e[a].d(r);r&&k(i)}}}function C3(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 M3(n){let e,t,i;function s(){return n[9](n[13])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Ye(wt.call(null,e,"Lock and set to Admins only")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ge(i)}}}function T3(n){let e,t,i;function s(){return n[8](n[13])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-unlock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Ye(wt.call(null,e,"Unlock and set custom rule")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ge(i)}}}function D3(n){let e;return{c(){e=F("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function O3(n){let e;return{c(){e=F("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function E3(n){let e,t=n[14]+"",i,s,l=Li(n[0][n[13]])?"Admins only":"Custom rule",o,r,a,u,f=n[13],c,d,h,g,v;const b=()=>n[10](u,f),y=()=>n[10](null,f);function C(O){n[11](O,n[13])}var S=n[4];function $(O){let L={id:O[17],baseCollection:O[0],disabled:Li(O[0][O[13]])};return O[0][O[13]]!==void 0&&(L.value=O[0][O[13]]),{props:L}}S&&(u=new S($(n)),b(),pe.push(()=>Fe(u,"value",C)));function M(O,L){return L&1&&(g=null),g==null&&(g=!!Li(O[0][O[13]])),g?O3:D3}let D=M(n,-1),E=D(n);return{c(){e=_("label"),i=F(t),s=F(" - "),o=F(l),a=T(),u&&V(u.$$.fragment),d=T(),h=_("div"),E.c(),p(e,"for",r=n[17]),p(h,"class","help-block")},m(O,L){w(O,e,L),m(e,i),m(e,s),m(e,o),w(O,a,L),u&&j(u,O,L),w(O,d,L),w(O,h,L),E.m(h,null),v=!0},p(O,L){n=O,(!v||L&1)&&l!==(l=Li(n[0][n[13]])?"Admins only":"Custom rule")
2022-08-16 12:36:15 +08:00
<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=F(o),a=T(),b&&b.c(),u=T(),c.c(),d=Ke(),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex"),p(e,"class","block m-b-base")},m($,M){w($,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),b&&b.m(e,null),w($,u,M),C[f].m($,M),w($,d,M),h=!0,g||(v=G(l,"click",n[7]),g=!0)},p($,[M]){(!h||M&4)&&o!==(o=$[2]?"Hide available fields":"Show available fields")&&ue(r,o),$[2]?b?(b.p($,M),M&4&&A(b,1)):(b=Xc($),b.c(),A(b,1),b.m(e,null)):b&&(Pe(),P(b,1,1,()=>{b=null}),Le());let D=f;f=S($),f===D?C[f].p($,M):(Pe(),P(C[D],1,1,()=>{C[D]=null}),Le(),c=C[f],c?c.p($,M):(c=C[f]=y[f]($),c.c()),A(c,1),c.m(d.parentNode,d))},i($){h||(A(b),A(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 Li(n){return n===null}function P3(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 Ai(()=>import("./FilterAutocompleteInput.9df887af.js"),["FilterAutocompleteInput.9df887af.js","index.afc1faa1.js"],import.meta.url)).default)}catch(b){console.warn(b),t(4,r=null)}t(5,a=!1)}Jn(()=>{f()});const c=()=>t(2,l=!l),d=async b=>{var y;t(0,i[b]=s[b]||"",i),await ii(),(y=o[b])==null||y.focus()},h=b=>{t(1,s[b]=i[b],s),t(0,i[b]=null,i)};function g(b,y){pe[b?"unshift":"push"](()=>{o[y]=b,t(3,o)})}function v(b,y){n.$$.not_equal(i[y],b)&&(i[y]=b,t(0,i))}return n.$$set=b=>{"collection"in b&&t(0,i=b.collection)},[i,s,l,o,r,a,u,c,d,h,g,v]}class L3 extends Ee{constructor(e){super(),Oe(this,e,P3,A3,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=F(`Renamed collection
2022-08-16 12:36:15 +08:00
`),s=_("strong"),o=F(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=F(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,g){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&2&&l!==(l=h[1].originalName+"")&&ue(o,l),g&2&&c!==(c=h[1].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function 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=F(`Renamed field
2022-08-18 03:29:11 +08:00
`),s=_("strong"),o=F(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=F(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,g){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&16&&l!==(l=h[14].originalName+"")&&ue(o,l),g&16&&c!==(c=h[14].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function ld(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=_("li"),t=F("Removed field "),i=_("span"),l=F(s),o=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+"")&&ue(l,s)},d(r){r&&k(e)}}}function I3(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(),Qt(b,S),Qt(C,S)}}}function F3(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 N3(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=[G(e,"click",n[8]),G(i,"click",n[9])],s=!0)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Ge(l)}}}function R3(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[N3],header:[F3],default:[I3]},$$scope:{ctx:n}};return e=new mi({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&524346&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),q(e,s)}}}function H3(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){pe[y?"unshift":"push"](()=>{r=y,t(2,r)})}function v(y){st.call(this,n,y)}function b(y){st.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=(a==null?void 0:a.originalName)!=(a==null?void 0:a.name)),n.$$.dirty&2&&t(4,s=(a==null?void 0:a.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(y=>y.id&&y.toDelete))||[])},[f,a,r,l,s,i,c,u,d,h,g,v,b]}class j3 extends Ee{constructor(e){super(),Oe(this,e,H3,R3,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 L3({props:o}),pe.push(()=>Fe(t,"collection",l)),{c(){e=_("div"),V(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),j(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],He(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&k(e),q(t)}}}function q3(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 k3({props:a}),pe.push(()=>Fe(i,"collection",r));let u=n[9]===ml&&od(n);return{c(){e=_("div"),t=_("div"),V(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),j(i,t,null),m(e,l),u&&u.m(e,null),o=!0},p(f,c){const d={};!s&&c[0]&4&&(s=!0,d.collection=f[2],He(()=>s=!1)),i.$set(d),c[0]&512&&ie(t,"active",f[9]===os),f[9]===ml?u?(u.p(f,c),c[0]&512&&A(u,1)):(u=od(f),u.c(),A(u,1),u.m(e,null)):u&&(Pe(),P(u,1,1,()=>{u=null}),Le())},i(f){o||(A(i.$$.fragment,f),A(u),o=!0)},o(f){P(i.$$.fragment,f),P(u),o=!1},d(f){f&&k(e),q(i),u&&u.d()}}}function rd(n){let e,t,i,s,l,o,r;return o=new Mi({props:{class:"dropdown dropdown-right m
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=G(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 z3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[2].system&&ad();return{c(){e=_("label"),t=F("Name"),s=T(),l=_("input"),u=T(),h&&h.c(),f=Ke(),p(e,"for",i=n[38]),p(l,"type","text"),p(l,"id",o=n[38]),l.required=!0,l.disabled=n[11],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",'eg. "posts"'),l.value=a=n[2].name},m(g,v){w(g,e,v),m(e,t),w(g,s,v),w(g,l,v),w(g,u,v),h&&h.m(g,v),w(g,f,v),n[2].isNew&&l.focus(),c||(d=G(l,"input",n[21]),c=!0)},p(g,v){v[1]&128&&i!==(i=g[38])&&p(e,"for",i),v[1]&128&&o!==(o=g[38])&&p(l,"id",o),v[0]&2048&&(l.disabled=g[11]),v[0]&4&&r!==(r=g[2].isNew)&&(l.autofocus=r),v[0]&4&&a!==(a=g[2].name)&&l.value!==a&&(l.value=a),g[2].system?h||(h=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=wt.call(null,e,n[12])),l=!0)},p(r,a){t&&Kn(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&Tt(()=>{i||(i=it(e,Tn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=it(e,Tn,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function 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(wt.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Tt(()=>{t||(t=it(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=it(e,Tn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function B3(n){var N,B,U,ee,K,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((N=n[4])==null?void 0:N.schema),b,y,C,S,$=!W.isEmpty((B=n[4])==null?void 0:B.listRule)||!W.isEmpty((U=n[4])==null?void 0:U.viewRule)||!W.isEmpty((ee=n[4])==null?void 0:ee.createRule)||!W.isEmpty((K=n[4])==null?void 0:K.updateRule)||!W.isEmpty((se=n[4])==null?void 0:se.deleteRule),M,D,E,O=!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:[z3,({uniqueId:Y})=>({38:Y}),({uniqueId:Y})=>[0,Y?128:0]]},$$scope:{ctx:n}}});let L=v&&ud(n),I=$&&fd();return{c(){e=_("h4"),i=F(t),s=T(),O&&O.c(),l=T(),o=_("form"),V(r.$$.fragment),a=T(),u=_("input"),f=T(),c=_("div"),d=_("button"),h=_("span"),h.textContent="Fields",g=T(),L&&L.c(),b=T(),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(Y,te){w(Y,e,te),m(e,i),w(Y,s,te),O&&O.m(Y,te),w(Y,l,te),w(Y,o,te),j(r,o,null),m(o,a),m(o,u),w(Y,f,te),w(Y,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||(E=[G(o,"submit",Yt(n[22])),G(d,"click",n[23]),G(y,"click",n[24])],D=!0)},p(Y,te){var _e,be,X,ae,ve,H;(!M||te[0]&4)&&t!==(t=Y[2].isNew?"New collection":"Edit collection")&&ue(i,t),!Y[2].isNew&&!Y[2].system?O?(O.p(Y,te),te[0]&4&&A(O,1)):(O=rd(Y),O.c(),A(O,1),O.m(l.parentNode,l)):O&&(Pe(),P(O,1,1,()=>{O=null}),Le());const J={};te[0]&2048&&(J.class="form-field required m-b-0 "+(Y[11]?"disabled":"")),te[0]&2052|te[1]&384&&(J.$$scope={dirty:te,ctx:Y}),r.$set(J),te[0]&16&&(v=!W.isEmpty((_e=Y[4])==null?void 0:_e.schema)),v?L?(L.p(Y,te),te[0]&16&&A(L,1)):(L=ud(Y),L.c(),A(L,1),L.m(d,null)):L&&(Pe(),P(L,1,1,()=>{L=null}),Le()),te[0]&512&&ie(d,"active",Y[9]===os),te[0]&16&&($=!W.isEmpty((be=Y[4])==null?void 0:be.listRule)||!W.isEmpty((X=Y[4])==null?void 0:X.viewRule)||!W.isEmpty((ae=Y[4])==null?v
<span class="txt">New collection</span>`,y=T(),V(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,N){w(I,e,N),m(e,t),m(t,i),m(i,s),m(s,l),m(i,o),m(i,r),Te(r,n[0]),m(e,a),m(e,u),m(e,f),m(e,c);for(let B=0;B<d.length;B+=1)d[B].m(c,null);O&&O.m(c,null),m(e,g),m(e,v),m(v,b),w(I,y,N),j(C,I,N),S=!0,$||(M=[G(l,"click",n[8]),G(r,"input",n[9]),G(b,"click",n[11])],$=!0)},p(I,[N]){N&16&&ie(l,"hidden",!I[4]),N&1&&r.value!==I[0]&&Te(r,I[0]),N&16&&ie(i,"active",I[4]),N&106&&(D=I[3],d=yt(d,N,E,1,I,D,h,c,Mn,hd,null,cd),!D.length&&O?O.p(I,N):D.length?O&&(O.d(1),O=null):(O=dd(I),O.c(),O.m(c,null)));const B={};C.$set(B)},i(I){S||(A(C.$$.fragment,I),S=!0)},o(I){P(C.$$.fragment,I),S=!1},d(I){I&&k(e);for(let N=0;N<d.length;N+=1)d[N].d();O&&O.d(),I&&k(y),n[12](null),q(C,I),$=!1,Ge(M)}}}function G3(n,e,t){let i,s,l,o,r;bt(n,ci,b=>t(5,o=b)),bt(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){pe[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 X3 extends Ee{constructor(e){super(),Oe(this,e,G3,Z3,De,{})}}function Q3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be,X,ae,ve,H,me,x,Q,Se,je,Ue,Z,ge,ce,$e,Ze;return{c(){e=_("p"),e.innerHTML=`The syntax basically follows the format
2022-08-16 12:36:15 +08:00
<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=F(` - 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"),E=_("code"),E.textContent=">",O=T(),L=_("span"),L.textContent="Greater than",I=T(),N=_("li"),B=_("code"),B.textContent=">=",U=T(),ee=_("span"),ee.textContent="Greater than or equal",K=T(),se=_("li"),Y=_("code"),Y.textContent="<",te=T(),J=_("span"),J.textContent="Less than or equal",_e=T(),be=_("li"),X=_("code"),X.textContent="<=",ae=T(),ve=_("span"),ve.textContent="Less than or equal",H=T(),me=_("li"),x=_("code"),x.textContent="~",Q=T(),Se=_("span"),Se.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
match)`,je=T(),Ue=_("li"),Z=_("code"),Z.textContent="!~",ge=T(),ce=_("span"),ce.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,$e=T(),Ze=_("p"),Ze.innerHTML=`To group and combine several expressions you could use brackets
<code>(...)</code>, <code>&amp;&amp;</code> (AND) and <code>||</code> (OR) tokens.`,p(r,"class","txt-danger"),p(h,"class","filter-op svelte-1w7s5nw"),p(v,"class","txt-hint"),p(C,"class","filter-op svelte-1w7s5nw"),p($,"class","txt-hint"),p(E,"class","filter-op svelte-1w7s5nw"),p(L,"class","txt-hint"),p(B,"class","filter-op svelte-1w7s5nw"),p(ee,"class","txt-hint"),p(Y,"class","filter-op svelte-1w7s5nw"),p(J,"class","txt-hint"),p(X,"class","filter-op svelte-1w7s5nw"),p(ve,"class","txt-hint"),p(x,"class","filter-op svelte-1w7s5nw"),p(Se,"class","txt-hint"),p(Z,"class","filter-op svelte-1w7s5nw"),p(ce,"class","txt-hint")},m(et,We){w(et,e,We),w(et,t,We),w(et,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,E),m(D,O),m(D,L),m(c,I),m(c,N),m(N,B),m(N,U),m(N,ee),m(c,K),m(c,se),m(se,Y),m(se,te),m(se,J),m(c,_e),m(c,be),m(be,X),m(be,ae),m(be,ve),m(c,H),m(c,me),m(me,x),m(me,Q),m(me,Se),m(c,je),m(c,Ue),m(Ue,Z),m(Ue,ge),m(Ue,ce),w(et,$e,We),w(et,Ze,We)},p:oe,i:oe,o:oe,d(et){et&&k(e),et&&k(t),et&&k(i),et&&k($e),et&&k(Ze)}}}class x3 extends Ee{constructor(e){super(),Oe(this,e,null,Q3,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=F(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=G(t,"click",u),r=!0)},p(f,c){e=f,c&2&&s!==(s=e[5].title+"")&&ue(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"),V(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),j(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&2&&(a.language=e[5].language),r&2&&(a.content=e[5].content),i.$set(a),r&3&&ie(t,"active",e[0]===e[5].language)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function eC(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=yt(i,v,c,1,g,f,s,t,Mn,_d,null,gd)),v&3&&(d=g[1],Pe(),r=yt(r,v,h,1,g,d,a,o,Zt,bd,null,md),Le())},i(g){if(!u){for(let v=0;v<d.length;v+=1)A(r[v]);u=!0}},o(g){for(let v=0;v<r.length;v+=1)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 tC(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,tC,eC,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=_(
2022-08-16 12:36:15 +08:00
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');
`}}),Z=new _n({props:{content:`
// DESC by created and ASC by id
?sort=-created,id
`}}),ze=new _n({props:{content:`
?filter=(id='abc' && created>'2022-01-01')
`}}),nt=new x3({}),mt=new _n({props:{content:`
2022-08-16 12:36:15 +08:00
?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),Gt=rn(xe);Ae.set(Gt,re[qe]=$d(Gt,xe))}let jt=n[4];const Ti=qe=>qe[6].code;for(let qe=0;qe<jt.length;qe+=1){let xe=yd(n,jt,qe),Gt=Ti(xe);fe.set(Gt,ke[qe]=Sd(Gt,xe))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records"),c=T(),Ie&&Ie.c(),d=T(),h=_("div"),g=_("p"),v=F("Fetch a paginated "),b=_("strong"),C=F(y),S=F(" records list."),$=T(),M=_("div"),M.textContent="Client SDKs example",D=T(),V(E.$$.fragment),O=T(),L=_("div"),L.textContent="Query parameters",I=T(),N=_("table"),B=_("thead"),B.innerHTML=`<tr><th>Param</th>
2022-08-16 12:36:15 +08:00
<th>Type</th>
<th width="60%">Description</th></tr>`,U=T(),ee=_("tbody"),K=_("tr"),K.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(),Y=_("tr"),Y.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(),J=_("tr"),_e=_("td"),_e.textContent="sort",be=T(),X=_("td"),X.innerHTML='<span class="label">String</span>',ae=T(),ve=_("td"),H=F("Specify the records order attribute(s). "),me=_("br"),x=F(`
Add `),Q=_("code"),Q.textContent="-",Se=F(" / "),je=_("code"),je.textContent="+",Ue=F(` (default) in front of the attribute for DESC / ASC order.
2022-08-16 12:36:15 +08:00
Ex.:
`),V(Z.$$.fragment),ge=T(),ce=_("tr"),$e=_("td"),$e.textContent="filter",Ze=T(),et=_("td"),et.innerHTML='<span class="label">String</span>',We=T(),tt=_("td"),Me=F(`Filter the returned records. Ex.:
`),V(ze.$$.fragment),Xe=T(),V(nt.$$.fragment),ut=T(),ye=_("tr"),Ne=_("td"),Ne.textContent="expand",ct=T(),Dt=_("td"),Dt.innerHTML='<span class="label">String</span>',dt=T(),lt=_("td"),Lt=F(`Auto expand record relations. Ex.:
`),V(mt.$$.fragment),Nt=F(`
Supports up to 6-levels depth nested relations expansion. `),Ot=_("br"),Je=F(`
2022-08-16 12:36:15 +08:00
The expanded relations will be appended to each individual record under the
`),Ce=_("code"),Ce.textContent="@expand",Be=F(" property (eg. "),ot=_("code"),ot.textContent='"@expand": {"rel1": {...}, ...}',rt=F(`). Only the
relations that the user has permissions to `),Ht=_("strong"),Ht.textContent="view",Ct=F(" will be expanded."),ft=T(),xt=_("div"),xt.textContent="Responses",R=T(),z=_("div"),ne=_("div");for(let qe=0;qe<re.length;qe+=1)re[qe].c();le=T(),de=_("div");for(let qe=0;qe<ke.length;qe+=1)ke[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(N,"class","table-compact table-border m-b-lg"),p(xt,"class","section-title"),p(ne,"class","tabs-header compact left"),p(de,"class","tabs-content"),p(z,"class","tabs")},m(qe,xe){w(qe,e,xe),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),Ie&&Ie.m(e,null),w(qe,d,xe),w(qe,h,xe),m(h,g),m(g,v),m(g,b),m(b,C),m(g,S),w(qe,$,xe),w(qe,M,xe),w(qe,D,xe),j(E,qe,xe),w(qe,O,xe),w(qe,L,xe),w(qe,I,xe),w(qe,N,xe),m(N,B),m(N,U),m(N,ee),m(ee,K),m(ee,se),m(ee,Y),m(ee,te),m(ee,J),m(J,_e),m(J,be),m(J,X),m(J,ae),m(J,ve),m(ve,H),m(ve,me),m(ve,x),m(ve,Q),m(ve,Se),m(ve,je),m(ve,Ue),j(Z,ve,null),m(ee,ge),m(ee,ce),m(ce,$e),m(ce,Ze),m(ce,et),m(ce,We),m(ce,tt),m(tt,Me),j(ze,tt,null),m(tt,Xe),j(nt,tt,null),m(ee,ut),m(ee,ye),m(ye,Ne),m(ye,ct),m(ye,Dt),m(ye,dt),m(ye,lt),m(lt,Lt),j(mt,lt,null),m(lt,Nt),m(lt,Ot),m(lt,Je),m(lt,Ce),m(lt,Be),m(lt,ot),m(lt,rt),m(lt,Ht),m(lt,Ct),w(qe,ft,xe),w(qe,xt,xe),w(qe,R,xe),w(qe,z,xe),m(z,ne);for(let Gt=0;Gt<re.length;Gt+=1)re[Gt].m(ne,null);m(z,le),m(z,de);for(let Gt=0;Gt<ke.length;Gt+=1)ke[Gt].m(de,null);he=!0},p(qe,[xe]){var Ol,El,Al,Pl;(!he||xe&1)&&a!==(a=qe[0].name+"")&&ue(u,a),qe[1]?Ie||(Ie=wd(),Ie.c(),Ie.m(e,null)):Ie&&(Ie.d(1),Ie=null),(!he||xe&1)&&y!==(y=qe[0].name+"")&&ue(C,y);const Gt={};xe&9&&(Gt.js=`
2022-08-16 12:36:15 +08:00
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&&(Gt.dart=`
2022-08-16 12:36:15 +08:00
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');
`),E.$set(Gt),xe&20&&(ht=qe[4],re=yt(re,xe,rn,1,qe,ht,Ae,ne,Mn,$d,null,kd)),xe&20&&(jt=qe[4],Pe(),ke=yt(ke,xe,Ti,1,qe,jt,fe,de,Zt,Sd,null,yd),Le())},i(qe){if(!he){A(E.$$.fragment,qe),A(Z.$$.fragment,qe),A(ze.$$.fragment,qe),A(nt.$$.fragment,qe),A(mt.$$.fragment,qe);for(let xe=0;xe<jt.length;xe+=1)A(ke[xe]);he=!0}},o(qe){P(E.$$.fragment,qe),P(Z.$$.fragment,qe),P(ze.$$.fragment,qe),P(nt.$$.fragment,qe),P(mt.$$.fragment,qe);for(let xe=0;xe<ke.length;xe+=1)P(ke[xe]);he=!1},d(qe){qe&&k(e),Ie&&Ie.d(),qe&&k(d),qe&&k(h),qe&&k($),qe&&k(M),qe&&k(D),q(E,qe),qe&&k(O),qe&&k(L),qe&&k(I),qe&&k(N),q(Z),q(ze),q(nt),q(mt),qe&&k(ft),qe&&k(xt),qe&&k(R),qe&&k(z);for(let xe=0;xe<re.length;xe+=1)re[xe].d();for(let xe=0;xe<ke.length;xe+=1)ke[xe].d()}}}function iC(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:`
2022-08-16 12:36:15 +08:00
{
"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(we.baseUrl)),[l,i,o,s,r,a]}class sC extends Ee{constructor(e){super(),Oe(this,e,iC,nC,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=F(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=G(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"),V(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),j(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||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function lC(n){var Ot,Je;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,C=n[0].name+"",S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be,X,ae,ve,H,me,x,Q,Se,je,Ue,Z,ge,ce,$e,Ze,et,We,tt,Me,ze,Xe=[],nt=new Map,ut,ye,Ne=[],ct=new Map,Dt,dt=n[1]&&Td();O=new Ls({props:{js:`
2022-08-16 12:36:15 +08:00
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
const record = await client.records.getOne('${(Ot=n[0])==null?void 0:Ot.name}', 'RECORD_ID', {
2022-08-16 12:36:15 +08:00
expand: 'some_relation'
});
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
final record = await client.records.getOne('${(Je=n[0])==null?void 0:Je.name}', 'RECORD_ID', query: {
'expand': 'some_relation',
});
`}}),x=new _n({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let lt=n[4];const Lt=Ce=>Ce[6].code;for(let Ce=0;Ce<lt.length;Ce+=1){let Be=Md(n,lt,Ce),ot=Lt(Be);nt.set(ot,Xe[Ce]=Dd(ot,Be))}let mt=n[4];const Nt=Ce=>Ce[6].code;for(let Ce=0;Ce<mt.length;Ce+=1){let Be=Cd(n,mt,Ce),ot=Nt(Be);ct.set(ot,Ne[Ce]=Od(ot,Be))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records/"),c=_("strong"),c.textContent=":id",d=T(),dt&&dt.c(),h=T(),g=_("div"),v=_("p"),b=F("Fetch a single "),y=_("strong"),S=F(C),$=F(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",E=T(),V(O.$$.fragment),L=T(),I=_("div"),I.textContent="Path Parameters",N=T(),B=_("table"),B.innerHTML=`<thead><tr><th>Param</th>
2022-08-16 12:36:15 +08:00
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to view.</td></tr></tbody>`,U=T(),ee=_("div"),ee.textContent="Query parameters",K=T(),se=_("table"),Y=_("thead"),Y.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,te=T(),J=_("tbody"),_e=_("tr"),be=_("td"),be.textContent="expand",X=T(),ae=_("td"),ae.innerHTML='<span class="label">String</span>',ve=T(),H=_("td"),me=F(`Auto expand record relations. Ex.:
2022-08-16 12:36:15 +08:00
`),V(x.$$.fragment),Q=F(`
Supports up to 6-levels depth nested relations expansion. `),Se=_("br"),je=F(`
2022-08-16 12:36:15 +08:00
The expanded relations will be appended to the record under the
`),Ue=_("code"),Ue.textContent="@expand",Z=F(" property (eg. "),ge=_("code"),ge.textContent='"@expand": {"rel1": {...}, ...}',ce=F(`). Only the
relations that the user has permissions to `),$e=_("strong"),$e.textContent="view",Ze=F(" will be expanded."),et=T(),We=_("div"),We.textContent="Responses",tt=T(),Me=_("div"),ze=_("div");for(let Ce=0;Ce<Xe.length;Ce+=1)Xe[Ce].c();ut=T(),ye=_("div");for(let Ce=0;Ce<Ne.length;Ce+=1)Ne[Ce].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(g,"class","content m-b-base"),p(D,"class","section-title"),p(I,"class","section-title"),p(B,"class","table-compact table-border m-b-lg"),p(ee,"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(ye,"class","tabs-content"),p(Me,"class","tabs")},m(Ce,Be){w(Ce,e,Be),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),dt&&dt.m(e,null),w(Ce,h,Be),w(Ce,g,Be),m(g,v),m(v,b),m(v,y),m(y,S),m(v,$),w(Ce,M,Be),w(Ce,D,Be),w(Ce,E,Be),j(O,Ce,Be),w(Ce,L,Be),w(Ce,I,Be),w(Ce,N,Be),w(Ce,B,Be),w(Ce,U,Be),w(Ce,ee,Be),w(Ce,K,Be),w(Ce,se,Be),m(se,Y),m(se,te),m(se,J),m(J,_e),m(_e,be),m(_e,X),m(_e,ae),m(_e,ve),m(_e,H),m(H,me),j(x,H,null),m(H,Q),m(H,Se),m(H,je),m(H,Ue),m(H,Z),m(H,ge),m(H,ce),m(H,$e),m(H,Ze),w(Ce,et,Be),w(Ce,We,Be),w(Ce,tt,Be),w(Ce,Me,Be),m(Me,ze);for(let ot=0;ot<Xe.length;ot+=1)Xe[ot].m(ze,null);m(Me,ut),m(Me,ye);for(let ot=0;ot<Ne.length;ot+=1)Ne[ot].m(ye,null);Dt=!0},p(Ce,[Be]){var rt,Ht;(!Dt||Be&1)&&a!==(a=Ce[0].name+"")&&ue(u,a),Ce[1]?dt||(dt=Td(),dt.c(),dt.m(e,null)):dt&&(dt.d(1),dt=null),(!Dt||Be&1)&&C!==(C=Ce[0].name+"")&&ue(S,C);const ot={};Be&9&&(ot.js=`
2022-08-16 12:36:15 +08:00
import PocketBase from 'pocketbase';
const client = new PocketBase('${Ce[3]}');
2022-08-16 12:36:15 +08:00
...
const record = await client.records.getOne('${(rt=Ce[0])==null?void 0:rt.name}', 'RECORD_ID', {
2022-08-16 12:36:15 +08:00
expand: 'some_relation'
});
`),Be&9&&(ot.dart=`
2022-08-16 12:36:15 +08:00
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${Ce[3]}');
2022-08-16 12:36:15 +08:00
...
final record = await client.records.getOne('${(Ht=Ce[0])==null?void 0:Ht.name}', 'RECORD_ID', query: {
2022-08-16 12:36:15 +08:00
'expand': 'some_relation',
});
`),O.$set(ot),Be&20&&(lt=Ce[4],Xe=yt(Xe,Be,Lt,1,Ce,lt,nt,ze,Mn,Dd,null,Md)),Be&20&&(mt=Ce[4],Pe(),Ne=yt(Ne,Be,Nt,1,Ce,mt,ct,ye,Zt,Od,null,Cd),Le())},i(Ce){if(!Dt){A(O.$$.fragment,Ce),A(x.$$.fragment,Ce);for(let Be=0;Be<mt.length;Be+=1)A(Ne[Be]);Dt=!0}},o(Ce){P(O.$$.fragment,Ce),P(x.$$.fragment,Ce);for(let Be=0;Be<Ne.length;Be+=1)P(Ne[Be]);Dt=!1},d(Ce){Ce&&k(e),dt&&dt.d(),Ce&&k(h),Ce&&k(g),Ce&&k(M),Ce&&k(D),Ce&&k(E),q(O,Ce),Ce&&k(L),Ce&&k(I),Ce&&k(N),Ce&&k(B),Ce&&k(U),Ce&&k(ee),Ce&&k(K),Ce&&k(se),q(x),Ce&&k(et),Ce&&k(We),Ce&&k(tt),Ce&&k(Me);for(let Be=0;Be<Xe.length;Be+=1)Xe[Be].d();for(let Be=0;Be<Ne.length;Be+=1)Ne[Be].d()}}}function oC(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:`
2022-08-16 12:36:15 +08:00
{
"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(we.baseUrl)),[l,i,o,s,r,a]}class rC extends Ee{constructor(e){super(),Oe(this,e,oC,lC,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 aC(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 uC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function fC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("User "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function cC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("Relation record "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function dC(n){let e,t,i,s,l;return{c(){e=F("FormData object."),t=_("br"),i=F(`
Set to `),s=_("code"),s.textContent="null",l=F(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function pC(n){let e;return{c(){e=F("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function hC(n){let e;return{c(){e=F("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function mC(n){let e;return{c(){e=F("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function gC(n){let e;return{c(){e=F("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function _C(n){let e;return{c(){e=F("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(E,O){return E[11].required?uC:aC}let C=y(e),S=C(e);function $(E,O){if(E[11].type==="text")return _C;if(E[11].type==="number")return gC;if(E[11].type==="json")return mC;if(E[11].type==="email")return hC;if(E[11].type==="url")return pC;if(E[11].type==="file")return dC;if(E[11].type==="relation")return cC;if(E[11].type==="user")return fC}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=F(r),u=T(),f=_("td"),c=_("span"),h=F(d),g=T(),v=_("td"),D&&D.c(),b=T(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(E,O){w(E,t,O),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(E,O){e=E,C!==(C=y(e))&&(S.d(1),S=C(e),S&&(S.c(),S.m(s,l))),O&1&&r!==(r=e[11].name+"")&&ue(a,r),O&1&&d!==(d=W.getFieldValueType(e[11])+"")&&ue(h,d),M===(M=$(e))&&D?D.p(e,O):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(E){E&&k(t),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=F(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=G(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(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"),V(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),j(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),r&6&&ie(t,"active",e[1]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function bC(n){var ne,re,Ae;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y=n[0].name+"",C,S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be=[],X=new Map,ae,ve,H,me,x,Q,Se,je,Ue,Z,ge,ce,$e,Ze,et,We,tt,Me,ze,Xe,nt,ut,ye,Ne,ct,Dt,dt,lt,Lt,mt=[],Nt=new Map,Ot,Je,Ce=[],Be=new Map,ot,rt=n[4]&&Ld();N=new Ls({props:{js:`
2022-08-16 12:36:15 +08:00
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 Ht=(Ae=n[0])==null?void 0:Ae.schema;const Ct=le=>le[11].name;for(let le=0;le<Ht.length;le+=1){let de=Pd(n,Ht,le),ke=Ct(de);X.set(ke,be[le]=Id(ke,de))}et=new _n({props:{content:`
2022-08-16 12:36:15 +08:00
?expand=rel1,rel2.subrel21.subrel22
`}});let ft=n[2];const xt=le=>le[6].code;for(let le=0;le<ft.length;le+=1){let de=Ad(n,ft,le),ke=xt(de);Nt.set(ke,mt[le]=Fd(ke,de))}let R=n[2];const z=le=>le[6].code;for(let le=0;le<R.length;le+=1){let de=Ed(n,R,le),ke=z(de);Be.set(ke,Ce[le]=Nd(ke,de))}return{c(){e=_("div"),t=_("strong"),t.textContent="POST",i=T(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records"),c=T(),rt&&rt.c(),d=T(),h=_("div"),g=_("p"),v=F("Create a new "),b=_("strong"),C=F(y),S=F(" record."),$=T(),M=_("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
2022-08-18 03:29:11 +08:00
<code>multipart/form-data</code>.`,D=T(),E=_("p"),E.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",O=T(),L=_("div"),L.textContent="Client SDKs example",I=T(),V(N.$$.fragment),B=T(),U=_("div"),U.textContent="Body Parameters",ee=T(),K=_("table"),se=_("thead"),se.innerHTML=`<tr><th>Param</th>
2022-08-16 12:36:15 +08:00
<th>Type</th>
<th width="50%">Description</th></tr>`,Y=T(),te=_("tbody"),J=_("tr"),J.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>`,_e=T();for(let le=0;le<be.length;le+=1)be[le].c();ae=T(),ve=_("div"),ve.textContent="Query parameters",H=T(),me=_("table"),x=_("thead"),x.innerHTML=`<tr><th>Param</th>
2022-08-16 12:36:15 +08:00
<th>Type</th>
<th width="60%">Description</th></tr>`,Q=T(),Se=_("tbody"),je=_("tr"),Ue=_("td"),Ue.textContent="expand",Z=T(),ge=_("td"),ge.innerHTML='<span class="label">String</span>',ce=T(),$e=_("td"),Ze=F(`Auto expand relations when returning the created record. Ex.:
`),V(et.$$.fragment),We=F(`
Supports up to 6-levels depth nested relations expansion. `),tt=_("br"),Me=F(`
2022-08-16 12:36:15 +08:00
The expanded relations will be appended to the record under the
`),ze=_("code"),ze.textContent="@expand",Xe=F(" property (eg. "),nt=_("code"),nt.textContent='"@expand": {"rel1": {...}, ...}',ut=F(`). Only the
relations that the user has permissions to `),ye=_("strong"),ye.textContent="view",Ne=F(" will be expanded."),ct=T(),Dt=_("div"),Dt.textContent="Responses",dt=T(),lt=_("div"),Lt=_("div");for(let le=0;le<mt.length;le+=1)mt[le].c();Ot=T(),Je=_("div");for(let le=0;le<Ce.length;le+=1)Ce[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(U,"class","section-title"),p(K,"class","table-compact table-border m-b-lg"),p(ve,"class","section-title"),p(me,"class","table-compact table-border m-b-lg"),p(Dt,"class","section-title"),p(Lt,"class","tabs-header compact left"),p(Je,"class","tabs-content"),p(lt,"class","tabs")},m(le,de){w(le,e,de),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),rt&&rt.m(e,null),w(le,d,de),w(le,h,de),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,E),w(le,O,de),w(le,L,de),w(le,I,de),j(N,le,de),w(le,B,de),w(le,U,de),w(le,ee,de),w(le,K,de),m(K,se),m(K,Y),m(K,te),m(te,J),m(te,_e);for(let ke=0;ke<be.length;ke+=1)be[ke].m(te,null);w(le,ae,de),w(le,ve,de),w(le,H,de),w(le,me,de),m(me,x),m(me,Q),m(me,Se),m(Se,je),m(je,Ue),m(je,Z),m(je,ge),m(je,ce),m(je,$e),m($e,Ze),j(et,$e,null),m($e,We),m($e,tt),m($e,Me),m($e,ze),m($e,Xe),m($e,nt),m($e,ut),m($e,ye),m($e,Ne),w(le,ct,de),w(le,Dt,de),w(le,dt,de),w(le,lt,de),m(lt,Lt);for(let ke=0;ke<mt.length;ke+=1)mt[ke].m(Lt,null);m(lt,Ot),m(lt,Je);for(let ke=0;ke<Ce.length;ke+=1)Ce[ke].m(Je,null);ot=!0},p(le,[de]){var fe,he,Ie;(!ot||de&1)&&a!==(a=le[0].name+"")&&ue(u,a),le[4]?rt||(rt=Ld(),rt.c(),rt.m(e,null)):rt&&(rt.d(1),rt=null),(!ot||de&1)&&y!==(y=le[0].name+"")&&ue(C,y);const ke={};de&9&&(ke.js=`
2022-08-16 12:36:15 +08:00
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);
`),de&9&&(ke.dart=`
2022-08-16 12:36:15 +08:00
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);
`),N.$set(ke),de&1&&(Ht=(Ie=le[0])==null?void 0:Ie.schema,be=yt(be,de,Ct,1,le,Ht,X,te,Mn,Id,null,Pd)),de&6&&(ft=le[2],mt=yt(mt,de,xt,1,le,ft,Nt,Lt,Mn,Fd,null,Ad)),de&6&&(R=le[2],Pe(),Ce=yt(Ce,de,z,1,le,R,Be,Je,Zt,Nd,null,Ed),Le())},i(le){if(!ot){A(N.$$.fragment,le),A(et.$$.fragment,le);for(let de=0;de<R.length;de+=1)A(Ce[de]);ot=!0}},o(le){P(N.$$.fragment,le),P(et.$$.fragment,le);for(let de=0;de<Ce.length;de+=1)P(Ce[de]);ot=!1},d(le){le&&k(e),rt&&rt.d(),le&&k(d),le&&k(h),le&&k(O),le&&k(L),le&&k(I),q(N,le),le&&k(B),le&&k(U),le&&k(ee),le&&k(K);for(let de=0;de<be.length;de+=1)be[de].d();le&&k(ae),le&&k(ve),le&&k(H),le&&k(me),q(et),le&&k(ct),le&&k(Dt),le&&k(dt),le&&k(lt);for(let de=0;de<mt.length;de+=1)mt[de].d();for(let de=0;de<Ce.length;de+=1)Ce[de].d()}}}function vC(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:`
2022-08-16 12:36:15 +08:00
{
"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(we.baseUrl)),[l,o,r,s,i,a]}class yC extends Ee{constructor(e){super(),Oe(this,e,vC,bC,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 kC(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 wC(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 $C(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("User "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function SC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("Relation record "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function CC(n){let e,t,i,s,l;return{c(){e=F("FormData object."),t=_("br"),i=F(`
Set to `),s=_("code"),s.textContent="null",l=F(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function MC(n){let e;return{c(){e=F("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function TC(n){let e;return{c(){e=F("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function DC(n){let e;return{c(){e=F("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function OC(n){let e;return{c(){e=F("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function EC(n){let e;return{c(){e=F("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(E,O){return E[11].required?wC:kC}let C=y(e),S=C(e);function $(E,O){if(E[11].type==="text")return EC;if(E[11].type==="number")return OC;if(E[11].type==="json")return DC;if(E[11].type==="email")return TC;if(E[11].type==="url")return MC;if(E[11].type==="file")return CC;if(E[11].type==="relation")return SC;if(E[11].type==="user")return $C}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=F(r),u=T(),f=_("td"),c=_("span"),h=F(d),g=T(),v=_("td"),D&&D.c(),b=T(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(E,O){w(E,t,O),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(E,O){e=E,C!==(C=y(e))&&(S.d(1),S=C(e),S&&(S.c(),S.m(s,l))),O&1&&r!==(r=e[11].name+"")&&ue(a,r),O&1&&d!==(d=W.getFieldValueType(e[11])+"")&&ue(h,d),M===(M=$(e))&&D?D.p(e,O):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(E){E&&k(t),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=F(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=G(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(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"),V(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),j(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),r&6&&ie(t,"active",e[1]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function AC(n){var le,de,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,E,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be,X,ae,ve=[],H=new Map,me,x,Q,Se,je,Ue,Z,ge,ce,$e,Ze,et,We,tt,Me,ze,Xe,nt,ut,ye,Ne,ct,Dt,dt,lt,Lt,mt,Nt,Ot,Je=[],Ce=new Map,Be,ot,rt=[],Ht=new Map,Ct,ft=n[4]&&qd();B=new Ls({props:{js:`
2022-08-16 12:36:15 +08:00
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('${(de=n[0])==null?void 0:de.name}', 'RECORD_ID', body: body);
`}});let xt=(ke=n[0])==null?void 0:ke.schema;const R=fe=>fe[11].name;for(let fe=0;fe<xt.length;fe+=1){let he=jd(n,xt,fe),Ie=R(he);H.set(Ie,ve[fe]=Vd(Ie,he))}Me=new _n({props:{content:`
2022-08-16 12:36:15 +08:00
?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),Ie=ne(he);Ce.set(Ie,Je[fe]=zd(Ie,he))}let re=n[2];const Ae=fe=>fe[6].code;for(let fe=0;fe<re.length;fe+=1){let he=Rd(n,re,fe),Ie=Ae(he);Ht.set(Ie,rt[fe]=Bd(Ie,he))}return{c(){e=_("div"),t=_("strong"),t.textContent="PATCH",i=T(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records/"),c=_("strong"),c.textContent=":id",d=T(),ft&&ft.c(),h=T(),g=_("div"),v=_("p"),b=F("Update a single "),y=_("strong"),S=F(C),$=F(" record."),M=T(),D=_("p"),D.innerHTML=`Body parameters could be sent as <code>application/json</code> or
2022-08-18 03:29:11 +08:00
<code>multipart/form-data</code>.`,E=T(),O=_("p"),O.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",L=T(),I=_("div"),I.textContent="Client SDKs example",N=T(),V(B.$$.fragment),U=T(),ee=_("div"),ee.textContent="Path parameters",K=T(),se=_("table"),se.innerHTML=`<thead><tr><th>Param</th>
2022-08-16 12:36:15 +08:00
<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>`,Y=T(),te=_("div"),te.textContent="Body Parameters",J=T(),_e=_("table"),be=_("thead"),be.innerHTML=`<tr><th>Param</th>
2022-08-16 12:36:15 +08:00
<th>Type</th>
<th width="50%">Description</th></tr>`,X=T(),ae=_("tbody");for(let fe=0;fe<ve.length;fe+=1)ve[fe].c();me=T(),x=_("div"),x.textContent="Query parameters",Q=T(),Se=_("table"),je=_("thead"),je.innerHTML=`<tr><th>Param</th>
2022-08-16 12:36:15 +08:00
<th>Type</th>
<th width="60%">Description</th></tr>`,Ue=T(),Z=_("tbody"),ge=_("tr"),ce=_("td"),ce.textContent="expand",$e=T(),Ze=_("td"),Ze.innerHTML='<span class="label">String</span>',et=T(),We=_("td"),tt=F(`Auto expand relations when returning the updated record. Ex.:
`),V(Me.$$.fragment),ze=F(`
Supports up to 6-levels depth nested relations expansion. `),Xe=_("br"),nt=F(`
2022-08-16 12:36:15 +08:00
The expanded relations will be appended to the record under the
`),ut=_("code"),ut.textContent="@expand",ye=F(" property (eg. "),Ne=_("code"),Ne.textContent='"@expand": {"rel1": {...}, ...}',ct=F(`). Only the
relations that the user has permissions to `),Dt=_("strong"),Dt.textContent="view",dt=F(" will be expanded."),lt=T(),Lt=_("div"),Lt.textContent="Responses",mt=T(),Nt=_("div"),Ot=_("div");for(let fe=0;fe<Je.length;fe+=1)Je[fe].c();Be=T(),ot=_("div");for(let fe=0;fe<rt.length;fe+=1)rt[fe].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-warning"),p(g,"class","content m-b-base"),p(I,"class","section-title"),p(ee,"class","section-title"),p(se,"class","table-compact table-border m-b-lg"),p(te,"class","section-title"),p(_e,"class","table-compact table-border m-b-lg"),p(x,"class","section-title"),p(Se,"class","table-compact table-border m-b-lg"),p(Lt,"class","section-title"),p(Ot,"class","tabs-header compact left"),p(ot,"class","tabs-content"),p(Nt,"class","tabs")},m(fe,he){w(fe,e,he),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),ft&&ft.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,E),m(g,O),w(fe,L,he),w(fe,I,he),w(fe,N,he),j(B,fe,he),w(fe,U,he),w(fe,ee,he),w(fe,K,he),w(fe,se,he),w(fe,Y,he),w(fe,te,he),w(fe,J,he),w(fe,_e,he),m(_e,be),m(_e,X),m(_e,ae);for(let Ie=0;Ie<ve.length;Ie+=1)ve[Ie].m(ae,null);w(fe,me,he),w(fe,x,he),w(fe,Q,he),w(fe,Se,he),m(Se,je),m(Se,Ue),m(Se,Z),m(Z,ge),m(ge,ce),m(ge,$e),m(ge,Ze),m(ge,et),m(ge,We),m(We,tt),j(Me,We,null),m(We,ze),m(We,Xe),m(We,nt),m(We,ut),m(We,ye),m(We,Ne),m(We,ct),m(We,Dt),m(We,dt),w(fe,lt,he),w(fe,Lt,he),w(fe,mt,he),w(fe,Nt,he),m(Nt,Ot);for(let Ie=0;Ie<Je.length;Ie+=1)Je[Ie].m(Ot,null);m(Nt,Be),m(Nt,ot);for(let Ie=0;Ie<rt.length;Ie+=1)rt[Ie].m(ot,null);Ct=!0},p(fe,[he]){var ht,rn,jt;(!Ct||he&1)&&a!==(a=fe[0].name+"")&&ue(u,a),fe[4]?ft||(ft=qd(),ft.c(),ft.m(e,null)):ft&&(ft.d(1),ft=null),(!Ct||he&1)&&C!==(C=fe[0].name+"")&&ue(S,C);const Ie={};he&9&&(Ie.js=`
2022-08-16 12:36:15 +08:00
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&&(Ie.dart=`
2022-08-16 12:36:15 +08:00
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);
`),B.$set(Ie),he&1&&(xt=(jt=fe[0])==null?void 0:jt.schema,ve=yt(ve,he,R,1,fe,xt,H,ae,Mn,Vd,null,jd)),he&6&&(z=fe[2],Je=yt(Je,he,ne,1,fe,z,Ce,Ot,Mn,zd,null,Hd)),he&6&&(re=fe[2],Pe(),rt=yt(rt,he,Ae,1,fe,re,Ht,ot,Zt,Bd,null,Rd),Le())},i(fe){if(!Ct){A(B.$$.fragment,fe),A(Me.$$.fragment,fe);for(let he=0;he<re.length;he+=1)A(rt[he]);Ct=!0}},o(fe){P(B.$$.fragment,fe),P(Me.$$.fragment,fe);for(let he=0;he<rt.length;he+=1)P(rt[he]);Ct=!1},d(fe){fe&&k(e),ft&&ft.d(),fe&&k(h),fe&&k(g),fe&&k(L),fe&&k(I),fe&&k(N),q(B,fe),fe&&k(U),fe&&k(ee),fe&&k(K),fe&&k(se),fe&&k(Y),fe&&k(te),fe&&k(J),fe&&k(_e);for(let he=0;he<ve.length;he+=1)ve[he].d();fe&&k(me),fe&&k(x),fe&&k(Q),fe&&k(Se),q(Me),fe&&k(lt),fe&&k(Lt),fe&&k(mt),fe&&k(Nt);for(let he=0;he<Je.length;he+=1)Je[he].d();for(let he=0;he<rt.length;he+=1)rt[he].d()}}}function PC(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:`
2022-08-16 12:36:15 +08:00
{
"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(we.baseUrl)),[l,o,r,s,i,a]}class LC extends Ee{constructor(e){super(),Oe(this,e,PC,AC,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=F(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=G(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"),V(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),j(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||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function IC(n){var je,Ue;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,C=n[0].name+"",S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te=[],J=new Map,_e,be,X=[],ae=new Map,ve,H=n[1]&&Yd();O=new Ls({props:{js:`
2022-08-16 12:36:15 +08:00
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
await client.records.delete('${(je=n[0])==null?void 0:je.name}', 'RECORD_ID');
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
await client.records.delete('${(Ue=n[0])==null?void 0:Ue.name}', 'RECORD_ID');
`}});let me=n[4];const x=Z=>Z[6].code;for(let Z=0;Z<me.length;Z+=1){let ge=Wd(n,me,Z),ce=x(ge);J.set(ce,te[Z]=Kd(ce,ge))}let Q=n[4];const Se=Z=>Z[6].code;for(let Z=0;Z<Q.length;Z+=1){let ge=Ud(n,Q,Z),ce=Se(ge);ae.set(ce,X[Z]=Jd(ce,ge))}return{c(){e=_("div"),t=_("strong"),t.textContent="DELETE",i=T(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records/"),c=_("strong"),c.textContent=":id",d=T(),H&&H.c(),h=T(),g=_("div"),v=_("p"),b=F("Delete a single "),y=_("strong"),S=F(C),$=F(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",E=T(),V(O.$$.fragment),L=T(),I=_("div"),I.textContent="Path parameters",N=T(),B=_("table"),B.innerHTML=`<thead><tr><th>Param</th>
2022-08-16 12:36:15 +08:00
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to delete.</td></tr></tbody>`,U=T(),ee=_("div"),ee.textContent="Responses",K=T(),se=_("div"),Y=_("div");for(let Z=0;Z<te.length;Z+=1)te[Z].c();_e=T(),be=_("div");for(let Z=0;Z<X.length;Z+=1)X[Z].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-danger"),p(g,"class","content m-b-base"),p(D,"class","section-title"),p(I,"class","section-title"),p(B,"class","table-compact table-border m-b-lg"),p(ee,"class","section-title"),p(Y,"class","tabs-header compact left"),p(be,"class","tabs-content"),p(se,"class","tabs")},m(Z,ge){w(Z,e,ge),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),H&&H.m(e,null),w(Z,h,ge),w(Z,g,ge),m(g,v),m(v,b),m(v,y),m(y,S),m(v,$),w(Z,M,ge),w(Z,D,ge),w(Z,E,ge),j(O,Z,ge),w(Z,L,ge),w(Z,I,ge),w(Z,N,ge),w(Z,B,ge),w(Z,U,ge),w(Z,ee,ge),w(Z,K,ge),w(Z,se,ge),m(se,Y);for(let ce=0;ce<te.length;ce+=1)te[ce].m(Y,null);m(se,_e),m(se,be);for(let ce=0;ce<X.length;ce+=1)X[ce].m(be,null);ve=!0},p(Z,[ge]){var $e,Ze;(!ve||ge&1)&&a!==(a=Z[0].name+"")&&ue(u,a),Z[1]?H||(H=Yd(),H.c(),H.m(e,null)):H&&(H.d(1),H=null),(!ve||ge&1)&&C!==(C=Z[0].name+"")&&ue(S,C);const ce={};ge&9&&(ce.js=`
2022-08-16 12:36:15 +08:00
import PocketBase from 'pocketbase';
const client = new PocketBase('${Z[3]}');
...
await client.records.delete('${($e=Z[0])==null?void 0:$e.name}', 'RECORD_ID');
`),ge&9&&(ce.dart=`
2022-08-16 12:36:15 +08:00
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${Z[3]}');
...
await client.records.delete('${(Ze=Z[0])==null?void 0:Ze.name}', 'RECORD_ID');
`),O.$set(ce),ge&20&&(me=Z[4],te=yt(te,ge,x,1,Z,me,J,Y,Mn,Kd,null,Wd)),ge&20&&(Q=Z[4],Pe(),X=yt(X,ge,Se,1,Z,Q,ae,be,Zt,Jd,null,Ud),Le())},i(Z){if(!ve){A(O.$$.fragment,Z);for(let ge=0;ge<Q.length;ge+=1)A(X[ge]);ve=!0}},o(Z){P(O.$$.fragment,Z);for(let ge=0;ge<X.length;ge+=1)P(X[ge]);ve=!1},d(Z){Z&&k(e),H&&H.d(),Z&&k(h),Z&&k(g),Z&&k(M),Z&&k(D),Z&&k(E),q(O,Z),Z&&k(L),Z&&k(I),Z&&k(N),Z&&k(B),Z&&k(U),Z&&k(ee),Z&&k(K),Z&&k(se);for(let ge=0;ge<te.length;ge+=1)te[ge].d();for(let ge=0;ge<X.length;ge+=1)X[ge].d()}}}function FC(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:`
2022-08-16 12:36:15 +08:00
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(we.baseUrl)),[l,i,o,s,r,a]}class NC extends Ee{constructor(e){super(),Oe(this,e,FC,IC,De,{collection:0})}}function RC(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:`
2022-08-16 12:36:15 +08:00
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 &quot;Event data format&quot; section below).</p>
<div class="alert alert-info m-t-10"><div class="icon"><i class="ri-information-line"></i></div>
<div class="contet"><p><strong>You could subscribe to a single record or to an entire collection.</strong></p>
<p>When you subscribe to a <strong>single record</strong>, the collection&#39;s
<strong>ViewRule</strong> will be used to determine whether the subscriber has access to receive
the event message.</p>
<p>When you subscribe to an <strong>entire collection</strong>, the collection&#39;s
<strong>ListRule</strong> will be used to determine whether the subscriber has access to receive
2022-08-18 03:29:11 +08:00
the event message.</p></div></div>`,s=T(),l=_("div"),l.textContent="Client SDKs example",o=T(),V(r.$$.fragment),a=T(),u=_("div"),u.textContent="Event data format",f=T(),V(c.$$.fragment),p(e,"class","alert"),p(i,"class","content m-b-base"),p(l,"class","section-title"),p(u,"class","section-title")},m(M,D){w(M,e,D),w(M,t,D),w(M,i,D),w(M,s,D),w(M,l,D),w(M,o,D),j(r,M,D),w(M,a,D),w(M,u,D),w(M,f,D),j(c,M,D),d=!0},p(M,[D]){var L,I,N,B,U,ee,K,se;const E={};D&3&&(E.js=`
2022-08-16 12:36:15 +08:00
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('${(N=M[0])==null?void 0:N.name}') // remove only the collection subscription
client.realtime.unsubscribe('${(B=M[0])==null?void 0:B.name}/RECORD_ID') // remove only the record subscription
2022-08-18 03:29:11 +08:00
`),D&3&&(E.dart=`
2022-08-16 12:36:15 +08:00
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${M[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(U=M[0])==null?void 0:U.name}', (e) {
print(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${(ee=M[0])==null?void 0:ee.name}/RECORD_ID', (e) {
print(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(K=M[0])==null?void 0:K.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(E);const O={};D&1&&(O.content=JSON.stringify({action:"create",record:W.dummyCollectionRecord(M[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),c.$set(O)},i(M){d||(A(r.$$.fragment,M),A(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),q(r,M),M&&k(a),M&&k(u),M&&k(f),q(c,M)}}}function HC(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(we.baseUrl)),[s,i]}class jC extends Ee{constructor(e){super(),Oe(this,e,HC,RC,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&&V(t.$$.fragment),i=T(),p(e,"class","tab-item active")},m(r,a){w(r,e,a),t&&j(t,e,null),m(e,i),s=!0},p(r,a){const u={};if(a&8&&(u.collection=r[3]),l!==(l=r[14].component)){if(t){Pe();const f=t;P(f.$$.fragment,1,0,()=>{q(f,1)}),Le()}l?(t=new l(o(r)),V(t.$$.fragment),A(t.$$.fragment,1),j(t,e,i)):t=null}else l&&t.$set(u)},i(r){s||(t&&A(t.$$.fragment,r),s=!0)},o(r){t&&P(t.$$.fragment,r),s=!1},d(r){r&&k(e),t&&q(t)}}}function Qd(n,e){let t,i,s,l=e[4]===e[14].id&&Xd(e);return{key:n,first:null,c(){t=Ke(),l&&l.c(),i=Ke(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[4]===e[14].id?l?(l.p(e,r),r&16&&A(l,1)):(l=Xd(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Pe(),P(l,1,1,()=>{l=null}),Le())},i(o){s||(A(l),s=!0)},o(o){P(l),s=!1},d(o){o&&k(t),l&&l.d(o),o&&k(i)}}}function qC(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],Pe(),t=yt(t,a,o,1,r,l,i,e,Zt,Qd,null,Zd),Le())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)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=F(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=[G(t,"click",u),G(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,Ge(a)}}}function VC(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=F(i),l=F(" 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+"")&&ue(s,i),h&114&&(f=d[5],a=yt(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 zC(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=G(e,"click",n[8]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function BC(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[zC],header:[VC],default:[qC]},$$scope:{ctx:n}};return e=new mi({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&524312&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),q(e,s)}}}function UC(n,e,t){const i=[{id:"list",label:"List",component:sC},{id:"view",label:"View",component:rC},{id:"create",label:"Create",component:yC},{id:"update",label:"Update",component:LC},{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=[G(t,"change",n[17]),G(s,"click",n[18])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&k(e),n[16](null),l=!1,Ge(o)}}}function U4(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 E=np(n,b,D),O=y(E);d.set(O,c[D]=ip(O,E))}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=F(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,E){w(D,e,E),m(e,t),m(e,s),m(e,l),m(l,r),w(D,u,E),w(D,f,E);for(let O=0;O<c.length;O+=1)c[O].m(f,null);m(f,h);for(let O=0;O<S.length;O+=1)S[O].m(f,null);m(f,g),M&&M.m(f,null),n[19](f),v=!0},p(D,E){if((!v||E&8&&i!==(i=W.getFieldTypeIcon(D[3].type)))&&p(t,"class",i),(!v||E&8)&&o!==(o=D[3].name+"")&&ue(r,o),(!v||E&2097152&&a!==(a=D[21]))&&p(e,"for",a),E&1558&&(b=D[4],Pe(),c=yt(c,E,y,1,D,b,d,f,Zt,ip,h,np),Le()),E&2049){C=D[0];let O;for(O=0;O<C.length;O+=1){const L=tp(D,C,O);S[O]?(S[O].p(L,E),A(S[O],1)):(S[O]=sp(L),S[O].c(),A(S[O],1),S[O].m(f,g))}for(Pe(),O=C.length;O<S.length;O+=1)$(O);Le()}D[8]?M&&(M.d(1),M=null):M?M.p(D,E):(M=lp(D),M.c(),M.m(f,null))},i(D){if(!v){for(let E=0;E<b.length;E+=1)A(c[E]);for(let E=0;E<C.length;E+=1)A(S[E]);v=!0}},o(D){for(let E=0;E<c.length;E+=1)P(c[E]);S=S.filter(Boolean);for(let E=0;E<S.length;E+=1)P(S[E]);v=!1},d(D){D&&k(e),D&&k(u),D&&k(f);for(let E=0;E<c.length;E+=1)c[E].d();Qt(S,D),M&&M.d(),n[19](null)}}}function W4(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:[U4,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&136315391&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function Y4(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new Dn}=e,c,d;function h(O){W.removeByValue(u,O),t(1,u)}function g(O){W.pushUnique(u,O),t(1,u)}function v(O){W.isEmpty(a[O])||a.splice(O,1),t(0,a)}function b(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const y=O=>h(O),C=O=>g(O),S=O=>v(O);function $(O){pe[O?"unshift":"push"](()=>{c=O,t(6,c)})}const M=()=>{for(let O of c.files)a.push(O);t(0,a),t(6,c.value=null,c)},D=()=>c==null?void 0:c.click();function E(O){pe[O?"unshift":"push"](()=>{d=O,t(7,d)})}return n.$$set=O=>{"record"in O&&t(2,o=O.record),"value"in O&&t(12,r=O.value),"uploadedFiles"in O&&t(0,a=O.uploadedFiles),"deletedFileIndexes"in O&&t(1,u=O.deletedFileIndexes),"field"in O&&t(3,f=O.field)},n.$$.update=()=>{var O,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=((O=f.options)==null?void 0:O.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,E]}class K4 extends Ee{constructor(e){super(),Oe(this,e,Y4,W4,De,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function op(n){let e,t;return{c(){e=_("small"),t=F(n[1]),p(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&ue(t,i[1])},d(i){i&&k(e)}}}function J4(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 gM(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 hM({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function _M(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 sM({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function bM(n){let e,t,i,s,l;function o(f){n[27](f,n[40])}function r(f){n[28](f,n[40])}function a(f){n[29](f,n[40])}let u={field:n[40],record:n[2]};return n[2][n[40].name]!==void 0&&(u.value=n[2][n[40].name]),n[3][n[40].name]!==void 0&&(u.uploadedFiles=n[3][n[40].name]),n[4][n[40].name]!==void 0&&(u.deletedFileIndexes=n[4][n[40].name]),e=new K4({props:u}),pe.push(()=>Fe(e,"value",o)),pe.push(()=>Fe(e,"uploadedFiles",r)),pe.push(()=>Fe(e,"deletedFileIndexes",a)),{c(){V(e.$$.fragment)},m(f,c){j(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[40]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[40].name],He(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],He(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[40].name],He(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){q(e,f)}}}function vM(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 M4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function yM(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 w4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function kM(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 b4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function wM(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 h4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function $M(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 f4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function SM(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 o4({props:l}),pe.push(()=>Fe(e,"value",
<span class="txt">Delete</span>`,p(e,"tabindex","0"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function OM(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=F(t),s=T(),o=F(l),r=F(" record"),a=T(),c&&c.c(),u=Ke()},m(d,h){w(d,e,h),m(e,i),m(e,s),m(e,o),m(e,r),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&ue(i,t),(!f||h[0]&1)&&l!==(l=d[0].name+"")&&ue(o,l),!d[2].isNew&&d[10]?c?(c.p(d,h),h[0]&1028&&A(c,1)):(c=mp(d),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Pe(),P(c,1,1,()=>{c=null}),Le())},i(d){f||(A(c),f=!0)},o(d){P(c),f=!1},d(d){d&&k(e),d&&k(a),c&&c.d(d),d&&k(u)}}}function EM(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=F(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[11]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[9]||n[7],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=G(e,"click",n[17]),u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&ue(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 AM(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[EM],header:[OM],default:[TM]},$$scope:{ctx:n}};return e=new mi({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&288&&(o.beforeHide=s[32]),l[0]&1693|l[1]&8192&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[33](null),q(e,s)}}}function gp(n){return JSON.stringify(n)}function PM(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(x){return $(x),t(8,g=!0),f==null?void 0:f.show()}function S(){return f==null?void 0:f.hide()}async function $(x){hi({}),c=x||{},t(2,d=x!=null&&x.clone?x.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 x=E();let Q;d.isNew?Q=we.records.create(u==null?void 0:u.id,x):Q=we.records.update(u==null?void 0:u.id,d.id,x),Q.then(async Se=>{cn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),S(),r("save",Se)}).catch(Se=>{we.errorResponseHandler(Se)}).finally(()=>{t(7,h=!1)})}function D(){!(c!=null&&c.id)||pi("Do you really want to delete the selected record?",()=>we.records.delete(c["@collectionId"],c.id).then(()=>{S(),cn("Successfully deleted record."),r("delete",c)}).catch(x=>{we.errorResponseHandler(x)}))}function E(){const x=(d==null?void 0:d.export())||{},Q=new FormData,Se={};for(const je of(u==null?void 0:u.schema)||[])Se[je.name]=je;for(const je in x)!Se[je]||(typeof x[je]>"u"&&(x[je]=null),W.addValueToFormData(Q,je,x[je]));for(const je in v){const Ue=W.toArray(v[je]);for(const Z of Ue)Q.append(je,Z)}for(const je in b){const Ue=W.toArray(b[je]);for(const Z of Ue)Q.append(je+"."+Z,"")}return Q}const O=()=>S(),L=()=>D();function I(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function N(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function B(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function U(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function ee(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function K(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function se(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function Y(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function te(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function J(x,Q){n.$$.not_equal(v[Q.name],x)&&(v[Q.name]=x,t(3,v))}function _e(x,Q){n.$$.not_equal(b[Q.name],x)&&(b[Q.name]=x,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=G(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=Ke(),V(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),j(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&8&&(r.record=e[35]),o[0]&2048&&(r.field=e[38]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),q(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,E,O,L,I,N,B;function U(){return e[25](e[35])}h=new Qo({props:{id:e[35].id}});let ee=e[11];const K=te=>te[38].name;for(let te=0;te<ee.length;te+=1){let J=Sp(e,ee,te),_e=K(J);b.set(_e,v[te]=Op(_e,J))}S=new $i({props:{date:e[35].created}}),D=new $i({props:{date:e[35].updated}});function se(){return e[26](e[35])}function Y(...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"),V(h.$$.fragment),g=T();for(let te=0;te<v.length;te+=1)v[te].c();y=T(),C=_("td"),V(S.$$.fragment),$=T(),M=_("td"),V(D.$$.fragment),E=T(),O=_("td"),O.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(O,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(te,J){w(te,t,J),m(t,i),m(i,s),m(s,l),m(s,a),m(s,u),m(t,c),m(t,d),j(h,d,null),m(t,g);for(let _e=0;_e<v.length;_e+=1)v[_e].m(t,null);m(t,y),m(t,C),j(S,C,null),m(t,$),m(t,M),j(D,M,null),m(t,E),m(t,O),m(t,L),I=!0,N||(B=[G(l,"change",U),G(s,"click",ei(e[19])),G(t,"click",se),G(t,"keydown",Y)],N=!0)},p(te,J){e=te,(!I||J[0]&8&&o!==(o="checkbox_"+e[35].id))&&p(l,"id",o),(!I||J[0]&40&&r!==(r=e[5][e[35].id]))&&(l.checked=r),(!I||J[0]&8&&f!==(f="checkbox_"+e[35].id))&&p(u,"for",f);const _e={};J[0]&8&&(_e.id=e[35].id),h.$set(_e),J[0]&2056&&(ee=e[11],Pe(),v=yt(v,J,K,1,e,ee,b,t,Zt,Op,y,Sp),Le());const be={};J[0]&8&&(be.date=e[35].created),S.$set(be);const X={};J[0]&8&&(X.date=e[35].updated),D.$set(X)},i(te){if(!I){A(h.$$.fragment,te);for(let J=0;J<ee.length;J+=1)A(v[J]);A(S.$$.fragment,te),A(D.$$.fragment,te),I=!0}},o(te){P(h.$$.fragment,te);for(let J=0;J<v.length;J+=1)P(v[J]);P(S.$$.fragment,te),P(D.$$.fragment,te),I=!1},d(te){te&&k(t),q(h);for(let J=0;J<v.length;J+=1)v[J].d();q(S),q(D),N=!1,Ge(B)}}}function Ap(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=F("Showing "),s=F(i),l=F(" of "),o=F(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&8&&i!==(i=r[3].length+"")&&ue(s,i),a[0]&16&&ue(o,r[4])},d(r){r&&k(e)}}}function 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=F("Load more ("),o=F(l),r=F(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),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=G(t,"click",n[29]),a=!0)},p(f,c){c[0]&24&&l!==(l=f[4]-f[3].length+"")&&ue(o,l),c[0]&256&&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=F("Selected "),s=_("strong"),l=F(n[6]),o=T(),a=F(r),u=T(),f=_("button"),f.innerHTML='<span class="txt">Reset</span>',c=T(),d=_("div"),h=T(),g=_("button"),g.innerHTML='<span class="txt">Delete selected</span>',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),ie(
2022-08-16 12:36:15 +08:00
<span class="txt">API Preview</span>`,b=T(),y=_("button"),y.innerHTML=`<i class="ri-add-line"></i>
2022-08-18 03:29:11 +08:00
<span class="txt">New record</span>`,C=T(),V(S.$$.fragment),$=T(),V(M.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"type","button"),p(f,"class","btn btn-secondary btn-circle"),p(u,"class","inline-flex gap-5"),p(v,"type","button"),p(v,"class","btn btn-outline"),p(y,"type","button"),p(y,"class","btn btn-expanded"),p(g,"class","btns-group"),p(e,"class","page-header")},m(ee,K){w(ee,e,K),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),m(e,u),m(u,f),m(u,c),j(d,u,null),m(e,h),m(e,g),m(g,v),m(g,b),m(g,y),w(ee,C,K),j(S,ee,K),w(ee,$,K),j(M,ee,K),O=!0,L||(I=[Ye(wt.call(null,f,{text:"Edit collection",position:"right"})),G(f,"click",n[12]),G(v,"click",n[14]),G(y,"click",n[15])],L=!0)},p(ee,K){(!O||K&4)&&o!==(o=ee[2].name+"")&&ue(r,o);const se={};K&1&&(se.value=ee[0]),K&4&&(se.autocompleteCollection=ee[2]),S.$set(se);const Y={};K&4&&(Y.collection=ee[2]),!D&&K&1&&(D=!0,Y.filter=ee[0],He(()=>D=!1)),!E&&K&2&&(E=!0,Y.sort=ee[1],He(()=>E=!1)),M.$set(Y)},i(ee){O||(A(d.$$.fragment,ee),A(S.$$.fragment,ee),A(M.$$.fragment,ee),O=!0)},o(ee){P(d.$$.fragment,ee),P(S.$$.fragment,ee),P(M.$$.fragment,ee),O=!1},d(ee){ee&&k(e),q(d),ee&&k(C),q(S,ee),ee&&k($),n[17](null),q(M,ee),L=!1,Ge(I)}}}function rT(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=G(o,"click",n[11]),r=!0)},p:oe,d(u){u&&k(e),r=!1,a()}}}function aT(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 uT(n){let e,t,i,s,l,o,r,a,u;const f=[lT,sT,iT],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 WC({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(),V(s.$$.fragment),l=T(),V(o.$$.fragment),r=T(),V(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),j(s,b,y),w(b,l,y),j(o,b,y),w(b,r,y),j(a,b,y),u=!0},p(b,[y]){let C=e;e=d(b),e===C?c[e].p(b,y):(Pe(),P(c[C],1,1,()=>{c[C]=null}),Le(),t=c[e],t?t.p(b,y):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const S={};s.$set(S);const $={};o.$set($);const M={};y&4&&(M.collection=b[2]),a.$set(M)},i(b){u||(A(t),A(s.$$.fragment,b),A(o.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){P(t),P(s.$$.fragment,b),P(o.$$.fragment,b),P(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[21](null),q(s,b),b&&k(l),n[22](null),q(o,b),b&&k(r),n[23](null),q(a,b)}}}function fT(n,e,t){let i,s,l,o,r,a;bt(n,ci,Y=>t(2,s=Y)),bt(n,Ds,Y=>t(10,l=Y)),bt(n,Ro,Y=>t(26,o=Y)),bt(n,Ft,Y=>t(27,r=Y)),bt(n,sa,Y=>t(8,a=Y)),dn(Ft,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(),E=Y=>t(0,g=Y.detail);function O(Y){pe[Y?"unshift":"push"](()=>{h=Y,t(6,h)})}function L(Y){g=Y,t(0,g)}function I(Y){v=Y,t(1,v)}const N=Y=>d==null?void 0:d.show(Y==null?void 0:Y.detail);function B(Y){pe[Y?"unshift":"push"](()=>{f=Y,t(3,f)})}function U(Y){pe[Y?"unshift":"push"](()=>{c=Y,t(4,c)})}function ee(Y){pe[Y?"unshift":"push"](()=>{d=Y,t(5,d)})}const K=()=>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(Y=>Y.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 Y=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:g,sort:v}).toString();Si("/collections?"+Y)}},[g,v,s,f,c,d,h,i,a,b,l,C,S,$,M,D,E,O,L,I,N,B,U,ee,K,se]}class cT extends Ee{constructor(e){super(),Oe(this,e,fT,uT,De,{})}}function Ip(n){let e,t;return e=new Re({props:{class:"form-field disabled",name:"id",$$slots:{default:[dT,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&2|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function dT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="ID",o=T(),r=_("input"),p(t,"class",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(wt.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function pT(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),Te(a,n[2]),f||(c=G(a,"input",n[19]),f=!0)},p(h,g){g[1]&1&&l!==(l=h[31])&&p(e,"for",l),h[1].verified?d||(d=Fp(),d.c(),d.m(r.parentNode,r)):d&&(d.d(1),d=null),g[1]&1&&u!=
2022-08-18 03:29:11 +08:00
<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=G(e,"click",n[16]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function yT(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=G(t,"click",n[17]),i=!0)},p(o,r){o[1].verified?l&&(l.d(1),l=null):l?l.p(o,r):(l=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 kT(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=F(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[5],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[5],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=G(t,"click",n[18]),c=!0)},p(g,v){g[1].isNew?h&&(Pe(),P(h,1,1,()=>{h=null}),Le()):h?(h.p(g,v),v[0]&2&&A(h,1)):(h=jp(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||v[0]&32)&&(t.disabled=g[5]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&ue(a,r),(!f||v[0]&1056&&u!==(u=!g[10]||g[5]))&&(l.disabled=u),v[0]&32&&ie(l,"btn-loading",g[5])},i(g){f||(A(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 wT(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[kT],header:[vT],default:[bT]},$$scope:{ctx:n}};return e=new mi({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&1088&&(o.beforeHide=s[24]),l[0]&1966|l[1]&2&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[25](null),q(e,s)}}}function $T(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 J;r.isNew?J=we.users.create(te):J=we.users.update(r.id,te),J.then(async _e=>{g&&M(!1),t(6,u=!1),b(),cn(r.isNew?"Successfully created user.":"Successfully updated user."),s("save",_e)}).catch(_e=>{we.errorResponseHandler(_e)}).finally(()=>{t(5,a=!1)})}function $(){!(r!=null&&r.id)||pi("Do you really want to delete the selected user?",()=>we.users.delete(r.id).then(()=>{t(6,u=!1),b(),cn("Successfully deleted user."),s("delete",r)}).catch(te=>{we.errorResponseHandler(te)}))}function M(te=!0){return we.users.requestVerification(r.isNew?f:r.email).then(()=>{t(6,u=!1),b(),te&&cn(`Successfully sent verification email to ${r.email}.`)}).catch(J=>{we.errorResponseHandler(J)})}const D=()=>M(),E=()=>$(),O=()=>b();function L(){f=this.value,t(2,f)}function I(){h=this.checked,t(3,h)}function N(){c=this.value,t(7,c)}function B(){d=this.value,t(8,d)}function U(){g=this.checked,t(9,g)}const ee=()=>i&&u?(pi("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),b()}),!1):!0;function K(te){pe[te?"unshift":"push"](()=>{o=te,t(4,o)})}function se(te){st.call(this,n,te)}function Y(te){st.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,E,O,L,I,N,B,U,ee,K,se,Y]}class ST extends Ee{constructor(e){super(),Oe(this,e,$T,wT,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 CT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E,O,L,I=[],N=new Map,B,U,ee,K,se,Y,te,J,_e,be,X=[],ae=new Map,ve,H,me,x,Q,Se;a=new Uo({}),a.$on("refresh",n[17]),g=new Bo({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["ver
<span class="txt">New user</span>`,h=T(),V(g.$$.fragment),v=T(),b=_("div"),y=_("table"),C=_("thead"),S=_("tr"),V($.$$.fragment),D=T(),V(E.$$.fragment),L=T();for(let ye=0;ye<I.length;ye+=1)I[ye].c();B=T(),V(U.$$.fragment),K=T(),V(se.$$.fragment),te=T(),J=_("th"),_e=T(),be=_("tbody");for(let ye=0;ye<X.length;ye+=1)X[ye].c();Xe&&Xe.c(),ve=T(),nt&&nt.c(),H=T(),ut&&ut.c(),me=Ke(),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(J,"class","col-type-action min-width"),p(y,"class","table"),ie(y,"table-loading",n[10]),p(b,"class","table-wrapper")},m(ye,Ne){w(ye,e,Ne),m(e,t),m(t,i),m(i,s),m(e,l),m(e,o),m(e,r),j(a,e,null),m(e,u),m(e,f),m(e,c),m(e,d),w(ye,h,Ne),j(g,ye,Ne),w(ye,v,Ne),w(ye,b,Ne),m(b,y),m(y,C),m(C,S),j($,S,null),m(S,D),j(E,S,null),m(S,L);for(let ct=0;ct<I.length;ct+=1)I[ct].m(S,null);m(S,B),j(U,S,null),m(S,K),j(se,S,null),m(S,te),m(S,J),m(y,_e),m(y,be);for(let ct=0;ct<X.length;ct+=1)X[ct].m(be,null);Xe&&Xe.m(be,null),w(ye,ve,Ne),nt&&nt.m(ye,Ne),w(ye,H,Ne),ut&&ut.m(ye,Ne),w(ye,me,Ne),x=!0,Q||(Se=[Ye(wt.call(null,o,{text:"Edit profile collection",position:"right"})),G(o,"click",n[16]),G(d,"click",n[18])],Q=!0)},p(ye,Ne){(!x||Ne[0]&16384)&&ue(s,ye[14]);const ct={};Ne[0]&8&&(ct.value=ye[3]),g.$set(ct);const Dt={};Ne[1]&131072&&(Dt.$$scope={dirty:Ne,ctx:ye}),!M&&Ne[0]&16&&(M=!0,Dt.sort=ye[4],He(()=>M=!1)),$.$set(Dt);const dt={};Ne[1]&131072&&(dt.$$scope={dirty:Ne,ctx:ye}),!O&&Ne[0]&16&&(O=!0,dt.sort=ye[4],He(()=>O=!1)),E.$set(dt),Ne[0]&4096&&(ce=ye[12],I=yt(I,Ne,$e,1,ye,ce,N,S,Mn,Up,B,Bp));const lt={};Ne[1]&131072&&(lt.$$scope={dirty:Ne,ctx:ye}),!ee&&Ne[0]&16&&(ee=!0,lt.sort=ye[4],He(()=>ee=!1)),U.$set(lt);const Lt={};Ne[1]&131072&&(Lt.$$scope={dirty:Ne,ctx:ye}),!Y&&Ne[0]&16&&(Y=!0,Lt.sort=ye[4],He(()=>Y=!1)),se.$set(Lt),Ne[0]&5450&&(Me=ye[1],Pe(),X=yt(X,Ne,ze,1,ye,Me,ae,be,Zt,Jp,null,Vp),Le(),!Me.length&&Xe?Xe.p(ye,Ne):Me.length?Xe&&(Xe.d(1),Xe=null):(Xe=Wp(ye),Xe.c(),Xe.m(be,null))),Ne[0]&1024&&ie(y,"table-loading",ye[10]),ye[1].length?nt?nt.p(ye,Ne):(nt=Zp(ye),nt.c(),nt.m(H.parentNode,H)):nt&&(nt.d(1),nt=null),ye[1].length&&ye[13]?ut?ut.p(ye,Ne):(ut=Gp(ye),ut.c(),ut.m(me.parentNode,me)):ut&&(ut.d(1),ut=null)},i(ye){if(!x){A(a.$$.fragment,ye),A(g.$$.fragment,ye),A($.$$.fragment,ye),A(E.$$.fragment,ye),A(U.$$.fragment,ye),A(se.$$.fragment,ye);for(let Ne=0;Ne<Me.length;Ne+=1)A(X[Ne]);x=!0}},o(ye){P(a.$$.fragment,ye),P(g.$$.fragment,ye),P($.$$.fragment,ye),P(E.$$.fragment,ye),P(U.$$.fragment,ye),P(se.$$.fragment,ye);for(let Ne=0;Ne<X.length;Ne+=1)P(X[Ne]);x=!1},d(ye){ye&&k(e),q(a),ye&&k(h),q(g,ye),ye&&k(v),ye&&k(b),q($),q(E);for(let Ne=0;Ne<I.length;Ne+=1)I[Ne].d();q(U),q(se);for(let Ne=0;Ne<X.length;Ne+=1)X[Ne].d();Xe&&Xe.d(),ye&&k(ve),nt&&nt.d(ye),ye&&k(H),ut&&ut.d(ye),ye&&k(me),Q=!1,Ge(Se)}}}function MT(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
2022-08-18 03:29:11 +08:00
<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 TT(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 DT(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=F("profile."),f=F(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+"")&&ue(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 OT(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 ET(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]?PT:AT}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function AT(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 PT(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=G(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=Ke(),V(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),j(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&4096&&(r.field=e[43]),o[0]&2&&(r.record=e[40].profile||{}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),q(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,E,O,L,I,N,B,U,ee,K,se,Y;s=new Qo({props:{id:e[40].id}});let te=e[12];const J=X=>X[43].name;for(let X=0;X<te.length;X+=1){let ae=zp(e,te,X),ve=J(ae);C.set(ve,y[X]=Kp(ve,ae))}M=new $i({props:{date:e[40].created}}),O=new $i({props:{date:e[40].updated}});function _e(){return e[24](e[40])}function be(){return e[25](e[40])}return{key:n,first:null,c(){t=_("tr"),i=_("td"),V(s.$$.fragment),l=T(),o=_("td"),r=_("div"),a=_("span"),f=F(u),d=T(),h=_("span"),v=F(g),b=T();for(let X=0;X<y.length;X+=1)y[X].c();S=T(),$=_("td"),V(M.$$.fragment),D=T(),E=_("td"),V(O.$$.fragment),L=T(),I=_("td"),N=_("button"),N.innerHTML=`<i class="ri-user-settings-line"></i>
2022-08-16 12:36:15 +08:00
<span class="txt">Edit user</span>`,B=T(),U=_("button"),U.innerHTML=`<i class="ri-profile-line"></i>
<span class="txt">Edit profile</span>`,ee=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(E,"class","col-type-date col-field-updated"),p(N,"type","button"),p(N,"class","btn btn-sm btn-outline"),p(U,"type","button"),p(U,"class","btn btn-sm m-l-10"),p(I,"class","col-type-action min-width"),this.first=t},m(X,ae){w(X,t,ae),m(t,i),j(s,i,null),m(t,l),m(t,o),m(o,r),m(r,a),m(a,f),m(r,d),m(r,h),m(h,v),m(t,b);for(let ve=0;ve<y.length;ve+=1)y[ve].m(t,null);m(t,S),m(t,$),j(M,$,null),m(t,D),m(t,E),j(O,E,null),m(t,L),m(t,I),m(I,N),m(I,B),m(I,U),m(t,ee),K=!0,se||(Y=[G(N,"click",ei(_e)),G(U,"click",ei(be))],se=!0)},p(X,ae){e=X;const ve={};ae[0]&2&&(ve.id=e[40].id),s.$set(ve),(!K||ae[0]&2)&&u!==(u=e[40].email+"")&&ue(f,u),(!K||ae[0]&2&&c!==(c=e[40].email))&&p(a,"title",c),(!K||ae[0]&2)&&g!==(g=e[40].verified?"Verified":"Unverified")&&ue(v,g),ae[0]&2&&ie(h,"label-success",e[40].verified),ae[0]&2&&ie(h,"label-warning",!e[40].verified),ae[0]&4098&&(te=e[12],Pe(),y=yt(y,ae,J,1,e,te,C,t,Zt,Kp,S,zp),Le());const H={};ae[0]&2&&(H.date=e[40].created),M.$set(H);const me={};ae[0]&2&&(me.date=e[40].updated),O.$set(me)},i(X){if(!K){A(s.$$.fragment,X);for(let ae=0;ae<te.length;ae+=1)A(y[ae]);A(M.$$.fragment,X),A(O.$$.fragment,X),K=!0}},o(X){P(s.$$.fragment,X);for(let ae=0;ae<y.length;ae+=1)P(y[ae]);P(M.$$.fragment,X),P(O.$$.fragment,X),K=!1},d(X){X&&k(t),q(s);for(let ae=0;ae<y.length;ae+=1)y[ae].d();q(M),q(O),se=!1,Ge(Y)}}}function Zp(n){let e,t,i=n[1].length+"",s,l,o;return{c(){e=_("small"),t=F("Showing "),s=F(i),l=F(" of "),o=F(n[2]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&2&&i!==(i=r[1].length+"")&&ue(s,i),a[0]&4&&ue(o,r[2])},d(r){r&&k(e)}}}function 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=F("Load more ("),o=F(l),r=F(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),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=G(t,"click",n[27]),a=!0)},p(f,c){c[0]&6&&l!==(l=f[2]-f[1].length+"")&&ue(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 LT(n){let e,t,i,s;const l=[MT,CT],o=[];function r(a,u){return a[11]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(Pe(),P(o[f],1,1,()=>{o[f]=null}),Le(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function IT(n){let e,t,i,s,l,o,r,a;e=new On({props:{$$slots:{default:[LT]},$$scope:{ctx:n}}});let u={};i=new ST({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(){V(e.$$.fragment),t=T(),V(i.$$.fragment),s=T(),V(l.$$.fragment),o=T(),V(r.$$.fragment)},m(d,h){j(e,d,h),w(d,t,h),j(i,d,h),w(d,s,h),j(l,d,h),w(d,o,h),j(r,d,h),a=!0},p(d,h){const g={};h[0]&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||(A(e.$$.fragment,d),A(i.$$.fragment,d),A(l.$$.fragment,d),A(r.$$.fragment,d),a=!0)},o(d){P(e.$$.fragment,d),P(i.$$.fragment,d),P(l.$$.fragment,d),P(r.$$.fragment,d),a=!1},d(d){q(e,d),d&&k(t),n[28](null),q(i,d),d&&k(s),n[31](null),q(l,d),d&&k(o),n[33](null),q(r,d)}}}function FT(n,e,t){let i,s,l,o;bt(n,Ro,x=>t(35,l=x)),bt(n,Ft,x=>t(14,o=x)),dn(Ft,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")|
2022-08-16 12:36:15 +08:00
<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>
2022-08-18 03:29:11 +08:00
<span class="txt">Token options</span>`,D=T(),E=_("a"),E.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(E,"href","/settings/admins"),p(E,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(I,N){w(I,e,N),m(e,t),m(t,i),m(t,s),m(t,l),m(t,o),m(t,r),m(t,a),m(t,u),m(t,f),m(t,c),m(t,d),m(t,h),m(t,g),m(t,v),m(t,b),m(t,y),m(t,C),m(t,S),m(t,$),m(t,M),m(t,D),m(t,E),O||(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,E,{path:"/settings/admins/?.*"})),Ye(mn.call(null,E))],O=!0)},p:oe,i:oe,o:oe,d(I){I&&k(e),O=!1,Ge(L)}}}class Bi extends Ee{constructor(e){super(),Oe(this,e,null,RT,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:[HT,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function HT(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=[G(e,"click",a),G(e,"keydown",u)],o=!0)},p(f,c){n=f,c[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(f){f&&k(e),o=!1,Ge(r)}}}function jT(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),Te(r,n[3]),u||(f=G(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&Te(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:[qT,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[15]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function YT(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&nh(n);return{c(){h&&h.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=F(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[6],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],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=G(t,"click",n[16]),c=!0)},p(g,v){g[1].isNew?h&&(Pe(),P(h,1,1,()=>{h=null}),Le()):h?(h.p(g,v),v[0]&2&&A(h,1)):(h=nh(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||v[0]&64)&&(t.disabled=g[6]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&ue(a,r),(!f||v[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),v[0]&64&&ie(l,"btn-loading",g[6])},i(g){f||(A(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:"admin-panel",beforeHide:n[23],$$slots:{footer:[YT],header:[UT],default:[BT]},$$scope:{ctx:n}};return e=new mi({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[23]),l[0]&1886|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[24](null),q(e,s)}}}function JT(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(Y){return y(Y),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(Y){hi({}),t(1,r=Y!=null&&Y.clone?Y.clone():new $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 Y={email:c,avatar:f};(r.isNew||g)&&(Y.password=d,Y.passwordConfirm=h);let te;r.isNew?te=we.admins.create(Y):te=we.admins.update(r.id,Y),te.then(async J=>{var _e;t(7,u=!1),b(),cn(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",J),((_e=we.authStore.model)==null?void 0:_e.id)===J.id&&we.authStore.save(we.authStore.token,J)}).catch(J=>{we.errorResponseHandler(J)}).finally(()=>{t(6,a=!1)})}function $(){!(r!=null&&r.id)||pi("Do you really want to delete the selected admin?",()=>we.admins.delete(r.id).then(()=>{t(7,u=!1),b(),cn("Successfully deleted admin."),s("delete",r)}).catch(Y=>{we.errorResponseHandler(Y)}))}const M=()=>$(),D=()=>b(),E=Y=>t(2,f=Y),O=(Y,te)=>{(te.code==="Enter"||te.code==="Space")&&(te.preventDefault(),t(2,f=Y))};function L(){c=this.value,t(3,c)}function I(){g=this.checked,t(4,g)}function N(){d=this.value,t(8,d)}function B(){h=this.value,t(9,h)}const U=()=>i&&u?(pi("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function ee(Y){pe[Y?"unshift":"push"](()=>{o=Y,t(5,o)})}function K(Y){st.call(this,n,Y)}function se(Y){st.call(this,n,Y)}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,E,O,L,I,N,B,U,ee,K,se]}class ZT extends Ee{constructor(e){super(),Oe(this,e,JT,KT,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 GT(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 XT(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 QT(n){let e,t,i,s;retur
`},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=G(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,E,O,L,I,N,B;u=new Qo({props:{id:e[24].id}});let U=e[24].id===e[7].id&&oh();S=new $i({props:{date:e[24].created}}),D=new $i({props:{date:e[24].updated}});function ee(){return e[15](e[24])}function K(...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"),V(u.$$.fragment),f=T(),U&&U.c(),c=T(),d=_("td"),h=_("span"),v=F(g),y=T(),C=_("td"),V(S.$$.fragment),$=T(),M=_("td"),V(D.$$.fragment),E=T(),O=_("td"),O.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(O,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(se,Y){w(se,t,Y),m(t,i),m(i,s),m(s,l),m(t,r),m(t,a),j(u,a,null),m(a,f),U&&U.m(a,null),m(t,c),m(t,d),m(d,h),m(h,v),m(t,y),m(t,C),j(S,C,null),m(t,$),m(t,M),j(D,M,null),m(t,E),m(t,O),m(t,L),I=!0,N||(B=[G(t,"click",ee),G(t,"keydown",K)],N=!0)},p(se,Y){e=se,(!I||Y&16&&!xn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const te={};Y&16&&(te.id=e[24].id),u.$set(te),e[24].id===e[7].id?U||(U=oh(),U.c(),U.m(a,null)):U&&(U.d(1),U=null),(!I||Y&16)&&g!==(g=e[24].email+"")&&ue(v,g),(!I||Y&16&&b!==(b=e[24].email))&&p(h,"title",b);const J={};Y&16&&(J.date=e[24].created),S.$set(J);const _e={};Y&16&&(_e.date=e[24].updated),D.$set(_e)},i(se){I||(A(u.$$.fragment,se),A(S.$$.fragment,se),A(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),q(u),U&&U.d(),q(S),q(D),N=!1,Ge(B)}}}function ah(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=_("small"),t=F("Showing "),s=F(i),l=F(" of "),r=F(o),p(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){w(a,e,u),m(e,t),m(e,s),m(e,l),m(e,r)},p(a,u){u&16&&i!==(i=a[4].length+"")&&ue(s,i),u&16&&o!==(o=a[4].length+"")&&ue(r,o)},d(a){a&&k(e)}}}function nD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be=[],X=new Map,ae,ve,H,me,x;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 Q(Me){n[11](Me)}let Se={class:"col-type-text",name:"id",$$slots:{default:[GT]},$$scope:{ctx:n}};n[2]!==void 0&&(Se.sort=n[2]),D=new sn({props:Se}),pe.push(()=>Fe(D,"sort",Q));function je(Me){n[12](Me)}let Ue={class:"col-type-email col-field-email",name:"email",$$slots:{default:[XT]},$$scope:{ctx:n}};n[2]!==void 0&&(Ue.sort=n[2]),L=new sn({props:Ue}),pe.push(()=>Fe(L,"sort",je));function Z(Me){n[13](Me)}let ge={class:"col-type-date col-field-created",name:"created",$$slots:{default:[QT]},$$scope:{ctx:n}};n[2]!==void 0&&(ge.sort=n[2]),B=new sn({props:ge}),pe.push(()=>Fe(B,"sort",Z));function ce(Me){n[14](Me)}let $e={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[xT]},$$scope:{ctx:n}};n[2]!==void 0&&($e.sort=n[2]),K=new sn({props:$e}),pe.push(()=>Fe(K,"sort",ce));let Ze=n[4];const et=Me=>Me[24].id;for(let Me=0;Me<Ze.length;Me+=1){let ze=ih(n,Ze,Me),Xe=et(ze);X.set(Xe,be[Me]=rh(Xe,ze))}let We=null;Ze.length||(We=sh(n));let tt=n[4].length&&ah(n);return{c(){e=_("header"),t=_("nav"),i=_("div"),i.textConten
<span class="txt">New admin</span>`,h=T(),V(g.$$.fragment),v=T(),b=_("div"),y=_("table"),C=_("thead"),S=_("tr"),$=_("th"),M=T(),V(D.$$.fragment),O=T(),V(L.$$.fragment),N=T(),V(B.$$.fragment),ee=T(),V(K.$$.fragment),Y=T(),te=_("th"),J=T(),_e=_("tbody");for(let Me=0;Me<be.length;Me+=1)be[Me].c();We&&We.c(),ae=T(),tt&&tt.c(),ve=Ke(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(d,"type","button"),p(d,"class","btn btn-expanded"),p(e,"class","page-header"),p($,"class","min-width"),p(te,"class","col-type-action min-width"),p(y,"class","table"),ie(y,"table-loading",n[5]),p(b,"class","table-wrapper")},m(Me,ze){w(Me,e,ze),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(e,r),j(a,e,null),m(e,u),m(e,f),m(e,c),m(e,d),w(Me,h,ze),j(g,Me,ze),w(Me,v,ze),w(Me,b,ze),m(b,y),m(y,C),m(C,S),m(S,$),m(S,M),j(D,S,null),m(S,O),j(L,S,null),m(S,N),j(B,S,null),m(S,ee),j(K,S,null),m(S,Y),m(S,te),m(y,J),m(y,_e);for(let Xe=0;Xe<be.length;Xe+=1)be[Xe].m(_e,null);We&&We.m(_e,null),w(Me,ae,ze),tt&&tt.m(Me,ze),w(Me,ve,ze),H=!0,me||(x=G(d,"click",n[9]),me=!0)},p(Me,ze){(!H||ze&64)&&ue(o,Me[6]);const Xe={};ze&2&&(Xe.value=Me[1]),g.$set(Xe);const nt={};ze&134217728&&(nt.$$scope={dirty:ze,ctx:Me}),!E&&ze&4&&(E=!0,nt.sort=Me[2],He(()=>E=!1)),D.$set(nt);const ut={};ze&134217728&&(ut.$$scope={dirty:ze,ctx:Me}),!I&&ze&4&&(I=!0,ut.sort=Me[2],He(()=>I=!1)),L.$set(ut);const ye={};ze&134217728&&(ye.$$scope={dirty:ze,ctx:Me}),!U&&ze&4&&(U=!0,ye.sort=Me[2],He(()=>U=!1)),B.$set(ye);const Ne={};ze&134217728&&(Ne.$$scope={dirty:ze,ctx:Me}),!se&&ze&4&&(se=!0,Ne.sort=Me[2],He(()=>se=!1)),K.$set(Ne),ze&186&&(Ze=Me[4],Pe(),be=yt(be,ze,et,1,Me,Ze,X,_e,Zt,rh,null,ih),Le(),!Ze.length&&We?We.p(Me,ze):Ze.length?We&&(We.d(1),We=null):(We=sh(Me),We.c(),We.m(_e,null))),ze&32&&ie(y,"table-loading",Me[5]),Me[4].length?tt?tt.p(Me,ze):(tt=ah(Me),tt.c(),tt.m(ve.parentNode,ve)):tt&&(tt.d(1),tt=null)},i(Me){if(!H){A(a.$$.fragment,Me),A(g.$$.fragment,Me),A(D.$$.fragment,Me),A(L.$$.fragment,Me),A(B.$$.fragment,Me),A(K.$$.fragment,Me);for(let ze=0;ze<Ze.length;ze+=1)A(be[ze]);H=!0}},o(Me){P(a.$$.fragment,Me),P(g.$$.fragment,Me),P(D.$$.fragment,Me),P(L.$$.fragment,Me),P(B.$$.fragment,Me),P(K.$$.fragment,Me);for(let ze=0;ze<be.length;ze+=1)P(be[ze]);H=!1},d(Me){Me&&k(e),q(a),Me&&k(h),q(g,Me),Me&&k(v),Me&&k(b),q(D),q(L),q(B),q(K);for(let ze=0;ze<be.length;ze+=1)be[ze].d();We&&We.d(),Me&&k(ae),tt&&tt.d(Me),Me&&k(ve),me=!1,x()}}}function iD(n){let e,t,i,s,l,o;e=new Bi({}),i=new On({props:{$$slots:{default:[nD]},$$scope:{ctx:n}}});let r={};return l=new ZT({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment),s=T(),V(l.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),w(a,s,u),j(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){q(e,a),a&&k(t),q(i,a),a&&k(s),n[18](null),q(l,a)}}}function sD(n,e,t){let i,s,l;bt(n,Ro,N=>t(21,i=N)),bt(n,Ft,N=>t(6,s=N)),bt(n,$a,N=>t(7,l=N)),dn(Ft,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){return t(5,u=!0),t(4,a=[]),we.admins.getFullList(100,{sort:c||"-created",filter:f}).then(N=>{t(4,a=N),t(5,u=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,u=!1),console.warn(N),h(),we.errorResponseHandler(N,!1))})}function h(){t(4,a=[])}const g=()=>d(),v=()=>r==null?void 0:r.show(),b=N=>t(1,f=N.detail);function y(N){c=N,t(2,c)}function C(N){c=N,t(2,c)}function S(N){c=N,t(2,c)}function $(N){c=N,t(2,c)}const M=N=>r==null?void 0:r.show(N),D=(N,B)=>{(B.code==="Enter"||B.code==="Space")&&(B.preventDefault(),r==null||r.show(N))},E=()=>t(1,f="");function O(N){pe[N?"unshift":"push"](()=>{r=N,t(3,r)})}const L=()=>d(),I=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const N=new URLSearchParams({filter:f,sort:c}).toString();Si("/settings/admins?"+N),d()}},[d,f,c,r,a,u,s,l,g,v,b,y,C,S,$,M,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),j(s,e,null),m(e,l),j(o,e,null),m(e,r),m(e,a),u=!0,f||(c=G(e,"submit",Yt(n[3])),f=!0)},p(d,h){const g={};h&769&&(g.$$scope={dirty:h,ctx:d}),s.$set(g);const v={};h&770&&(v.$$scope={dirty:h,ctx:d}),o.$set(v),h&4&&ie(a,"btn-disabled",d[2]),h&4&&ie(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){P(s.$$.fragment,d),P(o.$$.fragment,d),u=!1},d(d){d&&k(e),q(s),q(o),f=!1,c()}}}function uD(n){let e,t;return e=new Ng({props:{$$slots:{default:[aD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function fD(n,e,t){let i;bt(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),we.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 cD extends Ee{constructor(e){super(),Oe(this,e,fD,uD,De,{})}}function dD(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:[hD,({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:[mD,({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:[gD,({uniqueId:M})=>({17:M}),({uniqueId:M})=>M?131072:0]},$$scope:{ctx:n}}});let $=n[3]&&uh(n);return{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),V(a.$$.fragment),u=T(),f=_("div"),c=_("div"),d=T(),$&&$.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),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),j(a,e,null),m(e,u),m(e,f),m(f,c),m(f,d),$&&$.m(f,null),m(f,h),m(f,g),m(g,v),y=!0,C||(S=G(g,"click",n[12]),C=!0)},p(M,D){const E={};D&393217&&(E.$$scope={dirty:D,ctx:M}),i.$set(E);const O={};D&393217&&(O.$$scope={dirty:D,ctx:M}),o.$set(O);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||(A(i.$$.fragment,M),A(o.$$.fragment,M),A(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),q(i),q(o),q(a),$&&$.d(),C=!1,S()}}}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 hD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("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),Te(l,n[0].meta.appName),r||(a=G(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&&Te(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function mD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("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),Te(l,n[0].meta.appUrl),r||(a=G(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&&Te(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=G(s,"submit",Yt(n[4])),a=!0)},p(h,g){let v=l;l=d(h),l===v?c[l].p(h,g):(Pe(),P(c[v],1,1,()=>{c[v]=null}),Le(),o=c[l],o?o.p(h,g):(o=c[l]=f[l](h),o.c()),A(o,1),o.m(s,null))},i(h){r||(A(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 bD(n){let e,t,i,s;return e=new Bi({}),i=new On({props:{$$slots:{default:[_D]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&262159&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&k(t),q(i,l)}}}function vD(n,e,t){let i,s,l;bt(n,bo,$=>t(13,s=$)),bt(n,Ft,$=>t(14,l=$)),dn(Ft,l="Application settings",l);let o={},r={},a=!1,u=!1,f="";c();async function c(){t(1,a=!0);try{const $=await we.settings.getAll()||{};h($)}catch($){we.errorResponseHandler($)}t(1,a=!1)}async function d(){if(!(u||!i)){t(2,u=!0);try{const $=await we.settings.update(W.filterRedactedProps(r));h($),cn("Successfully saved application settings.")}catch($){we.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=Pt(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 yD extends Ee{constructor(e){super(),Oe(this,e,vD,bD,De,{})}}function kD(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=at(l,s[o]);return{c(){e=_("input"),di(e,l)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[7](e),Te(e,n[0]),t||(i=G(e,"input",n[8]),t=!0)},p(o,r){di(e,l=pn(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&Te(e,o[0])},d(o){o&&k(e),n[7](null),t=!1,i()}}}function wD(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=at(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(wt.call(null,t,{position:"left",text:"Set new value"})),G(t,"click",n[6])],l=!0)},p(u,f){di(s,a=pn(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&k(e),u&&k(i),u&&k(s),l=!1,Ge(o)}}}function $D(n){let e;function t(l,o){return l[3]?wD:kD}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function SD(n,e,t){const i=["value","mask"];let s=Bt(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await ii(),r==null||r.focus()}const f=()=>u();function c(h){pe[h?"unshift":"push"](()=>{r=h,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=at(at({},e),ni(h)),t(5,s=Bt(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,o=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&l===o&&t(3,a=!0)},[l,o,r,a,u,s,f,c,d]}class Za extends Ee{constructor(e){super(),Oe(this,e,SD,$D,De,{value:0,mask:1})}}function CD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v;return{c(){e=_("label"),t=F("Subject"),s=T(),l=_("input"),r=T(),a=_("div"),u=F(`Available placeholder parameters:
2022-08-16 12:36:15 +08:00
`),f=_("span"),f.textContent=`{APP_NAME}
`,c=F(`,
`),d=_("span"),d.textContent=`{APP_URL}
`,h=F("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(b,y){w(b,e,y),m(e,t),w(b,s,y),w(b,l,y),Te(l,n[0].subject),w(b,r,y),w(b,a,y),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),g||(v=[G(l,"input",n[13]),G(f,"click",n[14]),G(d,"click",n[15])],g=!0)},p(b,y){y[1]&1&&i!==(i=b[31])&&p(e,"for",i),y[1]&1&&o!==(o=b[31])&&p(l,"id",o),y[0]&1&&l.value!==b[0].subject&&Te(l,b[0].subject)},d(b){b&&k(e),b&&k(s),b&&k(l),b&&k(r),b&&k(a),g=!1,Ge(v)}}}function MD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y;return{c(){e=_("label"),t=F("Action URL"),s=T(),l=_("input"),r=T(),a=_("div"),u=F(`Available placeholder parameters:
2022-08-16 12:36:15 +08:00
`),f=_("span"),f.textContent=`{APP_NAME}
`,c=F(`,
`),d=_("span"),d.textContent=`{APP_URL}
`,h=F(`,
`),g=_("span"),g.textContent="{TOKEN}",v=F("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(C,S){w(C,e,S),m(e,t),w(C,s,S),w(C,l,S),Te(l,n[0].actionUrl),w(C,r,S),w(C,a,S),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),m(a,g),m(a,v),b||(y=[G(l,"input",n[16]),G(f,"click",n[17]),G(d,"click",n[18]),G(g,"click",n[19])],b=!0)},p(C,S){S[1]&1&&i!==(i=C[31])&&p(e,"for",i),S[1]&1&&o!==(o=C[31])&&p(l,"id",o),S[0]&1&&l.value!==C[0].actionUrl&&Te(l,C[0].actionUrl)},d(C){C&&k(e),C&&k(s),C&&k(l),C&&k(r),C&&k(a),b=!1,Ge(y)}}}function TD(n){let e,t,i,s;return{c(){e=_("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","12"),e.required=!0},m(l,o){w(l,e,o),Te(e,n[0].body),i||(s=G(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&Te(e,l[0].body)},i:oe,o:oe,d(l){l&&k(e),i=!1,s()}}}function DD(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=new o(r(n)),pe.push(()=>Fe(e,"value",l))),{c(){e&&V(e.$$.fragment),i=Ke()},m(a,u){e&&j(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,He(()=>t=!1)),o!==(o=a[4])){if(e){Pe();const c=e;P(c.$$.fragment,1,0,()=>{q(c,1)}),Le()}o?(e=new o(r(a)),pe.push(()=>Fe(e,"value",l)),V(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&q(e,a)}}}function OD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$;const M=[DD,TD],D=[];function E(O,L){return O[4]&&!O[5]?0:1}return l=E(n),o=D[l]=M[l](n),{c(){e=_("label"),t=F("Body (HTML)"),s=T(),o.c(),r=T(),a=_("div"),u=F(`Available placeholder parameters:
2022-08-16 12:36:15 +08:00
`),f=_("span"),f.textContent=`{APP_NAME}
`,c=F(`,
`),d=_("span"),d.textContent=`{APP_URL}
`,h=F(`,
`),g=_("span"),g.textContent=`{TOKEN}
`,v=F(`,
`),b=_("span"),b.textContent=`{ACTION_URL}
`,y=F("."),p(e,"for",i=n[31]),p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"class","label label-sm link-primary txt-mono"),p(b,"class","label label-sm link-primary txt-mono"),p(b,"title","Required parameter"),p(a,"class","help-block")},m(O,L){w(O,e,L),m(e,t),w(O,s,L),D[l].m(O,L),w(O,r,L),w(O,a,L),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),m(a,g),m(a,v),m(a,b),m(a,y),C=!0,S||($=[G(f,"click",n[22]),G(d,"click",n[23]),G(g,"click",n[24]),G(b,"click",n[25])],S=!0)},p(O,L){(!C||L[1]&1&&i!==(i=O[31]))&&p(e,"for",i);let I=l;l=E(O),l===I?D[l].p(O,L):(Pe(),P(D[I],1,1,()=>{D[I]=null}),Le(),o=D[l],o?o.p(O,L):(o=D[l]=M[l](O),o.c()),A(o,1),o.m(r.parentNode,r))},i(O){C||(A(o),C=!0)},o(O){P(o),C=!1},d(O){O&&k(e),O&&k(s),D[l].d(O),O&&k(r),O&&k(a),S=!1,Ge($)}}}function ED(n){let e,t,i,s,l,o;return e=new Re({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[CD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new Re({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[MD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new Re({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[OD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment),s=T(),V(l.$$.fragment)},m(r,a){j(e,r,a),w(r,t,a),j(i,r,a),w(r,s,a),j(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){q(e,r),r&&k(t),q(i,r),r&&k(s),q(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(wt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=it(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=it(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function AD(n){let e,t,i,s,l,o,r,a,u,f,c=n[6]&&fh();return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),l=F(n[2]),o=T(),r=_("div"),a=T(),c&&c.c(),u=Ke(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,s),m(s,l),w(d,o,h),w(d,r,h),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&ue(l,d[2]),d[6]?c?h[0]&64&&A(c,1):(c=fh(),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Pe(),P(c,1,1,()=>{c=null}),Le())},i(d){f||(A(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 PD(n){let e,t;const i=[n[8]];let s={$$slots:{header:[AD],default:[ED]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=at(s,i[l]);return e=new Xo({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){V(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,o){const r=o[0]&256?pn(i,[si(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[26](null),q(e,l)}}}function LD(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Bt(e,s),o;bt(n,qi,J=>t(12,o=J));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c,d=!1;function h(){f==null||f.expand()}function g(){f==null||f.collapse()}function v(){f==null||f.collapseSiblings()}async function b(){c||d||(t(5,d=!0),t(4,c=(await Ai(()=>import("./CodeEditor.f0bf9689.js"),["CodeEditor.f0bf9689.js","index.afc1faa1.js"],import.meta.url)).default),t(5,d=!1))}b();function y(J){W.copyToClipboard(J),Lg(`Copied ${J} to clipboard`,2e3)}function C(){u.subject=this.value,t(0,u)}const S=()=>y("{APP_NAME}"),$=()=>y("{APP_URL}");function M(){u.actionUrl=this.value,t(0,u)}const D=()=>y("{APP_NAME}"),E=()=>y("{APP_UR
2022-08-16 12:36:15 +08:00
the
`),r=_("strong"),u=F(a),f=F(`
to the
`),c=_("strong"),h=F(d),g=F(`.
`),v=_("br"),b=F(`
There are numerous command line tools that can help you, such as:
`),y=_("a"),y.textContent=`rclone
`,C=F(`,
`),S=_("a"),S.textContent=`s5cmd
`,$=F(", etc."),M=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,N){w(I,e,N),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(c,h),m(l,g),m(l,v),m(l,b),m(l,y),m(l,C),m(l,S),m(l,$),m(e,M),m(e,D),O=!0},p(I,N){var B;(!O||N&1)&&a!==(a=(B=I[0].s3)!=null&&B.enabled?"S3 storage":"local file system")&&ue(u,a),(!O||N&2)&&d!==(d=I[1].s3.enabled?"S3 storage":"local file system")&&ue(h,d)},i(I){O||(I&&Tt(()=>{E||(E=it(e,tn,{duration:150},!0)),E.run(1)}),O=!0)},o(I){I&&(E||(E=it(e,tn,{duration:150},!1)),E.run(0)),O=!1},d(I){I&&k(e),I&&E&&E.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:[XD,({uniqueId:E})=>({21:E}),({uniqueId:E})=>E?2097152:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[QD,({uniqueId:E})=>({21:E}),({uniqueId:E})=>E?2097152:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field required",name:"s3.region",$$slots:{default:[xD,({uniqueId:E})=>({21:E}),({uniqueId:E})=>E?2097152:0]},$$scope:{ctx:n}}}),d=new Re({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[eO,({uniqueId:E})=>({21:E}),({uniqueId:E})=>E?2097152:0]},$$scope:{ctx:n}}}),v=new Re({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[tO,({uniqueId:E})=>({21:E}),({uniqueId:E})=>E?2097152:0]},$$scope:{ctx:n}}}),C=new Re({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[nO,({uniqueId:E})=>({21:E}),({uniqueId:E})=>E?2097152:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),f=T(),c=_("div"),V(d.$$.fragment),h=T(),g=_("div"),V(v.$$.fragment),b=T(),y=_("div"),V(C.$$.fragment),S=T(),$=_("div"),p(t,"class","col-lg-12"),p(l,"class","col-lg-6"),p(a,"class","col-lg-6"),p(c,"class","col-lg-6"),p(g,"class","col-lg-6"),p(y,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid")},m(E,O){w(E,e,O),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),m(e,f),m(e,c),j(d,c,null),m(e,h),m(e,g),j(v,g,null),m(e,b),m(e,y),j(C,y,null),m(e,S),m(e,$),D=!0},p(E,O){const L={};O&6291458&&(L.$$scope={dirty:O,ctx:E}),i.$set(L);const I={};O&6291458&&(I.$$scope={dirty:O,ctx:E}),o.$set(I);const N={};O&6291458&&(N.$$scope={dirty:O,ctx:E}),u.$set(N);const B={};O&6291458&&(B.$$scope={dirty:O,ctx:E}),d.$set(B);const U={};O&6291458&&(U.$$scope={dirty:O,ctx:E}),v.$set(U);const ee={};O&6291458&&(ee.$$scope={dirty:O,ctx:E}),C.$set(ee)},i(E){D||(A(i.$$.fragment,E),A(o.$$.fragment,E),A(u.$$.fragment,E),A(d.$$.fragment,E),A(v.$$.fragment,E),A(C.$$.fragment,E),E&&Tt(()=>{M||(M=it(e,tn,{duration:150},!0)),M.run(1)}),D=!0)},o(E){P(i.$$.fragment,E),P(o.$$.fragment,E),P(u.$$.fragment,E),P(d.$$.fragment,E),P(v.$$.fragment,E),P(C.$$.fragment,E),E&&(M||(M=it(e,tn,{duration:150},!1)),M.run(0)),D=!1},d(E){E&&k(e),q(i),q(o),q(u),q(d),q(v),q(C),E&&M&&M.end()}}}function XD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("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),Te(l,n[1].s3.endpoint),r||(a=G(l,"input",n[10]),r=!0)},p(u,f){f&2097152&&i!==(i=u[21])&&p(e,"for",i),f&2097152&&o!==(o=u[21])&&p(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&Te(l,u[1].s3.endpoint)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function QD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("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),Te(l,n[1].s3.bucket),r||(a=G(l,"input",n[11]),r=!0)},p(u,f){f&2097152&&i!==(i=u[21])&&p(e,"for",i),f&2097152&&o!==(o=u[21])&&p(l,"
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,c=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=G(u,"submit",Yt(n[18])),v=!0)},p($,M){(!g||M&32)&&ue(o,$[5]);let D=d;d=S($),d===D?C[d].p($,M):(Pe(),P(C[D],1,1,()=>{C[D]=null}),Le(),h=C[d],h?h.p($,M):(h=C[d]=y[d]($),h.c()),A(h,1),h.m(u,null))},i($){g||(A(h),g=!0)},o($){P(h),g=!1},d($){$&&k(e),$&&k(r),$&&k(a),C[d].d(),v=!1,b()}}}function sO(n){let e,t,i,s;return e=new Bi({}),i=new On({props:{$$slots:{default:[iO]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&4194367&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&k(t),q(i,l)}}}function lO(n,e,t){let i,s,l;bt(n,Ft,O=>t(5,l=O)),dn(Ft,l="Files storage",l);let o={},r={},a=!1,u=!1;f();async function f(){t(2,a=!0);try{const O=await we.settings.getAll()||{};d(O)}catch(O){we.errorResponseHandler(O)}t(2,a=!1)}async function c(){if(!(u||!s)){t(3,u=!0);try{const O=await we.settings.update(W.filterRedactedProps(r));d(O),hi({}),cn("Successfully saved files storage settings.")}catch(O){we.errorResponseHandler(O)}t(3,u=!1)}}function d(O={}){t(1,r={s3:(O==null?void 0:O.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(O){n.$$.not_equal(r.s3.secret,O)&&(r.s3.secret=O,t(1,r))}function $(){r.s3.forcePathStyle=this.checked,t(1,r)}const M=()=>h(),D=()=>c(),E=()=>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,E]}class oO extends Ee{constructor(e){super(),Oe(this,e,lO,sO,De,{})}}function rO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[16]),p(s,"for",o=n[16])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[8]),r=!0)},p(u,f){f&65536&&t!==(t=u[16])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&65536&&o!==(o=u[16])&&p(s,"for",o)},d(u){u&&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:[aO,({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:[uO,({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:[fO,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),p(t,"class","col-sm-12 m-t-sm"),p(l,"class","col-lg-6"),p(a,"class","col-lg-6"),p(e,"class","grid")},m(d,h){w(d,e,h),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),c=!0},p(d,h){const g={};h&196609&&(g.$$scope={dirty:h,ctx:d}),i.$set(g);const v={};h&1&&(v.class="form-field "+(W.isEmpty(d[0].onlyDomains)?"":"disabled")),h&196609&&(v.$$scope={dirty:h,ctx:d}),o.$set(v);const b={};h&1&&(b.class="form-field "+(W.isEmpty(d[0].exceptDomains)?"":"disabled")),h&196609&&(b.$$scope={dirty:h,ctx:d}),u.$set(b)},i(d){c||(A(i.$$.fragment,d),A(o.$$.fragment,d),A(u.$$.fragment,d),d&&Tt(()=>{f||(f=it(e,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||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function fO(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}),pe.push(()=>Fe(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[16]+".config.onlyDomains"),p(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(wt.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||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function cO(n){let e,t,i,s;e=new Re({props:{class:"form-field form-field-toggle m-b-0",name:"emailAuth.enabled",$$slots:{default:[rO,({uniqueId:o})=>({16:o}),({uniqueId:o})=>o?65536:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&gh(n);return{c(){V(e.$$.fragment),t=T(),l&&l.c(),i=Ke()},m(o,r){j(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&196609&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].enabled?l?(l.p(o,r),r&1&&A(l,1)):(l=gh(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Pe(),P(l,1,1,()=>{l=null}),Le())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){q(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function dO(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 pO(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(wt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=it(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=it(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function hO(n){let e,t,i,s,l,o,r;function a(d,h){return d[0].enabled?pO:dO}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=Ke(),p(e,"class","inline-flex"),p(s,"class","flex-fill")},m(d,h){w(d,e,h),w(d,t,h),f.m(d,h),w(d,i,h),w(d,s,h),w(d,l,h),c&&c.m(d,h),w(d,o,h),r=!0},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(i.parentNode,i))),d[2]?c?h&4&&A(c,1):(c=_h(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(Pe(),P(c,1,1,()=>{c=null}),Le())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&k(e),d&&k(t),f.d(d),d&&k(i),d&&k(s),d&&k(l),c&&c.d(d),d&&k(o)}}}function mO(n){let e,t;const i=[n[3]];let s={$$slots:{header:[hO],default:[cO]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=at(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(){V(e.$$.fragment)},m(l,o){j(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||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[12](null),q(e,l)}}}function gO(n,e,t){let i;const s=["config","expand","collapse","collapseSiblings"];let l=Bt(e,s),o;bt(n,qi,$=>t(7,o=$));let{config:r={}}=e,a;function u(){a==null||a.expand()}function f(){a==null||a.collapse()}function c(){a==null||a.collapseSiblings()}function d(){r.enabled=this.checked,t(0,r)}function h(){r.minPasswordLength=Pt(this.value),t(0,r)}function g($){n.$$.not_equal(r.exceptDomains,$)&&(r.exceptDomains=$,t(0,r))}function v($){n.$$.not_equal(r.onlyDomains,$)&&(r.onlyDomains=$,t(0,r))}function b($){pe[$?"unshift":"push"](()=>{a=$,t(1,a)})}function y($){st.call(this,n,$)}function C($){st.call(this,n,$)}function S($){st.call(this,n,$)}return n.$$set=$=>{e=at(at({},e),ni($)),t(3,l=Bt(e,s)),"config"in $&&t(0,r=$.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!W.isEmpty(o==null?void 0:o.emailAuth))},[r,a,i,l,u,f,c,o,d,h,g,v,b,y,C,S]}class _O extends Ee{constructor(e){super(),Oe(this,e,gO,mO,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 bO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=G(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:[vO,({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:[yO,({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:[kO,({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"),V(l.$$.fragment),o=T(),r=_("div"),V(a.$$.fragment),u=T(),f=_("div"),V(c.$$.fragment),d=T(),v&&v.c(),p(t,"class","col-12 spacing"),p(s,"class","col-lg-6"),p(r,"class","col-lg-6"),p(f,"class","col-lg-12"),p(e,"class","grid")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),j(l,s,null),m(e,o),m(e,r),j(a,r,null),m(e,u),m(e,f),j(c,f,null),m(e,d),v&&v.m(e,null),g=!0},p(b,y){const C={};y&2&&(C.name=b[1]+".clientId"),y&25165825&&(C.$$scope={dirty:y,ctx:b}),l.$set(C);const S={};y&2&&(S.name=b[1]+".clientSecret"),y&25165825&&(S.$$scope={dirty:y,ctx:b}),a.$set(S);const $={};y&2&&($.name=b[1]+".allowRegistrations"),y&25165825&&($.$$scope={dirty:y,ctx:b}),c.$set($),b[4]?v?(v.p(b,y),y&16&&A(v,1)):(v=vh(b),v.c(),A(v,1),v.m(e,null)):v&&(Pe(),P(v,1,1,()=>{v=null}),Le())},i(b){g||(A(l.$$.fragment,b),A(a.$$.fragment,b),A(c.$$.fragment,b),A(v),b&&Tt(()=>{h||(h=it(e,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=it(e,tn,{duration:200},!1)),h.run(0)),g=!1},d(b){b
2022-08-16 12:36:15 +08:00
another PocketBase environment.</p>`,t=T(),i=_("div"),s=_("button"),s.innerHTML='<span class="txt">Copy</span>',l=T(),V(o.$$.fragment),r=T(),a=_("div"),u=_("div"),f=T(),c=_("button"),c.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-secondary fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(v,b){w(v,e,b),w(v,t,b),w(v,i,b),m(i,s),m(i,l),j(o,i,null),n[8](i),w(v,r,b),w(v,a,b),m(a,u),m(a,f),m(a,c),d=!0,h||(g=[G(s,"click",n[7]),G(i,"keydown",n[9]),G(c,"click",n[10])],h=!0)},p(v,b){const y={};b&4&&(y.content=v[2]),o.$set(y)},i(v){d||(A(o.$$.fragment,v),d=!0)},o(v){P(o.$$.fragment,v),d=!1},d(v){v&&k(e),v&&k(t),v&&k(i),q(o),n[8](null),v&&k(r),v&&k(a),h=!1,Ge(g)}}}function WO(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 YO(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[WO,UO],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=F(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)&&ue(o,b[3]);let C=f;f=v(b),f===C?g[f].p(b,y):(Pe(),P(g[C],1,1,()=>{g[C]=null}),Le(),c=g[f],c?c.p(b,y):(c=g[f]=h[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){P(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),g[f].d()}}}function KO(n){let e,t,i,s;return e=new Bi({}),i=new On({props:{$$slots:{default:[YO]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&k(t),q(i,l)}}}function JO(n,e,t){let i,s;bt(n,Ft,b=>t(3,s=b)),dn(Ft,s="Export collections",s);const l="export_"+W.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await we.collections.getFullList(100,{$cancelKey:l}));for(let b of r)delete b.created,delete b.updated}catch(b){we.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){pe[b?"unshift":"push"](()=>{o=b,t(0,o)})}const g=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const y=window.getSelection(),C=document.createRange();C.selectNodeContents(o),y.removeAllRanges(),y.addRange(C)}},v=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,h,g,v]}class ZO extends Ee{constructor(e){super(),Oe(this,e,JO,KO,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 GO(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=F(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),m(e,t),a&&a.m(e,null),m(e,i),m(e,s),m(s,o)},p(u,f){u[9]?r||(r=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+"")&&ue(o,l)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function XO(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=F(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),m(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?vo
2022-08-16 12:36:15 +08:00
<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 E=Ph($,h,D);g[D]?g[D].p(E,M):(g[D]=Fh(E),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 E=Dh($,b,D);y[D]?y[D].p(E,M):(y[D]=Vh(E),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 E=Mh($,C,D);S[D]?S[D].p(E,M):(S[D]=Bh(E),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),Qt(g,$),v&&v.d(),Qt(y,$),Qt(S,$)}}}function qn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function vn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function eE(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 tE extends Ee{constructor(e){super(),Oe(this,e,eE,xO,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 tE({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function nE(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=Ke()},m(o,r){for(let a=0;a<s.length;a+=1)s[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=Uh(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Wh(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(Pe(),a=i.length;a<s.length;a+=1)l(a);Le()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){Qt(s,o),o&&k(e)}}}function iE(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 sE(n){let e,t,i,s,l,o,r;return{c(){e=_("button"),t=F("Close"),i=T(),s=_("button"),l=_("span"),l.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=
2022-08-16 12:36:15 +08:00
- ${$.join(`
- `)}`,()=>{g()}):g()}async function g(){if(!u){t(4,u=!0);try{await we.collections.import(o,a),cn("Successfully imported collections configuration."),i("submit")}catch($){we.errorResponseHandler($)}t(4,u=!1),c()}}const v=()=>h(),b=()=>!u;function y($){pe[$?"unshift":"push"](()=>{s=$,t(1,s)})}function C($){st.call(this,n,$)}function S($){st.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,h,f,l,o,v,b,y,C,S]}class rE extends Ee{constructor(e){super(),Oe(this,e,oE,lE,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 aE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E;a=new Re({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[fE,({uniqueId:U})=>({40:U}),({uniqueId:U})=>[0,U?512:0]]},$$scope:{ctx:n}}});let O=!1,L=n[6]&&n[1].length&&!n[7]&&Gh(),I=n[6]&&n[1].length&&n[7]&&Xh(n),N=n[13].length&&am(n),B=!!n[0]&&um(n);return{c(){e=_("input"),t=T(),i=_("div"),s=_("p"),l=F(`Paste below the collections configuration you want to import or
`),o=_("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=T(),V(a.$$.fragment),u=T(),f=T(),L&&L.c(),c=T(),I&&I.c(),d=T(),N&&N.c(),h=T(),g=_("div"),B&&B.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(U,ee){w(U,e,ee),n[19](e),w(U,t,ee),w(U,i,ee),m(i,s),m(s,l),m(s,o),w(U,r,ee),j(a,U,ee),w(U,u,ee),w(U,f,ee),L&&L.m(U,ee),w(U,c,ee),I&&I.m(U,ee),w(U,d,ee),N&&N.m(U,ee),w(U,h,ee),w(U,g,ee),B&&B.m(g,null),m(g,v),m(g,b),m(g,y),m(g,C),m(C,S),M=!0,D||(E=[G(e,"change",n[20]),G(o,"click",n[21]),G(C,"click",n[26])],D=!0)},p(U,ee){ee[0]&4096&&ie(o,"btn-loading",U[12]);const K={};ee[0]&64&&(K.class="form-field "+(U[6]?"":"field-error")),ee[0]&65|ee[1]&1536&&(K.$$scope={dirty:ee,ctx:U}),a.$set(K),U[6]&&U[1].length&&!U[7]?L||(L=Gh(),L.c(),L.m(c.parentNode,c)):L&&(L.d(1),L=null),U[6]&&U[1].length&&U[7]?I?I.p(U,ee):(I=Xh(U),I.c(),I.m(d.parentNode,d)):I&&(I.d(1),I=null),U[13].length?N?N.p(U,ee):(N=am(U),N.c(),N.m(h.parentNode,h)):N&&(N.d(1),N=null),U[0]?B?B.p(U,ee):(B=um(U),B.c(),B.m(g,v)):B&&(B.d(1),B=null),(!M||ee[0]&16384&&$!==($=!U[14]))&&(C.disabled=$)},i(U){M||(A(a.$$.fragment,U),A(O),M=!0)},o(U){P(a.$$.fragment,U),P(O),M=!1},d(U){U&&k(e),n[19](null),U&&k(t),U&&k(i),U&&k(r),q(a,U),U&&k(u),U&&k(f),L&&L.d(U),U&&k(c),I&&I.d(U),U&&k(d),N&&N.d(U),U&&k(h),U&&k(g),B&&B.d(),D=!1,Ge(E)}}}function uE(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 fE(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&Zh();return{c(){e=_("label"),t=F("Collections"),s=T(),l=_("textarea"),r=T(),c&&c.c(),a=Ke(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,h){w(d,e,h),m(e,t),w(d,s,h),w(d,l,h),Te(l,n[0]),w(d,r,h),c&&c.m(d,h),w(d,a,h),u||(f=G(l,"input",n[22]),u=!0)},p(d,h){h[1]&512&&i!==(i=d[40])&&p(e,"for",i),h[1]&512&&o!==(o=d[40])&&p(l,"id",o),h[0]&1&&Te(l,d[0]),!!d[0]&&!d[6]?c||(c=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=Ke()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=yt(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=F("("),s=F(i),l=F(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&ue(s,i)},d(o){o&&k(e)}}}function 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=F(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+"")&&ue(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=Ke()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=yt(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=F(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+"")&&ue(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=F("("),s=F(i),l=F(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&ue(s,i)},d(o){o&&k(e)}}}function 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=F(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+"")&&ue(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=Ke()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=yt(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=F("("),s=F(i),l=F(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(
2022-08-16 12:36:15 +08:00
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=G(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=G(e,"click",n[25]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function cE(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[uE,aE],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=F(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)&&ue(o,b[15]);let C=f;f=v(b),f===C?g[f].p(b,y):(Pe(),P(g[C],1,1,()=>{g[C]=null}),Le(),c=g[f],c?c.p(b,y):(c=g[f]=h[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){P(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),g[f].d()}}}function dE(n){let e,t,i,s,l,o;e=new Bi({}),i=new On({props:{$$slots:{default:[cE]},$$scope:{ctx:n}}});let r={};return l=new rE({props:r}),n[27](l),l.$on("submit",n[28]),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment),s=T(),V(l.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),w(a,s,u),j(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){q(e,a),a&&k(t),q(i,a),a&&k(s),n[27](null),q(l,a)}}}function pE(n,e,t){let i,s,l,o,r,a,u;bt(n,Ft,J=>t(15,u=J)),dn(Ft,u="Import collections",u);let f,c,d="",h=!1,g=[],v=[],b=!0,y=[],C=!1;S();async function S(){t(5,C=!0);try{t(2,v=await we.collections.getFullList(200));for(let J of v)delete J.created,delete J.updated}catch(J){we.errorResponseHandler(J)}t(5,C=!1)}function $(){if(t(4,y=[]),!!i)for(let J of g){const _e=W.findByKey(v,"id",J.id);!(_e!=null&&_e.id)||!W.hasCollectionChanges(_e,J,b)||y.push({new:J,old:_e})}}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 J of g)delete J.created,delete J.updated,J.schema=W.filterDuplicatesByKey(J.schema)}function D(){var J,_e;for(let be of g){const X=W.findByKey(v,"name",be.name)||W.findByKey(v,"id",be.id);if(!X)continue;const ae=be.id,ve=X.id;be.id=ve;const H=Array.isArray(X.schema)?X.schema:[],me=Array.isArray(be.schema)?be.schema:[];for(const x of me){const Q=W.findByKey(H,"name",x.name);Q&&Q.id&&(x.id=Q.id)}for(let x of g)if(!!Array.isArray(x.schema))for(let Q of x.schema)((J=Q.options)==null?void 0:J.collectionId)&&((_e=Q.options)==null?void 0:_e.collectionId)===ae&&(Q.options.collectionId=ve)}t(0,d=JSON.stringify(g,null,4))}function E(J){t(12,h=!0);const _e=new FileReader;_e.onload=async be=>{t(12,h=!1),t(10,f.value="",f),t(0,d=be.target.result),await ii(),g.length||(go("Invalid collections configuration."),O())},_e.onerror=be=>{console.warn(be),go("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},_e.readAsText(J)}function O(){t(0,d=""),t(10,f.value="",f),hi({})}function L(J){pe[J?"unshift":"push"](()=>{f=J,t(10,f)})}const I=()=>{f.files.length&&E(f.files[0])},N=()=>{f.click()};function B(){d=this.value,t(0,d)}function U(){b=this.checked,t(3,b)}const ee=()=>D(),K=()=>O(),se=()=>c==null?void 0:c.show(v,g,b);function Y(J){pe[J?"unshift":"push"](()=>{c=J,t(11,c)})}const te=()=>O();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(J=>!!J.id&&!!J.name).length),n.$$.dirty[0]&78&&t(9,s=v.filter(J=>i&&b&&!W.findByKey(g,"id
2022-08-16 12:36:15 +08:00
<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)),G(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,Ge(r)}}}function EE(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:mE}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new $E({}),f=new DE({}),{c(){t=T(),i=_("div"),d&&d.c(),s=T(),l=_("div"),V(o.$$.fragment),r=T(),V(a.$$.fragment),u=T(),V(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(g,v){w(g,t,v),w(g,i,v),d&&d.m(i,null),m(i,s),m(i,l),j(o,l,null),m(l,r),j(a,l,null),w(g,u,v),j(f,g,v),c=!0},p(g,[v]){var b;(!c||v&12)&&e!==(e=W.joinNonEmpty([g[3],g[2],"PocketBase"]," - "))&&(document.title=e),((b=g[0])==null?void 0:b.id)&&g[1]?d?(d.p(g,v),v&3&&A(d,1)):(d=dm(g),d.c(),A(d,1),d.m(i,s)):d&&(Pe(),P(d,1,1,()=>{d=null}),Le())},i(g){c||(A(d),A(o.$$.fragment,g),A(a.$$.fragment,g),A(f.$$.fragment,g),c=!0)},o(g){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(),q(o),q(a),g&&k(u),q(f,g)}}}function AE(n,e,t){let i,s,l;bt(n,bo,d=>t(2,i=d)),bt(n,$a,d=>t(0,s=d)),bt(n,Ft,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(Ft,l="",l),hi({}),R_())}function u(){Si("/")}async function f(){var d;if(!!(s!=null&&s.id))try{const h=await we.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(){we.logout()}return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&f()},[s,r,i,l,a,u,c]}class PE extends Ee{constructor(e){super(),Oe(this,e,AE,EE,De,{})}}new PE({target:document.getElementById("app")});export{Ge as A,cn as B,W as C,Si as D,Ke as E,Ng as F,bt as G,Ds as H,on as I,fn as J,Jn as K,pe as L,Qa as M,Ee as S,P as a,T as b,V as c,q as d,_ as e,p as f,w as g,m as h,Oe as i,Ye as j,Pe as k,mn as l,j as m,Le as n,k as o,we as p,Re as q,ie as r,De as s,A as t,G as u,Yt as v,F as w,ue as x,oe as y,Te as z};