pocketbase/ui/dist/assets/index-e5419a23.js

204 lines
891 KiB
JavaScript
Raw Normal View History

2023-03-06 21:30:35 +08:00
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerpolicy&&(l.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?l.credentials="include":s.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function X(){}const kl=n=>n;function Je(n,e){for(const t in e)n[t]=e[t];return n}function Zb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function f_(n){return n()}function ru(){return Object.create(null)}function Pe(n){n.forEach(f_)}function Bt(n){return typeof n=="function"}function he(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Rl;function zn(n,e){return Rl||(Rl=document.createElement("a")),Rl.href=e,n===Rl.href}function Gb(n){return Object.keys(n).length===0}function c_(n,...e){if(n==null)return X;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Ye(n,e,t){n.$$.on_destroy.push(c_(e,t))}function Nt(n,e,t,i){if(n){const s=d_(n,e,t,i);return n[0](s)}}function d_(n,e,t,i){return n[1]&&i?Je(t.ctx.slice(),n[1](i(e))):t.ctx}function Ft(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 Rt(n,e,t,i,s,l){if(s){const o=d_(e,t,i,l);n.p(o,s)}}function qt(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 Qn(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function At(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 Si(n){return n??""}function Kt(n,e,t){return n.set(t),e}function Ie(n){return n&&Bt(n.destroy)?n.destroy:X}const p_=typeof window<"u";let Fo=p_?()=>window.performance.now():()=>Date.now(),da=p_?n=>requestAnimationFrame(n):X;const bs=new Set;function m_(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&da(m_)}function Ro(n){let e;return bs.size===0&&da(m_),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function g(n,e){n.appendChild(e)}function h_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Xb(n){const e=b("style");return Qb(h_(n),e),e.sheet}function Qb(n,e){return g(n.head||n,e),e.sheet}function S(n,e,t){n.insertBefore(e,t||null)}function w(n){n.parentNode&&n.parentNode.removeChild(n)}function ht(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function b(n){return document.createElement(n)}function z(n){return document.createTextNode(n)}function O(){return z(" ")}function Ce(){return z("")}function Y(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function ft(n){return function(e){return e.preventDefault(),n.call(this,e)}}function kn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Xn(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 xb(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function re(n,e){n.value=e??""}function Lr(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function Q(n,e,t){n.classList[t?"add":"remove"](e)}function __(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEven
`;for(let v=0;v<=1;v+=a){const k=e+(t-e)*l(v);u+=v*100+`%{${o(k,1-k)}}
2023-02-22 04:24:49 +08:00
`}const f=u+`100% {${o(t,1-t)}}
2023-03-06 21:30:35 +08:00
}`,c=`__svelte_${e1(f)}_${r}`,d=h_(n),{stylesheet:m,rules:h}=mo.get(d)||t1(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${s}ms 1 both`,ho+=1,c}function ul(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(", "),ho-=s,ho||n1())}function n1(){da(()=>{ho||(mo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),mo.clear())})}function i1(n,e,t,i){if(!e)return X;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return X;const{delay:l=0,duration:o=300,easing:r=kl,start:a=Fo()+l,end:u=a+o,tick:f=X,css:c}=t(n,{from:e,to:s},i);let d=!0,m=!1,h;function _(){c&&(h=al(n,0,1,o,l,r,c)),l||(m=!0)}function v(){c&&ul(n,h),d=!1}return Ro(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),v()),!d)return!1;if(m){const y=k-a,$=0+1*r(y/o);f($,1-$)}return!0}),_(),f(0,1),v}function s1(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,g_(n,s)}}function g_(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 fl;function oi(n){fl=n}function wl(){if(!fl)throw new Error("Function called outside component initialization");return fl}function Zt(n){wl().$$.on_mount.push(n)}function l1(n){wl().$$.after_update.push(n)}function b_(n){wl().$$.on_destroy.push(n)}function Ct(){const n=wl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=__(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Ve(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const _s=[],se=[],oo=[],Nr=[],v_=Promise.resolve();let Fr=!1;function y_(){Fr||(Fr=!0,v_.then(pa))}function sn(){return y_(),v_}function Ge(n){oo.push(n)}function ke(n){Nr.push(n)}const er=new Set;let fs=0;function pa(){if(fs!==0)return;const n=fl;do{try{for(;fs<_s.length;){const e=_s[fs];fs++,oi(e),o1(e.$$)}}catch(e){throw _s.length=0,fs=0,e}for(oi(null),_s.length=0,fs=0;se.length;)se.pop()();for(let e=0;e<oo.length;e+=1){const t=oo[e];er.has(t)||(er.add(t),t())}oo.length=0}while(_s.length);for(;Nr.length;)Nr.pop()();Fr=!1,er.clear(),oi(n)}function o1(n){if(n.fragment!==null){n.update(),Pe(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Ge)}}let qs;function ma(){return qs||(qs=Promise.resolve(),qs.then(()=>{qs=null})),qs}function Ki(n,e,t){n.dispatchEvent(__(`${e?"intro":"outro"}${t}`))}const ro=new Set;let Jn;function ae(){Jn={r:0,c:[],p:Jn}}function ue(){Jn.r||Pe(Jn.c),Jn=Jn.p}function A(n,e){n&&n.i&&(ro.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(ro.has(n))return;ro.add(n),Jn.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ha={duration:0};function k_(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&ul(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=kl,tick:_=X,css:v}=s||ha;v&&(o=al(n,0,1,m,d,h,v,a++)),_(0,1);const k=Fo()+d,y=k+m;r&&r.abort(),l=!0,Ge(()=>Ki(n,!0,"start")),r=Ro($=>{if(l){if($>=y)return _(1,0),Ki(n,!0,"end"),u(),l=!1;if($>=k){const T=h(($-k)/m);_(T,1-T)}}return l})}let c=!1;return{start(){c||(c=!0,ul(n),Bt(s)?(s=s(i),ma().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function w_(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Jn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:c=kl,tick:d=X,css:m}=s||ha;m&&(o=al(n,1,0,f,u,c,m));const h=Fo()+u,_=h+f;Ge(()=>Ki(n,!1,"start")),Ro(v=>{if(l){if(v>=_)return d(0,1),Ki(n,!1,"end"),--r.r||Pe(r.c),!1;if(v>=h){const k=c((v-h)/f);d(1-k,k)}}return l})}return Bt(s)?ma().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=O(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},d(s){s&&w(e),s&&w(t),s&&w(i)}}}function Rv(n){let e,t,i,s=!n[0]&&Vu();const l=n[1].default,o=Nt(l,n,n[2],null);return{c(){e=b("div"),s&&s.c(),t=O(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){S(r,e,a),s&&s.m(e,null),g(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Vu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Rt(o,l,r,r[2],i?Ft(l,r[2],a,null):qt(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&w(e),s&&s.d(),o&&o.d(r)}}}function qv(n){let e,t;return e=new wn({props:{class:"full-page",center:!0,$$slots:{default:[Rv]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(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){j(e,i)}}}function jv(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 Eg extends be{constructor(e){super(),ge(this,e,jv,qv,he,{nobranding:0})}}function Uo(n){const e=n-1;return e*e*e+1}function vo(n,{delay:e=0,duration:t=400,easing:i=kl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function Pn(n,{delay:e=0,duration:t=400,easing:i=Uo,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)=>`
2023-02-22 04:24:49 +08:00
transform: ${u} translate(${(1-c)*s}px, ${(1-c)*l}px);
2023-03-05 22:15:58 +08:00
opacity: ${a-f*d}`}}function St(n,{delay:e=0,duration:t=400,easing:i=Uo}={}){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:m=>`overflow: hidden;opacity: ${Math.min(m*20,1)*l};height: ${m*o}px;padding-top: ${m*r}px;padding-bottom: ${m*a}px;margin-top: ${m*u}px;margin-bottom: ${m*f}px;border-top-width: ${m*c}px;border-bottom-width: ${m*d}px;`}}function It(n,{delay:e=0,duration:t=400,easing:i=Uo,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)=>`
2023-02-22 04:24:49 +08:00
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
2023-03-06 21:30:35 +08:00
`}}function zu(n,e,t){const i=n.slice();return i[11]=e[t],i}const Hv=n=>({}),Bu=n=>({uniqueId:n[3]});function Vv(n){let e=(n[11]||yo)+"",t;return{c(){t=z(e)},m(i,s){S(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||yo)+"")&&le(t,e)},d(i){i&&w(t)}}}function zv(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||yo)+"",i;return{c(){e=b("pre"),i=z(t)},m(o,r){S(o,e,r),g(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)||yo)+"")&&le(i,t)},d(o){o&&w(e)}}}function Uu(n){let e,t,i,s;function l(a,u){return typeof a[11]=="object"?zv:Vv}let o=l(n),r=o(n);return{c(){e=b("div"),r.c(),t=O(),p(e,"class","help-block help-block-error")},m(a,u){S(a,e,u),r.m(e,null),g(e,t),s=!0},p(a,u){o===(o=l(a))&&r?r.p(a,u):(r.d(1),r=o(a),r&&(r.c(),r.m(e,t)))},i(a){s||(a&&Ge(()=>{i||(i=qe(e,St,{duration:150},!0)),i.run(1)}),s=!0)},o(a){a&&(i||(i=qe(e,St,{duration:150},!1)),i.run(0)),s=!1},d(a){a&&w(e),r.d(),a&&i&&i.end()}}}function Bv(n){let e,t,i,s,l;const o=n[8].default,r=Nt(o,n,n[7],Bu);let a=n[2],u=[];for(let c=0;c<a.length;c+=1)u[c]=Uu(zu(n,a,c));const f=c=>P(u[c],1,1,()=>{u[c]=null});return{c(){e=b("div"),r&&r.c(),t=O();for(let c=0;c<u.length;c+=1)u[c].c();p(e,"class",n[0]),Q(e,"error",n[2].length)},m(c,d){S(c,e,d),r&&r.m(e,null),g(e,t);for(let m=0;m<u.length;m+=1)u[m].m(e,null);n[10](e),i=!0,s||(l=Y(e,"click",n[9]),s=!0)},p(c,[d]){if(r&&r.p&&(!i||d&128)&&Rt(r,o,c,c[7],i?Ft(o,c[7],d,Hv):qt(c[7]),Bu),d&4){a=c[2];let m;for(m=0;m<a.length;m+=1){const h=zu(c,a,m);u[m]?(u[m].p(h,d),A(u[m],1)):(u[m]=Uu(h),u[m].c(),A(u[m],1),u[m].m(e,null))}for(ae(),m=a.length;m<u.length;m+=1)f(m);ue()}(!i||d&1)&&p(e,"class",c[0]),(!i||d&5)&&Q(e,"error",c[2].length)},i(c){if(!i){A(r,c);for(let d=0;d<a.length;d+=1)A(u[d]);i=!0}},o(c){P(r,c),u=u.filter(Boolean);for(let d=0;d<u.length;d+=1)P(u[d]);i=!1},d(c){c&&w(e),r&&r.d(c),ht(u,c),n[10](null),s=!1,l()}}}const yo="Invalid value";function Uv(n,e,t){let i;Ye(n,fi,h=>t(6,i=h));let{$$slots:s={},$$scope:l}=e;const o="field_"+V.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){Qi(r)}Zt(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(h){Ve.call(this,n,h)}function m(h){se[h?"unshift":"push"](()=>{u=h,t(1,u)})}return n.$$set=h=>{"name"in h&&t(4,r=h.name),"class"in h&&t(0,a=h.class),"$$scope"in h&&t(7,l=h.$$scope)},n.$$.update=()=>{n.$$.dirty&80&&t(2,f=V.toArray(V.getNestedVal(i,r)))},[a,u,f,o,r,c,i,l,s,d,m]}class pe extends be{constructor(e){super(),ge(this,e,Uv,Bv,he,{name:4,class:0,changed:5})}get changed(){return this.$$.ctx[5]}}function Wv(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Email"),s=O(),l=b("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){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0]),l.focus(),r||(a=Y(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]&&re(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Yv(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=z("Password"),s=O(),l=b("input"),r=O(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){S(c,e,d),g(e,t),S(c,s,d),S(c,l,d),re(l,n[1]),S(c,r,d),S(c,a,d),u||(f=Y(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(l,"id",o),d&2&&l.value!==c[1]&&re(l,c[1])},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function Kv(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Password confirm"),s=O(),l=b("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[2]),r||(a=Y(l,"input",n[7]),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&4&&l.value!==u[2]&&re(l,u[2])},d(u){u&&w(e),u&&w(s),u
<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"),Q(f,"btn-disabled",n[3]),Q(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,_){S(h,e,_),g(e,t),g(e,i),q(s,e,null),g(e,l),q(o,e,null),g(e,r),q(a,e,null),g(e,u),g(e,f),c=!0,d||(m=Y(e,"submit",ft(n[4])),d=!0)},p(h,[_]){const v={};_&1537&&(v.$$scope={dirty:_,ctx:h}),s.$set(v);const k={};_&1538&&(k.$$scope={dirty:_,ctx:h}),o.$set(k);const y={};_&1540&&(y.$$scope={dirty:_,ctx:h}),a.$set(y),(!c||_&8)&&Q(f,"btn-disabled",h[3]),(!c||_&8)&&Q(f,"btn-loading",h[3])},i(h){c||(A(s.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!0)},o(h){P(s.$$.fragment,h),P(o.$$.fragment,h),P(a.$$.fragment,h),c=!1},d(h){h&&w(e),j(s),j(o),j(a),d=!1,m()}}}function Zv(n,e,t){const i=Ct();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await me.admins.create({email:s,password:l,passwordConfirm:o}),await me.admins.authWithPassword(s,l),i("submit")}catch(d){me.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 Gv extends be{constructor(e){super(),ge(this,e,Zv,Jv,he,{})}}function Wu(n){let e,t;return e=new Eg({props:{$$slots:{default:[Xv]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Xv(n){let e,t;return e=new Gv({}),e.$on("submit",n[1]),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p:X,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Qv(n){let e,t,i=n[0]&&Wu(n);return{c(){i&&i.c(),e=Ce()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Wu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(ae(),P(i,1,1,()=>{i=null}),ue())},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function xv(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){me.logout(!1),t(0,i=!0);return}me.authStore.isValid?Di("/collections"):me.logout()}return[i,async()=>{t(0,i=!1),await sn(),window.location.search=""}]}class ey extends be{constructor(e){super(),ge(this,e,xv,Qv,he,{})}}const $t=Fn(""),ko=Fn(""),Cs=Fn(!1);function ty(n){let e,t,i,s;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){S(l,e,o),n[13](e),re(e,n[7]),i||(s=Y(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]&&re(e,l[7])},i:X,o:X,d(l){l&&w(e),n[13](null),i=!1,s()}}}function ny(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=Ht(o,r(n)),se.push(()=>_e(e,"value",l)),e.$on("submit",n[10])),{c(){e&&H(e.$$.fragment),i=Ce()},m(a,u){e&&q(e,a,u),S(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],ke(()=>t=!1)),o!==(o=a[4])){if(e){ae();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ue()}o?(e=Ht(o,r(a)),se.push(()=>_e(e,"value",l)),e.$on("submit",a[10]),H(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function Yu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Ku();return{c(){r&&r.c(),e=O(),t=b("button"),t.innerHTML='<span class="txt">Clear</span>',p(t,"type","button"),p(t,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),S(a,e,u),S(a,t,u),s=!0,l||(o=Y(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&A(r,1):(r=Ku(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(ae(),P(r,1,1,()=>{r=null}),ue())},i(a){s||(A(r),a&&Ge(()=>{i||(i=qe(t,Pn,{duration:150,x:5},!0)),i.run(
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function vy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="url",p(t,"class",V.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:X,d(l){l&&w(e)}}}function yy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="referer",p(t,"class",V.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:X,d(l){l&&w(e)}}}function ky(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="User IP",p(t,"class",V.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:X,d(l){l&&w(e)}}}function wy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="status",p(t,"class",V.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:X,d(l){l&&w(e)}}}function Sy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="created",p(t,"class",V.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:X,d(l){l&&w(e)}}}function Qu(n){let e;function t(l,o){return l[6]?Ty:$y}let i=t(n),s=i(n);return{c(){s.c(),e=Ce()},m(l,o){s.m(l,o),S(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&&w(e)}}}function $y(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&xu(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",s=O(),o&&o.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),g(e,t),g(t,i),g(t,s),o&&o.m(t,null),g(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=xu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function Ty(n){let e;return{c(){e=b("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function xu(n){let e,t,i;return{c(){e=b("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){S(s,e,l),t||(i=Y(e,"click",n[19]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function ef(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function tf(n,e){var Se,We,lt;let t,i,s,l=((Se=e[23].method)==null?void 0:Se.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,m,h,_,v,k,y=(e[23].referer||"N/A")+"",$,T,M,C,D,E=(e[23].userIp||"N/A")+"",I,L,N,F,R,K=e[23].status+"",x,U,G,ne,J,fe,Z,de,ve,Te,Ne=(((We=e[23].meta)==null?void 0:We.errorMessage)||((lt=e[23].meta)==null?void 0:lt.errorData))&&ef();ne=new ui({props:{date:e[23].created}});function Re(){return e[17](e[23])}function ye(...ce){return e[18](e[23],...ce)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),s=b("span"),o=z(l),a=O(),u=b("td"),f=b("span"),d=z(c),h=O(),Ne&&Ne.c(),_=O(),v=b("td"),k=b("span"),$=z(y),M=O(),C=b("td"),D=b("span"),I=z(E),N=O(),F=b("td"),R=b("span"),x=z(K),U=O(),G=b("td"),H(ne.$$.fragment),J=O(),fe=b("td"),fe.innerHTML='<i class="ri-arrow-right-line"></i>',Z=O(),p(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",m=e[23].url),p(u,"class","col-type-text col-field-url"),p(k,"class","txt txt-ellipsis"),p(k,"title",T=e[23].referer),Q(k,"txt-hint",!e[23].referer),p(v,"class","col-type-text col-field-referer"),p(D,"class","txt txt-ellipsis"),p(D,"title",L=e[23].userIp),Q(D,"txt-hint",!e[23].userIp),p(C,"class","col-type-number col-field-userIp"),p(R,"class","label"),Q(R,"label-danger",e[23].status>=400),p(F,"class","col-type-number col-field-status"),p(G,"class","col-type-date col-field-created"),p(fe,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ce,ze){S(ce,t,ze),g(t,i),g(i,s),g(s,o),g(t,a),g(t,u),g(u,f),g(f,d),g(u,h),Ne&&Ne.m(u,null),g(t,_),g(t,v),g(v,k),g(k,$),g(t,M),g(t,C),g(C,D),g(D,I),g(t,N),g(t,F),g(F,R),g(R,x),g(t,U),g(t,G),q(ne,G,null),g(t,J),g(t,fe),g(t,Z),de=!0,ve||(Te=[Y(t,"click",Re),Y(t,"keydown",ye)],ve=!0)},p(ce,ze){var Fe,ot,Vt;e=ce,(!de||ze&8)&&l!==(l=((Fe=e[23].method)==null?void 0:Fe.toUpperCase())+"")&&le(o,l),(!de||ze&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&p(s,"class",r),(!de||ze&8)&&c!==(c=e[23].url+"")&&le(d,c),(!de||ze&8&&m!==(m=e[23].url))&&p(f,"title",m),(ot=e[23].meta)!=null&&ot.errorMessage||(Vt=e[23].meta)!=null&&Vt.errorData?Ne||(Ne=ef(),Ne.c(),Ne.m(u,null)):Ne&&(Ne.d(1),Ne=null),(!de||ze&8)&&y!==(y=(e[23].referer||"N/A")+"")&&le($,y),(!de||ze&8&&T!==(T=e[23].referer))&&p(k,"title",T),(!de||ze&8)&&Q(k,"txt-hint",!e[23].referer),(!de||ze&8)&&E!==(E=(e[23].userIp||"N/A")+"")&&le(I,E),(!de||ze&8&&L!==(L=e[23].userIp))&&p(D,"title",L),(!de||ze&8)&&Q(D,"txt-hint",!e[23].userIp),(!de||ze&8)&&K!==(K=e[23].status+"")&&le(x,K),(!de||ze&8)&&Q(R,"label-danger",e[23].status>=400);const te={};ze&8&&(te.date=e[23].created),ne.$set(te)},i(ce){de||(A(ne.$$.fragment,ce),de=!0)},o(ce){P(ne.$$.fragment,ce),de=!1},d(ce){ce&&w(t),Ne&&Ne.d(),j(ne),ve=!1,Pe(Te)}}}function Cy(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,D,E,I=[],L=new Map,N;function F(ye){n[11](ye)}let R={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[by]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),s=new Wt({props:R}),se.push(()=>_e(s,"sort",F));function K(ye){n[12](ye)}let x={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[vy]},$$scope:{ctx:n}};n[1]!==void 0&&(x.sort=n[1]),r=new Wt({props:x}),se.push(()=>_e(r,"sort",K));function U(ye){n[13](ye)}let G={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[yy]},$$scope:{ctx:n}};n[1]!==void 0&&(G.sort=n[1]),f=new Wt({props:G}),se.push(()=>_e(f,"sort",U));function ne(ye){n[14](ye)}let J={disable:!0,class:"col-type-number col-field-userI
2023-02-22 04:24:49 +08:00
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
2023-03-06 21:30:35 +08:00
*/function ni(){}const Ey=function(){let n=0;return function(){return n++}}();function at(n){return n===null||typeof n>"u"}function _t(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 Ke(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Mt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Cn(n,e){return Mt(n)?n:e}function Qe(n,e){return typeof n>"u"?e:n}const Ay=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Ig=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function yt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function ut(n,e,t,i){let s,l,o;if(_t(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(Ke(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function wo(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 So(n){if(_t(n))return n.map(So);if(Ke(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=So(n[t[s]]);return e}return n}function Pg(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Iy(n,e,t,i){if(!Pg(n))return;const s=e[n],l=t[n];Ke(s)&&Ke(l)?pl(s,l,i):e[n]=So(l)}function pl(n,e,t){const i=_t(e)?e:[e],s=i.length;if(!Ke(n))return n;t=t||{};const l=t.merger||Iy;for(let o=0;o<s;++o){if(e=i[o],!Ke(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 nl(n,e){return pl(n,e,{merger:Py})}function Py(n,e,t){if(!Pg(n))return;const i=e[n],s=t[n];Ke(i)&&Ke(s)?nl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=So(s))}const lf={"":n=>n,x:n=>n.x,y:n=>n.y};function Ti(n,e){return(lf[e]||(lf[e]=Ly(e)))(n)}function Ly(n){const e=Ny(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Ny(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 Ia(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Ln=n=>typeof n<"u",Ci=n=>typeof n=="function",of=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function Fy(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Tt=Math.PI,dt=2*Tt,Ry=dt+Tt,$o=Number.POSITIVE_INFINITY,qy=Tt/180,kt=Tt/2,Bs=Tt/4,rf=Tt*2/3,En=Math.log10,Gn=Math.sign;function af(n){const e=Math.round(n);n=il(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(En(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function jy(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function Ms(n){return!isNaN(parseFloat(n))&&isFinite(n)}function il(n,e,t){return Math.abs(n-e)<t}function Hy(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function Lg(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 Vn(n){return n*(Tt/180)}function Pa(n){return n*(180/Tt)}function uf(n){if(!Mt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function Ng(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*Tt&&(l+=dt),{angle:l,distance:s}}function Xr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Vy(n,e){return(n-e+Ry)%dt-Tt}function bn(n){return(n%dt+dt)%dt}function ml(n,e,t,i){const s=bn(n),l=bn(e),o=bn(t),r=bn(l-s),a=bn(o-s),u=bn(s-l),f=bn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function Yt(n,e,t){return Math.max(e,Math.min(t,n))}function zy(n){return Yt(n,-32768,32767)}function hl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function La(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 Yi=(n,e,t,i)=>La(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),By=(n,e,t)=>La(n,t,i=>n[i][e]>=t);function Uy(n,e,
2023-02-22 04:24:49 +08:00
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
2023-03-06 21:30:35 +08:00
*/function Ol(n){return n+.5|0}const bi=(n,e,t)=>Math.max(Math.min(n,t),e);function Qs(n){return bi(Ol(n*2.55),0,255)}function wi(n){return bi(Ol(n*255),0,255)}function li(n){return bi(Ol(n/2.55)/100,0,1)}function mf(n){return bi(Ol(n*100),0,100)}const Tn={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},Qr=[..."0123456789ABCDEF"],Jy=n=>Qr[n&15],Zy=n=>Qr[(n&240)>>4]+Qr[n&15],Wl=n=>(n&240)>>4===(n&15),Gy=n=>Wl(n.r)&&Wl(n.g)&&Wl(n.b)&&Wl(n.a);function Xy(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Tn[n[1]]*17,g:255&Tn[n[2]]*17,b:255&Tn[n[3]]*17,a:e===5?Tn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Tn[n[1]]<<4|Tn[n[2]],g:Tn[n[3]]<<4|Tn[n[4]],b:Tn[n[5]]<<4|Tn[n[6]],a:e===9?Tn[n[7]]<<4|Tn[n[8]]:255})),t}const Qy=(n,e)=>n<255?e(n):"";function xy(n){var e=Gy(n)?Jy:Zy;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Qy(n.a,e):void 0}const e2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function zg(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 t2(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 n2(n,e,t){const i=zg(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 i2(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 Na(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=i2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Fa(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(wi)}function Ra(n,e,t){return Fa(zg,n,e,t)}function s2(n,e,t){return Fa(n2,n,e,t)}function l2(n,e,t){return Fa(t2,n,e,t)}function Bg(n){return(n%360+360)%360}function o2(n){const e=e2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Qs(+e[5]):wi(+e[5]));const s=Bg(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=s2(s,l,o):e[1]==="hsv"?i=l2(s,l,o):i=Ra(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function r2(n,e){var t=Na(n);t[0]=Bg(t[0]+e),t=Ra(t),n.r=t[0],n.g=t[1],n.b=t[2]}function a2(n){if(!n)return;const e=Na(n),t=e[0],i=mf(e[1]),s=mf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${li(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const hf={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"},_f={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:"
2023-02-22 04:24:49 +08:00
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
2023-03-06 21:30:35 +08:00
*/class ck{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=qg.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 ii=new ck;const Df="transparent",dk={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=bf(n||Df),s=i.valid&&bf(e||Df);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class pk{constructor(e,t,i,s){const l=t[i];s=Jl([e.to,s,l,e.from]);const o=Jl([e.from,l,s]);this._active=!0,this._fn=e.fn||dk[e.type||typeof o],this._easing=sl[e.easing]||sl.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=Jl([e.to,t,s,e.from]),this._from=Jl([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 mk=["x","y","borderWidth","radius","tension"],hk=["color","borderColor","backgroundColor"];xe.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 _k=Object.keys(xe.animation);xe.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});xe.set("animations",{colors:{type:"color",properties:hk},numbers:{type:"number",properties:mk}});xe.describe("animations",{_fallback:"animation"});xe.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 sb{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!Ke(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!Ke(s))return;const l={};for(con
2023-02-22 04:24:49 +08:00
`)>-1?n.split(`
2023-03-06 21:30:35 +08:00
`):n}function IS(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 lc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=vn(e.bodyFont),u=vn(e.titleFont),f=vn(e.footerFont),c=l.length,d=s.length,m=i.length,h=Nn(e.padding);let _=h.height,v=0,k=i.reduce((T,M)=>T+M.before.length+M.lines.length+M.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(_+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;_+=m*T+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(_+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let y=0;const $=function(T){v=Math.max(v,t.measureText(T).width+y)};return t.save(),t.font=u.string,ut(n.title,$),t.font=a.string,ut(n.beforeBody.concat(n.afterBody),$),y=e.displayColors?o+2+e.boxPadding:0,ut(i,T=>{ut(T.before,$),ut(T.lines,$),ut(T.after,$)}),y=0,t.font=f.string,ut(n.footer,$),t.restore(),v+=h.width,{width:v,height:_}}function PS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function LS(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 NS(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"),LS(u,n,e,t)&&(u="center"),u}function oc(n,e,t){const i=t.yAlign||e.yAlign||PS(n,t);return{xAlign:t.xAlign||e.xAlign||NS(n,e,t,i),yAlign:i}}function FS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function RS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function rc(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:m}=ys(o);let h=FS(e,r);const _=RS(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+s:r==="right"&&(h+=Math.max(c,m)+s),{x:Yt(h,0,i.width-e.width),y:Yt(_,0,i.height-e.height)}}function to(n,e,t){const i=Nn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function ac(n){return Kn([],si(n))}function qS(n,e,t){return Oi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function uc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ra 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 sb(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=qS(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=Kn(r,si(s)),r=Kn(r,si(l)),r=Kn(r,si(o)),r}getBeforeBody(e,t){return ac(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return ut(e,l=>{const o={before:[],lines:[],after:[]},r=uc(i,l);Kn(o.before,si(r.beforeLabel.call(this,l))
2023-02-22 04:24:49 +08:00
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
2023-03-06 21:30:35 +08:00
*/const l3={datetime:je.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:je.TIME_WITH_SECONDS,minute:je.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};ub._date.override({_id:"luxon",_create:function(n){return je.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return l3},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=je.fromFormat(n,e,t):n=je.fromISO(n,t):n instanceof Date?n=je.fromJSDate(n,t):i==="object"&&!(n instanceof je)&&(n=je.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 gc(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&Ge(()=>{t||(t=qe(e,It,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=qe(e,It,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function o3(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=z(n[1]),t=O(),s=z(i)},m(l,o){S(l,e,o),S(l,t,o),S(l,s,o)},p(l,o){o&2&&le(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&le(s,i)},d(l){l&&w(e),l&&w(t),l&&w(s)}}}function r3(n){let e;return{c(){e=z("Loading...")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function a3(n){let e,t,i,s,l,o=n[2]&&gc();function r(f,c){return f[2]?r3:o3}let a=r(n),u=a(n);return{c(){e=b("div"),o&&o.c(),t=O(),i=b("canvas"),s=O(),l=b("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),Lr(i,"height","250px"),Lr(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){S(f,e,c),o&&o.m(e,null),g(e,t),g(e,i),n[8](i),S(f,s,c),S(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=gc(),o.c(),A(o,1),o.m(e,t)):o&&(ae(),P(o,1,1,()=>{o=null}),ue()),c&4&&Q(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&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function u3(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),me.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(m=>{c();for(let h of m)r.push({x:new Date(h.date),y:h.total}),t(1,a+=h.total);r.push({x:new Date,y:void 0})}).catch(m=>{m!=null&&m.isAbort||(c(),console.warn(m),me.errorResponseHandler(m,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Zt(()=>(Io.register(Ei,Zo,Ko,xa,Pl,AS,jS),t(6,o=new Io(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:m=>m.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>m.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){se[m?"unshift":"push"](()=>{l=m,t(0,l)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,s=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o
2023-02-22 04:24:49 +08:00
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
2023-03-05 22:15:58 +08:00
*/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 y($){return $ instanceof a?new a($.type,y($.content),$.alias):Array.isArray($)?$.map(y):$.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(y){return Object.prototype.toString.call(y).slice(8,-1)},objId:function(y){return y.__id||Object.defineProperty(y,"__id",{value:++l}),y.__id},clone:function y($,T){T=T||{};var M,C;switch(r.util.type($)){case"Object":if(C=r.util.objId($),T[C])return T[C];M={},T[C]=M;for(var D in $)$.hasOwnProperty(D)&&(M[D]=y($[D],T));return M;case"Array":return C=r.util.objId($),T[C]?T[C]:(M=[],T[C]=M,$.forEach(function(E,I){M[I]=y(E,T)}),M);default:return $}},getLanguage:function(y){for(;y;){var $=s.exec(y.className);if($)return $[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,$){y.className=y.className.replace(RegExp(s,"gi"),""),y.classList.add("language-"+$)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var y=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(y){var $=document.getElementsByTagName("script");for(var T in $)if($[T].src==y)return $[T]}return null}},isActive:function(y,$,T){for(var M="no-"+$;y;){var C=y.classList;if(C.contains($))return!0;if(C.contains(M))return!1;y=y.parentElement}return!!T}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(y,$){var T=r.util.clone(r.languages[y]);for(var M in $)T[M]=$[M];return T},insertBefore:function(y,$,T,M){M=M||r.languages;var C=M[y],D={};for(var E in C)if(C.hasOwnProperty(E)){if(E==$)for(var I in T)T.hasOwnProperty(I)&&(D[I]=T[I]);T.hasOwnProperty(E)||(D[E]=C[E])}var L=M[y];return M[y]=D,r.languages.DFS(r.languages,function(N,F){F===L&&N!=y&&(this[N]=D)}),D},DFS:function y($,T,M,C){C=C||{};var D=r.util.objId;for(var E in $)if($.hasOwnProperty(E)){T.call($,E,$[E],M||E);var I=$[E],L=r.util.type(I);L==="Object"&&!C[D(I)]?(C[D(I)]=!0,y(I,T,null,C)):L==="Array"&&!C[D(I)]&&(C[D(I)]=!0,y(I,T,E,C))}}},plugins:{},highlightAll:function(y,$){r.highlightAllUnder(document,y,$)},highlightAllUnder:function(y,$,T){var M={callback:T,container:y,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 C=0,D;D=M.elements[C++];)r.highlightElement(D,$===!0,M.callback)},highlightElement:function(y,$,T){var M=r.util.getLanguage(y),C=r.languages[M];r.util.setLanguage(y,M);var D=y.parentElement;D&&D.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(D,M);var E=y.textContent,I={element:y,language:M,grammar:C,code:E};function L(F){I.highlightedCode=F,r.hooks.run("before-insert",I),I.element.innerHTML=I.highlightedCode,r.hooks.run("after-highlight",I),r.hooks.run("complete",I),T&&T.call(I.element)}if(r.hooks.run("before-sanity-check",I),D=I.element.parentElement,D&&D.nodeName.toLowerCase()==="pre"&&!D.hasAttribute("tabindex")&&D.setAttribute("tabindex","0"),!I.code){r.hooks.run("complete",I),T&&T.call(I.element);return}if(r.hooks.run("before-highlight",I),!I.grammar){L(r.util.encode(I.code));return}if($&&i.Worker){var N=new Worker(r.filename);N.onmessage=function(F){L(F.data)},N.postMessage(JSON.stringify({language:I.language,code:I.code,immediateClose:!0}))}else L(r.highlight(I.code,I.grammar,I.language))},highlight:function(y,$,T){var M={code:y,grammar:$,language:T};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(y,$){var T=$.rest;if(T){for(var M in T)$[M]=T[M];delete $.rest}var C=new c;return d(C,C.head,y),f(y,C,$,C.head,0),h(C)},hooks:{all:{},add:function
2023-03-06 21:30:35 +08:00
`),v.hasAttribute("data-start")||v.setAttribute("data-start",String(I+1))}k.textContent=C,t.highlightElement(k)},function(C){v.setAttribute(r,f),k.textContent=C})}}),t.plugins.fileHighlight={highlight:function(v){for(var k=(v||document).querySelectorAll(c),y=0,$;$=k[y++];)t.highlightElement($)}};var h=!1;t.fileHighlight=function(){h||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),h=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(c3);const Zs=fa;var vc={},d3={get exports(){return vc},set exports(n){vc=n}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var l={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};t.prototype={setDefaults:function(o){this.defaults=e(this.defaults,o)},normalize:function(o,r){r=e(this.defaults,r);for(var a in r){var u=i(a);a!=="normalize"&&u!=="setDefaults"&&r[a]&&this[u]&&(o=this[u].call(this,o,r[a]))}return o},leftTrim:function(o){return o.replace(/^\s+/,"")},rightTrim:function(o){return o.replace(/\s+$/,"")},tabsToSpaces:function(o,r){return r=r|0||4,o.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(o,r){return r=r|0||4,o.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(o){return o.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(o){return o.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(o){var r=o.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(a,u){return a.length-u.length}),!r[0].length)?o:o.replace(RegExp("^"+r[0],"gm"),"")},indent:function(o,r){return o.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(o,r){r=r===!0?80:r|0||80;for(var a=o.split(`
2023-02-22 04:24:49 +08:00
`),u=0;u<a.length;++u)if(!(s(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),c=0,d=0;d<f.length;++d){var m=s(f[d]);c+=m,c>r&&(f[d]=`
`+f[d],c=m)}a[u]=f.join("")}return a.join(`
2023-03-06 21:30:35 +08:00
`)}},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(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,m="",h="",_=!1,v=0;v<d.length;++v){var k=d[v];k==o.element?_=!0:k.nodeName==="#text"&&(_?h+=k.nodeValue:m+=k.nodeValue,a.removeChild(k),--v)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=m+o.code+h,o.code=r.normalize(o.code,o.settings);else{var y=m+o.element.innerHTML+h;o.element.innerHTML=r.normalize(y,o.settings),o.code=o.element.textContent}}}})})()})(d3);(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 p3(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){S(s,e,l),g(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-10s5tkd")&&p(e,"class",i)},i:X,o:X,d(s){s&&w(e)}}}function m3(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=Zs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Zs.highlight(a,Zs.languages[l]||Zs.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 Zs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class Ob extends be{constructor(e){super(),ge(this,e,m3,p3,he,{class:0,content:2,language:3})}}const h3=n=>({}),yc=n=>({}),_3=n=>({}),kc=n=>({});function wc(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$=n[4]&&!n[2]&&Sc(n);const T=n[19].header,M=Nt(T,n,n[18],kc);let C=n[4]&&n[2]&&$c(n);const D=n[19].default,E=Nt(D,n,n[18],null),I=n[19].footer,L=Nt(I,n,n[18],yc);return{c(){e=b("div"),t=b("div"),s=O(),l=b("div"),o=b("div"),$&&$.c(),r=O(),M&&M.c(),a=O(),C&&C.c(),u=O(),f=b("div"),E&&E.c(),c=O(),d=b("div"),L&&L.c(),p(t,
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&16&&l!==(l=v[4]))&&p(e,"for",l);const y={};k&16&&(y.id=v[4]),k&1&&(y.disabled=!V.isEmpty(v[0].onlyDomains)),!a&&k&1&&(a=!0,y.value=v[0].exceptDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(A(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function w$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[3](v)}let _={id:n[4]+".options.onlyDomains",disabled:!V.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(_.value=n[0].onlyDomains),r=new Fs({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=O(),s=b("i"),o=O(),H(r.$$.fragment),u=O(),f=b("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(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(Be.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(v,k){(!c||k&16&&l!==(l=v[4]+".options.onlyDomains"))&&p(e,"for",l);const y={};k&16&&(y.id=v[4]+".options.onlyDomains"),k&1&&(y.disabled=!V.isEmpty(v[0].exceptDomains)),!a&&k&1&&(a=!0,y.value=v[0].onlyDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(A(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function S$(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[k$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[w$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=O(),l=b("div"),H(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){S(a,e,u),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function $$(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 Pb extends be{constructor(e){super(),ge(this,e,$$,S$,he,{key:1,options:0})}}function T$(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 Pb({props:r}),se.push(()=>_e(e,"key",l)),se.push(()=>_e(e,"options",o)),{c(){H(e.$$.fragment)},m(a,u){q(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],ke(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],ke(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){j(e,a)}}}function C$(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 M$ extends be{constructor(e){super(),ge(this,e,C$,T$,he,{key:0,options:1})}}function D$(n,e,t){let{key:i=""}=e,{options:s={}}=e;return n.$$set=l=>{"key"in l&&t(0,i=l.key),"options"in l&&t(1,s=l.options)},[i,s]}class O$ extends be{constructor(e){super(),ge(this,e,D$,null,he,{key:0,options:1})}}var $r=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ws={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onR
2023-02-22 04:24:49 +08:00
<span class='flatpickr-weekday'>
`+W.join("</span><span class='flatpickr-weekday'>")+`
</span>
2023-03-06 21:30:35 +08:00
`}}function fe(){t.calendarContainer.classList.add("hasWeeks");var B=st("div","flatpickr-weekwrapper");B.appendChild(st("span","flatpickr-weekday",t.l10n.weekAbbreviation));var W=st("div","flatpickr-weeks");return B.appendChild(W),{weekWrapper:B,weekNumbers:W}}function Z(B,W){W===void 0&&(W=!0);var ee=W?B:B-t.currentMonth;ee<0&&t._hidePrevMonthArrow===!0||ee>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ee,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Ze("onYearChange"),R()),F(),Ze("onMonthChange"),Li())}function de(B,W){if(B===void 0&&(B=!0),W===void 0&&(W=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,W===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ee=Dr(t.config),oe=ee.hours,$e=ee.minutes,Oe=ee.seconds;m(oe,$e,Oe)}t.redraw(),B&&Ze("onChange")}function ve(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Ze("onClose")}function Te(){t.config!==void 0&&Ze("onDestroy");for(var B=t._handlers.length;B--;)t._handlers[B].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 W=t.calendarContainer.parentNode;if(W.lastChild&&W.removeChild(W.lastChild),W.parentNode){for(;W.firstChild;)W.parentNode.insertBefore(W.firstChild,W);W.parentNode.removeChild(W)}}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(ee){try{delete t[ee]}catch{}})}function Ne(B){return t.calendarContainer.contains(B)}function Re(B){if(t.isOpen&&!t.config.inline){var W=_n(B),ee=Ne(W),oe=W===t.input||W===t.altInput||t.element.contains(W)||B.path&&B.path.indexOf&&(~B.path.indexOf(t.input)||~B.path.indexOf(t.altInput)),$e=!oe&&!ee&&!Ne(B.relatedTarget),Oe=!t.config.ignoredFocusElements.some(function(Ee){return Ee.contains(W)});$e&&Oe&&(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 ye(B){if(!(!B||t.config.minDate&&B<t.config.minDate.getFullYear()||t.config.maxDate&&B>t.config.maxDate.getFullYear())){var W=B,ee=t.currentYear!==W;t.currentYear=W||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)),ee&&(t.redraw(),Ze("onYearChange"),R())}}function Se(B,W){var ee;W===void 0&&(W=!0);var oe=t.parseDate(B,void 0,W);if(t.config.minDate&&oe&&gn(oe,t.config.minDate,W!==void 0?W:!t.minDateHasTime)<0||t.config.maxDate&&oe&&gn(oe,t.config.maxDate,W!==void 0?W:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)retu
2023-03-05 22:15:58 +08:00
`),r=b("code"),r.textContent="multipart/form-data",a=z(`
requests, the following normalization rules are applied if the `),u=b("code"),u.textContent="json",f=z(` field is a
`),c=b("strong"),c.textContent="plain string",d=z(`:
`),m=b("ul"),h=b("li"),h.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",_=O(),v=b("li"),v.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",k=O(),y=b("li"),y.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",$=O(),T=b("li"),T.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",M=O(),C=b("li"),E=z(D),I=z(" is converted to the json "),L=b("code"),L.textContent='{"a":1,"b":2}',N=O(),F=b("li"),F.textContent="numeric strings are converted to json number",R=O(),K=b("li"),K.textContent="double quoted strings are left as they are (aka. without normalizations)",x=O(),U=b("li"),U.textContent="any other string (empty string too) is double quoted",G=z(`
2023-02-22 04:24:49 +08:00
Alternatively, if you want to avoid the string value normalizations, you can wrap your data inside
2023-03-06 21:30:35 +08:00
an object, eg.`),ne=b("code"),ne.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(Z,de){S(Z,e,de),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o),g(i,r),g(i,a),g(i,u),g(i,f),g(i,c),g(i,d),g(i,m),g(m,h),g(m,_),g(m,v),g(m,k),g(m,y),g(m,$),g(m,T),g(m,M),g(m,C),g(C,E),g(C,I),g(C,L),g(m,N),g(m,F),g(m,R),g(m,K),g(m,x),g(m,U),g(i,G),g(i,ne),fe=!0},i(Z){fe||(Z&&Ge(()=>{J||(J=qe(e,St,{duration:150},!0)),J.run(1)}),fe=!0)},o(Z){Z&&(J||(J=qe(e,St,{duration:150},!1)),J.run(0)),fe=!1},d(Z){Z&&w(e),Z&&J&&J.end()}}}function Q$(n){let e,t,i,s,l,o,r;function a(d,m){return d[0]?X$:G$}let u=a(n),f=u(n),c=n[0]&&Qc();return{c(){e=b("button"),t=b("strong"),t.textContent="String value normalizations",i=O(),f.c(),s=O(),c&&c.c(),l=Ce(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,m){S(d,e,m),g(e,t),g(e,i),f.m(e,null),S(d,s,m),c&&c.m(d,m),S(d,l,m),o||(r=Y(e,"click",n[3]),o=!0)},p(d,[m]){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[0]?c?m&1&&A(c,1):(c=Qc(),c.c(),A(c,1),c.m(l.parentNode,l)):c&&(ae(),P(c,1,1,()=>{c=null}),ue())},i(d){A(c)},o(d){P(c)},d(d){d&&w(e),f.d(),d&&w(s),c&&c.d(d),d&&w(l),o=!1,r()}}}function x$(n,e,t){const i="",s={};let l=!1;return[l,i,s,()=>{t(0,l=!l)}]}class eT extends be{constructor(e){super(),ge(this,e,x$,Q$,he,{key:1,options:2})}get key(){return this.$$.ctx[1]}get options(){return this.$$.ctx[2]}}function tT(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=z(t),s=O(),l=b("small"),r=z(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){S(a,e,u),g(e,i),S(a,s,u),S(a,l,u),g(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&le(i,t),u&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:X,o:X,d(a){a&&w(e),a&&w(s),a&&w(l)}}}function nT(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class xc extends be{constructor(e){super(),ge(this,e,nT,tT,he,{item:0})}}const iT=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeTy
Leave empty for no restriction.`,position:"top"})),y=!0)},p(C,D){(!k||D&4096&&l!==(l=C[12]))&&p(e,"for",l);const E={};D&4096&&(E.id=C[12]),D&4&&(E.items=C[2]),!a&&D&1&&(a=!0,E.keyOfSelected=C[0].mimeTypes,ke(()=>a=!1)),r.$set(E);const I={};D&8193&&(I.$$scope={dirty:D,ctx:C}),v.$set(I)},i(C){k||(A(r.$$.fragment,C),A(v.$$.fragment,C),k=!0)},o(C){P(r.$$.fragment,C),P(v.$$.fragment,C),k=!1},d(C){C&&w(e),C&&w(o),j(r,C),C&&w(u),C&&w(f),j(v),y=!1,$()}}}function aT(n){let e;return{c(){e=b("ul"),e.innerHTML=`<li><strong>WxH</strong>
2023-02-22 04:24:49 +08:00
(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>
2023-03-06 21:30:35 +08:00
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,p(e,"class","m-0")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function uT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M;function C(E){n[10](E)}let D={id:n[12],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(D.value=n[0].thumbs),r=new Fs({props:D}),se.push(()=>_e(r,"value",C)),y=new ei({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[aT]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=O(),s=b("i"),o=O(),H(r.$$.fragment),u=O(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=O(),m=b("button"),h=b("span"),h.textContent="Supported formats",_=O(),v=b("i"),k=O(),H(y.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(v,"class","ri-arrow-drop-down-fill"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,I){S(E,e,I),g(e,t),g(e,i),g(e,s),S(E,o,I),q(r,E,I),S(E,u,I),S(E,f,I),g(f,c),g(f,d),g(f,m),g(m,h),g(m,_),g(m,v),g(m,k),q(y,m,null),$=!0,T||(M=Ie(Be.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"})),T=!0)},p(E,I){(!$||I&4096&&l!==(l=E[12]))&&p(e,"for",l);const L={};I&4096&&(L.id=E[12]),!a&&I&1&&(a=!0,L.value=E[0].thumbs,ke(()=>a=!1)),r.$set(L);const N={};I&8192&&(N.$$scope={dirty:I,ctx:E}),y.$set(N)},i(E){$||(A(r.$$.fragment,E),A(y.$$.fragment,E),$=!0)},o(E){P(r.$$.fragment,E),P(y.$$.fragment,E),$=!1},d(E){E&&w(e),E&&w(o),j(r,E),E&&w(u),E&&w(f),j(y),T=!1,M()}}}function fT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return i=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[sT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[lT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[rT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),d=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[uT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=O(),l=b("div"),H(o.$$.fragment),r=O(),a=b("div"),H(u.$$.fragment),f=O(),c=b("div"),H(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(h,_){S(h,e,_),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),q(u,a,null),g(e,f),g(e,c),q(d,c,null),m=!0},p(h,[_]){const v={};_&2&&(v.name="schema."+h[1]+".options.maxSize"),_&12289&&(v.$$scope={dirty:_,ctx:h}),i.$set(v);const k={};_&2&&(k.name="schema."+h[1]+".options.maxSelect"),_&12289&&(k.$$scope={dirty:_,ctx:h}),o.$set(k);const y={};_&2&&(y.name="schema."+h[1]+".options.mimeTypes"),_&12293&&(y.$$scope={dirty:_,ctx:h}),u.$set(y);const $={};_&2&&($.name="schema."+h[1]+".options.thumbs"),_&12289&&($.$$scope={dirty:_,ctx:h}),d.$set($)},i(h){m||(A(i.$$.fragment,h),A(o.$$.fragment,h),A(u.$$.fragment,h),A(d.$$.fragment,h),m=!0)},o(h){P(i.$$.fragment,h),P(o.$$.fragment,h),P(u.$$.fragment,h),P(d.$$.fragment,h),m=!1},d(h){h&&w(e),j(i),j(o),j(u),j(d)}}}function cT(n,e,t){let{key:i=""}=e,{options:s={}}=e,l=iT.slice();function o(){if(V.isEmpty(s.mimeTypes))return;const _=[];for(const v of s.mimeTypes)l.find(k=>k.mimeType===v)||_.push({mimeType:v});_.length&&t(2,l=l.concat(_))}function r(){s.maxSize=pt(this.value),t(0,s)}function a(){s.maxSelect=pt(this.value),t(0,s)}function u(_){n.$$.not_equal(s.mimeTypes,_)&&(s.mimeTypes=_,t(0,s))}const f=()=>{t(0,s.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},c=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlfo
<span class="txt">New collection</span>`,p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(i,"click",n[10]),s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function mT(n){let e,t,i,s,l,o,r;function a(f){n[11](f)}let u={id:n[23],searchable:n[3].length>5,selectPlaceholder:"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[3],$$slots:{afterOptions:[pT]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=z("Collection"),s=O(),H(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&p(e,"for",i);const d={};c&8388608&&(d.id=f[23]),c&8&&(d.searchable=f[3].length>5),c&8&&(d.items=f[3]),c&16777232&&(d.$$scope={dirty:c,ctx:f}),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].collectionId,ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function hT(n){let e,t,i,s,l,o,r;function a(f){n[12](f)}let u={id:n[23],items:n[6]};return n[2]!==void 0&&(u.keyOfSelected=n[2]),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=z("Relation type"),s=O(),H(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&p(e,"for",i);const d={};c&8388608&&(d.id=f[23]),!o&&c&4&&(o=!0,d.keyOfSelected=f[2],ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function ed(n){let e,t,i,s,l,o;return t=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[_T,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[gT,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),i=O(),s=b("div"),H(l.$$.fragment),p(e,"class","col-sm-6"),p(s,"class","col-sm-6")},m(r,a){S(r,e,a),q(t,e,null),S(r,i,a),S(r,s,a),q(l,s,null),o=!0},p(r,a){const u={};a&2&&(u.name="schema."+r[1]+".options.minSelect"),a&25165825&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="schema."+r[1]+".options.maxSelect"),a&25165825&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(t.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){P(t.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(t),r&&w(i),r&&w(s),j(l)}}}function _T(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Min select"),s=O(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"min","1"),p(l,"placeholder","No min limit")},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].minSelect),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].minSelect&&re(l,u[0].minSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function gT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=z("Max select"),s=O(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"placeholder","No max limit"),p(l,"min",r=n[0].minSelect||2)},m(f,c){S(f,e,c),g(e,t),S(f,s,c),S(f,l,c),re(l,n[0].maxSelect),a||(u=Y(l,"input",n[14]),a=!0)},p(f,c){c&8388608&&i!==(i=f[23])&&p(e,"for",i),c&8388608&&o!==(o=f[23])&&p(l,"id",o),c&1&&r!==(r=f[0].minSelect||2)&&p(l,"min",r),c&1&&pt(l.value)!==f[0].maxSelect&&re(l,f[0].maxSelect)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function bT(n){let e,t,i,s,l,o,r,a,u,f,c;function d(h){n[15](h)}let m={multiple:!0,searchable:!0,id:n[23],selectPlaceholder:"Auto",items:n[5]};return n[0].displayFields!==void 0&&(m.selected=n[0].displayFields),r=new tu({props:m}),se.push(()=>_e(r,"selected",d)),{c(){e=b("label"),t=b("span"),t.textContent="Display fields",i=O(),s=b("i"),o=O(),H(r.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23])},m(h
2023-03-05 22:15:58 +08:00
(aka. not ${V.zeroDefaultStr(n[0])}).`,position:"right"}))],d=!0)},p(h,_){_[1]&4096&&t!==(t=h[43])&&p(e,"id",t),_[0]&1&&(e.checked=h[0].required),_[0]&1&&o!==(o=gs(h[0])+"")&&le(r,o),f&&Bt(f.update)&&_[0]&1&&f.update.call(null,{text:`Requires the field value to be ${gs(h[0])}
2023-03-06 21:30:35 +08:00
(aka. not ${V.zeroDefaultStr(h[0])}).`,position:"right"}),_[1]&4096&&c!==(c=h[43])&&p(s,"for",c)},d(h){h&&w(e),h&&w(i),h&&w(s),d=!1,Pe(m)}}}function nd(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle m-0",name:"unique",$$slots:{default:[RT,({uniqueId:i})=>({43:i}),({uniqueId:i})=>[0,i?4096:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&1|s[1]&12288&&(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){j(e,i)}}}function RT(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=z("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[43]),p(s,"for",o=n[43])},m(u,f){S(u,e,f),e.checked=n[0].unique,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[31]),r=!0)},p(u,f){f[1]&4096&&t!==(t=u[43])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].unique),f[1]&4096&&o!==(o=u[43])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function id(n){let e,t,i,s,l,o,r,a,u,f;a=new ei({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[qT]},$$scope:{ctx:n}}});let c=n[8]&&sd(n);return{c(){e=b("div"),t=b("div"),i=O(),s=b("div"),l=b("button"),o=b("i"),r=O(),H(a.$$.fragment),u=O(),c&&c.c(),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(l,"type","button"),p(l,"aria-label","More"),p(l,"class","btn btn-circle btn-sm btn-transparent"),p(s,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","col-sm-4 txt-right")},m(d,m){S(d,e,m),g(e,t),g(e,i),g(e,s),g(s,l),g(l,o),g(l,r),q(a,l,null),g(s,u),c&&c.m(s,null),f=!0},p(d,m){const h={};m[1]&8192&&(h.$$scope={dirty:m,ctx:d}),a.$set(h),d[8]?c?c.p(d,m):(c=sd(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i(d){f||(A(a.$$.fragment,d),f=!0)},o(d){P(a.$$.fragment,d),f=!1},d(d){d&&w(e),j(a),c&&c.d()}}}function qT(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Remove</span>',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[9]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function sd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Done</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-outline btn-expanded-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",kn(n[3])),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function jT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C;s=new pe({props:{class:"form-field required "+(n[0].id?"readonly":""),name:"schema."+n[1]+".type",$$slots:{default:[ST,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:`
2023-02-22 04:24:49 +08:00
form-field
required
`+(n[5]?"":"invalid")+`
`+(n[0].id&&n[0].system?"disabled":"")+`
2023-03-06 21:30:35 +08:00
`,name:"schema."+n[1]+".name",$$slots:{default:[$T,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}});const D=[NT,LT,PT,IT,AT,ET,OT,DT,MT,CT,TT],E=[];function I(F,R){return F[0].type==="text"?0:F[0].type==="number"?1:F[0].type==="bool"?2:F[0].type==="email"?3:F[0].type==="url"?4:F[0].type==="editor"?5:F[0].type==="date"?6:F[0].type==="select"?7:F[0].type==="json"?8:F[0].type==="file"?9:F[0].type==="relation"?10:-1}~(f=I(n))&&(c=E[f]=D[f](n)),h=new pe({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[FT,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}});let L=n[0].type!=="file"&&nd(n),N=!n[0].toDelete&&id(n);return{c(){e=b("form"),t=b("div"),i=b("div"),H(s.$$.fragment),l=O(),o=b("div"),H(r.$$.fragment),a=O(),u=b("div"),c&&c.c(),d=O(),m=b("div"),H(h.$$.fragment),_=O(),v=b("div"),L&&L.c(),k=O(),N&&N.c(),y=O(),$=b("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(m,"class","col-sm-4 flex"),p(v,"class","col-sm-4 flex"),p(t,"class","grid"),p($,"type","submit"),p($,"class","hidden"),p($,"tabindex","-1"),p(e,"class","field-form")},m(F,R){S(F,e,R),g(e,t),g(t,i),q(s,i,null),g(t,l),g(t,o),q(r,o,null),g(t,a),g(t,u),~f&&E[f].m(u,null),g(t,d),g(t,m),q(h,m,null),g(t,_),g(t,v),L&&L.m(v,null),g(t,k),N&&N.m(t,null),g(e,y),g(e,$),T=!0,M||(C=[Y(e,"dragstart",zT),Y(e,"submit",ft(n[32]))],M=!0)},p(F,R){const K={};R[0]&1&&(K.class="form-field required "+(F[0].id?"readonly":"")),R[0]&2&&(K.name="schema."+F[1]+".type"),R[0]&1|R[1]&12288&&(K.$$scope={dirty:R,ctx:F}),s.$set(K);const x={};R[0]&33&&(x.class=`
2023-02-22 04:24:49 +08:00
form-field
required
`+(F[5]?"":"invalid")+`
`+(F[0].id&&F[0].system?"disabled":"")+`
2023-03-06 21:30:35 +08:00
`),R[0]&2&&(x.name="schema."+F[1]+".name"),R[0]&33|R[1]&12288&&(x.$$scope={dirty:R,ctx:F}),r.$set(x);let U=f;f=I(F),f===U?~f&&E[f].p(F,R):(c&&(ae(),P(E[U],1,1,()=>{E[U]=null}),ue()),~f?(c=E[f],c?c.p(F,R):(c=E[f]=D[f](F),c.c()),A(c,1),c.m(u,null)):c=null);const G={};R[0]&1|R[1]&12288&&(G.$$scope={dirty:R,ctx:F}),h.$set(G),F[0].type!=="file"?L?(L.p(F,R),R[0]&1&&A(L,1)):(L=nd(F),L.c(),A(L,1),L.m(v,null)):L&&(ae(),P(L,1,1,()=>{L=null}),ue()),F[0].toDelete?N&&(ae(),P(N,1,1,()=>{N=null}),ue()):N?(N.p(F,R),R[0]&1&&A(N,1)):(N=id(F),N.c(),A(N,1),N.m(t,null))},i(F){T||(A(s.$$.fragment,F),A(r.$$.fragment,F),A(c),A(h.$$.fragment,F),A(L),A(N),T=!0)},o(F){P(s.$$.fragment,F),P(r.$$.fragment,F),P(c),P(h.$$.fragment,F),P(L),P(N),T=!1},d(F){F&&w(e),j(s),j(r),~f&&E[f].d(),j(h),L&&L.d(),N&&N.d(),M=!1,Pe(C)}}}function ld(n){let e,t,i,s,l=n[0].system&&od(),o=!n[0].id&&rd(n),r=n[0].required&&ad(n),a=n[0].unique&&ud();return{c(){e=b("div"),l&&l.c(),t=O(),o&&o.c(),i=O(),r&&r.c(),s=O(),a&&a.c(),p(e,"class","inline-flex")},m(u,f){S(u,e,f),l&&l.m(e,null),g(e,t),o&&o.m(e,null),g(e,i),r&&r.m(e,null),g(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=od(),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=rd(u),o.c(),o.m(e,i)),u[0].required?r?r.p(u,f):(r=ad(u),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=ud(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function od(n){let e;return{c(){e=b("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function rd(n){let e;return{c(){e=b("span"),e.textContent="New",p(e,"class","label"),Q(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){S(t,e,i)},p(t,i){i[0]&257&&Q(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&w(e)}}}function ad(n){let e,t=gs(n[0])+"",i;return{c(){e=b("span"),i=z(t),p(e,"class","label label-success")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l[0]&1&&t!==(t=gs(s[0])+"")&&le(i,t)},d(s){s&&w(e)}}}function ud(n){let e;return{c(){e=b("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function fd(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function cd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,l){S(s,e,l),t||(i=Y(e,"click",kn(n[16])),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function HT(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,m,h,_,v,k=!n[0].toDelete&&ld(n),y=n[7]&&!n[0].system&&fd(),$=n[0].toDelete&&cd(n);return{c(){e=b("div"),t=b("span"),i=b("i"),l=O(),o=b("strong"),a=z(r),f=O(),k&&k.c(),c=O(),d=b("div"),m=O(),y&&y.c(),h=O(),$&&$.c(),_=Ce(),p(i,"class",s=Si(V.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),Q(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m(T,M){S(T,e,M),g(e,t),g(t,i),g(e,l),g(e,o),g(o,a),S(T,f,M),k&&k.m(T,M),S(T,c,M),S(T,d,M),S(T,m,M),y&&y.m(T,M),S(T,h,M),$&&$.m(T,M),S(T,_,M),v=!0},p(T,M){(!v||M[0]&1&&s!==(s=Si(V.getFieldTypeIcon(T[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!v||M[0]&1)&&r!==(r=(T[0].name||"-")+"")&&le(a,r),(!v||M[0]&1&&u!==(u=T[0].name))&&p(o,"title",u),(!v||M[0]&1)&&Q(o,"txt-strikethrough",T[0].toDelete),T[0].toDelete?k&&(k.d(1),k=null):k?k.p(T,M):(k=ld(T),k.c(),k.m(c.parentNode,c)),T[7]&&!T[0].system?y?M[0]&129&&A(y,1):(y=fd(),y.c(),A(y,1),y.m(h.parentNode,h)):y&&(ae(),P(y,1,1,()=>{y=null}),ue()),T[0].toDelete?$?$.p(T,M):($=cd(T),$.c(),$.m(_.parentNode,_)):$&&($.d(1),$=null)},i(T){v||(A(y),v=!0)},o(T){P(y),v=!1},d(T){T&&w(e),T&&w(f),k&&k.d(T),T&&w(c),T&&w(d),T&&w(m),y&&y.d(T),T&&w(h),$&&$.d(T),T&&w(_)}}}function V
2023-03-05 22:15:58 +08:00
`),t=b("code"),t.textContent="username",i=z(` ,
`),s=b("code"),s.textContent="email",l=z(` ,
`),o=b("code"),o.textContent="emailVisibility",r=z(` ,
2023-03-06 21:30:35 +08:00
`),a=b("code"),a.textContent="verified",p(t,"class","txt-sm"),p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),S(u,s,f),S(u,l,f),S(u,o,f),S(u,r,f),S(u,a,f)},d(u){u&&w(e),u&&w(t),u&&w(i),u&&w(s),u&&w(l),u&&w(o),u&&w(r),u&&w(a)}}}function md(n,e){let t,i,s,l;function o(c){e[6](c,e[13],e[14],e[15])}function r(){return e[7](e[15])}function a(...c){return e[8](e[15],...c)}function u(...c){return e[9](e[15],...c)}let f={key:e[15],excludeNames:e[1].concat(e[4](e[13]))};return e[13]!==void 0&&(f.field=e[13]),i=new UT({props:f}),se.push(()=>_e(i,"field",o)),i.$on("remove",r),i.$on("dragstart",a),i.$on("drop",u),{key:n,first:null,c(){t=Ce(),H(i.$$.fragment),this.first=t},m(c,d){S(c,t,d),q(i,c,d),l=!0},p(c,d){e=c;const m={};d&1&&(m.key=e[15]),d&3&&(m.excludeNames=e[1].concat(e[4](e[13]))),!s&&d&1&&(s=!0,m.field=e[13],ke(()=>s=!1)),i.$set(m)},i(c){l||(A(i.$$.fragment,c),l=!0)},o(c){P(i.$$.fragment,c),l=!1},d(c){c&&w(t),j(i,c)}}}function WT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=[],h=new Map,_,v,k,y,$,T,M,C,D,E,I,L=n[0].isAuth&&pd(),N=n[0].schema;const F=R=>R[13];for(let R=0;R<N.length;R+=1){let K=dd(n,N,R),x=F(K);h.set(x,m[R]=md(x,K))}return{c(){e=b("div"),t=b("p"),i=z(`System fields:
2023-03-05 22:15:58 +08:00
`),s=b("code"),s.textContent="id",l=z(` ,
`),o=b("code"),o.textContent="created",r=z(` ,
`),a=b("code"),a.textContent="updated",u=O(),L&&L.c(),f=z(`
2023-03-06 21:30:35 +08:00
.`),c=O(),d=b("div");for(let R=0;R<m.length;R+=1)m[R].c();_=O(),v=b("div"),k=O(),y=b("button"),$=b("i"),T=O(),M=b("span"),M.textContent="New field",p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm"),p(t,"class","txt-sm"),p(e,"class","block m-b-25"),p(d,"class","accordions"),p(v,"class","clearfix m-t-xs"),p($,"class","ri-add-line"),p(M,"class","txt"),p(y,"type","button"),p(y,"class",C="btn btn-block "+(n[0].schema.length?"btn-transparent":"btn-secondary"))},m(R,K){S(R,e,K),g(e,t),g(t,i),g(t,s),g(t,l),g(t,o),g(t,r),g(t,a),g(t,u),L&&L.m(t,null),g(t,f),S(R,c,K),S(R,d,K);for(let x=0;x<m.length;x+=1)m[x].m(d,null);S(R,_,K),S(R,v,K),S(R,k,K),S(R,y,K),g(y,$),g(y,T),g(y,M),D=!0,E||(I=Y(y,"click",n[3]),E=!0)},p(R,[K]){R[0].isAuth?L||(L=pd(),L.c(),L.m(t,f)):L&&(L.d(1),L=null),K&55&&(N=R[0].schema,ae(),m=wt(m,K,F,1,R,N,h,d,ln,md,null,dd),ue()),(!D||K&1&&C!==(C="btn btn-block "+(R[0].schema.length?"btn-transparent":"btn-secondary")))&&p(y,"class",C)},i(R){if(!D){for(let K=0;K<N.length;K+=1)A(m[K]);D=!0}},o(R){for(let K=0;K<m.length;K+=1)P(m[K]);D=!1},d(R){R&&w(e),L&&L.d(),R&&w(c),R&&w(d);for(let K=0;K<m.length;K+=1)m[K].d();R&&w(_),R&&w(v),R&&w(k),R&&w(y),E=!1,I()}}}function YT(n,e){n&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.dropEffect="move",n.dataTransfer.setData("text/plain",e))}function KT(n,e,t){let{collection:i=new pn}=e;const s=["id","created","updated","collectionId","collectionName","expand","true","false","null"];let l=[];function o(v){i.schema[v]&&(i.schema.splice(v,1),t(0,i))}function r(){const v=new mn({name:a()});v.onMountExpand=!0,i.schema.push(v),t(0,i)}function a(v="field"){let k="";for(;u(v+k);)++k;return v+k}function u(v){return!!i.schema.find(k=>k.name===v)}function f(v){let k=[];if(v.toDelete)return k;for(let y of i.schema)y===v||y.toDelete||k.push(y.name);return k}function c(v,k){if(!v)return;v.dataTransfer.dropEffect="move";const y=parseInt(v.dataTransfer.getData("text/plain")),$=i.schema;y<k?($.splice(k+1,0,$[y]),$.splice(y,1)):($.splice(k,0,$[y]),$.splice(y+1,1)),t(0,i.schema=$,i)}function d(v,k,y,$){y[$]=v,t(0,i)}const m=v=>o(v),h=(v,k)=>YT(k==null?void 0:k.detail,v),_=(v,k)=>c(k==null?void 0:k.detail,v);return n.$$set=v=>{"collection"in v&&t(0,i=v.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof i.schema>"u"&&(t(0,i=i||new pn),t(0,i.schema=[],i)),n.$$.dirty&1&&(i.isAuth?t(1,l=s.concat(["username","email","emailVisibility","verified","tokenKey","passwordHash","lastResetSentAt","lastVerificationSentAt","password","passwordConfirm","oldPassword"])):t(1,l=s.slice(0)))},[i,l,o,r,f,c,d,m,h,_]}class JT extends be{constructor(e){super(),ge(this,e,KT,WT,he,{collection:0})}}const ZT=n=>({isAdminOnly:n&256}),hd=n=>({isAdminOnly:n[8]});function GT(n){let e,t;return e=new pe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[8]?"disabled":""),name:n[3],$$slots:{default:[eC,({uniqueId:i})=>({17:i}),({uniqueId:i})=>i?131072:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&272&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[8]?"disabled":"")),s&8&&(l.name=i[3]),s&147815&&(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){j(e,i)}}}function XT(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function QT(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-lock-line"></i>
<span class="txt">Set Admins only</span>`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-5uq9tk")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[10]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function xT(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-lock-unlock-line"></i>
<span class="txt">Enable custom rule</span>`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-success lock-toggle svelte-5uq9tk")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[9]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function eC(n){let e,t,i,s,l,o=n[8]?"Admins only":"Custom rule",r,a,u,f,c,d,m,h,_;function v(E,I){return E[8]?xT:QT}let k=v(n),y=k(n);function $(E){n[13](E)}var T=n[6];function M(E){let I={id:E[17],baseCollection:E[1],disabled:E[8],placeholder:E[8]?"":"Leave empty to grant everyone access..."};return E[0]!==void 0&&(I.value=E[0]),{props:I}}T&&(c=Ht(T,M(n)),n[12](c),se.push(()=>_e(c,"value",$)));const C=n[11].default,D=Nt(C,n,n[14],hd);return{c(){e=b("label"),t=b("span"),i=z(n[2]),s=O(),l=b("span"),r=z(o),a=O(),y.c(),f=O(),c&&H(c.$$.fragment),m=O(),h=b("div"),D&&D.c(),p(t,"class","txt"),Q(t,"txt-hint",n[8]),p(l,"class","label label-sm svelte-5uq9tk"),p(e,"for",u=n[17]),p(e,"class","svelte-5uq9tk"),p(h,"class","help-block")},m(E,I){S(E,e,I),g(e,t),g(t,i),g(e,s),g(e,l),g(l,r),g(e,a),y.m(e,null),S(E,f,I),c&&q(c,E,I),S(E,m,I),S(E,h,I),D&&D.m(h,null),_=!0},p(E,I){(!_||I&4)&&le(i,E[2]),(!_||I&256)&&Q(t,"txt-hint",E[8]),(!_||I&256)&&o!==(o=E[8]?"Admins only":"Custom rule")&&le(r,o),k===(k=v(E))&&y?y.p(E,I):(y.d(1),y=k(E),y&&(y.c(),y.m(e,null))),(!_||I&131072&&u!==(u=E[17]))&&p(e,"for",u);const L={};if(I&131072&&(L.id=E[17]),I&2&&(L.baseCollection=E[1]),I&256&&(L.disabled=E[8]),I&256&&(L.placeholder=E[8]?"":"Leave empty to grant everyone access..."),!d&&I&1&&(d=!0,L.value=E[0],ke(()=>d=!1)),T!==(T=E[6])){if(c){ae();const N=c;P(N.$$.fragment,1,0,()=>{j(N,1)}),ue()}T?(c=Ht(T,M(E)),E[12](c),se.push(()=>_e(c,"value",$)),H(c.$$.fragment),A(c.$$.fragment,1),q(c,m.parentNode,m)):c=null}else T&&c.$set(L);D&&D.p&&(!_||I&16640)&&Rt(D,C,E,E[14],_?Ft(C,E[14],I,ZT):qt(E[14]),hd)},i(E){_||(c&&A(c.$$.fragment,E),A(D,E),_=!0)},o(E){c&&P(c.$$.fragment,E),P(D,E),_=!1},d(E){E&&w(e),y.d(),E&&w(f),n[12](null),c&&j(c,E),E&&w(m),E&&w(h),D&&D.d(E)}}}function tC(n){let e,t,i,s;const l=[XT,GT],o=[];function r(a,u){return a[7]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Ce()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),P(o[f],1,1,()=>{o[f]=null}),ue(),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&&w(i)}}}let _d;function nC(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,c=null,d=null,m=_d,h=!1;_();async function _(){m||h||(t(7,h=!0),t(6,m=(await rt(()=>import("./FilterAutocompleteInput-dd018caa.js"),["./FilterAutocompleteInput-dd018caa.js","./index-a6ccb683.js"],import.meta.url)).default),_d=m,t(7,h=!1))}async function v(){t(0,r=d||""),await sn(),c==null||c.focus()}async function k(){d=r,t(0,r=null)}function y(T){se[T?"unshift":"push"](()=>{c=T,t(5,c)})}function $(T){r=T,t(0,r)}return n.$$set=T=>{"collection"in T&&t(1,o=T.collection),"rule"in T&&t(0,r=T.rule),"label"in T&&t(2,a=T.label),"formKey"in T&&t(3,u=T.formKey),"required"in T&&t(4,f=T.required),"$$scope"in T&&t(14,l=T.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(8,i=r===null)},[r,o,a,u,f,c,m,h,i,v,k,s,y,$,l]}class $s extends be{constructor(e){super(),ge(this,e,nC,tC,he,{collection:1,rule:0,label:2,formKey:3,required:4})}}function gd(n,e,t){const i=n.slice();return i[10]=e[t],i}function bd(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,D,E,I=n[2],L=[];for(let N=0;N<I.length;N+=1)L[N]=vd(gd(n,I,N));return{c(){e=b("div"),t=b("div"),i=b("div"),s=b("p"),s.textContent="The following record fields are available:",l=O(),o=b("div");for(let N=0;N<L.length;N+=1)L[N].c();r=O(),a=b("hr"),u=O(),f=b("p"),f.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",c=O(),d=b("div"),d.innerHTML=`<code>@request.headers.*</code>
2023-02-22 04:24:49 +08:00
<code>@request.query.*</code>
<code>@request.data.*</code>
2023-03-05 22:15:58 +08:00
<code>@request.auth.*</code>`,m=O(),h=b("hr"),_=O(),v=b("p"),v.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",k=O(),y=b("div"),y.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",$=O(),T=b("hr"),M=O(),C=b("p"),C.innerHTML=`Example rule:
2023-02-22 04:24:49 +08:00
<br/>
2023-03-06 21:30:35 +08:00
<code>@request.auth.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(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(v,"class","m-b-0"),p(y,"class","inline-flex flex-gap-5"),p(T,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(N,F){S(N,e,F),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o);for(let R=0;R<L.length;R+=1)L[R].m(o,null);g(i,r),g(i,a),g(i,u),g(i,f),g(i,c),g(i,d),g(i,m),g(i,h),g(i,_),g(i,v),g(i,k),g(i,y),g(i,$),g(i,T),g(i,M),g(i,C),E=!0},p(N,F){if(F&4){I=N[2];let R;for(R=0;R<I.length;R+=1){const K=gd(N,I,R);L[R]?L[R].p(K,F):(L[R]=vd(K),L[R].c(),L[R].m(o,null))}for(;R<L.length;R+=1)L[R].d(1);L.length=I.length}},i(N){E||(N&&Ge(()=>{D||(D=qe(e,St,{duration:150},!0)),D.run(1)}),E=!0)},o(N){N&&(D||(D=qe(e,St,{duration:150},!1)),D.run(0)),E=!1},d(N){N&&w(e),ht(L,N),N&&D&&D.end()}}}function vd(n){let e,t=n[10]+"",i;return{c(){e=b("code"),i=z(t)},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&4&&t!==(t=s[10]+"")&&le(i,t)},d(s){s&&w(e)}}}function yd(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;function v(C){n[6](C)}let k={label:"Create rule",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(k.rule=n[0].createRule),i=new $s({props:k}),se.push(()=>_e(i,"rule",v));function y(C){n[7](C)}let $={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&($.rule=n[0].updateRule),a=new $s({props:$}),se.push(()=>_e(a,"rule",y));function T(C){n[8](C)}let M={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(M.rule=n[0].deleteRule),m=new $s({props:M}),se.push(()=>_e(m,"rule",T)),{c(){e=b("hr"),t=O(),H(i.$$.fragment),l=O(),o=b("hr"),r=O(),H(a.$$.fragment),f=O(),c=b("hr"),d=O(),H(m.$$.fragment)},m(C,D){S(C,e,D),S(C,t,D),q(i,C,D),S(C,l,D),S(C,o,D),S(C,r,D),q(a,C,D),S(C,f,D),S(C,c,D),S(C,d,D),q(m,C,D),_=!0},p(C,D){const E={};D&1&&(E.collection=C[0]),!s&&D&1&&(s=!0,E.rule=C[0].createRule,ke(()=>s=!1)),i.$set(E);const I={};D&1&&(I.collection=C[0]),!u&&D&1&&(u=!0,I.rule=C[0].updateRule,ke(()=>u=!1)),a.$set(I);const L={};D&1&&(L.collection=C[0]),!h&&D&1&&(h=!0,L.rule=C[0].deleteRule,ke(()=>h=!1)),m.$set(L)},i(C){_||(A(i.$$.fragment,C),A(a.$$.fragment,C),A(m.$$.fragment,C),_=!0)},o(C){P(i.$$.fragment,C),P(a.$$.fragment,C),P(m.$$.fragment,C),_=!1},d(C){C&&w(e),C&&w(t),j(i,C),C&&w(l),C&&w(o),C&&w(r),j(a,C),C&&w(f),C&&w(c),C&&w(d),j(m,C)}}}function kd(n){let e,t,i,s,l;function o(a){n[9](a)}let r={label:"Manage rule",formKey:"options.manageRule",collection:n[0],$$slots:{default:[iC]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(r.rule=n[0].options.manageRule),i=new $s({props:r}),se.push(()=>_e(i,"rule",o)),{c(){e=b("hr"),t=O(),H(i.$$.fragment)},m(a,u){S(a,e,u),S(a,t,u),q(i,a,u),l=!0},p(a,u){const f={};u&1&&(f.collection=a[0]),u&8192&&(f.$$scope={dirty:u,ctx:a}),!s&&u&1&&(s=!0,f.rule=a[0].options.manageRule,ke(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(e),a&&w(t),j(i,a)}}}function iC(n){let e,t,i;return{c(){e=b("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg.
2023-02-22 04:24:49 +08:00
changing the password without requiring to enter the old one, directly updating the verified
2023-03-06 21:30:35 +08:00
state or email, etc.`,t=O(),i=b("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},p:X,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function sC(n){var K,x;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,D=n[1]&&bd(n);function E(U){n[4](U)}let I={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(I.rule=n[0].listRule),f=new $s({props:I}),se.push(()=>_e(f,"rule",E));function L(U){n[5](U)}let N={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(N.rule=n[0].viewRule),_=new $s({props:N}),se.push(()=>_e(_,"rule",L));let F=!((K=n[0])!=null&&K.isView)&&yd(n),R=((x=n[0])==null?void 0:x.isAuth)&&kd(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the
2023-02-22 04:24:49 +08:00
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
2023-03-06 21:30:35 +08:00
</a>.`,s=O(),l=b("button"),r=z(o),a=O(),D&&D.c(),u=O(),H(f.$$.fragment),d=O(),m=b("hr"),h=O(),H(_.$$.fragment),k=O(),F&&F.c(),y=O(),R&&R.c(),$=Ce(),p(l,"type","button"),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-base handle"),Q(e,"fade",!n[1])},m(U,G){S(U,e,G),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),D&&D.m(e,null),S(U,u,G),q(f,U,G),S(U,d,G),S(U,m,G),S(U,h,G),q(_,U,G),S(U,k,G),F&&F.m(U,G),S(U,y,G),R&&R.m(U,G),S(U,$,G),T=!0,M||(C=Y(l,"click",n[3]),M=!0)},p(U,[G]){var fe,Z;(!T||G&2)&&o!==(o=U[1]?"Hide available fields":"Show available fields")&&le(r,o),U[1]?D?(D.p(U,G),G&2&&A(D,1)):(D=bd(U),D.c(),A(D,1),D.m(e,null)):D&&(ae(),P(D,1,1,()=>{D=null}),ue()),(!T||G&2)&&Q(e,"fade",!U[1]);const ne={};G&1&&(ne.collection=U[0]),!c&&G&1&&(c=!0,ne.rule=U[0].listRule,ke(()=>c=!1)),f.$set(ne);const J={};G&1&&(J.collection=U[0]),!v&&G&1&&(v=!0,J.rule=U[0].viewRule,ke(()=>v=!1)),_.$set(J),(fe=U[0])!=null&&fe.isView?F&&(ae(),P(F,1,1,()=>{F=null}),ue()):F?(F.p(U,G),G&1&&A(F,1)):(F=yd(U),F.c(),A(F,1),F.m(y.parentNode,y)),(Z=U[0])!=null&&Z.isAuth?R?(R.p(U,G),G&1&&A(R,1)):(R=kd(U),R.c(),A(R,1),R.m($.parentNode,$)):R&&(ae(),P(R,1,1,()=>{R=null}),ue())},i(U){T||(A(D),A(f.$$.fragment,U),A(_.$$.fragment,U),A(F),A(R),T=!0)},o(U){P(D),P(f.$$.fragment,U),P(_.$$.fragment,U),P(F),P(R),T=!1},d(U){U&&w(e),D&&D.d(),U&&w(u),j(f,U),U&&w(d),U&&w(m),U&&w(h),j(_,U),U&&w(k),F&&F.d(U),U&&w(y),R&&R.d(U),U&&w($),M=!1,C()}}}function lC(n,e,t){let i,{collection:s=new pn}=e,l=!1;const o=()=>t(1,l=!l);function r(m){n.$$.not_equal(s.listRule,m)&&(s.listRule=m,t(0,s))}function a(m){n.$$.not_equal(s.viewRule,m)&&(s.viewRule=m,t(0,s))}function u(m){n.$$.not_equal(s.createRule,m)&&(s.createRule=m,t(0,s))}function f(m){n.$$.not_equal(s.updateRule,m)&&(s.updateRule=m,t(0,s))}function c(m){n.$$.not_equal(s.deleteRule,m)&&(s.deleteRule=m,t(0,s))}function d(m){n.$$.not_equal(s.options.manageRule,m)&&(s.options.manageRule=m,t(0,s))}return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=V.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class oC extends be{constructor(e){super(),ge(this,e,lC,sC,he,{collection:0})}}function wd(n,e,t){const i=n.slice();return i[9]=e[t],i}function rC(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Ht(o,r(n)),se.push(()=>_e(e,"value",l)),e.$on("change",n[6])),{c(){e&&H(e.$$.fragment),i=Ce()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ke(()=>t=!1)),o!==(o=a[1])){if(e){ae();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ue()}o?(e=Ht(o,r(a)),se.push(()=>_e(e,"value",l)),e.$on("change",a[6]),H(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function aC(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function Sd(n){let e,t,i=n[3],s=[];for(let l=0;l<i.length;l+=1)s[l]=$d(wd(n,i,l));return{c(){e=b("div"),t=b("div");for(let l=0;l<s.length;l+=1)s[l].c();p(t,"class","content"),p(e,"class","help-block help-block-error")},m(l,o){S(l,e,o),g(e,t);for(let r=0;r<s.length;r+=1)s[r].m(t,null)},p(l,o){if(o&8){i=l[3];let r;for(r=0;r<i.length;r+=1){const a=wd(l,i,r);s[r]?s[r].p(a,o):(s[r]=$d(a),s[r].c(),s[r].m(t,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=i.length}},d(l){l&&w(e),ht(s,l)}}}function $d(n){let e,t=n[9]+"",i;return{c(){e=b("p"),i=z(t)},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&le(i,t)},d(s){s&&w(e)}}}function uC(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[aC,rC],m=[];function h(v,k){return v[2]?0:1}l=h(n),o=m[l]=d[l](n);let _=n[3].length&&Sd(n);return{c(){e=b("label"),t=b("span"),t.textContent="Select query",s=O(),o.c(),r=O(),
2023-02-22 04:24:49 +08:00
<li>The query must have a unique <code>id</code> column.
<br/>
If your query doesn&#39;t have a suitable one, you can use the universal
2023-03-06 21:30:35 +08:00
<code>(ROW_NUMBER() OVER()) as id</code>.</li></ul>`,u=O(),_&&_.c(),f=Ce(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(v,k){S(v,e,k),g(e,t),S(v,s,k),m[l].m(v,k),S(v,r,k),S(v,a,k),S(v,u,k),_&&_.m(v,k),S(v,f,k),c=!0},p(v,k){(!c||k&256&&i!==(i=v[8]))&&p(e,"for",i);let y=l;l=h(v),l===y?m[l].p(v,k):(ae(),P(m[y],1,1,()=>{m[y]=null}),ue(),o=m[l],o?o.p(v,k):(o=m[l]=d[l](v),o.c()),A(o,1),o.m(r.parentNode,r)),v[3].length?_?_.p(v,k):(_=Sd(v),_.c(),_.m(f.parentNode,f)):_&&(_.d(1),_=null)},i(v){c||(A(o),c=!0)},o(v){P(o),c=!1},d(v){v&&w(e),v&&w(s),m[l].d(v),v&&w(r),v&&w(a),v&&w(u),_&&_.d(v),v&&w(f)}}}function fC(n){let e,t;return e=new pe({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[uC,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(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){j(e,i)}}}function cC(n,e,t){let i;Ye(n,fi,c=>t(4,i=c));let{collection:s=new pn}=e,l,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=V.getNestedVal(c,"schema",null);if(V.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=V.extractColumnsFromQuery((h=s==null?void 0:s.options)==null?void 0:h.query);V.removeByValue(m,"id"),V.removeByValue(m,"created"),V.removeByValue(m,"updated");for(let _ in d)for(let v in d[_]){const k=d[_][v].message,y=m[_]||_;r.push(V.sentenize(y+": "+k))}}Zt(async()=>{t(2,o=!0);try{t(1,l=(await rt(()=>import("./CodeEditor-dca4f6f5.js"),["./CodeEditor-dca4f6f5.js","./index-a6ccb683.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(s.options.query,c)&&(s.options.query=c,t(0,s))}const f=()=>{r.length&&Qi("schema")};return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class dC extends be{constructor(e){super(),ge(this,e,cC,fC,he,{collection:0})}}function pC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=z("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowUsernameAuth,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[5]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function mC(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[pC,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&12289&&(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){j(e,i)}}}function hC(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function _C(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Td(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function gC(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowUsernameAuth?_C:hC}let u=a(n),f=u(n),c=n[3]&&Td();return{c(){e=b("div"),e.innerHTML=`<i class="ri-user-star-line"></i>
<span class="txt">Username/Password</span>`,t=O(),i=b("div"),s=O(),f.c(),l=O(),c&&c.c(),o=Ce(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[3]?c?m&8&&A(c,1):(c=Td(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(ae(),P(c,1,1,()=>{c=null}),ue())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function bC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=z("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowEmailAuth,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Cd(n){let e,t,i,s,l,o,r,a;return i=new pe({props:{class:"form-field "+(V.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[vC,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+(V.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[yC,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=O(),l=b("div"),H(o.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(u,f){S(u,e,f),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(V.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(V.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(A(i.$$.fragment,u),A(o.$$.fragment,u),u&&Ge(()=>{r||(r=qe(e,St,{duration:150},!0)),r.run(1)}),a=!0)},o(u){P(i.$$.fragment,u),P(o.$$.fragment,u),u&&(r||(r=qe(e,St,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),j(i),j(o),u&&r&&r.end()}}}function vC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[7](v)}let _={id:n[12],disabled:!V.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(_.value=n[0].options.exceptEmailDomains),r=new Fs({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=O(),s=b("i"),o=O(),H(r.$$.fragment),u=O(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(Be.call(null,s,{text:`Email domains that are NOT allowed to sign up.
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&4096&&l!==(l=v[12]))&&p(e,"for",l);const y={};k&4096&&(y.id=v[12]),k&1&&(y.disabled=!V.isEmpty(v[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,y.value=v[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(A(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function yC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[8](v)}let _={id:n[12],disabled:!V.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(_.value=n[0].options.onlyEmailDomains),r=new Fs({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=O(),s=b("i"),o=O(),H(r.$$.fragment),u=O(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(Be.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(v,k){(!c||k&4096&&l!==(l=v[12]))&&p(e,"for",l);const y={};k&4096&&(y.id=v[12]),k&1&&(y.disabled=!V.isEmpty(v[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,y.value=v[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(A(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function kC(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[bC,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Cd(n);return{c(){H(e.$$.fragment),t=O(),l&&l.c(),i=Ce()},m(o,r){q(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=Cd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),P(l,1,1,()=>{l=null}),ue())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function wC(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function SC(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Md(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function $C(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowEmailAuth?SC:wC}let u=a(n),f=u(n),c=n[2]&&Md();return{c(){e=b("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
<span class="txt">Email/Password</span>`,t=O(),i=b("div"),s=O(),f.c(),l=O(),c&&c.c(),o=Ce(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[2]?c?m&4&&A(c,1):(c=Md(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(ae(),P(c,1,1,()=>{c=null}),ue())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function TC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=z("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowOAuth2Auth,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Dd(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='<div class="flex p-t-base"><a href="/_/#/settings/auth-providers" target="_blank" class="btn btn-sm btn-outline"><span class="txt">Manage OAuth2 providers</span></a></div>',p(e,"class","block")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&Ge(()=>{t||(t=qe(e,St,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=qe(e,St,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function CC(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[TC,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Dd();return{c(){H(e.$$.fragment),t=O(),l&&l.c(),i=Ce()},m(o,r){q(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=Dd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),P(l,1,1,()=>{l=null}),ue())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function MC(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function DC(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Od(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function OC(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowOAuth2Auth?DC:MC}let u=a(n),f=u(n),c=n[1]&&Od();return{c(){e=b("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
<span class="txt">OAuth2</span>`,t=O(),i=b("div"),s=O(),f.c(),l=O(),c&&c.c(),o=Ce(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[1]?c?m&2&&A(c,1):(c=Od(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(ae(),P(c,1,1,()=>{c=null}),ue())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function EC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Minimum password length"),s=O(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),l.required=!0,p(l,"min","6"),p(l,"max","72")},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].options.minPasswordLength),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].options.minPasswordLength&&re(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function AC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=O(),s=b("label"),l=b("span"),l.textContent="Always require email",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(s,"for",a=n[12])},m(c,d){S(c,e,d),e.checked=n[0].options.requireEmail,S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=[Y(e,"change",n[11]),Ie(Be.call(null,r,{text:`The constraint is applied only for new records.
Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(c,d){d&4096&&t!==(t=c[12])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function IC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k;return s=new ks({props:{single:!0,$$slots:{header:[gC],default:[mC]},$$scope:{ctx:n}}}),o=new ks({props:{single:!0,$$slots:{header:[$C],default:[kC]},$$scope:{ctx:n}}}),a=new ks({props:{single:!0,$$slots:{header:[OC],default:[CC]},$$scope:{ctx:n}}}),h=new pe({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[EC,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),v=new pe({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[AC,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=O(),i=b("div"),H(s.$$.fragment),l=O(),H(o.$$.fragment),r=O(),H(a.$$.fragment),u=O(),f=b("hr"),c=O(),d=b("h4"),d.textContent="General",m=O(),H(h.$$.fragment),_=O(),H(v.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(y,$){S(y,e,$),S(y,t,$),S(y,i,$),q(s,i,null),g(i,l),q(o,i,null),g(i,r),q(a,i,null),S(y,u,$),S(y,f,$),S(y,c,$),S(y,d,$),S(y,m,$),q(h,y,$),S(y,_,$),q(v,y,$),k=!0},p(y,[$]){const T={};$&8201&&(T.$$scope={dirty:$,ctx:y}),s.$set(T);const M={};$&8197&&(M.$$scope={dirty:$,ctx:y}),o.$set(M);const C={};$&8195&&(C.$$scope={dirty:$,ctx:y}),a.$set(C);const D={};$&12289&&(D.$$scope={dirty:$,ctx:y}),h.$set(D);const E={};$&12289&&(E.$$scope={dirty:$,ctx:y}),v.$set(E)},i(y){k||(A(s.$$.fragment,y),A(o.$$.fragment,y),A(a.$$.fragment,y),A(h.$$.fragment,y),A(v.$$.fragment,y),k=!0)},o(y){P(s.$$.fragment,y),P(o.$$.fragment,y),P(a.$$.fragment,y),P(h.$$.fragment,y),P(v.$$.fragment,y),k=!1},d(y){y&&w(e),y&&w(t),y&&w(i),j(s),j(o),j(a),y&&w(u),y&&w(f),y&&w(c),y&&w(d),y&&w(m),j(h,y),y&&w(_),j(v,y)}}}function PC(n,e,t){let i,s,l,o;Ye(n,fi,_=>t(4,o=_));let{collection:r=new pn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(_){n.$$.not_equal(r.options.exceptEmailDomains,_)&&(r.options.exceptEmailDomains=_,t(0,r))}function c(_){n.$$.not_equal(r.options.onlyEmailDomains,_)&&(r.options.onlyEmailDomains=_,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=pt(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=_=>{"collection"in _&&t(0,r=_.collection)},n.$$.update=()=>{var _,v,k,y;n.$$.dirty&1&&r.isAuth&&V.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!V.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.allowEmailAuth)||!V.isEmpty((v=o==null?void 0:o.options)==null?void 0:v.onlyEmailDomains)||!V.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!V.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,m,h]}class LC extends be{constructor(e){super(),ge(this,e,PC,IC,he,{collection:0})}}function Ed(n,e,t){const i=n.slice();return i[15]=e[t],i}function Ad(n,e,t){const i=n.slice();return i[15]=e[t],i}function Id(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Pd(n){var r;let e,t,i,s,l=n[2]&&Ld(n),o=!((r=n[1])!=null&&r.isView)&&Nd(n);return{c(){e=b("h6"),e.textContent="Changes:",t=O(),i=b("ul"),l&&l.c(),s=O(),o&&o.c(),p(i,"class","changes-list svelte-1ghly2p")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),l&&l.m(i,null),g(i,s),o&&o.m(i,null)},p(a,u){var f;a[2]?l?l.p(a,u):(l=Ld(a),l.c(),l.m(i,s)):l&&(l.d(1),l=null),(f=a[1])!=null&&f.isView?o&&(o.d(1),o=null):o?o.p(a,u):(o=Nd(a),o.c(),o.m(i,null))},d(a){a&&w(e),a&&w(t),a&&w(i),l&&l.d
`),s=b("strong"),o=z(l),r=O(),a=b("i"),u=O(),f=b("strong"),d=z(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(m,h){S(m,e,h),g(e,t),g(t,i),g(t,s),g(s,o),g(t,r),g(t,a),g(t,u),g(t,f),g(f,d)},p(m,h){h&2&&l!==(l=m[1].originalName+"")&&le(o,l),h&2&&c!==(c=m[1].name+"")&&le(d,c)},d(m){m&&w(e)}}}function Nd(n){let e,t,i=n[5],s=[];for(let r=0;r<i.length;r+=1)s[r]=Fd(Ad(n,i,r));let l=n[4],o=[];for(let r=0;r<l.length;r+=1)o[r]=Rd(Ed(n,l,r));return{c(){for(let r=0;r<s.length;r+=1)s[r].c();e=O();for(let r=0;r<o.length;r+=1)o[r].c();t=Ce()},m(r,a){for(let u=0;u<s.length;u+=1)s[u].m(r,a);S(r,e,a);for(let u=0;u<o.length;u+=1)o[u].m(r,a);S(r,t,a)},p(r,a){if(a&32){i=r[5];let u;for(u=0;u<i.length;u+=1){const f=Ad(r,i,u);s[u]?s[u].p(f,a):(s[u]=Fd(f),s[u].c(),s[u].m(e.parentNode,e))}for(;u<s.length;u+=1)s[u].d(1);s.length=i.length}if(a&16){l=r[4];let u;for(u=0;u<l.length;u+=1){const f=Ed(r,l,u);o[u]?o[u].p(f,a):(o[u]=Rd(f),o[u].c(),o[u].m(t.parentNode,t))}for(;u<o.length;u+=1)o[u].d(1);o.length=l.length}},d(r){ht(s,r),r&&w(e),ht(o,r),r&&w(t)}}}function Fd(n){let e,t,i,s,l=n[15].originalName+"",o,r,a,u,f,c=n[15].name+"",d;return{c(){e=b("li"),t=b("div"),i=z(`Renamed field
`),s=b("strong"),o=z(l),r=O(),a=b("i"),u=O(),f=b("strong"),d=z(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(m,h){S(m,e,h),g(e,t),g(t,i),g(t,s),g(s,o),g(t,r),g(t,a),g(t,u),g(t,f),g(f,d)},p(m,h){h&32&&l!==(l=m[15].originalName+"")&&le(o,l),h&32&&c!==(c=m[15].name+"")&&le(d,c)},d(m){m&&w(e)}}}function Rd(n){let e,t,i,s=n[15].name+"",l,o;return{c(){e=b("li"),t=z("Removed field "),i=b("span"),l=z(s),o=O(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(r,a){S(r,e,a),g(e,t),g(e,i),g(i,l),g(e,o)},p(r,a){a&16&&s!==(s=r[15].name+"")&&le(l,s)},d(r){r&&w(e)}}}function NC(n){let e,t,i,s,l,o,r,a,u=n[4].length&&Id(),f=n[6]&&Pd(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=O(),s=b("div"),l=b("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query,
you'll have to update it manually!`,o=O(),u&&u.c(),r=O(),f&&f.c(),a=Ce(),p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),g(s,l),g(s,o),u&&u.m(s,null),S(c,r,d),f&&f.m(c,d),S(c,a,d)},p(c,d){c[4].length?u||(u=Id(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[6]?f?f.p(c,d):(f=Pd(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&w(e),u&&u.d(),c&&w(r),f&&f.d(c),c&&w(a)}}}function FC(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function RC(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=O(),i=b("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),e.focus(),s||(l=[Y(e,"click",n[9]),Y(i,"click",n[10])],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function qC(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[RC],header:[FC],default:[NC]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&1048694&&(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),j(e,s)}}}function jC(n,e,t){let i,s,l,o;const r=Ct();let a,u;async function f(y){t(1,u=y),await sn(),!i&&!s.length&&!l.length?d():a==null||a.show()}function c(){a==null||a.hide()}function d(){c(),r("confirm")}const m=()=>c(),h=()=>d();function _(y){se[y?"unshift":"push"](()=>{a=y,t(3,a)})}function v(y){Ve.call(this,n,y)}function k(y){Ve.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(2,i=(u==null?void 0:u.originalName)!=(u==null?void 0:u.name)),n.$$.dirty&2&&t(5,s=(u==null?void 0:u.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(4,l=(u==null?void 0:u.schema.filter(y=>y.id&&y.toDelete))||[]),n.$$.dirty&6&&t(6,o=i||!(u!=null&&u.isView))},[c,u,i,a,l,s,o,d,f,m,h,_,v,k]}class HC extends be{constructor(e){super(),ge(this,e,jC,qC,he,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function qd(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function VC(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new JT({props:l}),se.push(()=>_e(e,"collection",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function zC(n){let e,t,i;function s(o){n[31](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new dC({props:l}),se.push(()=>_e(e,"collection",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function jd(n){let e,t,i,s;function l(r){n[33](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new oC({props:o}),se.push(()=>_e(t,"collection",l)),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){S(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>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&&w(e),j(t)}}}function Hd(n){let e,t,i,s;function l(r){n[34](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new LC({props:o}),se.push(()=>_e(t,"collection",l)),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===Es)},m(r,a){S(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&Q(e,"active",r[3]===Es)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function BC(n){let e,t,i,s,l,o,r;const a=[zC,VC],u=[];function f(m,h){return m[2].isView?0:1}i=f(n),s=u[i]=a[i](n);let c=n[3]===vl&&jd(
2023-03-05 22:15:58 +08:00
<span class="txt">Duplicate</span>`,t=O(),i=b("button"),i.innerHTML=`<i class="ri-delete-bin-7-line"></i>
2023-03-06 21:30:35 +08:00
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger closable")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[Y(e,"click",n[23]),Y(i,"click",kn(ft(n[24])))],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function zd(n){let e,t,i,s;return i=new ei({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[WC]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=O(),H(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&1048576&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),j(i,l)}}}function Bd(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,c;function d(){return n[26](n[47])}return{c(){e=b("button"),t=b("i"),s=O(),l=b("span"),r=z(o),a=z(" collection"),u=O(),p(t,"class",i=Si(V.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),Q(e,"selected",n[47]==n[2].type)},m(m,h){S(m,e,h),g(e,t),g(e,s),g(e,l),g(l,r),g(l,a),g(e,u),f||(c=Y(e,"click",d),f=!0)},p(m,h){n=m,h[0]&64&&i!==(i=Si(V.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&p(t,"class",i),h[0]&64&&o!==(o=n[48]+"")&&le(r,o),h[0]&68&&Q(e,"selected",n[47]==n[2].type)},d(m){m&&w(e),f=!1,c()}}}function WC(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=Bd(qd(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Ce()},m(s,l){for(let o=0;o<i.length;o+=1)i[o].m(s,l);S(s,e,l)},p(s,l){if(l[0]&131140){t=Object.entries(s[6]);let o;for(o=0;o<t.length;o+=1){const r=qd(s,t,o);i[o]?i[o].p(r,l):(i[o]=Bd(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){ht(i,s),s&&w(e)}}}function Ud(n){let e;return{c(){e=b("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function YC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k=(n[6][n[2].type]||"N/A")+"",y,$,T,M,C,D,E,I,L,N=n[2].isNew&&zd(n),F=n[2].system&&Ud();return{c(){e=b("label"),t=z("Name"),s=O(),l=b("input"),f=O(),c=b("div"),d=b("button"),m=b("span"),h=O(),_=b("span"),v=z("Type: "),y=z(k),$=O(),N&&N.c(),C=O(),F&&F.c(),D=Ce(),p(e,"for",i=n[46]),p(l,"type","text"),p(l,"id",o=n[46]),l.required=!0,l.disabled=n[13],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",a=n[2].isAuth?'eg. "users"':'eg. "posts"'),l.value=u=n[2].name,p(_,"class","txt"),p(d,"type","button"),p(d,"class",T="btn btn-sm p-r-10 p-l-10 "+(n[2].isNew?"btn-outline":"btn-transparent")),d.disabled=M=!n[2].isNew,p(c,"class","form-field-addon")},m(R,K){S(R,e,K),g(e,t),S(R,s,K),S(R,l,K),S(R,f,K),S(R,c,K),g(c,d),g(d,m),g(d,h),g(d,_),g(_,v),g(_,y),g(d,$),N&&N.m(d,null),S(R,C,K),F&&F.m(R,K),S(R,D,K),E=!0,n[2].isNew&&l.focus(),I||(L=Y(l,"input",n[25]),I=!0)},p(R,K){(!E||K[1]&32768&&i!==(i=R[46]))&&p(e,"for",i),(!E||K[1]&32768&&o!==(o=R[46]))&&p(l,"id",o),(!E||K[0]&8192)&&(l.disabled=R[13]),(!E||K[0]&4&&r!==(r=R[2].isNew))&&(l.autofocus=r),(!E||K[0]&4&&a!==(a=R[2].isAuth?'eg. "users"':'eg. "posts"'))&&p(l,"placeholder",a),(!E||K[0]&4&&u!==(u=R[2].name)&&l.value!==u)&&(l.value=u),(!E||K[0]&68)&&k!==(k=(R[6][R[2].type]||"N/A")+"")&&le(y,k),R[2].isNew?N?(N.p(R,K),K[0]&4&&A(N,1)):(N=zd(R),N.c(),A(N,1),N.m(d,null)):N&&(ae(),P(N,1,1,()=>{N=null}),ue()),(!E||K[0]&4&&T!==(T="btn btn-sm p-r-10 p-l-10 "+(R[2].isNew?"btn-outline":"btn-transparent")))&&p(d,"class",T),(!E||K[0]&4&&M!==(M=!R[2].isNew))&&(d.disabled=M),R[2].system?F||(F=Ud(),F.c(),F.m(D.parentNode,D)):F&&(F.d(1),F=null)},i(R){E||(A(N),E=!0)},o(R){P(N),E=!1},d(R){R&&w(e),R&&w(s),R&&w(l),R&&w(f),R&&w(c),N&&N.d(),R&&w(C),F&&F.d(R),R&&w(D),I=!1,L()}}}function Wd(n){let e,t,i,s,l,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){S(r,e,a),s=!0,l||(o=Ie(t=Be.call(null,e,n[11])),l=!0)},p(r,a){t&&Bt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&Ge(()=>{i||(i=qe(e,It,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=qe(e,It,{duration:
<span class="txt">New collection</span>`,p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){S(l,e,o),g(e,t),i||(s=Y(t,"click",n[12]),i=!0)},p:X,d(l){l&&w(e),i=!1,s()}}}function QC(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],m=new Map,h,_,v,k,y,$,T=n[3];const M=I=>I[15].id;for(let I=0;I<T.length;I+=1){let L=Xd(n,T,I),N=M(L);m.set(N,d[I]=ep(N,L))}let C=null;T.length||(C=Qd(n));let D=!n[7]&&tp(n),E={};return v=new iu({props:E}),n[13](v),v.$on("save",n[14]),{c(){e=b("aside"),t=b("header"),i=b("div"),s=b("div"),l=b("button"),l.innerHTML='<i class="ri-close-line"></i>',o=O(),r=b("input"),a=O(),u=b("hr"),f=O(),c=b("div");for(let I=0;I<d.length;I+=1)d[I].c();C&&C.c(),h=O(),D&&D.c(),_=O(),H(v.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),Q(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"),Q(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),Q(c,"fade",n[6]),Q(c,"sidebar-content-compact",n[3].length>20),p(e,"class","page-sidebar collection-sidebar")},m(I,L){S(I,e,L),g(e,t),g(t,i),g(i,s),g(s,l),g(i,o),g(i,r),re(r,n[0]),g(e,a),g(e,u),g(e,f),g(e,c);for(let N=0;N<d.length;N+=1)d[N].m(c,null);C&&C.m(c,null),g(e,h),D&&D.m(e,null),S(I,_,L),q(v,I,L),k=!0,y||($=[Y(l,"click",n[10]),Y(r,"input",n[11])],y=!0)},p(I,[L]){(!k||L&16)&&Q(l,"hidden",!I[4]),L&1&&r.value!==I[0]&&re(r,I[0]),(!k||L&16)&&Q(i,"active",I[4]),L&42&&(T=I[3],d=wt(d,L,M,1,I,T,m,c,es,ep,null,Xd),!T.length&&C?C.p(I,L):T.length?C&&(C.d(1),C=null):(C=Qd(I),C.c(),C.m(c,null))),(!k||L&64)&&Q(c,"fade",I[6]),(!k||L&8)&&Q(c,"sidebar-content-compact",I[3].length>20),I[7]?D&&(D.d(1),D=null):D?D.p(I,L):(D=tp(I),D.c(),D.m(e,null));const N={};v.$set(N)},i(I){k||(A(v.$$.fragment,I),k=!0)},o(I){P(v.$$.fragment,I),k=!1},d(I){I&&w(e);for(let L=0;L<d.length;L+=1)d[L].d();C&&C.d(),D&&D.d(),I&&w(_),n[13](null),j(v,I),y=!1,Pe($)}}}function xC(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function e4(n,e,t){let i,s,l,o,r,a,u;Ye(n,Mi,y=>t(5,o=y)),Ye(n,Ai,y=>t(9,r=y)),Ye(n,Lo,y=>t(6,a=y)),Ye(n,Cs,y=>t(7,u=y));let f,c="";function d(y){Kt(Mi,o=y,o)}const m=()=>t(0,c="");function h(){c=this.value,t(0,c)}const _=()=>f==null?void 0:f.show();function v(y){se[y?"unshift":"push"](()=>{f=y,t(2,f)})}const k=y=>{var $;($=y.detail)!=null&&$.isNew&&y.detail.collection&&d(y.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&xC(),n.$$.dirty&1&&t(1,i=c.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=c!==""),n.$$.dirty&515&&t(3,l=r.filter(y=>y.id==c||y.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[c,i,f,l,s,o,a,u,d,r,m,h,_,v,k]}class t4 extends be{constructor(e){super(),ge(this,e,e4,QC,he,{})}}function np(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function ip(n){n[18]=n[19].default}function sp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function lp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function op(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&lp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=Ce(),c&&c.c(),s=O(),l=b("button"),r=z(o),a=O(),p(l,"type","button"),p(l,"class","sidebar-item"),Q(l,"active",e[5]===e[14]),this.first=t},m(m,h){S(m,t,h),c&&c.m(m,h),S(m,s,h),S(m,l,h),g(l,r),g(l,a),u||(f=Y(l,"click",d),u=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=lp(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&le(r,o),h&40&&Q(l,"active",e[5]===e[14])},d(m){m&&w(t),c&&c.d(m),m&&w(s),m&&w(l),u=!1,f()}}}function rp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:s4,then:i4,catch:n4,value:19,blocks:[,,,]};return au(t=n[15].component,s),{c(){e=Ce(),s.block.c()},m(l,o){S(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.anchor=e
`),D&&D.c(),m=O(),_.c(),v=Ce(),p(s,"type","button"),p(s,"class","btn btn-transparent btn-hint p-l-sm p-r-sm"),p(e,"class","flex m-b-base flex-gap-10"),p(o,"class","list picker-list m-b-base svelte-1u8jhky"),p(c,"class","section-title")},m(N,F){S(N,e,F),q(t,e,null),g(e,i),g(e,s),S(N,l,F),S(N,o,F);for(let R=0;R<r.length;R+=1)r[R].m(o,null);C&&C.m(o,null),S(N,f,F),S(N,c,F),g(c,d),D&&D.m(c,null),S(N,m,F),I[h].m(N,F),S(N,v,F),k=!0,y||($=[Y(s,"click",n[31]),Ie(u=$M.call(null,o,n[36]))],y=!0)},p(N,F){const R={};F[0]&4&&(R.value=N[2]),F[0]&4096&&(R.autocompleteCollection=N[12]),t.$set(R),F[0]&142252&&(T=N[3],ae(),r=wt(r,F,M,1,N,T,a,o,ln,Op,null,Cp),ue(),!T.length&&C?C.p(N,F):T.length?C&&(C.d(1),C=null):(C=Mp(N),C.c(),C.m(o,null))),u&&Bt(u.update)&&F[0]&1040&&u.update.call(null,N[36]),N[5]>1?D?D.p(N,F):(D=Ep(N),D.c(),D.m(c,null)):D&&(D.d(1),D=null);let K=h;h=L(N),h===K?I[h].p(N,F):(ae(),P(I[K],1,1,()=>{I[K]=null}),ue(),_=I[h],_?_.p(N,F):(_=I[h]=E[h](N),_.c()),A(_,1),_.m(v.parentNode,v))},i(N){if(!k){A(t.$$.fragment,N);for(let F=0;F<T.length;F+=1)A(r[F]);A(_),k=!0}},o(N){P(t.$$.fragment,N);for(let F=0;F<r.length;F+=1)P(r[F]);P(_),k=!1},d(N){N&&w(e),j(t),N&&w(l),N&&w(o);for(let F=0;F<r.length;F+=1)r[F].d();C&&C.d(),N&&w(f),N&&w(c),D&&D.d(),N&&w(m),I[h].d(N),N&&w(v),y=!1,Pe($)}}}function jM(n){var r;let e,t,i,s=(((r=n[12])==null?void 0:r.name)||"")+"",l,o;return{c(){e=b("h4"),t=z("Select "),i=b("strong"),l=z(s),o=z(" records")},m(a,u){S(a,e,u),g(e,t),g(e,i),g(i,l),g(e,o)},p(a,u){var f;u[0]&4096&&s!==(s=(((f=a[12])==null?void 0:f.name)||"")+"")&&le(l,s)},d(a){a&&w(e)}}}function HM(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=O(),i=b("button"),i.innerHTML='<span class="txt">Save selection</span>',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[Y(e,"click",n[28]),Y(i,"click",n[29])],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function VM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[HM],header:[jM],default:[qM]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=Je(o,l[a]);e=new Sn({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[12]};return i=new qb({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),s=!0},p(a,u){const f=u[0]&524288?on(l,[l[0],l[1],xn(a[19])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&4096&&(c.collection=a[12]),i.$set(c)},i(a){s||(A(e.$$.fragment,a),A(i.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),s=!1},d(a){n[39](null),j(e,a),a&&w(t),n[42](null),j(i,a)}}}const Er=100;function zM(n,e,t){let i,s,l,o,r,a,u,f;const c=["value","field","show","hide"];let d=At(e,c),m;Ye(n,Ai,Ae=>t(26,m=Ae));const h=Ct(),_="picker_"+V.randomString(5);let{value:v}=e,{field:k}=e,y,$,T="",M=[],C=[],D=1,E=0,I=!1,L=!1;function N(){return t(2,T=""),t(3,M=[]),t(6,C=[]),R(),K(!0),y==null?void 0:y.show()}function F(){return y==null?void 0:y.hide()}async function R(){const Ae=V.toArray(v);if(!s||!Ae.length)return;t(24,L=!0);let ie=[];const we=Ae.slice(),nt=[];for(;we.length>0;){const et=[];for(const bt of we.splice(0,Er))et.push(`id="${bt}"`);nt.push(me.collection(s).getFullList(Er,{filter:et.join("||"),$autoCancel:!1}))}try{await Promise.all(nt).then(et=>{ie=ie.concat(...et)}),t(6,C=[]);for(const et of Ae){const bt=V.findByKey(ie,"id",et);bt&&C.push(bt)}T.trim()||t(3,M=V.filterDuplicatesByKey(C.concat(M)))}catch(et){me.errorResponseHandler(et)}t(24,L=!1)}async function K(Ae=!1){if(s){t(4,I=!0),Ae&&(T.trim()?t(3,M=[]):t(3,M=V.toArray(C).slice()));try{const ie=Ae?1:D+1,we=await me.collection(s).getList(ie,Er,{filter:T,sort:"-created",$cancelKey:_+"loadList"});t(3,M=V.filterDuplicatesByKey(M.concat(we.items))),D=we.page,t(23,E=we.totalItems)}catch(ie){me.errorResponseHandler(ie)}t(4,I=!1)}}function x(Ae){i==1?t(6,C=[Ae]):u&&(V.pushOrReplaceByKey(C,Ae),t(6,C))}function U(Ae){V.remove
`,p(e,"class","list-item")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Rp(n){var d;let e,t,i,s,l,o,r,a,u,f;i=new Qo({props:{record:n[15],displayFields:(d=n[2].options)==null?void 0:d.displayFields}});function c(){return n[8](n[15])}return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=O(),l=b("div"),o=b("button"),o.innerHTML='<i class="ri-close-line"></i>',r=O(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(l,"class","actions"),p(e,"class","list-item")},m(m,h){S(m,e,h),g(e,t),q(i,t,null),g(e,s),g(e,l),g(l,o),g(e,r),a=!0,u||(f=[Ie(Be.call(null,o,"Remove")),Y(o,"click",c)],u=!0)},p(m,h){var v;n=m;const _={};h&16&&(_.record=n[15]),h&4&&(_.displayFields=(v=n[2].options)==null?void 0:v.displayFields),i.$set(_)},i(m){a||(A(i.$$.fragment,m),a=!0)},o(m){P(i.$$.fragment,m),a=!1},d(m){m&&w(e),j(i),u=!1,Pe(f)}}}function UM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,h,_,v,k,y=n[4],$=[];for(let C=0;C<y.length;C+=1)$[C]=Rp(Ip(n,y,C));const T=C=>P($[C],1,1,()=>{$[C]=null});let M=null;return y.length||(M=Lp(n)),{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=z(o),u=O(),f=b("div"),c=b("div");for(let C=0;C<$.length;C+=1)$[C].c();M&&M.c(),d=O(),m=b("div"),h=b("button"),h.innerHTML=`<i class="ri-magic-line"></i>
2023-02-22 04:24:49 +08:00
2023-03-06 21:30:35 +08:00
<span class="txt">Open picker</span>`,p(t,"class",i=Si(V.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",a=n[14]),p(c,"class","relations-list svelte-1ynw0pc"),p(h,"type","button"),p(h,"class","btn btn-transparent btn-sm btn-block"),p(m,"class","list-item list-item-btn"),p(f,"class","list")},m(C,D){S(C,e,D),g(e,t),g(e,s),g(e,l),g(l,r),S(C,u,D),S(C,f,D),g(f,c);for(let E=0;E<$.length;E+=1)$[E].m(c,null);M&&M.m(c,null),g(f,d),g(f,m),g(m,h),_=!0,v||(k=Y(h,"click",n[9]),v=!0)},p(C,D){if((!_||D&4&&i!==(i=Si(V.getFieldTypeIcon(C[2].type))+" svelte-1ynw0pc"))&&p(t,"class",i),(!_||D&4)&&o!==(o=C[2].name+"")&&le(r,o),(!_||D&16384&&a!==(a=C[14]))&&p(e,"for",a),D&181){y=C[4];let E;for(E=0;E<y.length;E+=1){const I=Ip(C,y,E);$[E]?($[E].p(I,D),A($[E],1)):($[E]=Rp(I),$[E].c(),A($[E],1),$[E].m(c,null))}for(ae(),E=y.length;E<$.length;E+=1)T(E);ue(),!y.length&&M?M.p(C,D):y.length?M&&(M.d(1),M=null):(M=Lp(C),M.c(),M.m(c,null))}},i(C){if(!_){for(let D=0;D<y.length;D+=1)A($[D]);_=!0}},o(C){$=$.filter(Boolean);for(let D=0;D<$.length;D+=1)P($[D]);_=!1},d(C){C&&w(e),C&&w(u),C&&w(f),ht($,C),M&&M.d(),v=!1,k()}}}function WM(n){let e,t,i,s,l={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[UM,({uniqueId:r})=>({14:r}),({uniqueId:r})=>r?16384:0]},$$scope:{ctx:n}};e=new pe({props:l}),n[10](e);let o={value:n[0],field:n[2]};return i=new BM({props:o}),n[11](i),i.$on("save",n[12]),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&2113591&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[10](null),j(e,r),r&&w(t),n[11](null),j(i,r)}}}const qp=100;function YM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new mn}=e,r,a=[],u=!1;f();async function f(){var T,M;const k=V.toArray(s);if(!((T=o==null?void 0:o.options)!=null&&T.collectionId)||!k.length){t(4,a=[]),t(5,u=!1);return}t(5,u=!0);const y=k.slice(),$=[];for(;y.length>0;){const C=[];for(const D of y.splice(0,qp))C.push(`id="${D}"`);$.push(me.collection((M=o==null?void 0:o.options)==null?void 0:M.collectionId).getFullList(qp,{filter:C.join("||"),$autoCancel:!1}))}try{let C=[];await Promise.all($).then(D=>{C=C.concat(...D)});for(const D of k){const E=V.findByKey(C,"id",D);E&&a.push(E)}t(4,a)}catch(C){me.errorResponseHandler(C)}t(5,u=!1)}function c(k){var y;V.removeByKey(a,"id",k.id),t(4,a),i?t(0,s=a.map($=>$.id)):t(0,s=((y=a[0])==null?void 0:y.id)||"")}const d=k=>c(k),m=()=>l==null?void 0:l.show();function h(k){se[k?"unshift":"push"](()=>{r=k,t(3,r)})}function _(k){se[k?"unshift":"push"](()=>{l=k,t(1,l)})}const v=k=>{var y;t(4,a=k.detail||[]),t(0,s=i?a.map($=>$.id):((y=a[0])==null?void 0:y.id)||"")};return n.$$set=k=>{"value"in k&&t(0,s=k.value),"picker"in k&&t(1,l=k.picker),"field"in k&&t(2,o=k.field)},n.$$.update=()=>{var k;n.$$.dirty&4&&t(6,i=((k=o.options)==null?void 0:k.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed())},[s,l,o,r,a,u,i,c,d,m,h,_,v]}class KM extends be{constructor(e){super(),ge(this,e,YM,WM,he,{value:0,picker:1,field:2})}}const JM=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],ZM=(n,e)=>{J
2023-03-02 05:29:45 +08:00
...
2023-03-06 21:30:35 +08:00
-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){S(c,e,d),g(e,t),S(c,s,d),S(c,l,d),re(l,n[5]),S(c,r,d),S(c,a,d),u||(f=Y(l,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&32&&re(l,c[5])},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function C5(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y;return s=new pe({props:{class:"form-field required",name:"clientId",$$slots:{default:[k5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"teamId",$$slots:{default:[w5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"keyId",$$slots:{default:[S5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field required",name:"duration",$$slots:{default:[$5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[T5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),H(s.$$.fragment),l=O(),o=b("div"),H(r.$$.fragment),a=O(),u=b("div"),H(f.$$.fragment),c=O(),d=b("div"),H(m.$$.fragment),h=O(),H(_.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m($,T){S($,e,T),g(e,t),g(t,i),q(s,i,null),g(t,l),g(t,o),q(r,o,null),g(t,a),g(t,u),q(f,u,null),g(t,c),g(t,d),q(m,d,null),g(t,h),q(_,t,null),v=!0,k||(y=Y(e,"submit",ft(n[17])),k=!0)},p($,T){const M={};T&25165828&&(M.$$scope={dirty:T,ctx:$}),s.$set(M);const C={};T&25165832&&(C.$$scope={dirty:T,ctx:$}),r.$set(C);const D={};T&25165840&&(D.$$scope={dirty:T,ctx:$}),f.$set(D);const E={};T&25165888&&(E.$$scope={dirty:T,ctx:$}),m.$set(E);const I={};T&25165856&&(I.$$scope={dirty:T,ctx:$}),_.$set(I)},i($){v||(A(s.$$.fragment,$),A(r.$$.fragment,$),A(f.$$.fragment,$),A(m.$$.fragment,$),A(_.$$.fragment,$),v=!0)},o($){P(s.$$.fragment,$),P(r.$$.fragment,$),P(f.$$.fragment,$),P(m.$$.fragment,$),P(_.$$.fragment,$),v=!1},d($){$&&w(e),j(s),j(r),j(f),j(m),j(_),k=!1,y()}}}function M5(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function D5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("button"),t=z("Close"),i=O(),s=b("button"),l=b("i"),o=O(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(l,"class","ri-key-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[9]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],Q(s,"btn-loading",n[7])},m(c,d){S(c,e,d),g(e,t),S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(s.disabled=a),d&128&&Q(s,"btn-loading",c[7])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function O5(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[D5],header:[M5],default:[C5]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(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[19](null),j(e,s)}}}const po=15777e3;function E5(n,e,t){let i;const s=Ct(),l="apple_secret_"+V.randomString(5);let o,r,a,u,f,c,d=!1;function m(L={}){t(2,r=L.clientId||""),t(3,a=L.teamId||""),t(4,u=L.keyId||""),t(5,f=L.privateKey||""),t(6,c=L.duration||po),In({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function _(){t(7,d=!0);try{const L=await me.send("/api/settings/apple/generate-client-secret",{method:"POST",body:{teamId:a,clientId:r,keyId:u,privateKey:f.trim(),duration:c}});t(7,d=!1),jt("Successfully generated cl
2023-03-02 05:29:45 +08:00
Updated: ${n[2].updated}`,position:"left"})),v=!0)},p(y,$){$[1]&8388608&&r!==(r=y[54])&&p(e,"for",r),c&&Bt(c.update)&&$[0]&4&&c.update.call(null,{text:`Created: ${y[2].created}
2023-03-06 21:30:35 +08:00
Updated: ${y[2].updated}`,position:"left"}),$[1]&8388608&&h!==(h=y[54])&&p(m,"id",h),$[0]&4&&_!==(_=y[2].id)&&m.value!==_&&(m.value=_)},d(y){y&&w(e),y&&w(a),y&&w(u),y&&w(d),y&&w(m),v=!1,k()}}}function Up(n){var u,f;let e,t,i,s,l;function o(c){n[29](c)}let r={collection:n[0]};n[2]!==void 0&&(r.record=n[2]),e=new b4({props:r}),se.push(()=>_e(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&Wp();return{c(){H(e.$$.fragment),i=O(),a&&a.c(),s=Ce()},m(c,d){q(e,c,d),S(c,i,d),a&&a.m(c,d),S(c,s,d),l=!0},p(c,d){var h,_;const m={};d[0]&1&&(m.collection=c[0]),!t&&d[0]&4&&(t=!0,m.record=c[2],ke(()=>t=!1)),e.$set(m),(_=(h=c[0])==null?void 0:h.schema)!=null&&_.length?a||(a=Wp(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){P(e.$$.fragment,c),l=!1},d(c){j(e,c),c&&w(i),a&&a.d(c),c&&w(s)}}}function Wp(n){let e;return{c(){e=b("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function z5(n){let e,t,i;function s(o){n[42](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new KM({props:l}),se.push(()=>_e(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function B5(n){let e,t,i,s,l;function o(f){n[39](f,n[51])}function r(f){n[40](f,n[51])}function a(f){n[41](f,n[51])}let u={field:n[51],record:n[2]};return n[2][n[51].name]!==void 0&&(u.value=n[2][n[51].name]),n[3][n[51].name]!==void 0&&(u.uploadedFiles=n[3][n[51].name]),n[4][n[51].name]!==void 0&&(u.deletedFileIndexes=n[4][n[51].name]),e=new SM({props:u}),se.push(()=>_e(e,"value",o)),se.push(()=>_e(e,"uploadedFiles",r)),se.push(()=>_e(e,"deletedFileIndexes",a)),{c(){H(e.$$.fragment)},m(f,c){q(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[51]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[51].name],ke(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[51].name],ke(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[51].name],ke(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function U5(n){let e,t,i;function s(o){n[38](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new x4({props:l}),se.push(()=>_e(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function W5(n){let e,t,i;function s(o){n[37](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new Z4({props:l}),se.push(()=>_e(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Y5(n){let e,t,i;function s(o){n[36](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new W4({props:l}),se.push(()=>_e(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function K5(n){let e,t,i;function s(o){n[35](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new l5({props:l}),se.push(()=>_e(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function J5(n){let e,t,i;function s(o){n[34](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new V4({props:l}),se.push(()=>_e(e,"value",s)),{c(){H(
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[23]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Gp(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Send password reset email</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[24]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function eD(n){let e,t,i,s,l,o,r,a=n[0].isAuth&&!n[7].verified&&n[7].email&&Zp(n),u=n[0].isAuth&&n[7].email&&Gp(n);return{c(){a&&a.c(),e=O(),u&&u.c(),t=O(),i=b("button"),i.innerHTML=`<i class="ri-file-copy-line"></i>
2023-03-05 22:15:58 +08:00
<span class="txt">Duplicate</span>`,s=O(),l=b("button"),l.innerHTML=`<i class="ri-delete-bin-7-line"></i>
2023-03-06 21:30:35 +08:00
<span class="txt">Delete</span>`,p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item txt-danger closable")},m(f,c){a&&a.m(f,c),S(f,e,c),u&&u.m(f,c),S(f,t,c),S(f,i,c),S(f,s,c),S(f,l,c),o||(r=[Y(i,"click",n[25]),Y(l,"click",kn(ft(n[26])))],o=!0)},p(f,c){f[0].isAuth&&!f[7].verified&&f[7].email?a?a.p(f,c):(a=Zp(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].isAuth&&f[7].email?u?u.p(f,c):(u=Gp(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&w(e),u&&u.d(f),f&&w(t),f&&w(i),f&&w(s),f&&w(l),o=!1,Pe(r)}}}function Xp(n){let e,t,i,s,l,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=O(),s=b("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),Q(t,"active",n[10]===Gi),p(s,"type","button"),p(s,"class","tab-item"),Q(s,"active",n[10]===yl),p(e,"class","tabs-header stretched")},m(r,a){S(r,e,a),g(e,t),g(e,i),g(e,s),l||(o=[Y(t,"click",n[27]),Y(s,"click",n[28])],l=!0)},p(r,a){a[0]&1024&&Q(t,"active",r[10]===Gi),a[0]&1024&&Q(s,"active",r[10]===yl)},d(r){r&&w(e),l=!1,Pe(o)}}}function tD(n){var _;let e,t=n[2].isNew?"New":"Edit",i,s,l,o=((_=n[0])==null?void 0:_.name)+"",r,a,u,f,c,d,m=!n[2].isNew&&Jp(n),h=n[0].isAuth&&!n[2].isNew&&Xp(n);return{c(){e=b("h4"),i=z(t),s=O(),l=b("strong"),r=z(o),a=z(" record"),u=O(),m&&m.c(),f=O(),h&&h.c(),c=Ce()},m(v,k){S(v,e,k),g(e,i),g(e,s),g(e,l),g(l,r),g(e,a),S(v,u,k),m&&m.m(v,k),S(v,f,k),h&&h.m(v,k),S(v,c,k),d=!0},p(v,k){var y;(!d||k[0]&4)&&t!==(t=v[2].isNew?"New":"Edit")&&le(i,t),(!d||k[0]&1)&&o!==(o=((y=v[0])==null?void 0:y.name)+"")&&le(r,o),v[2].isNew?m&&(ae(),P(m,1,1,()=>{m=null}),ue()):m?(m.p(v,k),k[0]&4&&A(m,1)):(m=Jp(v),m.c(),A(m,1),m.m(f.parentNode,f)),v[0].isAuth&&!v[2].isNew?h?h.p(v,k):(h=Xp(v),h.c(),h.m(c.parentNode,c)):h&&(h.d(1),h=null)},i(v){d||(A(m),d=!0)},o(v){P(m),d=!1},d(v){v&&w(e),v&&w(u),m&&m.d(v),v&&w(f),h&&h.d(v),v&&w(c)}}}function nD(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),s=b("button"),l=b("span"),r=z(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[8],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[13]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[11]||n[8],Q(s,"btn-loading",n[8])},m(c,d){S(c,e,d),g(e,t),S(c,i,d),S(c,s,d),g(s,l),g(l,r),u||(f=Y(e,"click",n[22]),u=!0)},p(c,d){d[0]&256&&(e.disabled=c[8]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&le(r,o),d[0]&2304&&a!==(a=!c[11]||c[8])&&(s.disabled=a),d[0]&256&&Q(s,"btn-loading",c[8])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function iD(n){var s;let e,t,i={class:`
2023-02-22 04:24:49 +08:00
record-panel
`+(n[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((s=n[0])!=null&&s.isAuth&&!n[2].isNew?"colored-header":"")+`
2023-03-06 21:30:35 +08:00
`,beforeHide:n[43],$$slots:{footer:[nD],header:[tD],default:[x5]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[44](e),e.$on("hide",n[45]),e.$on("show",n[46]),{c(){H(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&4101&&(r.class=`
2023-02-22 04:24:49 +08:00
record-panel
`+(l[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((a=l[0])!=null&&a.isAuth&&!l[2].isNew?"colored-header":"")+`
2023-03-06 21:30:35 +08:00
`),o[0]&544&&(r.beforeHide=l[43]),o[0]&3485|o[1]&16777216&&(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[44](null),j(e,l)}}}const Gi="form",yl="providers";function Qp(n){return JSON.stringify(n)}function sD(n,e,t){let i,s,l,o;const r=Ct(),a="record_"+V.randomString(5);let{collection:u}=e,f,c=null,d=new $i,m=!1,h=!1,_={},v={},k="",y=Gi;function $(ie){return M(ie),t(9,h=!0),t(10,y=Gi),f==null?void 0:f.show()}function T(){return f==null?void 0:f.hide()}async function M(ie){In({}),t(7,c=ie||{}),ie!=null&&ie.clone?t(2,d=ie.clone()):t(2,d=new $i),t(3,_={}),t(4,v={}),await sn(),t(20,k=Qp(d))}function C(){if(m||!o||!(u!=null&&u.id))return;t(8,m=!0);const ie=E();let we;d.isNew?we=me.collection(u.id).create(ie):we=me.collection(u.id).update(d.id,ie),we.then(nt=>{jt(d.isNew?"Successfully created record.":"Successfully updated record."),t(9,h=!1),T(),r("save",nt)}).catch(nt=>{me.errorResponseHandler(nt)}).finally(()=>{t(8,m=!1)})}function D(){c!=null&&c.id&&cn("Do you really want to delete the selected record?",()=>me.collection(c.collectionId).delete(c.id).then(()=>{T(),jt("Successfully deleted record."),r("delete",c)}).catch(ie=>{me.errorResponseHandler(ie)}))}function E(){const ie=(d==null?void 0:d.export())||{},we=new FormData,nt={};for(const et of(u==null?void 0:u.schema)||[])nt[et.name]=!0;u!=null&&u.isAuth&&(nt.username=!0,nt.email=!0,nt.emailVisibility=!0,nt.password=!0,nt.passwordConfirm=!0,nt.verified=!0);for(const et in ie)nt[et]&&(typeof ie[et]>"u"&&(ie[et]=null),V.addValueToFormData(we,et,ie[et]));for(const et in _){const bt=V.toArray(_[et]);for(const Gt of bt)we.append(et,Gt)}for(const et in v){const bt=V.toArray(v[et]);for(const Gt of bt)we.append(et+"."+Gt,"")}return we}function I(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent verification email to ${c.email}?`,()=>me.collection(u.id).requestVerification(c.email).then(()=>{jt(`Successfully sent verification email to ${c.email}.`)}).catch(ie=>{me.errorResponseHandler(ie)}))}function L(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent password reset email to ${c.email}?`,()=>me.collection(u.id).requestPasswordReset(c.email).then(()=>{jt(`Successfully sent password reset email to ${c.email}.`)}).catch(ie=>{me.errorResponseHandler(ie)}))}function N(){l?cn("You have unsaved changes. Do you really want to discard them?",()=>{F()}):F()}async function F(){const ie=c==null?void 0:c.clone();if(ie){ie.id="",ie.created="",ie.updated="";const we=(u==null?void 0:u.schema)||[];for(const nt of we)nt.type==="file"&&delete ie[nt.name]}$(ie),await sn(),t(20,k="")}const R=()=>T(),K=()=>I(),x=()=>L(),U=()=>N(),G=()=>D(),ne=()=>t(10,y=Gi),J=()=>t(10,y=yl);function fe(ie){d=ie,t(2,d)}function Z(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function de(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ve(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Te(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Ne(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Re(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ye(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Se(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function We(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function lt(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ce(ie,we){n.$$.not_equal(_[we.name],ie)&&(_[we.name]=ie,t(3,_))}function ze(ie,we){n.$$.not_equal(v[we.name],ie)&&(v[we.name]=ie,t(4,v))}function te(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}const Fe=()=>l&&h?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(9,h=!1),T()}),!1):(In({}),!0);function ot(ie){se[ie?"unshift":"push"](()=>{f=ie,t(6,f)})}function Vt(ie){Ve.call(this,n,ie)}function Ae(ie){Ve.call(this,n,ie)}return n.$$set=ie=>{"collection"in ie&&t(0,u=ie.collection)},n.$$.update=()=>{var ie;n.$$.dirty[0]&1&&t(12,i=!!((
`},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function zD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[40]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function BD(n){let e,t,i;return{c(){e=b("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){S(s,e,l),t||(i=Y(e,"click",n[39]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Cm(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[36](n[55])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=O(),r=b("label"),p(i,"type","checkbox"),p(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],p(r,"for",a="checkbox_"+n[55].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){S(d,e,m),g(e,t),g(t,i),g(t,o),g(t,r),u||(f=[Y(i,"change",c),Y(t,"click",kn(n[26]))],u=!0)},p(d,m){n=d,m[0]&16&&s!==(s="checkbox_"+n[55].id)&&p(i,"id",s),m[0]&80&&l!==(l=n[6][n[55].id])&&(i.checked=l),m[0]&16&&a!==(a="checkbox_"+n[55].id)&&p(r,"for",a)},d(d){d&&w(e),u=!1,Pe(f)}}}function Mm(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new lu({props:{value:n[55].id}});let c=n[2].isAuth&&Dm(n);return{c(){e=b("td"),t=b("div"),i=b("div"),H(s.$$.fragment),l=O(),o=b("div"),a=z(r),u=O(),c&&c.c(),p(o,"class","txt"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){S(d,e,m),g(e,t),g(t,i),q(s,i,null),g(i,l),g(i,o),g(o,a),g(t,u),c&&c.m(t,null),f=!0},p(d,m){const h={};m[0]&16&&(h.value=d[55].id),s.$set(h),(!f||m[0]&16)&&r!==(r=d[55].id+"")&&le(a,r),d[2].isAuth?c?c.p(d,m):(c=Dm(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(s.$$.fragment,d),f=!0)},o(d){P(s.$$.fragment,d),f=!1},d(d){d&&w(e),j(s),c&&c.d()}}}function Dm(n){let e;function t(l,o){return l[55].verified?WD:UD}let i=t(n),s=i(n);return{c(){s.c(),e=Ce()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function UD(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=Ie(Be.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function WD(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=Ie(Be.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function Om(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&Em(n),o=i&&Am(n);return{c(){l&&l.c(),t=O(),o&&o.c(),s=Ce()},m(r,a){l&&l.m(r,a),S(r,t,a),o&&o.m(r,a),S(r,s,a)},p(r,a){a[0]&128&&(e=!r[7].includes("@username")),e?l?l.p(r,a):(l=Em(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&128&&(i=!r[7].includes("@email")),i?o?o.p(r,a):(o=Am(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&w(t),o&&o.d(r),r&&w(s)}}}function Em(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!V.isEmpty(o[55].username)),t?KD:YD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=b("td"),l.c(),p(e,"class","col-type-text col-field-username")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function YD(n){let e,t=n[55].username+"",i,s;return{c(){e=b("span"),i=z(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].username)},m(l,o){S(l,e,o),g(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&le(i,t),o[0]&16&&s!==(s=l[55].username)&&p(e,"title",s)},d(l){l&&w(e)}}}function KD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Am(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!V.isEmpty(o[55].email)),t?ZD:JD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=b("td"),l.c(),p(e,"class","col-type-text col-field-email")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function JD(n){let e,t=n[55].email+"",i,s;return{c(){e=b("span"),i=z(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].email)},m(l,o){S(l,e,o),g(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].email+"")
<span class="txt">New record</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[18]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function rO(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,D,E,I,L,N=!n[10]&&Vm(n);c=new Ea({}),c.$on("refresh",n[16]);let F=!n[2].isView&&zm(n);k=new Wo({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[19]);function R(U){n[21](U)}function K(U){n[22](U)}let x={collection:n[2]};return n[0]!==void 0&&(x.filter=n[0]),n[1]!==void 0&&(x.sort=n[1]),M=new iO({props:x}),n[20](M),se.push(()=>_e(M,"filter",R)),se.push(()=>_e(M,"sort",K)),M.$on("select",n[23]),M.$on("new",n[24]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",s=O(),l=b("div"),r=z(o),a=O(),u=b("div"),N&&N.c(),f=O(),H(c.$$.fragment),d=O(),m=b("div"),h=b("button"),h.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,_=O(),F&&F.c(),v=O(),H(k.$$.fragment),y=O(),$=b("div"),T=O(),H(M.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p($,"class","clearfix m-b-base")},m(U,G){S(U,e,G),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),g(e,u),N&&N.m(u,null),g(u,f),q(c,u,null),g(e,d),g(e,m),g(m,h),g(m,_),F&&F.m(m,null),S(U,v,G),q(k,U,G),S(U,y,G),S(U,$,G),S(U,T,G),q(M,U,G),E=!0,I||(L=Y(h,"click",n[17]),I=!0)},p(U,G){(!E||G[0]&4)&&o!==(o=U[2].name+"")&&le(r,o),U[10]?N&&(N.d(1),N=null):N?N.p(U,G):(N=Vm(U),N.c(),N.m(u,f)),U[2].isView?F&&(F.d(1),F=null):F?F.p(U,G):(F=zm(U),F.c(),F.m(m,null));const ne={};G[0]&1&&(ne.value=U[0]),G[0]&4&&(ne.autocompleteCollection=U[2]),k.$set(ne);const J={};G[0]&4&&(J.collection=U[2]),!C&&G[0]&1&&(C=!0,J.filter=U[0],ke(()=>C=!1)),!D&&G[0]&2&&(D=!0,J.sort=U[1],ke(()=>D=!1)),M.$set(J)},i(U){E||(A(c.$$.fragment,U),A(k.$$.fragment,U),A(M.$$.fragment,U),E=!0)},o(U){P(c.$$.fragment,U),P(k.$$.fragment,U),P(M.$$.fragment,U),E=!1},d(U){U&&w(e),N&&N.d(),j(c),F&&F.d(),U&&w(v),j(k,U),U&&w(y),U&&w($),U&&w(T),n[20](null),j(M,U),I=!1,L()}}}function aO(n){let e,t,i,s,l;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=O(),i=b("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(i,"click",n[14]),s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function uO(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function fO(n){let e,t,i;function s(r,a){return r[10]?uO:aO}let l=s(n),o=l(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=O(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){S(r,e,a),g(e,t),g(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&w(e),o.d()}}}function cO(n){let e;return{c(){e=b("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function dO(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[oO,lO,sO],m=[];function h($,T){return $[3]&&!$[9].length?0:$[9].length?2:1}e=h(n),t=m[e]=d[e](n);let _={};s=new iu({props:_}),n[25](s);let v={};o=new u4({props:v}),n[26](o);let k={collection:n[2]};a=new qb({props:k}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let y={collection:n[2]};return f=new AD({props:y}),n[30](f),{c(){t.c(),i=O(),H(s.$$.fragment),l=O(),H(o.$$.fragment),r=O(),H(a.$$.fragment),u=O(),H(f.$$.fragment)},m($,T){m[e].m($,T),S($,i,T),q(s,$,T),S($,l,T),q(o,$,T),S($,r,T),q(a,$,T),S($,u,T),q(f,$,T),c=!0},p($,T){let M=e;e=h($),e===M?m[e].p($,T):(ae(),P(m[M],1,1,()=>{m[M]=null}),ue(),t=m[e],t?t.p($,T):(t=m[e]=d[e]($),t.c()),A(t,1),t.m(i.parentNode,i));const C={};s.$set(C);const D={};o.$set(D);const E={};T[0]&4&&(E.collection=$[2]),a.$set(E);const I={};T[0]&4&&(I.collection=$[2]),f.$set(I)},i($){c||(A(t),A(s.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(f.$$.fragment,$),c=!0)},o($){P(t),P(s.$$.fragment,$),P(o.$$.fragment,$),P(a.$$.fragment,$),P(f.$$.fragment,$),c=!1},d($){m[e].d($),$&&w(i),n[25](null),j(s,$),$&&w(l),n[26](null),j(o,$),$&&w(r),n[27](null),j(a,$),$&&w(u),n[30](null),j(f,$)}}}function pO(n,e,t){let i,s,l,o,r,a,u;Ye(n,Mi,Z=>t(2,s=Z)),Ye(n,$t,Z=>t(31,l=Z)),Ye(n,Lo,Z=>t(3,o=Z)),Ye(n,_a,Z=>t(13,r=Z)),Ye(n,Ai,Z=>t(9,a=Z)),Ye(n,Cs,Z=>t(10,u=Z));const f=new URLSearchParams(r);let c,d,m,h,_,v=f.get("filter")||"",k=f.get("sort")||"",y=f.get("collectionId")||(s==null?void 0:s.id);function $(){t(11,y=s==null?void 0:s.id),t(0,v=""),t(1,k="-created"),s!=null&&s.isView&&!V.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}Ab(y);const T=()=>c==null?void 0:c.show(),M=()=>c==null?void 0:c.show(s),C=()=>_==null?void 0:_.load(),D=()=>d==null?void 0:d.show(s),E=()=>m==null?void 0:m.show(),I=Z=>t(0,v=Z.detail);function L(Z){se[Z?"unshift":"push"](()=>{_=Z,t(8,_)})}function N(Z){v=Z,t(0,v)}function F(Z){k=Z,t(1,k)}const R=Z=>{s.isView?h.show(Z==null?void 0:Z.detail):m==null||m.show(Z==null?void 0:Z.detail)},K=()=>m==null?void 0:m.show();function x(Z){se[Z?"unshift":"push"](()=>{c=Z,t(4,c)})}function U(Z){se[Z?"unshift":"push"](()=>{d=Z,t(5,d)})}function G(Z){se[Z?"unshift":"push"](()=>{m=Z,t(6,m)})}const ne=()=>_==null?void 0:_.reloadLoadedPages(),J=()=>_==null?void 0:_.reloadLoadedPages();function fe(Z){se[Z?"unshift":"push"](()=>{h=Z,t(7,h)})}return n.$$.update=()=>{if(n.$$.dirty[0]&8192&&t(12,i=new URLSearchParams(r)),n.$$.dirty[0]&6152&&!o&&i.get("collectionId")&&i.get("collectionId")!=y&&L3(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&y!=s.id&&$(),n.$$.dirty[0]&7&&(k||v||s!=null&&s.id)){const Z=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:v,sort:k}).toString();Di("/collections?"+Z)}n.$$.dirty[0]&4&&Kt($t,l=(s==null?void 0:s.name)||"Collections",l)},[v,k,s,o,c,d,m,h,_,a,u,y,i,r,T,M,C,D,E,I,L,N,F,R,K,x,U,G,ne,J,fe]}class mO extends be{constructor(e){super(),ge(this,e,pO,dO,he,{},null,[-1,-1])}}function hO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,D,E,I;return{c(){e=b("aside"),t=b("div"),i=b("div"),i.textContent="System",s=O(),l=b("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
2023-03-05 22:15:58 +08:00
<span class="txt">Application</span>`,o=O(),r=b("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=O(),u=b("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=O(),c=b("div"),c.innerHTML='<span class="txt">Sync</span>',d=O(),m=b("a"),m.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,h=O(),_=b("a"),_.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,v=O(),k=b("div"),k.textContent="Authentication",y=O(),$=b("a"),$.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,T=O(),M=b("a"),M.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,C=O(),D=b("a"),D.innerHTML=`<i class="ri-shield-user-line"></i>
2023-03-06 21:30:35 +08:00
<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(m,"href","/settings/export-collections"),p(m,"class","sidebar-list-item"),p(_,"href","/settings/import-collections"),p(_,"class","sidebar-list-item"),p(k,"class","sidebar-title"),p($,"href","/settings/auth-providers"),p($,"class","sidebar-list-item"),p(M,"href","/settings/tokens"),p(M,"class","sidebar-list-item"),p(D,"href","/settings/admins"),p(D,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(L,N){S(L,e,N),g(e,t),g(t,i),g(t,s),g(t,l),g(t,o),g(t,r),g(t,a),g(t,u),g(t,f),g(t,c),g(t,d),g(t,m),g(t,h),g(t,_),g(t,v),g(t,k),g(t,y),g(t,$),g(t,T),g(t,M),g(t,C),g(t,D),E||(I=[Ie(jn.call(null,l,{path:"/settings"})),Ie(xt.call(null,l)),Ie(jn.call(null,r,{path:"/settings/mail/?.*"})),Ie(xt.call(null,r)),Ie(jn.call(null,u,{path:"/settings/storage/?.*"})),Ie(xt.call(null,u)),Ie(jn.call(null,m,{path:"/settings/export-collections/?.*"})),Ie(xt.call(null,m)),Ie(jn.call(null,_,{path:"/settings/import-collections/?.*"})),Ie(xt.call(null,_)),Ie(jn.call(null,$,{path:"/settings/auth-providers/?.*"})),Ie(xt.call(null,$)),Ie(jn.call(null,M,{path:"/settings/tokens/?.*"})),Ie(xt.call(null,M)),Ie(jn.call(null,D,{path:"/settings/admins/?.*"})),Ie(xt.call(null,D))],E=!0)},p:X,i:X,o:X,d(L){L&&w(e),E=!1,Pe(I)}}}class Ii extends be{constructor(e){super(),ge(this,e,null,hO,he,{})}}function Bm(n,e,t){const i=n.slice();return i[30]=e[t],i}function Um(n){let e,t;return e=new pe({props:{class:"form-field readonly",name:"id",$$slots:{default:[_O,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&536870914|s[1]&4&&(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){j(e,i)}}}function _O(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="id",o=O(),r=b("div"),a=b("i"),f=O(),c=b("input"),p(t,"class",V.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[29]),p(a,"class","ri-calendar-event-line txt-disabled"),p(r,"class","form-field-addon"),p(c,"type","text"),p(c,"id",d=n[29]),c.value=m=n[1].id,c.readOnly=!0},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),S(v,r,k),g(r,a),S(v,f,k),S(v,c,k),h||(_=Ie(u=Be.call(null,a,{text:`Created: ${n[1].created}
Updated: ${n[1].updated}`,position:"left"})),h=!0)},p(v,k){k[0]&536870912&&l!==(l=v[29])&&p(e,"for",l),u&&Bt(u.update)&&k[0]&2&&u.update.call(null,{text:`Created: ${v[1].created}
2023-03-06 21:30:35 +08:00
Updated: ${v[1].updated}`,position:"left"}),k[0]&536870912&&d!==(d=v[29])&&p(c,"id",d),k[0]&2&&m!==(m=v[1].id)&&c.value!==m&&(c.value=m)},d(v){v&&w(e),v&&w(o),v&&w(r),v&&w(f),v&&w(c),h=!1,_()}}}function Wm(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=b("button"),t=b("img"),s=O(),zn(t.src,i="./images/avatars/avatar"+n[30]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[30]),p(e,"type","button"),p(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){S(u,e,f),g(e,t),g(e,s),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(u){u&&w(e),o=!1,r()}}}function gO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Email",o=O(),r=b("input"),p(t,"class",V.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),re(r,n[3]),u||(f=Y(r,"input",n[18]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&re(r,c[3])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function Ym(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[bO,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&536870928|s[1]&4&&(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){j(e,i)}}}function bO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=z("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[29]),p(s,"for",o=n[29])},m(u,f){S(u,e,f),e.checked=n[4],S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Km(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[vO,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[yO,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),H(s.$$.fragment),l=O(),o=b("div"),H(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){S(f,e,c),g(e,t),g(t,i),q(s,i,null),g(t,l),g(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&536871168|c[1]&4&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c[0]&536871424|c[1]&4&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Ge(()=>{a||(a=qe(t,St,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=qe(t,St,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),j(s),j(r),f&&a&&a.end()}}}function vO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Password",o=O(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),re(r,n[8]),u||(f=Y(r,"input",n[20]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&256&&r.value!==c[8]&&re(r,c[8])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function yO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Password confirm",o=O(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),re(r,n[9]),u||(f=Y(r,"input",n[21]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&5
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[15]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function $O(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,m=!n[1].isNew&&Jm(n);return{c(){m&&m.c(),e=O(),t=b("button"),i=b("span"),i.textContent="Cancel",s=O(),l=b("button"),o=b("span"),a=z(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),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],Q(l,"btn-loading",n[6])},m(h,_){m&&m.m(h,_),S(h,e,_),S(h,t,_),g(t,i),S(h,s,_),S(h,l,_),g(l,o),g(o,a),f=!0,c||(d=Y(t,"click",n[16]),c=!0)},p(h,_){h[1].isNew?m&&(ae(),P(m,1,1,()=>{m=null}),ue()):m?(m.p(h,_),_[0]&2&&A(m,1)):(m=Jm(h),m.c(),A(m,1),m.m(e.parentNode,e)),(!f||_[0]&64)&&(t.disabled=h[6]),(!f||_[0]&2)&&r!==(r=h[1].isNew?"Create":"Save changes")&&le(a,r),(!f||_[0]&1088&&u!==(u=!h[10]||h[6]))&&(l.disabled=u),(!f||_[0]&64)&&Q(l,"btn-loading",h[6])},i(h){f||(A(m),f=!0)},o(h){P(m),f=!1},d(h){m&&m.d(h),h&&w(e),h&&w(t),h&&w(s),h&&w(l),c=!1,d()}}}function TO(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[$O],header:[wO],default:[kO]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[22]),l[0]&1886|l[1]&4&&(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[23](null),j(e,s)}}}function CO(n,e,t){let i;const s=Ct(),l="admin_"+V.randomString(5);let o,r=new Xi,a=!1,u=!1,f=0,c="",d="",m="",h=!1;function _(U){return k(U),t(7,u=!0),o==null?void 0:o.show()}function v(){return o==null?void 0:o.hide()}function k(U){t(1,r=U!=null&&U.clone?U.clone():new Xi),y()}function y(){t(4,h=!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,m=""),In({})}function $(){if(a||!i)return;t(6,a=!0);const U={email:c,avatar:f};(r.isNew||h)&&(U.password=d,U.passwordConfirm=m);let G;r.isNew?G=me.admins.create(U):G=me.admins.update(r.id,U),G.then(async ne=>{var J;t(7,u=!1),v(),jt(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ne),((J=me.authStore.model)==null?void 0:J.id)===ne.id&&me.authStore.save(me.authStore.token,ne)}).catch(ne=>{me.errorResponseHandler(ne)}).finally(()=>{t(6,a=!1)})}function T(){r!=null&&r.id&&cn("Do you really want to delete the selected admin?",()=>me.admins.delete(r.id).then(()=>{t(7,u=!1),v(),jt("Successfully deleted admin."),s("delete",r)}).catch(U=>{me.errorResponseHandler(U)}))}const M=()=>T(),C=()=>v(),D=U=>t(2,f=U);function E(){c=this.value,t(3,c)}function I(){h=this.checked,t(4,h)}function L(){d=this.value,t(8,d)}function N(){m=this.value,t(9,m)}const F=()=>i&&u?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),v()}),!1):!0;function R(U){se[U?"unshift":"push"](()=>{o=U,t(5,o)})}function K(U){Ve.call(this,n,U)}function x(U){Ve.call(this,n,U)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||h||c!==r.email||f!==r.avatar)},[v,r,f,c,h,o,a,u,d,m,i,l,$,T,_,M,C,D,E,I,L,N,F,R,K,x]}class MO extends be{constructor(e){super(),ge(this,e,CO,TO,he,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function Zm(n,e,t){const i=n.slice();return i[24]=e[t],i}function DO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="id",p(t,"class",V.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:X,d(l){l&&w(e)}}}function OO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="email",p(t,"class",V.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:X,d(l){l&&w(e)}}}function EO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="created",p(t,"class"
`},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Xm(n){let e,t,i;return{c(){e=b("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){S(s,e,l),t||(i=Y(e,"click",n[17]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Qm(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function xm(n,e){let t,i,s,l,o,r,a,u,f,c,d,m=e[24].id+"",h,_,v,k,y,$=e[24].email+"",T,M,C,D,E,I,L,N,F,R,K,x,U,G;f=new lu({props:{value:e[24].id}});let ne=e[24].id===e[7].id&&Qm();E=new ui({props:{date:e[24].created}}),N=new ui({props:{date:e[24].updated}});function J(){return e[15](e[24])}function fe(...Z){return e[16](e[24],...Z)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),s=b("figure"),l=b("img"),r=O(),a=b("td"),u=b("div"),H(f.$$.fragment),c=O(),d=b("span"),h=z(m),_=O(),ne&&ne.c(),v=O(),k=b("td"),y=b("span"),T=z($),C=O(),D=b("td"),H(E.$$.fragment),I=O(),L=b("td"),H(N.$$.fragment),F=O(),R=b("td"),R.innerHTML='<i class="ri-arrow-right-line"></i>',K=O(),zn(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(d,"class","txt"),p(u,"class","label"),p(a,"class","col-type-text col-field-id"),p(y,"class","txt txt-ellipsis"),p(y,"title",M=e[24].email),p(k,"class","col-type-email col-field-email"),p(D,"class","col-type-date col-field-created"),p(L,"class","col-type-date col-field-updated"),p(R,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Z,de){S(Z,t,de),g(t,i),g(i,s),g(s,l),g(t,r),g(t,a),g(a,u),q(f,u,null),g(u,c),g(u,d),g(d,h),g(a,_),ne&&ne.m(a,null),g(t,v),g(t,k),g(k,y),g(y,T),g(t,C),g(t,D),q(E,D,null),g(t,I),g(t,L),q(N,L,null),g(t,F),g(t,R),g(t,K),x=!0,U||(G=[Y(t,"click",J),Y(t,"keydown",fe)],U=!0)},p(Z,de){e=Z,(!x||de&16&&!zn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const ve={};de&16&&(ve.value=e[24].id),f.$set(ve),(!x||de&16)&&m!==(m=e[24].id+"")&&le(h,m),e[24].id===e[7].id?ne||(ne=Qm(),ne.c(),ne.m(a,null)):ne&&(ne.d(1),ne=null),(!x||de&16)&&$!==($=e[24].email+"")&&le(T,$),(!x||de&16&&M!==(M=e[24].email))&&p(y,"title",M);const Te={};de&16&&(Te.date=e[24].created),E.$set(Te);const Ne={};de&16&&(Ne.date=e[24].updated),N.$set(Ne)},i(Z){x||(A(f.$$.fragment,Z),A(E.$$.fragment,Z),A(N.$$.fragment,Z),x=!0)},o(Z){P(f.$$.fragment,Z),P(E.$$.fragment,Z),P(N.$$.fragment,Z),x=!1},d(Z){Z&&w(t),j(f),ne&&ne.d(),j(E),j(N),U=!1,Pe(G)}}}function LO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M=[],C=new Map,D;function E(J){n[11](J)}let I={class:"col-type-text",name:"id",$$slots:{default:[DO]},$$scope:{ctx:n}};n[2]!==void 0&&(I.sort=n[2]),o=new Wt({props:I}),se.push(()=>_e(o,"sort",E));function L(J){n[12](J)}let N={class:"col-type-email col-field-email",name:"email",$$slots:{default:[OO]},$$scope:{ctx:n}};n[2]!==void 0&&(N.sort=n[2]),u=new Wt({props:N}),se.push(()=>_e(u,"sort",L));function F(J){n[13](J)}let R={class:"col-type-date col-field-created",name:"created",$$slots:{default:[EO]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),d=new Wt({props:R}),se.push(()=>_e(d,"sort",F));function K(J){n[14](J)}let x={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[AO]},$$scope:{ctx:n}};n[2]!==void 0&&(x.sort=n[2]),_=new Wt({props:x}),se.push(()=>_e(_,"sort",K));let U=n[4];const G=J=>J[24].id;for(let J=0;J<U.length;J+=1){let fe=Zm(n,U,J),Z=G(fe);C.set(Z,M[J]=xm(Z,fe))}let ne=null;return U.length||(ne=Gm(n)),{c(){e=b("table"),t=b("thead"),i=b("tr"),s=b("th"),l=O(),H(o.$$.fragment),a=O(),H(u.$$.fragment),c=O(),H(d.$$.fragment),h=O(),H(_.$$.fragment),k=O(),y=b("th"),$=O(),T=b("tbody");for(let J=0;J<M.length;J+=1)M[J].c();ne&&ne.c(),p(s,"class","min-width"),p(y,"class","col-type-action min-width"),p(e,"class","table"),Q(e,"table-loading",n[5])},m(J,fe){S(J,e,fe),g(e,t),g(t,i),g(i,s),g(i,l),q(o,i,null),g(i,a),q(u,i,null),g(i,c),q(d,i,null),g(i,h),q(_,i,null),g(i,k),g(i,y),g(e,$),g(e,T);f
<span class="txt">New admin</span>`,m=O(),H(h.$$.fragment),_=O(),v=b("div"),k=O(),H(y.$$.fragment),$=O(),E&&E.c(),T=Ce(),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(v,"class","clearfix m-b-base")},m(I,L){S(I,e,L),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),g(e,r),q(a,e,null),g(e,u),g(e,f),g(e,c),g(e,d),S(I,m,L),q(h,I,L),S(I,_,L),S(I,v,L),S(I,k,L),q(y,I,L),S(I,$,L),E&&E.m(I,L),S(I,T,L),M=!0,C||(D=Y(d,"click",n[9]),C=!0)},p(I,L){(!M||L&64)&&le(o,I[6]);const N={};L&2&&(N.value=I[1]),h.$set(N);const F={};L&134217918&&(F.$$scope={dirty:L,ctx:I}),y.$set(F),I[4].length?E?E.p(I,L):(E=eh(I),E.c(),E.m(T.parentNode,T)):E&&(E.d(1),E=null)},i(I){M||(A(a.$$.fragment,I),A(h.$$.fragment,I),A(y.$$.fragment,I),M=!0)},o(I){P(a.$$.fragment,I),P(h.$$.fragment,I),P(y.$$.fragment,I),M=!1},d(I){I&&w(e),j(a),I&&w(m),j(h,I),I&&w(_),I&&w(v),I&&w(k),j(y,I),I&&w($),E&&E.d(I),I&&w(T),C=!1,D()}}}function FO(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[NO]},$$scope:{ctx:n}}});let r={};return l=new MO({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment),s=O(),H(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(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){j(e,a),a&&w(t),j(i,a),a&&w(s),n[18](null),j(l,a)}}}function RO(n,e,t){let i,s,l;Ye(n,_a,N=>t(21,i=N)),Ye(n,$t,N=>t(6,s=N)),Ye(n,Oa,N=>t(7,l=N)),Kt($t,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=[]),me.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),m(),me.errorResponseHandler(N,!1))})}function m(){t(4,a=[])}const h=()=>d(),_=()=>r==null?void 0:r.show(),v=N=>t(1,f=N.detail);function k(N){c=N,t(2,c)}function y(N){c=N,t(2,c)}function $(N){c=N,t(2,c)}function T(N){c=N,t(2,c)}const M=N=>r==null?void 0:r.show(N),C=(N,F)=>{(F.code==="Enter"||F.code==="Space")&&(F.preventDefault(),r==null||r.show(N))},D=()=>t(1,f="");function E(N){se[N?"unshift":"push"](()=>{r=N,t(3,r)})}const I=()=>d(),L=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const N=new URLSearchParams({filter:f,sort:c}).toString();Di("/settings/admins?"+N),d()}},[d,f,c,r,a,u,s,l,h,_,v,k,y,$,T,M,C,D,E,I,L]}class qO extends be{constructor(e){super(),ge(this,e,RO,FO,he,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function jO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Email"),s=O(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0]),l.focus(),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&1&&l.value!==u[0]&&re(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function HO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=z("Password"),s=O(),l=b("input"),r=O(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(l,"type","password"),p(l,"id",o=n[8]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),re(l,n[1]),S(d,r,m),S(d,a,m),g(a,u),f||(c=[Y(l,"input",n[5]),Ie(xt.call(null,u))],f=!0)},p(d,m){m&256&&i!==(i=d[8])&&p(e,"for",i),m&256&&o!==(o=d[8])&&p(l,"id",o),m&2&&l.value!==d[1]&&re(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),f=!1,Pe(c)}}}function VO(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new pe({props:{class:"form-field required",name:"identity",$$slots:{default:[jO,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:
<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"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){S(d,e,m),g(e,t),g(e,i),q(s,e,null),g(e,l),q(o,e,null),g(e,r),g(e,a),u=!0,f||(c=Y(e,"submit",ft(n[3])),f=!0)},p(d,m){const h={};m&769&&(h.$$scope={dirty:m,ctx:d}),s.$set(h);const _={};m&770&&(_.$$scope={dirty:m,ctx:d}),o.$set(_),(!u||m&4)&&Q(a,"btn-disabled",d[2]),(!u||m&4)&&Q(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&&w(e),j(s),j(o),f=!1,c()}}}function zO(n){let e,t;return e=new Eg({props:{$$slots:{default:[VO]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(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){j(e,i)}}}function BO(n,e,t){let i;Ye(n,_a,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),me.admins.authWithPassword(l,o).then(()=>{Ma(),Di("/")}).catch(()=>{dl("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 UO extends be{constructor(e){super(),ge(this,e,BO,zO,he,{})}}function WO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M;i=new pe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[KO,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[JO,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[ZO,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[GO,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}});let C=n[3]&&th(n);return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=O(),l=b("div"),H(o.$$.fragment),r=O(),H(a.$$.fragment),u=O(),H(f.$$.fragment),c=O(),d=b("div"),m=b("div"),h=O(),C&&C.c(),_=O(),v=b("button"),k=b("span"),k.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(m,"class","flex-fill"),p(k,"class","txt"),p(v,"type","submit"),p(v,"class","btn btn-expanded"),v.disabled=y=!n[3]||n[2],Q(v,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(D,E){S(D,e,E),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),q(a,e,null),g(e,u),q(f,e,null),g(e,c),g(e,d),g(d,m),g(d,h),C&&C.m(d,null),g(d,_),g(d,v),g(v,k),$=!0,T||(M=Y(v,"click",n[13]),T=!0)},p(D,E){const I={};E&1572865&&(I.$$scope={dirty:E,ctx:D}),i.$set(I);const L={};E&1572865&&(L.$$scope={dirty:E,ctx:D}),o.$set(L);const N={};E&1572865&&(N.$$scope={dirty:E,ctx:D}),a.$set(N);const F={};E&1572865&&(F.$$scope={dirty:E,ctx:D}),f.$set(F),D[3]?C?C.p(D,E):(C=th(D),C.c(),C.m(d,_)):C&&(C.d(1),C=null),(!$||E&12&&y!==(y=!D[3]||D[2]))&&(v.disabled=y),(!$||E&4)&&Q(v,"btn-loading",D[2])},i(D){$||(A(i.$$.fragment,D),A(o.$$.fragment,D),A(a.$$.fragment,D),A(f.$$.fragment,D),$=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(a.$$.fragment,D),P(f.$$.fragment,D),$=!1},d(D){D&&w(e),j(i),j(o),j(a),j(f),C&&C.d(),T=!1,M()}}}function YO(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function KO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Application name"),s=O(),l=b("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].meta.appName),r||(a=Y(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appName&&re(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function JO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Application url"),s=O(),l=b("inpu
<div class="breadcrumb-item">Application</div></nav>`,t=O(),i=b("div"),s=b("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(m,h){S(m,e,h),S(m,t,h),S(m,i,h),g(i,s),c[l].m(s,null),r=!0,a||(u=Y(s,"submit",ft(n[4])),a=!0)},p(m,h){let _=l;l=d(m),l===_?c[l].p(m,h):(ae(),P(c[_],1,1,()=>{c[_]=null}),ue(),o=c[l],o?o.p(m,h):(o=c[l]=f[l](m),o.c()),A(o,1),o.m(s,null))},i(m){r||(A(o),r=!0)},o(m){P(o),r=!1},d(m){m&&w(e),m&&w(t),m&&w(i),c[l].d(),a=!1,u()}}}function QO(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[XO]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function xO(n,e,t){let i,s,l,o;Ye(n,Cs,C=>t(14,s=C)),Ye(n,ko,C=>t(15,l=C)),Ye(n,$t,C=>t(16,o=C)),Kt($t,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const C=await me.settings.getAll()||{};h(C)}catch(C){me.errorResponseHandler(C)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const C=await me.settings.update(V.filterRedactedProps(a));h(C),jt("Successfully saved application settings.")}catch(C){me.errorResponseHandler(C)}t(2,f=!1)}}function h(C={}){var D,E;Kt(ko,l=(D=C==null?void 0:C.meta)==null?void 0:D.appName,l),Kt(Cs,s=!!((E=C==null?void 0:C.meta)!=null&&E.hideControls),s),t(0,a={meta:(C==null?void 0:C.meta)||{},logs:(C==null?void 0:C.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function v(){a.meta.appName=this.value,t(0,a)}function k(){a.meta.appUrl=this.value,t(0,a)}function y(){a.logs.maxDays=pt(this.value),t(0,a)}function $(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>_(),M=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,m,_,r,c,v,k,y,$,T,M]}class eE extends be{constructor(e){super(),ge(this,e,xO,QO,he,{})}}function tE(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=Je(l,s[o]);return{c(){e=b("input"),Xn(e,l)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[7](e),re(e,n[0]),t||(i=Y(e,"input",n[8]),t=!0)},p(o,r){Xn(e,l=on(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&re(e,o[0])},d(o){o&&w(e),n[7](null),t=!1,i()}}}function nE(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=Je(a,r[u]);return{c(){e=b("div"),t=b("button"),t.innerHTML='<i class="ri-key-line"></i>',i=O(),s=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),Xn(s,a)},m(u,f){S(u,e,f),g(e,t),S(u,i,f),S(u,s,f),s.autofocus&&s.focus(),l||(o=[Ie(Be.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",n[6])],l=!0)},p(u,f){Xn(s,a=on(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&w(e),u&&w(i),u&&w(s),l=!1,Pe(o)}}}function iE(n){let e;function t(l,o){return l[3]?nE:tE}let i=t(n),s=i(n);return{c(){s.c(),e=Ce()},m(l,o){s.m(l,o),S(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:X,o:X,d(l){s.d(l),l&&w(e)}}}function sE(n,e,t){const i=["value","mask"];let s=At(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await sn(),r==null||r.focus()}const f=()=>u();function c(m){se[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=m=>{e=Je(Je({},e),Qn(m)),t(5,s=At(e,i)),"value"in m&&t(0,l=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,c,d]}class ou extends be{constructor(e){super(),ge(this,e,sE,iE,he,{value:0,mask:1})}}function lE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;return{c(){e=b("label"),t=z("Subject"),s=O(),l=b("input"),r=O(),a=b("div"),u=z(`Available placeholder paramete
`),f=b("button"),f.textContent=`{APP_NAME}
2023-03-05 22:15:58 +08:00
`,c=z(`,
`),d=b("button"),d.textContent=`{APP_URL}
2023-03-06 21:30:35 +08:00
`,m=z("."),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,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(v,k){S(v,e,k),g(e,t),S(v,s,k),S(v,l,k),re(l,n[0].subject),S(v,r,k),S(v,a,k),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),h||(_=[Y(l,"input",n[13]),Y(f,"click",n[14]),Y(d,"click",n[15])],h=!0)},p(v,k){k[1]&1&&i!==(i=v[31])&&p(e,"for",i),k[1]&1&&o!==(o=v[31])&&p(l,"id",o),k[0]&1&&l.value!==v[0].subject&&re(l,v[0].subject)},d(v){v&&w(e),v&&w(s),v&&w(l),v&&w(r),v&&w(a),h=!1,Pe(_)}}}function oE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k;return{c(){e=b("label"),t=z("Action URL"),s=O(),l=b("input"),r=O(),a=b("div"),u=z(`Available placeholder parameters:
`),f=b("button"),f.textContent=`{APP_NAME}
2023-03-05 22:15:58 +08:00
`,c=z(`,
`),d=b("button"),d.textContent=`{APP_URL}
2023-03-05 22:15:58 +08:00
`,m=z(`,
`),h=b("button"),h.textContent=`{TOKEN}
2023-03-06 21:30:35 +08:00
`,_=z("."),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,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(h,"title","Required parameter"),p(a,"class","help-block")},m(y,$){S(y,e,$),g(e,t),S(y,s,$),S(y,l,$),re(l,n[0].actionUrl),S(y,r,$),S(y,a,$),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),g(a,h),g(a,_),v||(k=[Y(l,"input",n[16]),Y(f,"click",n[17]),Y(d,"click",n[18]),Y(h,"click",n[19])],v=!0)},p(y,$){$[1]&1&&i!==(i=y[31])&&p(e,"for",i),$[1]&1&&o!==(o=y[31])&&p(l,"id",o),$[0]&1&&l.value!==y[0].actionUrl&&re(l,y[0].actionUrl)},d(y){y&&w(e),y&&w(s),y&&w(l),y&&w(r),y&&w(a),v=!1,Pe(k)}}}function rE(n){let e,t,i,s;return{c(){e=b("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){S(l,e,o),re(e,n[0].body),i||(s=Y(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&re(e,l[0].body)},i:X,o:X,d(l){l&&w(e),i=!1,s()}}}function aE(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=Ht(o,r(n)),se.push(()=>_e(e,"value",l))),{c(){e&&H(e.$$.fragment),i=Ce()},m(a,u){e&&q(e,a,u),S(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,ke(()=>t=!1)),o!==(o=a[4])){if(e){ae();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ue()}o?(e=Ht(o,r(a)),se.push(()=>_e(e,"value",l)),H(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function uE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T;const M=[aE,rE],C=[];function D(E,I){return E[4]&&!E[5]?0:1}return l=D(n),o=C[l]=M[l](n),{c(){e=b("label"),t=z("Body (HTML)"),s=O(),o.c(),r=O(),a=b("div"),u=z(`Available placeholder parameters:
`),f=b("button"),f.textContent=`{APP_NAME}
2023-03-05 22:15:58 +08:00
`,c=z(`,
`),d=b("button"),d.textContent=`{APP_URL}
2023-03-05 22:15:58 +08:00
`,m=z(`,
`),h=b("button"),h.textContent=`{TOKEN}
2023-03-05 22:15:58 +08:00
`,_=z(`,
`),v=b("button"),v.textContent=`{ACTION_URL}
2023-03-06 21:30:35 +08:00
`,k=z("."),p(e,"for",i=n[31]),p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(v,"type","button"),p(v,"class","label label-sm link-primary txt-mono"),p(v,"title","Required parameter"),p(a,"class","help-block")},m(E,I){S(E,e,I),g(e,t),S(E,s,I),C[l].m(E,I),S(E,r,I),S(E,a,I),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),g(a,h),g(a,_),g(a,v),g(a,k),y=!0,$||(T=[Y(f,"click",n[22]),Y(d,"click",n[23]),Y(h,"click",n[24]),Y(v,"click",n[25])],$=!0)},p(E,I){(!y||I[1]&1&&i!==(i=E[31]))&&p(e,"for",i);let L=l;l=D(E),l===L?C[l].p(E,I):(ae(),P(C[L],1,1,()=>{C[L]=null}),ue(),o=C[l],o?o.p(E,I):(o=C[l]=M[l](E),o.c()),A(o,1),o.m(r.parentNode,r))},i(E){y||(A(o),y=!0)},o(E){P(o),y=!1},d(E){E&&w(e),E&&w(s),C[l].d(E),E&&w(r),E&&w(a),$=!1,Pe(T)}}}function fE(n){let e,t,i,s,l,o;return e=new pe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[lE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[oE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[uE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment),s=O(),H(l.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),S(r,s,a),q(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){j(e,r),r&&w(t),j(i,r),r&&w(s),j(l,r)}}}function nh(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function cE(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&nh();return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),l=z(n[2]),o=O(),r=b("div"),a=O(),f&&f.c(),u=Ce(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),g(s,l),S(c,o,d),S(c,r,d),S(c,a,d),f&&f.m(c,d),S(c,u,d)},p(c,d){d[0]&4&&le(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=nh(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(ae(),P(f,1,1,()=>{f=null}),ue())},d(c){c&&w(e),c&&w(o),c&&w(r),c&&w(a),f&&f.d(c),c&&w(u)}}}function dE(n){let e,t;const i=[n[8]];let s={$$slots:{header:[cE],default:[fE]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Je(s,i[l]);return e=new ks({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){H(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){const r=o[0]&256?on(i,[xn(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),j(e,l)}}}let ih;function pE(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=At(e,s),o;Ye(n,fi,J=>t(12,o=J));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=ih,d=!1;function m(){f==null||f.expand()}function h(){f==null||f.collapse()}function _(){f==null||f.collapseSiblings()}async function v(){c||d||(t(5,d=!0),t(4,c=(await rt(()=>import("./CodeEditor-dca4f6f5.js"),["./CodeEditor-dca4f6f5.js","./index-a6ccb683.js"],import.meta.url)).default),ih=c,t(5,d=!1))}function k(J){V.copyToClipboard(J),Dg(`Copied ${J} to clipboard`,2e3)}v();function y(){u.subject=this.value,t(0,u)}const $=()=>k("{APP_NAME}"),T=()=>k("{APP_URL}");function M(){u.actionUrl=t
<span class="txt">Send test email</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[26]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function LE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),s=b("button"),l=b("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],Q(s,"btn-loading",n[3])},m(u,f){S(u,e,f),g(e,t),S(u,i,f),S(u,s,f),g(s,l),r||(a=[Y(e,"click",n[24]),Y(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&Q(s,"btn-loading",u[3])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Pe(a)}}}function NE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[SE,wE],y=[];function $(T,M){return T[2]?0:1}return d=$(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=z(n[5]),r=O(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=O(),m.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(T,M){S(T,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(T,r,M),S(T,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",ft(n[27])),_=!0)},p(T,M){(!h||M[0]&32)&&le(o,T[5]);let C=d;d=$(T),d===C?y[d].p(T,M):(ae(),P(y[C],1,1,()=>{y[C]=null}),ue(),m=y[d],m?m.p(T,M):(m=y[d]=k[d](T),m.c()),A(m,1),m.m(u,null))},i(T){h||(A(m),h=!0)},o(T){P(m),h=!1},d(T){T&&w(e),T&&w(r),T&&w(a),y[d].d(),_=!1,v()}}}function FE(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[NE]},$$scope:{ctx:n}}});let r={};return l=new kE({props:r}),n[28](l),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment),s=O(),H(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(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){j(e,a),a&&w(t),j(i,a),a&&w(s),n[28](null),j(l,a)}}}function RE(n,e,t){let i,s,l;Ye(n,$t,ne=>t(5,l=ne));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Kt($t,l="Mail settings",l);let a,u={},f={},c=!1,d=!1;m();async function m(){t(2,c=!0);try{const ne=await me.settings.getAll()||{};_(ne)}catch(ne){me.errorResponseHandler(ne)}t(2,c=!1)}async function h(){if(!(d||!s)){t(3,d=!0);try{const ne=await me.settings.update(V.filterRedactedProps(f));_(ne),In({}),jt("Successfully saved mail settings.")}catch(ne){me.errorResponseHandler(ne)}t(3,d=!1)}}function _(ne={}){t(0,f={meta:(ne==null?void 0:ne.meta)||{},smtp:(ne==null?void 0:ne.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function v(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function k(){f.meta.senderName=this.value,t(0,f)}function y(){f.meta.senderAddress=this.value,t(0,f)}function $(ne){n.$$.not_equal(f.meta.verificationTemplate,ne)&&(f.meta.verificationTemplate=ne,t(0,f))}function T(ne){n.$$.not_equal(f.meta.resetPasswordTemplate,ne)&&(f.meta.resetPasswordTemplate=ne,t(0,f))}function M(ne){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ne)&&(f.meta.confirmEmailChangeTemplate=ne,t(0,f))}function C(){f.smtp.enabled=this.checked,t(0,f)}function D(){f.smtp.host=this.value,t(0,f)}function E(){f.smtp.port=pt(this.value),t(0,f)}function I(ne){n.$$.not_equal(f.smtp.tls,ne)&&(f.smtp.tls=ne,t(0,f))}function L(ne){n.$$.not_equal(f.smtp.authMethod,ne)&&(f.smtp.authMethod=ne,t(0,f))}function N(){f.smtp.username=this.value,t(0,f)}function F(ne){n.$$.not_equal(f.smtp.password,ne)&&(f.smtp.password=ne,t(0,f))}const R=()=>v(),K=()=>h(),x=()=>a==null?v
2023-02-22 04:24:49 +08:00
the
2023-03-05 22:15:58 +08:00
`),r=b("strong"),u=z(a),f=z(`
2023-02-22 04:24:49 +08:00
to the
2023-03-05 22:15:58 +08:00
`),c=b("strong"),m=z(d),h=z(`.
`),_=b("br"),v=z(`
2023-02-22 04:24:49 +08:00
There are numerous command line tools that can help you, such as:
`),k=b("a"),k.textContent=`rclone
2023-03-05 22:15:58 +08:00
`,y=z(`,
2023-03-02 05:29:45 +08:00
`),$=b("a"),$.textContent=`s5cmd
2023-03-06 21:30:35 +08:00
`,T=z(", etc."),M=O(),C=b("div"),p(i,"class","icon"),p(k,"href","https://github.com/rclone/rclone"),p(k,"target","_blank"),p(k,"rel","noopener noreferrer"),p(k,"class","txt-bold"),p($,"href","https://github.com/peak/s5cmd"),p($,"target","_blank"),p($,"rel","noopener noreferrer"),p($,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(C,"class","clearfix m-t-base")},m(L,N){S(L,e,N),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),g(l,r),g(r,u),g(l,f),g(l,c),g(c,m),g(l,h),g(l,_),g(l,v),g(l,k),g(l,y),g(l,$),g(l,T),g(e,M),g(e,C),E=!0},p(L,N){var F;(!E||N&1)&&a!==(a=(F=L[0].s3)!=null&&F.enabled?"S3 storage":"local file system")&&le(u,a),(!E||N&2)&&d!==(d=L[1].s3.enabled?"S3 storage":"local file system")&&le(m,d)},i(L){E||(L&&Ge(()=>{D||(D=qe(e,St,{duration:150},!0)),D.run(1)}),E=!0)},o(L){L&&(D||(D=qe(e,St,{duration:150},!1)),D.run(0)),E=!1},d(L){L&&w(e),L&&D&&D.end()}}}function uh(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C;return i=new pe({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[zE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[BE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field required",name:"s3.region",$$slots:{default:[UE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),d=new pe({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[WE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[YE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),y=new pe({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[KE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=O(),l=b("div"),H(o.$$.fragment),r=O(),a=b("div"),H(u.$$.fragment),f=O(),c=b("div"),H(d.$$.fragment),m=O(),h=b("div"),H(_.$$.fragment),v=O(),k=b("div"),H(y.$$.fragment),$=O(),T=b("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(k,"class","col-lg-12"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(D,E){S(D,e,E),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),q(u,a,null),g(e,f),g(e,c),q(d,c,null),g(e,m),g(e,h),q(_,h,null),g(e,v),g(e,k),q(y,k,null),g(e,$),g(e,T),C=!0},p(D,E){const I={};E&100663298&&(I.$$scope={dirty:E,ctx:D}),i.$set(I);const L={};E&100663298&&(L.$$scope={dirty:E,ctx:D}),o.$set(L);const N={};E&100663298&&(N.$$scope={dirty:E,ctx:D}),u.$set(N);const F={};E&100663298&&(F.$$scope={dirty:E,ctx:D}),d.$set(F);const R={};E&100663298&&(R.$$scope={dirty:E,ctx:D}),_.$set(R);const K={};E&100663298&&(K.$$scope={dirty:E,ctx:D}),y.$set(K)},i(D){C||(A(i.$$.fragment,D),A(o.$$.fragment,D),A(u.$$.fragment,D),A(d.$$.fragment,D),A(_.$$.fragment,D),A(y.$$.fragment,D),D&&Ge(()=>{M||(M=qe(e,St,{duration:150},!0)),M.run(1)}),C=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(u.$$.fragment,D),P(d.$$.fragment,D),P(_.$$.fragment,D),P(y.$$.fragment,D),D&&(M||(M=qe(e,St,{duration:150},!1)),M.run(0)),C=!1},d(D){D&&w(e),j(i),j(o),j(u),j(d),j(_),j(y),D&&M&&M.end()}}}function zE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Endpoint"),s=O(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[1].s3.endpoint),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&re(l,u[1].s3.endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function BE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Bucket"),s=O(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[1].s3.bucket),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"
<span class="txt">S3 connected successfully</span>`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function ZE(n){let e,t,i,s;return{c(){e=b("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=Ie(t=Be.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Bt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&w(e),i=!1,s()}}}function GE(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function ch(n){let e,t,i,s;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),g(e,t),i||(s=Y(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function XE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[HE,jE],y=[];function $(T,M){return T[2]?0:1}return d=$(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=z(n[7]),r=O(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,c=O(),m.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(T,M){S(T,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(T,r,M),S(T,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",ft(n[20])),_=!0)},p(T,M){(!h||M&128)&&le(o,T[7]);let C=d;d=$(T),d===C?y[d].p(T,M):(ae(),P(y[C],1,1,()=>{y[C]=null}),ue(),m=y[d],m?m.p(T,M):(m=y[d]=k[d](T),m.c()),A(m,1),m.m(u,null))},i(T){h||(A(m),h=!0)},o(T){P(m),h=!1},d(T){T&&w(e),T&&w(r),T&&w(a),y[d].d(),_=!1,v()}}}function QE(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[XE]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(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){j(e,l),l&&w(t),j(i,l)}}}const lo="s3_test_request";function xE(n,e,t){let i,s,l;Ye(n,$t,F=>t(7,l=F)),Kt($t,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null,d=null;m();async function m(){t(2,a=!0);try{const F=await me.settings.getAll()||{};_(F)}catch(F){me.errorResponseHandler(F)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{me.cancelRequest(lo);const F=await me.settings.update(V.filterRedactedProps(r));In({}),await _(F),Ma(),c?Pv("Successfully saved but failed to establish S3 connection."):jt("Successfully saved files storage settings.")}catch(F){me.errorResponseHandler(F)}t(3,u=!1)}}async function _(F={}){t(1,r={s3:(F==null?void 0:F.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await k()}async function v(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await k()}async function k(){if(t(5,c=null),!!r.s3.enabled){me.cancelRequest(lo),clearTimeout(d),d=setTimeout(()=>{me.cancelRequest(lo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await me.settings.testS3({$cancelKey:lo})}catch(F){t(5,c=F)}t(4,f=!1),clearTimeout(d)}}Zt(()=>()=>{clearTimeout(d)});function y(){r.s3.enabled=this.checked,t(1,r)}function $(){r.s3.endpoint=this.value,t(1,r)}function T(){r.s3.bucket=this.value,t(1,r)}function M(){r.s3.region=this.value,t(1,r)}function C(){r.s3.accessKey=this.value,t(1,r)}function D(F){n.$$.not_equal(r.s3.secret,F)&&(r.s3.secret=F,t(1,r))}function E(){r.s3.forcePathStyle=this.checked,t(1,r)}const I=()=>v(),L=()=>h(),N=()=>h();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,h,v,i,y,$,T,M,C,D,E,I,L,N]}class eA extends be{constructor(e){super(),ge(this,e,xE,QE,he,{})}}function tA(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=z("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[21]),p(s,"for",o=n[21])},m(u,f){S(u,e,f),e.checked=n[0].enabled,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[13]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&2097152&&o!==(o=u[21])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function nA(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=z("Client ID"),s=O(),l=b("input"),p(e,"for",i=n[21]),p(l,"type","text"),p(l,"id",o=n[21]),l.required=r=n[0].enabled},m(f,c){S(f,e,c),g(e,t),S(f,s,c),S(f,l,c),re(l,n[0].clientId),a||(u=Y(l,"input",n[14]),a=!0)},p(f,c){c&2097152&&i!==(i=f[21])&&p(e,"for",i),c&2097152&&o!==(o=f[21])&&p(l,"id",o),c&1&&r!==(r=f[0].enabled)&&(l.required=r),c&1&&l.value!==f[0].clientId&&re(l,f[0].clientId)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function iA(n){let e,t,i,s,l,o,r;function a(f){n[15](f)}let u={id:n[21],required:n[0].enabled};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new ou({props:u}),se.push(()=>_e(l,"value",a)),{c(){e=b("label"),t=z("Client secret"),s=O(),H(l.$$.fragment),p(e,"for",i=n[21])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&2097152&&i!==(i=f[21]))&&p(e,"for"
2023-03-05 22:15:58 +08:00
another PocketBase environment.</p>`,t=O(),i=b("div"),s=b("button"),s.innerHTML='<span class="txt">Copy</span>',l=O(),H(o.$$.fragment),r=O(),a=b("div"),u=b("div"),f=O(),c=b("button"),c.innerHTML=`<i class="ri-download-line"></i>
2023-03-06 21:30:35 +08:00
<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-transparent 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){S(_,e,v),S(_,t,v),S(_,i,v),g(i,s),g(i,l),q(o,i,null),n[8](i),S(_,r,v),S(_,a,v),g(a,u),g(a,f),g(a,c),d=!0,m||(h=[Y(s,"click",n[7]),Y(i,"keydown",n[9]),Y(c,"click",n[10])],m=!0)},p(_,v){const k={};v&4&&(k.content=_[2]),o.$set(k)},i(_){d||(A(o.$$.fragment,_),d=!0)},o(_){P(o.$$.fragment,_),d=!1},d(_){_&&w(e),_&&w(t),_&&w(i),j(o),n[8](null),_&&w(r),_&&w(a),m=!1,Pe(h)}}}function TA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function CA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[TA,$A],h=[];function _(v,k){return v[1]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=z(n[3]),r=O(),a=b("div"),u=b("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(v,k){S(v,e,k),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(v,r,k),S(v,a,k),g(a,u),h[f].m(u,null),d=!0},p(v,k){(!d||k&8)&&le(o,v[3]);let y=f;f=_(v),f===y?h[f].p(v,k):(ae(),P(h[y],1,1,()=>{h[y]=null}),ue(),c=h[f],c?c.p(v,k):(c=h[f]=m[f](v),c.c()),A(c,1),c.m(u,null))},i(v){d||(A(c),d=!0)},o(v){P(c),d=!1},d(v){v&&w(e),v&&w(r),v&&w(a),h[f].d()}}}function MA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[CA]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(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){j(e,l),l&&w(t),j(i,l)}}}function DA(n,e,t){let i,s;Ye(n,$t,v=>t(3,s=v)),Kt($t,s="Export collections",s);const l="export_"+V.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await me.collections.getFullList(100,{$cancelKey:l}));for(let v of r)delete v.created,delete v.updated}catch(v){me.errorResponseHandler(v)}t(1,a=!1)}function f(){V.downloadJson(r,"pb_schema")}function c(){V.copyToClipboard(i),Dg("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(v){se[v?"unshift":"push"](()=>{o=v,t(0,o)})}const h=v=>{if(v.ctrlKey&&v.code==="KeyA"){v.preventDefault();const k=window.getSelection(),y=document.createRange();y.selectNodeContents(o),k.removeAllRanges(),k.addRange(y)}},_=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,m,h,_]}class OA extends be{constructor(e){super(),ge(this,e,DA,MA,he,{})}}function Sh(n,e,t){const i=n.slice();return i[14]=e[t],i}function $h(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Th(n,e,t){const i=n.slice();return i[14]=e[t],i}function Ch(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Mh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Dh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Oh(n,e,t){const i=n.slice();return i[30]=e[t],i}function EA(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Eh(),a=n[0].name!==n[1].name&&Ah(n);return{c(){e=b("div"),r&&r.c(),t=O(),a&&a.c(),i=O(),s=b("strong"),o=z(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){S(u,e,f),r&&r.m(e,null),g(e,t),a&&a.m(e,null),g(e,i),g(e,s),g(s,o)},p(u,f){u[9]?r||(r=Eh(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Ah(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&le(o,l)},d(u){u&&w(e),r&&r.d(),a&&a.d()}}}function AA(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=b("span"),e.textContent="Deleted",t=O(),i=b("strong"),l=z(s),p(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),g(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?voi
2023-02-22 04:24:49 +08:00
<th width="10%" class="svelte-lmkr38">Old</th>
2023-03-06 21:30:35 +08:00
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=O(),o=b("tbody");for(let T=0;T<h.length;T+=1)h[T].c();r=O(),_&&_.c(),a=O();for(let T=0;T<k.length;T+=1)k[T].c();u=O();for(let T=0;T<$.length;T+=1)$[T].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(T,M){S(T,e,M),d.m(e,null),S(T,t,M),S(T,i,M),g(i,s),g(i,l),g(i,o);for(let C=0;C<h.length;C+=1)h[C].m(o,null);g(o,r),_&&_.m(o,null),g(o,a);for(let C=0;C<k.length;C+=1)k[C].m(o,null);g(o,u);for(let C=0;C<$.length;C+=1)$[C].m(o,null)},p(T,M){if(c===(c=f(T))&&d?d.p(T,M):(d.d(1),d=c(T),d&&(d.c(),d.m(e,null))),M[0]&7203){m=T[11];let C;for(C=0;C<m.length;C+=1){const D=Oh(T,m,C);h[C]?h[C].p(D,M):(h[C]=Ih(D),h[C].c(),h[C].m(o,r))}for(;C<h.length;C+=1)h[C].d(1);h.length=m.length}if(T[2]||T[5]?_?_.p(T,M):(_=Ph(T),_.c(),_.m(o,a)):_&&(_.d(1),_=null),M[0]&4248){v=T[7];let C;for(C=0;C<v.length;C+=1){const D=Th(T,v,C);k[C]?k[C].p(D,M):(k[C]=qh(D),k[C].c(),k[C].m(o,u))}for(;C<k.length;C+=1)k[C].d(1);k.length=v.length}if(M[0]&4352){y=T[8];let C;for(C=0;C<y.length;C+=1){const D=Sh(T,y,C);$[C]?$[C].p(D,M):($[C]=Hh(D),$[C].c(),$[C].m(o,null))}for(;C<$.length;C+=1)$[C].d(1);$.length=y.length}},i:X,o:X,d(T){T&&w(e),d.d(),T&&w(t),T&&w(i),ht(h,T),_&&_.d(),ht(k,T),ht($,T)}}}function Dn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function un(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function LA(n,e,t){let i,s,l,{collectionA:o=new pn}=e,{collectionB:r=new pn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],m=[];const h=Object.keys(new pn().export()).filter(k=>!["schema","created","updated"].includes(k));function _(){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(k=>!f.find(y=>k.id==y.id))))}function v(k){return typeof k>"u"?"":V.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,o=k.collectionA),"collectionB"in k&&t(1,r=k.collectionB),"deleteMissing"in k&&t(2,a=k.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")&&_(),n.$$.dirty[0]&24&&t(6,c=u.filter(k=>!f.find(y=>k.id==y.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(k=>u.find(y=>y.id==k.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(k=>!u.find(y=>y.id==k.id))),n.$$.dirty[0]&7&&t(9,l=V.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,m,l,s,h,v]}class NA extends be{constructor(e){super(),ge(this,e,LA,PA,he,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Vh(n,e,t){const i=n.slice();return i[17]=e[t],i}function zh(n){let e,t;return e=new NA({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){H(e.$$.fragment)},m(i,s){q(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){j(e,i)}}}function FA(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=zh(Vh(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=Ce()},m(o,r){for(let a=0;a<s.length;a+=1)s[a].m(o,r);S(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=Vh(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=zh(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(ae(),a=i.length;a<s.length;a+=1)l(a);ue()}},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){ht(s,o),o&&w(e)}}}function RA(n){let e;return{c(){e=b("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function qA(n){let e,t,i,s,l,o,r;return{c(){e=b("button"),t=z("Close"),i=O(),s=b("button"),l=b("span"),l.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n
2023-03-02 05:29:45 +08:00
- ${T.join(`
2023-03-06 21:30:35 +08:00
- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await me.collections.import(o,a),jt("Successfully imported collections configuration."),i("submit")}catch(T){me.errorResponseHandler(T)}t(4,u=!1),c()}}const _=()=>m(),v=()=>!u;function k(T){se[T?"unshift":"push"](()=>{s=T,t(1,s)})}function y(T){Ve.call(this,n,T)}function $(T){Ve.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,m,f,l,o,_,v,k,y,$]}class VA extends be{constructor(e){super(),ge(this,e,HA,jA,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function Bh(n,e,t){const i=n.slice();return i[32]=e[t],i}function Uh(n,e,t){const i=n.slice();return i[35]=e[t],i}function Wh(n,e,t){const i=n.slice();return i[32]=e[t],i}function zA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,D;a=new pe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[UA,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let E=!1,I=n[6]&&n[1].length&&!n[7]&&Kh(),L=n[6]&&n[1].length&&n[7]&&Jh(n),N=n[13].length&&l_(n),F=!!n[0]&&o_(n);return{c(){e=b("input"),t=O(),i=b("div"),s=b("p"),l=z(`Paste below the collections configuration you want to import or
`),o=b("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=O(),H(a.$$.fragment),u=O(),f=O(),I&&I.c(),c=O(),L&&L.c(),d=O(),N&&N.c(),m=O(),h=b("div"),F&&F.c(),_=O(),v=b("div"),k=O(),y=b("button"),$=b("span"),$.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"),Q(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(v,"class","flex-fill"),p($,"class","txt"),p(y,"type","button"),p(y,"class","btn btn-expanded btn-warning m-l-auto"),y.disabled=T=!n[14],p(h,"class","flex m-t-base")},m(R,K){S(R,e,K),n[19](e),S(R,t,K),S(R,i,K),g(i,s),g(s,l),g(s,o),S(R,r,K),q(a,R,K),S(R,u,K),S(R,f,K),I&&I.m(R,K),S(R,c,K),L&&L.m(R,K),S(R,d,K),N&&N.m(R,K),S(R,m,K),S(R,h,K),F&&F.m(h,null),g(h,_),g(h,v),g(h,k),g(h,y),g(y,$),M=!0,C||(D=[Y(e,"change",n[20]),Y(o,"click",n[21]),Y(y,"click",n[26])],C=!0)},p(R,K){(!M||K[0]&4096)&&Q(o,"btn-loading",R[12]);const x={};K[0]&64&&(x.class="form-field "+(R[6]?"":"field-error")),K[0]&65|K[1]&1536&&(x.$$scope={dirty:K,ctx:R}),a.$set(x),R[6]&&R[1].length&&!R[7]?I||(I=Kh(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),R[6]&&R[1].length&&R[7]?L?L.p(R,K):(L=Jh(R),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),R[13].length?N?N.p(R,K):(N=l_(R),N.c(),N.m(m.parentNode,m)):N&&(N.d(1),N=null),R[0]?F?F.p(R,K):(F=o_(R),F.c(),F.m(h,_)):F&&(F.d(1),F=null),(!M||K[0]&16384&&T!==(T=!R[14]))&&(y.disabled=T)},i(R){M||(A(a.$$.fragment,R),A(E),M=!0)},o(R){P(a.$$.fragment,R),P(E),M=!1},d(R){R&&w(e),n[19](null),R&&w(t),R&&w(i),R&&w(r),j(a,R),R&&w(u),R&&w(f),I&&I.d(R),R&&w(c),L&&L.d(R),R&&w(d),N&&N.d(R),R&&w(m),R&&w(h),F&&F.d(),C=!1,Pe(D)}}}function BA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function Yh(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function UA(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&Yh();return{c(){e=b("label"),t=z("Collections"),s=O(),l=b("textarea"),r=O(),c&&c.c(),a=Ce(),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,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),re(l,n[0]),S(d,r,m),c&&c.m(d,m),S(d,a,m),u||(f=Y(l,"input",n[22]),u=!0)},p(d,m){m[1]&512&&i!==(i=d[40])&&p(e,"for",i),m[1]&512&&o!==(o=d[40])&&p(l,"id",o),m[0]&1&&re(l,d[0]),d[0]&&!d[6]?c||(c=Yh(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),c&&c.d(d),d&&w(a),u=!1,f()}}}function Kh(n){let e;return{c(){e=b("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){S(t,e,i)},d(t){t&&w(e)}}}function Jh(n){let e,t,i,s,l,o=n[9].length&&Zh(n),r=n[4].length&&Qh(n),a=n[8].length&&n_(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=O(),i=b("div"),o&&o.c(),s=O(),r&&r.c(),l=O(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),o&&o.m(i,null),g(i,s),r&&r.m(i,null),g(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=Zh(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Qh(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=n_(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),u&&w(t),u&&w(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function Zh(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=Wh(n,s,o),a=l(r);t.set(a,e[o]=Xh(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ce()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=wt(e,r,l,1,o,s,t,i.parentNode,es,Xh,i,Wh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function Gh(n){let e,t,i=n[32].id+"",s,l;return{c(){e=b("small"),t=z("("),s=z(i),l=z(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function Xh(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&Gh(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Deleted",s=O(),l=b("strong"),r=z(o),a=O(),f&&f.c(),u=O(),p(i,"class","label label-danger list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){S(c,t,d),g(t,i),g(t,s),g(t,l),g(l,r),g(t,a),f&&f.m(t,null),g(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,d):(f=Gh(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function Qh(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=Uh(n,s,o),a=l(r);t.set(a,e[o]=t_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ce()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=wt(e,r,l,1,o,s,t,i.parentNode,es,t_,i,Uh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function xh(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=b("strong"),i=z(t),s=O(),l=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),g(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&le(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function e_(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=b("small"),t=z("("),s=z(i),l=z(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&le(s,i)},d(o){o&&w(e)}}}function t_(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&&xh(e),m=e[35].new.id&&e_(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Changed",s=O(),l=b("div"),d&&d.c(),o=O(),r=b("strong"),u=z(a),f=O(),m&&m.c(),c=O(),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(h,_){S(h,t,_),g(t,i),g(t,s),g(t,l),d&&d.m(l,null),g(l,o),g(l,r),g(r,u),g(l,f),m&&m.m(l,null),g(t,c)},p(h,_){e=h,e[35].old.name!==e[35].new.name?d?d.p(e,_):(d=xh(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),_[0]&16&&a!==(a=e[35].new.name+"")&&le(u,a),e[35].new.id?m?m.p(e,_):(m=e_(e),m.c(),m.m(l,null)):m&&(m.d(1),m=null)},d(h){h&&w(t),d&&d.d(),m&&m.d()}}}function n_(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=Bh(n,s,o),a=l(r);t.set(a,e[o]=s_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ce()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=wt(e,r,l,1,o,s,t,i.parentNode,es,s_,i,Bh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function i_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=b("small"),t=z("("),s=z(i),l=z(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),g(e,t),g(e,s),g(
2023-02-22 04:24:49 +08:00
imported with different IDs. You can replace them in the import if you want
2023-03-06 21:30:35 +08:00
to.</string>`,l=O(),o=b("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){S(u,e,f),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),r||(a=Y(o,"click",n[24]),r=!0)},p:X,d(u){u&&w(e),r=!1,a()}}}function o_(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[25]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function WA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[BA,zA],h=[];function _(v,k){return v[5]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=z(n[15]),r=O(),a=b("div"),u=b("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(v,k){S(v,e,k),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(v,r,k),S(v,a,k),g(a,u),h[f].m(u,null),d=!0},p(v,k){(!d||k[0]&32768)&&le(o,v[15]);let y=f;f=_(v),f===y?h[f].p(v,k):(ae(),P(h[y],1,1,()=>{h[y]=null}),ue(),c=h[f],c?c.p(v,k):(c=h[f]=m[f](v),c.c()),A(c,1),c.m(u,null))},i(v){d||(A(c),d=!0)},o(v){P(c),d=!1},d(v){v&&w(e),v&&w(r),v&&w(a),h[f].d()}}}function YA(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[WA]},$$scope:{ctx:n}}});let r={};return l=new VA({props:r}),n[27](l),l.$on("submit",n[28]),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment),s=O(),H(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(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){j(e,a),a&&w(t),j(i,a),a&&w(s),n[27](null),j(l,a)}}}function KA(n,e,t){let i,s,l,o,r,a,u;Ye(n,$t,J=>t(15,u=J)),Kt($t,u="Import collections",u);let f,c,d="",m=!1,h=[],_=[],v=!0,k=[],y=!1;$();async function $(){t(5,y=!0);try{t(2,_=await me.collections.getFullList(200));for(let J of _)delete J.created,delete J.updated}catch(J){me.errorResponseHandler(J)}t(5,y=!1)}function T(){if(t(4,k=[]),!!i)for(let J of h){const fe=V.findByKey(_,"id",J.id);!(fe!=null&&fe.id)||!V.hasCollectionChanges(fe,J,v)||k.push({new:J,old:fe})}}function M(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=V.filterDuplicatesByKey(h)):t(1,h=[]);for(let J of h)delete J.created,delete J.updated,J.schema=V.filterDuplicatesByKey(J.schema)}function C(){var J,fe;for(let Z of h){const de=V.findByKey(_,"name",Z.name)||V.findByKey(_,"id",Z.id);if(!de)continue;const ve=Z.id,Te=de.id;Z.id=Te;const Ne=Array.isArray(de.schema)?de.schema:[],Re=Array.isArray(Z.schema)?Z.schema:[];for(const ye of Re){const Se=V.findByKey(Ne,"name",ye.name);Se&&Se.id&&(ye.id=Se.id)}for(let ye of h)if(Array.isArray(ye.schema))for(let Se of ye.schema)(J=Se.options)!=null&&J.collectionId&&((fe=Se.options)==null?void 0:fe.collectionId)===ve&&(Se.options.collectionId=Te)}t(0,d=JSON.stringify(h,null,4))}function D(J){t(12,m=!0);const fe=new FileReader;fe.onload=async Z=>{t(12,m=!1),t(10,f.value="",f),t(0,d=Z.target.result),await sn(),h.length||(dl("Invalid collections configuration."),E())},fe.onerror=Z=>{console.warn(Z),dl("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},fe.readAsText(J)}function E(){t(0,d=""),t(10,f.value="",f),In({})}function I(J){se[J?"unshift":"push"](()=>{f=J,t(10,f)})}const L=()=>{f.files.length&&D(f.files[0])},N=()=>{f.click()};function F(){d=this.value,t(0,d)}function R(){v=this.checked,t(3,v)}const K=()=>C(),x=()=>E(),U=()=>c==null?void 0:c.show(_,h,v);function G(J){se[J?"unshift":"push"](()=>{c=J,t(11,c)})}const ne=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(J=>!!J.id&&!!J.name).length),n.$$.dirty[0]&78&&t(9,s=_.filter(J=>i&&v&&!V.findByKey(h,"id",
2023-03-05 22:15:58 +08:00
<span class="txt">Manage admins</span>`,t=O(),i=b("hr"),s=O(),l=b("button"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
2023-03-06 21:30:35 +08:00
<span class="txt">Logout</span>`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),S(a,s,u),S(a,l,u),o||(r=[Ie(xt.call(null,e)),Y(l,"click",n[6])],o=!0)},p:X,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,Pe(r)}}}function f6(n){var m;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=V.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((m=n[0])==null?void 0:m.id)&&n[1]&&u_(n);return o=new _1({props:{routes:ZA}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new i6({}),f=new a6({}),{c(){t=O(),i=b("div"),d&&d.c(),s=O(),l=b("div"),H(o.$$.fragment),r=O(),H(a.$$.fragment),u=O(),H(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(h,_){S(h,t,_),S(h,i,_),d&&d.m(i,null),g(i,s),g(i,l),q(o,l,null),g(l,r),q(a,l,null),S(h,u,_),q(f,h,_),c=!0},p(h,[_]){var v;(!c||_&12)&&e!==(e=V.joinNonEmpty([h[3],h[2],"PocketBase"]," - "))&&(document.title=e),(v=h[0])!=null&&v.id&&h[1]?d?(d.p(h,_),_&3&&A(d,1)):(d=u_(h),d.c(),A(d,1),d.m(i,s)):d&&(ae(),P(d,1,1,()=>{d=null}),ue())},i(h){c||(A(d),A(o.$$.fragment,h),A(a.$$.fragment,h),A(f.$$.fragment,h),c=!0)},o(h){P(d),P(o.$$.fragment,h),P(a.$$.fragment,h),P(f.$$.fragment,h),c=!1},d(h){h&&w(t),h&&w(i),d&&d.d(),j(o),j(a),h&&w(u),j(f,h)}}}function c6(n,e,t){let i,s,l,o;Ye(n,Cs,m=>t(8,i=m)),Ye(n,ko,m=>t(2,s=m)),Ye(n,Oa,m=>t(0,l=m)),Ye(n,$t,m=>t(3,o=m));let r,a=!1;function u(m){var h,_,v,k;((h=m==null?void 0:m.detail)==null?void 0:h.location)!==r&&(t(1,a=!!((v=(_=m==null?void 0:m.detail)==null?void 0:_.userData)!=null&&v.showAppSidebar)),r=(k=m==null?void 0:m.detail)==null?void 0:k.location,Kt($t,o="",o),In({}),Ib())}function f(){Di("/")}async function c(){var m,h;if(l!=null&&l.id)try{const _=await me.settings.getAll({$cancelKey:"initialAppSettings"});Kt(ko,s=((m=_==null?void 0:_.meta)==null?void 0:m.appName)||"",s),Kt(Cs,i=!!((h=_==null?void 0:_.meta)!=null&&h.hideControls),i)}catch(_){_!=null&&_.isAbort||console.warn("Failed to load app settings.",_)}}function d(){me.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class d6 extends be{constructor(e){super(),ge(this,e,c6,f6,he,{})}}new d6({target:document.getElementById("app")});export{Pe as A,jt as B,V as C,Di as D,Ce as E,Eg as F,ba as G,_u as H,Ye as I,Ai as J,Ct as K,Zt as L,se as M,Ob as N,wt as O,es as P,ln as Q,pn as R,be as S,Lr as T,P as a,O as b,H as c,j as d,b as e,p as f,S as g,g as h,ge as i,Ie as j,ae as k,xt as l,q as m,ue as n,w as o,me as p,pe as q,Q as r,he as s,A as t,Y as u,ft as v,z as w,le as x,X as y,re as z};