pocketbase/ui/dist/assets/index-911f9de6.js

227 lines
968 KiB
JavaScript
Raw Normal View History

2023-06-11 04:32:41 +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 Sl=n=>n;function qe(n,e){for(const t in e)n[t]=e[t];return n}function q1(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Q_(n){return n()}function hu(){return Object.create(null)}function Ee(n){n.forEach(Q_)}function qt(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let ql;function hn(n,e){return ql||(ql=document.createElement("a")),ql.href=e,n===ql.href}function j1(n){return Object.keys(n).length===0}function va(n,...e){if(n==null)return x;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function V1(n){let e;return va(n,t=>e=t)(),e}function Je(n,e,t){n.$$.on_destroy.push(va(e,t))}function yt(n,e,t,i){if(n){const s=x_(n,e,t,i);return n[0](s)}}function x_(n,e,t,i){return n[1]&&i?qe(t.ctx.slice(),n[1](i(e))):t.ctx}function kt(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 wt(n,e,t,i,s,l){if(s){const o=x_(e,t,i,l);n.p(o,s)}}function St(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 Zt(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function xe(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 ls(n){return n??""}function sn(n,e,t){return n.set(t),e}function Me(n){return n&&qt(n.destroy)?n.destroy:x}function _u(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const eg=typeof window<"u";let Ro=eg?()=>window.performance.now():()=>Date.now(),ya=eg?n=>requestAnimationFrame(n):x;const ws=new Set;function tg(n){ws.forEach(e=>{e.c(n)||(ws.delete(e),e.f())}),ws.size!==0&&ya(tg)}function qo(n){let e;return ws.size===0&&ya(tg),{promise:new Promise(t=>{ws.add(e={c:n,f:t})}),abort(){ws.delete(e)}}}function g(n,e){n.appendChild(e)}function ng(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function z1(n){const e=v("style");return H1(ng(n),e),e.sheet}function H1(n,e){return g(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode&&n.parentNode.removeChild(n)}function mt(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function v(n){return document.createElement(n)}function U(n){return document.createTextNode(n)}function E(){return U(" ")}function ye(){return U("")}function K(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function et(n){return function(e){return e.preventDefault(),n.call(this,e)}}function An(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)}const B1=["width","height"];function ri(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&&B1.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function U1(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function dt(n){return n===""?null:+n}function W1(n){return Arr
`;for(let b=0;b<=1;b+=a){const y=e+(t-e)*l(b);u+=b*100+`%{${o(y,1-y)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${Y1(f)}_${r}`,d=ng(n),{stylesheet:m,rules:_}=ho.get(d)||K1(d,n);_[c]||(_[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const h=n.style.animation||"";return n.style.animation=`${h?`${h}, `:""}${c} ${i}ms linear ${s}ms 1 both`,_o+=1,c}function pl(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(", "),_o-=s,_o||J1())}function J1(){ya(()=>{_o||(ho.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&k(e)}),ho.clear())})}function Z1(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=Sl,start:a=Ro()+l,end:u=a+o,tick:f=x,css:c}=t(n,{from:e,to:s},i);let d=!0,m=!1,_;function h(){c&&(_=dl(n,0,1,o,l,r,c)),l||(m=!0)}function b(){c&&pl(n,_),d=!1}return qo(y=>{if(!m&&y>=a&&(m=!0),m&&y>=u&&(f(1,0),b()),!d)return!1;if(m){const S=y-a,C=0+1*r(S/o);f(C,1-C)}return!0}),h(),f(0,1),b}function G1(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,sg(n,s)}}function sg(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 ml;function bi(n){ml=n}function $l(){if(!ml)throw new Error("Function called outside component initialization");return ml}function Gt(n){$l().$$.on_mount.push(n)}function X1(n){$l().$$.after_update.push(n)}function jo(n){$l().$$.on_destroy.push(n)}function $t(){const n=$l();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=ig(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Ne(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const ks=[],ee=[];let Ss=[];const Hr=[],lg=Promise.resolve();let Br=!1;function og(){Br||(Br=!0,lg.then(ka))}function fn(){return og(),lg}function Qe(n){Ss.push(n)}function he(n){Hr.push(n)}const sr=new Set;let hs=0;function ka(){if(hs!==0)return;const n=ml;do{try{for(;hs<ks.length;){const e=ks[hs];hs++,bi(e),Q1(e.$$)}}catch(e){throw ks.length=0,hs=0,e}for(bi(null),ks.length=0,hs=0;ee.length;)ee.pop()();for(let e=0;e<Ss.length;e+=1){const t=Ss[e];sr.has(t)||(sr.add(t),t())}Ss.length=0}while(ks.length);for(;Hr.length;)Hr.pop()();Br=!1,sr.clear(),bi(n)}function Q1(n){if(n.fragment!==null){n.update(),Ee(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Qe)}}function x1(n){const e=[],t=[];Ss.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Ss=e}let Hs;function wa(){return Hs||(Hs=Promise.resolve(),Hs.then(()=>{Hs=null})),Hs}function ts(n,e,t){n.dispatchEvent(ig(`${e?"intro":"outro"}${t}`))}const oo=new Set;let si;function ae(){si={r:0,c:[],p:si}}function ue(){si.r||Ee(si.c),si=si.p}function A(n,e){n&&n.i&&(oo.delete(n),n.i(e))}function I(n,e,t,i){if(n&&n.o){if(oo.has(n))return;oo.add(n),si.c.push(()=>{oo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const Sa={duration:0};function rg(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&pl(n,o)}function f(){const{delay:d=0,duration:m=300,easing:_=Sl,tick:h=x,css:b}=s||Sa;b&&(o=dl(n,0,1,m,d,_,b,a++)),h(0,1);const y=Ro()+d,S=y+m;r&&r.abort(),l=!0,Qe(()=>ts(n,!0,"start")),r=qo(C=>{if(l){if(C>=S)return h(1,0),ts(n,!0,"end"),u(),l=!1;if(C>=y){const $=_((C-y)/m);h($,1-$)}}return l})}let c=!1;return{start(){c||(c=!0,pl(n),qt(s)?(s=s(i),wa().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function $a(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=si;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:c=Sl,tick:d=x,css:m}=s||Sa;m&&(o=dl(n,1,0,f,u,c,m));const _=Ro()+u,h=_+f;Qe(()=>ts(n,!1,"start")),qo(b=>{if(l){if(b>=h)return d(0,1),ts(n,!1,"end"),--r.r||Ee(r.c),!1;if(b>=_){con
`),t+=i.map(s=>{let l="";return s.name.includes("(")||s.name.includes(" ")?l+=s.name:l+="`"+s.name+"`",s.collate&&(l+=" COLLATE "+s.collate),s.sort&&(l+=" "+s.sort.toUpperCase()),l}).join(`,
`),i.length>1&&(t+=`
`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=B.parseIndex(e);return i.tableName=t,B.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=B.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?B.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const s of i)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}}const Wo=In([]);function yo(n,e=4e3){return Yo(n,"info",e)}function zt(n,e=3e3){return Yo(n,"success",e)}function Ds(n,e=4500){return Yo(n,"error",e)}function Oy(n,e=4500){return Yo(n,"warning",e)}function Yo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{hb(i)},t)};Wo.update(s=>(Fa(s,i.message),B.pushOrReplaceByKey(s,i,"message"),s))}function hb(n){Wo.update(e=>(Fa(e,n),e))}function Na(){Wo.update(n=>{for(let e of n)Fa(n,e);return[]})}function Fa(n,e){let t;typeof e=="string"?t=B.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),B.removeByKey(n,"message",t.message))}const $i=In({});function en(n){$i.set(n||{})}function ai(n){$i.update(e=>(B.deleteByPath(e,n),e))}const Ra=In({});function ea(n){Ra.set(n||{})}const ci=In([]),ui=In({}),ko=In(!1),_b=In({});function Ey(n){ci.update(e=>{const t=B.findByKey(e,"id",n);return t?ui.set(t):e.length&&ui.set(e[0]),e})}function Dy(n){ui.update(e=>B.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),ci.update(e=>(B.pushOrReplaceByKey(e,n,"id"),qa(),B.sortCollections(e)))}function Ay(n){ci.update(e=>(B.removeByKey(e,"id",n.id),ui.update(t=>t.id===n.id?e[0]:t),qa(),e))}async function Iy(n=null){ko.set(!0);try{let e=await ce.collections.getFullList(200,{sort:"+name"});e=B.sortCollections(e),ci.set(e);const t=n&&B.findByKey(e,"id",n);t?ui.set(t):e.length&&ui.set(e[0]),qa()}catch(e){ce.error(e)}ko.set(!1)}function qa(){_b.update(n=>(ci.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(s=>{var l;return s.type=="file"&&((l=s.options)==null?void 0:l.protected)}));return e}),n))}const pr="pb_admin_file_token";zo.prototype.logout=function(n=!0){this.authStore.clear(),n&&ji("/login")};zo.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{};if(e&&i!==404){let l=s.message||n.message||t;l&&Ds(l)}if(B.isEmpty(s.data)||en(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),ji("/")};zo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=V1(_b);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(pr)||"";return(!t||hg(t,10))&&(t&&localStorage.removeItem(pr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(pr,t),this._adminFileTokenRequest=null),t};class Ly extends _g{save(e,t){super.save(e,t),t instanceof os&&ea(t)}clear(){super.clear(),ea(null)}}const ce=new zo("../",new Ly("pb_admin_auth"));ce.authStore.model instanceof os&&ea(ce.authStore.model);function Py(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=n[3].default,_=yt(m,n,n[2],null);return{c(){e=v("div"),t=v("main"),_&&_.c(),i=E(),s=v("footer"),l=v("a"),l.innerHTML=`<i class="ri-book-open-line txt-sm"></i>
<span class="txt">Docs</span>`,o=E(),r=v("span"),r.textContent="|",a=E(),u=v("a"),f=v("span"),f.textContent="PocketBase v0.16.5",p(t,"class","page-content"),p(l,"href","https://pocketbase.io/docs/"),p(l,"target","_blank"),p(l,"rel","noopener noreferrer"),p(r,"class","delimiter"),p(f,"class","txt"),p(u,"href","https://github.com/pocketbase/pocketbase/releases"),p(u,"target","_blank"),p(u,"rel","noopener noreferrer"),p(u,"title","Releases"),p(s,"class","page-footer"),p(e,"class",c="page-wrapper "+n[1]),Q(e,"center-content",n[0])},m(h,b){w(h,e,b),g(e,t),_&&_.m(t,null),g(e,i),g(e,s),g(s,l),g(s,o),g(s,r),g(s,a),g(s,u),g(u,f),d=!0},p(h,[b]){_&&_.p&&(!d||b&4)&&wt(_,m,h,h[2],d?kt(m,h[2],b,null):St(h[2]),null),(!d||b&2&&c!==(c="page-wrapper "+h[1]))&&p(e,"class",c),(!d||b&3)&&Q(e,"center-content",h[0])},i(h){d||(A(_,h),d=!0)},o(h){I(_,h),d=!1},d(h){h&&k(e),_&&_.d(h)}}}function Ny(n,e,t){let{$$slots:i={},$$scope:s}=e,{center:l=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,l=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,s=r.$$scope)},[l,o,s,i]}class wn extends ge{constructor(e){super(),_e(this,e,Ny,Py,me,{center:0,class:1})}}function Gu(n){let e,t,i;return{c(){e=v("div"),e.innerHTML=`<figure class="logo"><img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=E(),i=v("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function Fy(n){let e,t,i,s=!n[0]&&Gu();const l=n[1].default,o=yt(l,n,n[2],null);return{c(){e=v("div"),s&&s.c(),t=E(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),s&&s.m(e,null),g(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Gu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&wt(o,l,r,r[2],i?kt(l,r[2],a,null):St(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){I(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function Ry(n){let e,t;return e=new wn({props:{class:"full-page",center:!0,$$slots:{default:[Fy]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function qy(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 gb extends ge{constructor(e){super(),_e(this,e,qy,Ry,me,{nobranding:0})}}function Ko(n){const e=n-1;return e*e*e+1}function ta(n,{delay:e=0,duration:t=400,easing:i=Sl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function fi(n,{delay:e=0,duration:t=400,easing:i=Ko,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),[c,d]=_u(s),[m,_]=_u(l);return{delay:e,duration:t,easing:i,css:(h,b)=>`
transform: ${u} translate(${(1-h)*c}${d}, ${(1-h)*m}${_});
opacity: ${a-f*b}`}}function ot(n,{delay:e=0,duration:t=400,easing:i=Ko,axis:s="y"}={}){const l=getComputedStyle(n),o=+l.opacity,r=s==="y"?"height":"width",a=parseFloat(l[r]),u=s==="y"?["top","bottom"]:["left","right"],f=u.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(l[`padding${f[0]}`]),d=parseFloat(l[`padding${f[1]}`]),m=parseFloat(l[`margin${f[0]}`]),_=parseFloat(l[`margin${f[1]}`]),h=parseFloat(l[`border${f[0]}Width`]),b=parseFloat(l[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${r}: ${y*a}px;padding-${u[0]}: ${y*c}px;padding-${u[1]}: ${y*d}px;margin-${u[0]}: ${y*m}px;margin-${u[1]}: ${y*_}px;border-${u[0]}-width: ${y*h}px;border-${u[1]}-width: ${y*b}px;`}}function Kt(n,{delay:e=0,duration:t=400,easing:i=Ko,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
`}}let na,Yi;const ia="app-tooltip";function Xu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ni(){return Yi=Yi||document.querySelector("."+ia),Yi||(Yi=document.createElement("div"),Yi.classList.add(ia),document.body.appendChild(Yi)),Yi}function bb(n,e){let t=Ni();if(!t.classList.contains("active")||!(e!=null&&e.text)){sa();return}t.textContent=e.text,t.className=ia+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function sa(){clearTimeout(na),Ni().classList.remove("active"),Ni().activeNode=void 0}function jy(n,e){Ni().activeNode=n,clearTimeout(na),na=setTimeout(()=>{Ni().classList.add("active"),bb(n,e)},isNaN(e.delay)?0:e.delay)}function He(n,e){let t=Xu(e);function i(){jy(n,t)}function s(){sa()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&B.isFocusable(n))&&n.addEventListener("click",s),Ni(),{update(l){var o,r;t=Xu(l),(r=(o=Ni())==null?void 0:o.activeNode)!=null&&r.contains(n)&&bb(n,t)},destroy(){var l,o;(o=(l=Ni())==null?void 0:l.activeNode)!=null&&o.contains(n)&&sa(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Qu(n,e,t){const i=n.slice();return i[12]=e[t],i}const Vy=n=>({}),xu=n=>({uniqueId:n[4]});function zy(n){let e,t,i=n[3],s=[];for(let o=0;o<i.length;o+=1)s[o]=ef(Qu(n,i,o));const l=o=>I(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=ye()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&8){i=o[3];let a;for(a=0;a<i.length;a+=1){const u=Qu(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=ef(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)I(s[r]);t=!1},d(o){mt(s,o),o&&k(e)}}}function Hy(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("i"),p(t,"class","ri-error-warning-fill txt-danger"),p(e,"class","form-field-addon")},m(a,u){w(a,e,u),g(e,t),l=!0,o||(r=Me(i=He.call(null,t,{position:"left",text:n[3].map(wo).join(`
`)})),o=!0)},p(a,u){i&&qt(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(wo).join(`
`)})},i(a){l||(a&&Qe(()=>{l&&(s||(s=je(t,Kt,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=je(t,Kt,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&k(e),a&&s&&s.end(),o=!1,r()}}}function ef(n){let e,t,i=wo(n[12])+"",s,l,o,r;return{c(){e=v("div"),t=v("pre"),s=U(i),l=E(),p(e,"class","help-block help-block-error")},m(a,u){w(a,e,u),g(e,t),g(t,s),g(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=wo(a[12])+"")&&se(s,i)},i(a){r||(a&&Qe(()=>{r&&(o||(o=je(e,ot,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=je(e,ot,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&k(e),a&&o&&o.end()}}}function By(n){let e,t,i,s,l,o,r;const a=n[9].default,u=yt(a,n,n[8],xu),f=[Hy,zy],c=[];function d(m,_){return m[0]&&m[3].length?0:1}return i=d(n),s=c[i]=f[i](n),{c(){e=v("div"),u&&u.c(),t=E(),s.c(),p(e,"class",n[1]),Q(e,"error",n[3].length)},m(m,_){w(m,e,_),u&&u.m(e,null),g(e,t),c[i].m(e,null),n[11](e),l=!0,o||(r=K(e,"click",n[10]),o=!0)},p(m,[_]){u&&u.p&&(!l||_&256)&&wt(u,a,m,m[8],l?kt(a,m[8],_,Vy):St(m[8]),xu);let h=i;i=d(m),i===h?c[i].p(m,_):(ae(),I(c[h],1,1,()=>{c[h]=null}),ue(),s=c[i],s?s.p(m,_):(s=c[i]=f[i](m),s.c()),A(s,1),s.m(e,null)),(!l||_&2)&&p(e,"class",m[1]),(!l||_&10)&&Q(e,"error",m[3].length)},i(m){l||(A(u,m),A(s),l=!0)},o(m){I(u,m),I(s),l=!1},d(m){m&&k(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const tf="Invalid value";function wo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||tf:n||tf}function Uy(n,e,t){let i;Je(n,$i,h=>t(7,i=h));let{$$slots:s={},$$scope:l}=e;const o="field_"+B.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){ai(r)}Gt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(h){Ne.call(this,n,h)}function _(h){ee[h?"unshift":"push"](()=>{f=h,t(2,f)})}return n.$$set=h=>{"name"in h&&t(5,r=h.name),"inlineError"in h&&t(0,a=h.inlineError),"class"in h&&t(1,u=h.class),"$$scope"in h&&t(8,l=h.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=B.toArray(B.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,l,s,m,_]}class pe extends ge{constructor(e){super(),_e(this,e,Uy,By,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function Wy(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),re(l,n[0]),l.focus(),r||(a=K(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&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function Yy(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Password"),s=E(),l=v("input"),r=E(),a=v("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){w(c,e,d),g(e,t),w(c,s,d),w(c,l,d),re(l,n[1]),w(c,r,d),w(c,a,d),u||(f=K(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&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function Ky(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Password confirm"),s=E(),l=v("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){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),re(l,n[2]),r||(a=K(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&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function Jy(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return s=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[Wy,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[Yy,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:
2023-06-11 04:43:09 +08:00
<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){w(_,e,h),g(e,t),g(e,i),j(s,e,null),g(e,l),j(o,e,null),g(e,r),j(a,e,null),g(e,u),g(e,f),c=!0,d||(m=K(e,"submit",et(n[4])),d=!0)},p(_,[h]){const b={};h&1537&&(b.$$scope={dirty:h,ctx:_}),s.$set(b);const y={};h&1538&&(y.$$scope={dirty:h,ctx:_}),o.$set(y);const S={};h&1540&&(S.$$scope={dirty:h,ctx:_}),a.$set(S),(!c||h&8)&&Q(f,"btn-disabled",_[3]),(!c||h&8)&&Q(f,"btn-loading",_[3])},i(_){c||(A(s.$$.fragment,_),A(o.$$.fragment,_),A(a.$$.fragment,_),c=!0)},o(_){I(s.$$.fragment,_),I(o.$$.fragment,_),I(a.$$.fragment,_),c=!1},d(_){_&&k(e),V(s),V(o),V(a),d=!1,m()}}}function Zy(n,e,t){const i=$t();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ce.admins.create({email:s,password:l,passwordConfirm:o}),await ce.admins.authWithPassword(s,l),i("submit")}catch(d){ce.error(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 Gy extends ge{constructor(e){super(),_e(this,e,Zy,Jy,me,{})}}function nf(n){let e,t;return e=new gb({props:{$$slots:{default:[Xy]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Xy(n){let e,t;return e=new Gy({}),e.$on("submit",n[1]),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p:x,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Qy(n){let e,t,i=n[0]&&nf(n);return{c(){i&&i.c(),e=ye()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=nf(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(ae(),I(i,1,1,()=>{i=null}),ue())},i(s){t||(A(i),t=!0)},o(s){I(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function xy(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ce.logout(!1),t(0,i=!0);return}ce.authStore.isValid?ji("/collections"):ce.logout()}return[i,async()=>{t(0,i=!1),await fn(),window.location.search=""}]}class ek extends ge{constructor(e){super(),_e(this,e,xy,Qy,me,{})}}const Tt=In(""),So=In(""),As=In(!1);function tk(n){let e,t,i,s;return{c(){e=v("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),re(e,n[7]),i||(s=K(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&&k(e),n[13](null),i=!1,s()}}}function nk(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=Ft(o,r(n)),ee.push(()=>de(e,"value",l)),e.$on("submit",n[10])),{c(){e&&z(e.$$.fragment),i=ye()},m(a,u){e&&j(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],he(()=>t=!1)),u&16&&o!==(o=a[4])){if(e){ae();const c=e;I(c.$$.fragment,1,0,()=>{V(c,1)}),ue()}o?(e=Ft(o,r(a)),ee.push(()=>de(e,"value",l)),e.$on("submit",a[10]),z(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function sf(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Qe(()=>{i&&(t||(t=je(e,fi,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=je(e,fi,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function lf(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","
2023-06-11 04:32:41 +08:00
<span class="txt">Method</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function bk(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="URL",p(t,"class",B.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function vk(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="Referer",p(t,"class",B.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function yk(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="User IP",p(t,"class",B.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function kk(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="Status",p(t,"class",B.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function wk(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="Created",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function uf(n){let e;function t(l,o){return l[6]?$k:Sk}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function Sk(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&ff(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No logs found.",s=E(),o&&o.c(),l=E(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(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=ff(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function $k(n){let e;return{c(){e=v("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function ff(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[19]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function cf(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function df(n,e){var Te,Ze,ht;let t,i,s,l=((Te=e[23].method)==null?void 0:Te.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,m,_,h,b,y,S=(e[23].referer||"N/A")+"",C,$,T,M,O,D=(e[23].userIp||"N/A")+"",L,P,N,F,R,q=e[23].status+"",H,W,X,J,Z,le,ne,ie,be,Se,Ve=(((Ze=e[23].meta)==null?void 0:Ze.errorMessage)||((ht=e[23].meta)==null?void 0:ht.errorData))&&cf();J=new Si({props:{date:e[23].created}});function Be(){return e[17](e[23])}function ke(...Ge){return e[18](e[23],...Ge)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("span"),o=U(l),a=E(),u=v("td"),f=v("span"),d=U(c),_=E(),Ve&&Ve.c(),h=E(),b=v("td"),y=v("span"),C=U(S),T=E(),M=v("td"),O=v("span"),L=U(D),N=E(),F=v("td"),R=v("span"),H=U(q),W=E(),X=v("td"),z(J.$$.fragment),Z=E(),le=v("td"),le.innerHTML='<i class="ri-arrow-right-line"></i>',ne=E(),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(y,"class","txt txt-ellipsis"),p(y,"title",$=e[23].referer),Q(y,"txt-hint",!e[23].referer),p(b,"class","col-type-text col-field-referer"),p(O,"class","txt txt-ellipsis"),p(O,"title",P=e[23].userIp),Q(O,"txt-hint",!e[23].userIp),p(M,"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(X,"class","col-type-date col-field-created"),p(le,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Ge,Ye){w(Ge,t,Ye),g(t,i),g(i,s),g(s,o),g(t,a),g(t,u),g(u,f),g(f,d),g(u,_),Ve&&Ve.m(u,null),g(t,h),g(t,b),g(b,y),g(y,C),g(t,T),g(t,M),g(M,O),g(O,L),g(t,N),g(t,F),g(F,R),g(R,H),g(t,W),g(t,X),j(J,X,null),g(t,Z),g(t,le),g(t,ne),ie=!0,be||(Se=[K(t,"click",Be),K(t,"keydown",ke)],be=!0)},p(Ge,Ye){var fe,ze,Dt;e=Ge,(!ie||Ye&8)&&l!==(l=((fe=e[23].method)==null?void 0:fe.toUpperCase())+"")&&se(o,l),(!ie||Ye&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&p(s,"class",r),(!ie||Ye&8)&&c!==(c=e[23].url+"")&&se(d,c),(!ie||Ye&8&&m!==(m=e[23].url))&&p(f,"title",m),(ze=e[23].meta)!=null&&ze.errorMessage||(Dt=e[23].meta)!=null&&Dt.errorData?Ve||(Ve=cf(),Ve.c(),Ve.m(u,null)):Ve&&(Ve.d(1),Ve=null),(!ie||Ye&8)&&S!==(S=(e[23].referer||"N/A")+"")&&se(C,S),(!ie||Ye&8&&$!==($=e[23].referer))&&p(y,"title",$),(!ie||Ye&8)&&Q(y,"txt-hint",!e[23].referer),(!ie||Ye&8)&&D!==(D=(e[23].userIp||"N/A")+"")&&se(L,D),(!ie||Ye&8&&P!==(P=e[23].userIp))&&p(O,"title",P),(!ie||Ye&8)&&Q(O,"txt-hint",!e[23].userIp),(!ie||Ye&8)&&q!==(q=e[23].status+"")&&se(H,q),(!ie||Ye&8)&&Q(R,"label-danger",e[23].status>=400);const we={};Ye&8&&(we.date=e[23].created),J.$set(we)},i(Ge){ie||(A(J.$$.fragment,Ge),ie=!0)},o(Ge){I(J.$$.fragment,Ge),ie=!1},d(Ge){Ge&&k(t),Ve&&Ve.d(),V(J),be=!1,Ee(Se)}}}function Ck(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,b,y,S,C,$,T,M,O,D,L=[],P=new Map,N;function F(ke){n[11](ke)}let R={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[gk]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),s=new an({props:R}),ee.push(()=>de(s,"sort",F));function q(ke){n[12](ke)}let H={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[bk]},$$scope:{ctx:n}};n[1]!==void 0&&(H.sort=n[1]),r=new an({props:H}),ee.push(()=>de(r,"sort",q));function W(ke){n[13](ke)}let X={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[vk]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),f=new an({props:X}),ee.push(()=>de(f,"sort",W));function J(ke){n[14](ke)}let Z={disable:!0,class:"col-type-number col-field-userIp",nam
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/function mi(){}const Ek=function(){let n=0;return function(){return n++}}();function ct(n){return n===null||typeof n>"u"}function Ct(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 tt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Ht=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function qn(n,e){return Ht(n)?n:e}function st(n,e){return typeof n>"u"?e:n}const Dk=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,vb=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Pt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function pt(n,e,t,i){let s,l,o;if(Ct(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(tt(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function $o(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 Co(n){if(Ct(n))return n.map(Co);if(tt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=Co(n[t[s]]);return e}return n}function yb(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Ak(n,e,t,i){if(!yb(n))return;const s=e[n],l=t[n];tt(s)&&tt(l)?hl(s,l,i):e[n]=Co(l)}function hl(n,e,t){const i=Ct(e)?e:[e],s=i.length;if(!tt(n))return n;t=t||{};const l=t.merger||Ak;for(let o=0;o<s;++o){if(e=i[o],!tt(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 ol(n,e){return hl(n,e,{merger:Ik})}function Ik(n,e,t){if(!yb(n))return;const i=e[n],s=t[n];tt(i)&&tt(s)?ol(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=Co(s))}const hf={"":n=>n,x:n=>n.x,y:n=>n.y};function Ri(n,e){return(hf[e]||(hf[e]=Lk(e)))(n)}function Lk(n){const e=Pk(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Pk(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 Va(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Wn=n=>typeof n<"u",qi=n=>typeof n=="function",_f=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function Nk(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Rt=Math.PI,gt=2*Rt,Fk=gt+Rt,To=Number.POSITIVE_INFINITY,Rk=Rt/180,Nt=Rt/2,Ks=Rt/4,gf=Rt*2/3,Bn=Math.log10,oi=Math.sign;function bf(n){const e=Math.round(n);n=rl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Bn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function qk(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 Is(n){return!isNaN(parseFloat(n))&&isFinite(n)}function rl(n,e,t){return Math.abs(n-e)<t}function jk(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function kb(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 Xn(n){return n*(Rt/180)}function za(n){return n*(180/Rt)}function vf(n){if(!Ht(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function wb(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*Rt&&(l+=gt),{angle:l,distance:s}}function la(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Vk(n,e){return(n-e+Fk)%gt-Rt}function On(n){return(n%gt+gt)%gt}function _l(n,e,t,i){const s=On(n),l=On(e),o=On(t),r=On(l-s),a=On(o-s),u=On(s-l),f=On(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function un(n,e,t){return Math.max(e,Math.min(t,n))}function zk(n){return un(n,-32768,32767)}function gl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ha(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,l;for(;i-s>1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const es=(n,e,t,i)=>Ha(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),Hk=(n,e,t)=>Ha(n,t,i=>n[i][e]>=t);function Bk(n,e,
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function Dl(n){return n+.5|0}const Ii=(n,e,t)=>Math.max(Math.min(n,t),e);function nl(n){return Ii(Dl(n*2.55),0,255)}function Fi(n){return Ii(Dl(n*255),0,255)}function gi(n){return Ii(Dl(n/2.55)/100,0,1)}function $f(n){return Ii(Dl(n*100),0,100)}const Rn={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},oa=[..."0123456789ABCDEF"],Kk=n=>oa[n&15],Jk=n=>oa[(n&240)>>4]+oa[n&15],Yl=n=>(n&240)>>4===(n&15),Zk=n=>Yl(n.r)&&Yl(n.g)&&Yl(n.b)&&Yl(n.a);function Gk(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Rn[n[1]]*17,g:255&Rn[n[2]]*17,b:255&Rn[n[3]]*17,a:e===5?Rn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Rn[n[1]]<<4|Rn[n[2]],g:Rn[n[3]]<<4|Rn[n[4]],b:Rn[n[5]]<<4|Rn[n[6]],a:e===9?Rn[n[7]]<<4|Rn[n[8]]:255})),t}const Xk=(n,e)=>n<255?e(n):"";function Qk(n){var e=Zk(n)?Kk:Jk;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Xk(n.a,e):void 0}const xk=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Eb(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 e2(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 t2(n,e,t){const i=Eb(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 n2(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 Ba(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=n2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Ua(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Fi)}function Wa(n,e,t){return Ua(Eb,n,e,t)}function i2(n,e,t){return Ua(t2,n,e,t)}function s2(n,e,t){return Ua(e2,n,e,t)}function Db(n){return(n%360+360)%360}function l2(n){const e=xk.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?nl(+e[5]):Fi(+e[5]));const s=Db(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=i2(s,l,o):e[1]==="hsv"?i=s2(s,l,o):i=Wa(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function o2(n,e){var t=Ba(n);t[0]=Db(t[0]+e),t=Wa(t),n.r=t[0],n.g=t[1],n.b=t[2]}function r2(n){if(!n)return;const e=Ba(n),t=e[0],i=$f(e[1]),s=$f(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${gi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Cf={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"},Tf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class fw{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=Cb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var hi=new fw;const qf="transparent",cw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Of(n||qf),s=i.valid&&Of(e||qf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class dw{constructor(e,t,i,s){const l=t[i];s=Zl([e.to,s,l,e.from]);const o=Zl([e.from,l,s]);this._active=!0,this._fn=e.fn||cw[e.type||typeof o],this._easing=al[e.easing]||al.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Zl([e.to,t,s,e.from]),this._from=Zl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t<i),!this._active){this._target[s]=r,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][t]()}}const pw=["x","y","borderWidth","radius","tension"],mw=["color","borderColor","backgroundColor"];lt.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 hw=Object.keys(lt.animation);lt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});lt.set("animations",{colors:{type:"color",properties:mw},numbers:{type:"number",properties:pw}});lt.describe("animations",{_fallback:"animation"});lt.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 Wb{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!tt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!tt(s))return;const l={};for(con
`)>-1?n.split(`
`):n}function AS(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 hc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=En(e.bodyFont),u=En(e.titleFont),f=En(e.footerFont),c=l.length,d=s.length,m=i.length,_=Yn(e.padding);let h=_.height,b=0,y=i.reduce(($,T)=>$+T.before.length+T.lines.length+T.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(h+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;h+=m*$+(y-m)*a.lineHeight+(y-1)*e.bodySpacing}d&&(h+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const C=function($){b=Math.max(b,t.measureText($).width+S)};return t.save(),t.font=u.string,pt(n.title,C),t.font=a.string,pt(n.beforeBody.concat(n.afterBody),C),S=e.displayColors?o+2+e.boxPadding:0,pt(i,$=>{pt($.before,C),pt($.lines,C),pt($.after,C)}),S=0,t.font=f.string,pt(n.footer,C),t.restore(),b+=_.width,{width:b,height:h}}function IS(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 PS(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 _c(n,e,t){const i=t.yAlign||e.yAlign||IS(n,t);return{xAlign:t.xAlign||e.xAlign||PS(n,e,t,i),yAlign:i}}function NS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function FS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function gc(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}=Cs(o);let _=NS(e,r);const h=FS(e,a,u);return a==="center"?r==="left"?_+=u:r==="right"&&(_-=u):r==="left"?_-=Math.max(f,d)+s:r==="right"&&(_+=Math.max(c,m)+s),{x:un(_,0,i.width-e.width),y:un(h,0,i.height-e.height)}}function no(n,e,t){const i=Yn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function bc(n){return ii([],_i(n))}function RS(n,e,t){return Vi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function vc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ha 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 Wb(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=RS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=ii(r,_i(s)),r=ii(r,_i(l)),r=ii(r,_i(o)),r}getBeforeBody(e,t){return bc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return pt(e,l=>{const o={before:[],lines:[],after:[]},r=vc(i,l);ii(o.before,_i(r.beforeLabel.call(this,l))
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const s$={datetime:Ue.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Ue.TIME_WITH_SECONDS,minute:Ue.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Gb._date.override({_id:"luxon",_create:function(n){return Ue.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return s$},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=Ue.fromFormat(n,e,t):n=Ue.fromISO(n,t):n instanceof Date?n=Ue.fromJSDate(n,t):i==="object"&&!(n instanceof Ue)&&(n=Ue.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 Mc(n){let e,t,i;return{c(){e=v("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Qe(()=>{i&&(t||(t=je(e,Kt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=je(e,Kt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function l$(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=U(n[1]),t=E(),s=U(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&se(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&se(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function o$(n){let e;return{c(){e=U("Loading...")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function r$(n){let e,t,i,s,l,o=n[2]&&Mc();function r(f,c){return f[2]?o$:l$}let a=r(n),u=a(n);return{c(){e=v("div"),o&&o.c(),t=E(),i=v("canvas"),s=E(),l=v("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),zr(i,"height","250px"),zr(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){w(f,e,c),o&&o.m(e,null),g(e,t),g(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=Mc(),o.c(),A(o,1),o.m(e,t)):o&&(ae(),I(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){I(o)},d(f){f&&k(e),o&&o.d(),n[8](null),f&&k(s),f&&k(l),u.d()}}}function a$(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),ce.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(m=>{c();for(let _ of m)r.push({x:new Date(_.date),y:_.total}),t(1,a+=_.total);r.push({x:new Date,y:void 0})}).catch(m=>{m!=null&&m.isAbort||(c(),console.warn(m),ce.error(m,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Gt(()=>(Po.register(zi,xo,Xo,ru,Pl,DS,qS),t(6,o=new Po(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){ee[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.update())
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function S(C){return C instanceof a?new a(C.type,S(C.content),C.alias):Array.isArray(C)?C.map(S):C.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(S){return Object.prototype.toString.call(S).slice(8,-1)},objId:function(S){return S.__id||Object.defineProperty(S,"__id",{value:++l}),S.__id},clone:function S(C,$){$=$||{};var T,M;switch(r.util.type(C)){case"Object":if(M=r.util.objId(C),$[M])return $[M];T={},$[M]=T;for(var O in C)C.hasOwnProperty(O)&&(T[O]=S(C[O],$));return T;case"Array":return M=r.util.objId(C),$[M]?$[M]:(T=[],$[M]=T,C.forEach(function(D,L){T[L]=S(D,$)}),T);default:return C}},getLanguage:function(S){for(;S;){var C=s.exec(S.className);if(C)return C[1].toLowerCase();S=S.parentElement}return"none"},setLanguage:function(S,C){S.className=S.className.replace(RegExp(s,"gi"),""),S.classList.add("language-"+C)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(T){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(T.stack)||[])[1];if(S){var C=document.getElementsByTagName("script");for(var $ in C)if(C[$].src==S)return C[$]}return null}},isActive:function(S,C,$){for(var T="no-"+C;S;){var M=S.classList;if(M.contains(C))return!0;if(M.contains(T))return!1;S=S.parentElement}return!!$}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(S,C){var $=r.util.clone(r.languages[S]);for(var T in C)$[T]=C[T];return $},insertBefore:function(S,C,$,T){T=T||r.languages;var M=T[S],O={};for(var D in M)if(M.hasOwnProperty(D)){if(D==C)for(var L in $)$.hasOwnProperty(L)&&(O[L]=$[L]);$.hasOwnProperty(D)||(O[D]=M[D])}var P=T[S];return T[S]=O,r.languages.DFS(r.languages,function(N,F){F===P&&N!=S&&(this[N]=O)}),O},DFS:function S(C,$,T,M){M=M||{};var O=r.util.objId;for(var D in C)if(C.hasOwnProperty(D)){$.call(C,D,C[D],T||D);var L=C[D],P=r.util.type(L);P==="Object"&&!M[O(L)]?(M[O(L)]=!0,S(L,$,null,M)):P==="Array"&&!M[O(L)]&&(M[O(L)]=!0,S(L,$,D,M))}}},plugins:{},highlightAll:function(S,C){r.highlightAllUnder(document,S,C)},highlightAllUnder:function(S,C,$){var T={callback:$,container:S,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",T),T.elements=Array.prototype.slice.apply(T.container.querySelectorAll(T.selector)),r.hooks.run("before-all-elements-highlight",T);for(var M=0,O;O=T.elements[M++];)r.highlightElement(O,C===!0,T.callback)},highlightElement:function(S,C,$){var T=r.util.getLanguage(S),M=r.languages[T];r.util.setLanguage(S,T);var O=S.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,T);var D=S.textContent,L={element:S,language:T,grammar:M,code:D};function P(F){L.highlightedCode=F,r.hooks.run("before-insert",L),L.element.innerHTML=L.highlightedCode,r.hooks.run("after-highlight",L),r.hooks.run("complete",L),$&&$.call(L.element)}if(r.hooks.run("before-sanity-check",L),O=L.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!L.code){r.hooks.run("complete",L),$&&$.call(L.element);return}if(r.hooks.run("before-highlight",L),!L.grammar){P(r.util.encode(L.code));return}if(C&&i.Worker){var N=new Worker(r.filename);N.onmessage=function(F){P(F.data)},N.postMessage(JSON.stringify({language:L.language,code:L.code,immediateClose:!0}))}else P(r.highlight(L.code,L.grammar,L.language))},highlight:function(S,C,$){var T={code:S,grammar:C,language:$};if(r.hooks.run("before-tokenize",T),!T.grammar)throw new Error('The language "'+T.language+'" has no grammar.');return T.tokens=r.tokenize(T.code,T.grammar),r.hooks.run("after-tokenize",T),a.stringify(r.util.encode(T.tokens),T.language)},tokenize:function(S,C){var $=C.rest;if($){for(var T in $)C[T]=$[T];delete C.rest}var M=new c;return d(M,M.head,S),f(S,M,C,M.head,0),_(M)},hooks:{all:{},add:function
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(L+1))}y.textContent=M,t.highlightElement(y)},function(M){b.setAttribute(r,f),y.textContent=M})}}),t.plugins.fileHighlight={highlight:function(b){for(var y=(b||document).querySelectorAll(c),S=0,C;C=y[S++];)t.highlightElement(C)}};var _=!1;t.fileHighlight=function(){_||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),_=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(_1);var c$=_1.exports;const xs=f$(c$);var d$={exports:{}};(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(`
`),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-06-11 04:43:09 +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,b=0;b<d.length;++b){var y=d[b];y==o.element?h=!0:y.nodeName==="#text"&&(h?_+=y.nodeValue:m+=y.nodeValue,a.removeChild(y),--b)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=m+o.code+_,o.code=r.normalize(o.code,o.settings);else{var S=m+o.element.innerHTML+_;o.element.innerHTML=r.normalize(S,o.settings),o.code=o.element.textContent}}}})})()})(d$);(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 p$(n){let e,t,i;return{c(){e=v("div"),t=v("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){w(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&&k(e)}}}function m$(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=xs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),xs.highlight(a,xs.languages[l]||xs.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 xs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class g1 extends ge{constructor(e){super(),_e(this,e,m$,p$,me,{class:0,content:2,language:3})}}const h$=n=>({}),Ec=n=>({}),_$=n=>({}),Dc=n=>({});function Ac(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,b,y,S,C=n[4]&&!n[2]&&Ic(n);const $=n[19].header,T=yt($,n,n[18],Dc);let M=n[4]&&n[2]&&Lc(n);const O=n[19].default,D=yt(O,n,n[18],null),L=n[19].footer,P=yt(L,n,n[18],Ec);return{c(){e=v("div"),t=v("div"),s=E(),l=v("div"),o=v("div"),C&&C.c(),r=E(),T&&T.c(),a=E(),M&&M.c(),u=E(),f=v("div"),D&&D.c(),c=E(),d=v("div"),P&&P.c(),p(t,
2023-06-11 04:32:41 +08:00
<span class="txt">New index</span>`,f=E(),z(c.$$.fragment),p(e,"class","section-title"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(O,D){w(O,e,D),g(e,t),g(e,s),g(e,l),w(O,o,D),w(O,r,D);for(let L=0;L<y.length;L+=1)y[L]&&y[L].m(r,null);g(r,a),g(r,u),w(O,f,D),j(c,O,D),m=!0,_||(h=K(u,"click",n[5]),_=!0)},p(O,[D]){var P,N,F;if((!m||D&1)&&i!==(i=(((N=(P=O[0])==null?void 0:P.indexes)==null?void 0:N.length)||0)+"")&&se(s,i),D&7){b=((F=O[0])==null?void 0:F.indexes)||[];let R;for(R=0;R<b.length;R+=1){const q=Bc(O,b,R);y[R]?y[R].p(q,D):(y[R]=Wc(q),y[R].c(),y[R].m(r,a))}for(;R<y.length;R+=1)y[R].d(1);y.length=b.length}const L={};!d&&D&1&&(d=!0,L.collection=O[0],he(()=>d=!1)),c.$set(L)},i(O){m||(A(c.$$.fragment,O),m=!0)},o(O){I(c.$$.fragment,O),m=!1},d(O){O&&k(e),O&&k(o),O&&k(r),mt(y,O),O&&k(f),n[6](null),V(c,O),_=!1,h()}}}const Yc=n=>n.name;function K$(n,e,t){let i;Je(n,$i,m=>t(2,i=m));let{collection:s}=e,l;function o(m,_){for(let h=0;h<s.indexes.length;h++)if(s.indexes[h]==m){t(0,s.indexes[h]=_,s),ai("indexes."+h);return}s.indexes.push(_),t(0,s)}const r=(m,_)=>l==null?void 0:l.show(m,_),a=()=>l==null?void 0:l.show();function u(m){ee[m?"unshift":"push"](()=>{l=m,t(1,l)})}function f(m){s=m,t(0,s)}const c=m=>{for(let _=0;_<s.indexes.length;_++)if(s.indexes[_]==m.detail){s.indexes.splice(_,1),ai("indexes."+_);break}t(0,s)},d=m=>{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},[s,l,i,o,r,a,u,f,c,d]}class J$ extends ge{constructor(e){super(),_e(this,e,K$,Y$,me,{collection:0})}}function Kc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Jc(n){let e,t,i,s,l=n[6].label+"",o,r,a,u;function f(){return n[4](n[6])}function c(...d){return n[5](n[6],...d)}return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),o=U(l),r=E(),p(t,"class","icon "+n[6].icon+" svelte-1gz9b6p"),p(s,"class","txt"),p(e,"tabindex","0"),p(e,"class","dropdown-item closable svelte-1gz9b6p")},m(d,m){w(d,e,m),g(e,t),g(e,i),g(e,s),g(s,o),g(e,r),a||(u=[K(e,"click",An(f)),K(e,"keydown",An(c))],a=!0)},p(d,m){n=d},d(d){d&&k(e),a=!1,Ee(u)}}}function Z$(n){let e,t=n[2],i=[];for(let s=0;s<t.length;s+=1)i[s]=Jc(Kc(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=ye()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);w(s,e,l)},p(s,l){if(l&12){t=s[2];let o;for(o=0;o<t.length;o+=1){const r=Kc(s,t,o);i[o]?i[o].p(r,l):(i[o]=Jc(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){mt(i,s),s&&k(e)}}}function G$(n){let e,t,i,s,l,o,r,a,u,f;return o=new Kn({props:{class:"dropdown field-types-dropdown",$$slots:{default:[Z$]},$$scope:{ctx:n}}}),{c(){e=v("button"),t=v("i"),i=E(),s=v("div"),s.textContent="New field",l=E(),z(o.$$.fragment),p(t,"class","ri-add-line"),p(s,"class","txt"),p(e,"type","button"),p(e,"class",r="field-types-btn "+n[0]+" svelte-1gz9b6p")},m(c,d){w(c,e,d),g(e,t),g(e,i),g(e,s),g(e,l),j(o,e,null),a=!0,u||(f=K(e,"click",n[1]),u=!0)},p(c,[d]){const m={};d&512&&(m.$$scope={dirty:d,ctx:c}),o.$set(m),(!a||d&1&&r!==(r="field-types-btn "+c[0]+" svelte-1gz9b6p"))&&p(e,"class",r)},i(c){a||(A(o.$$.fragment,c),a=!0)},o(c){I(o.$$.fragment,c),a=!1},d(c){c&&k(e),V(o),u=!1,f()}}}function X$(n,e,t){let{class:i=""}=e;const s=$t(),l=[{label:"Plain text",value:"text",icon:B.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:B.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:B.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:B.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:B.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:B.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:B.getFieldTypeIcon("date")},{label:"Select",value:"select",icon:B.getFieldTypeIcon("select")},{label:"File",value:"file",icon:B.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:B.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:B.getFieldTypeIcon("json")}];function o(u){s("select",u)}const r=u=>{o(u.value)},a=(u,f)=>{(f.code==="Enter"||f.code==="Sp
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&256&&l!==(l=b[8]))&&p(e,"for",l);const S={};y&256&&(S.id=b[8]),y&1&&(S.disabled=!B.isEmpty(b[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=b[0].options.exceptDomains,he(()=>a=!1)),r.$set(S)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){I(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,m()}}}function DC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function _(b){n[4](b)}let h={id:n[8]+".options.onlyDomains",disabled:!B.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(h.value=n[0].options.onlyDomains),r=new Vs({props:h}),ee.push(()=>de(r,"value",_)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]+".options.onlyDomains"),p(f,"class","help-block")},m(b,y){w(b,e,y),g(e,t),g(e,i),g(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(m=Me(He.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&256&&l!==(l=b[8]+".options.onlyDomains"))&&p(e,"for",l);const S={};y&256&&(S.id=b[8]+".options.onlyDomains"),y&1&&(S.disabled=!B.isEmpty(b[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=b[0].options.onlyDomains,he(()=>a=!1)),r.$set(S)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){I(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,m()}}}function AC(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:[EC,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[DC,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),g(e,t),j(i,t,null),g(e,s),g(e,l),j(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&769&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&769&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function IC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[AC]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new di({props:o}),ee.push(()=>de(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?Mt(s,[a&2&&{key:r[1]},a&4&&Xt(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],he(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function LC(n,e,t){const i=["field","key"];let s=xe(e,i),{field:l}=e,{key:o=""}=e;function r(d){n.$$.not_equal(l.options.exceptDomains,d)&&(l.options.exceptDomains=d,t(0,l))}function a(d){n.$$.not_equal(l.options.onlyDomains,d)&&(l.options.onlyDomains=d,t(0,l))}function u(d){l=d,t(0,l)}function f(d){Ne.call(this,n,d)}function c(d){Ne.call(this,n,d)}return n.$$set=d=>{e=qe(qe({},e),Zt(d)),t(2,s=xe(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,s,r,a,u,f,c]}class y1 extends ge{constructor(e){super(),_e(this,e,LC,IC,me,{field:0,key:1})}}function PC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new y1({props:o}),ee.push(()=>de(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?Mt(s,[a&2&&{key:r[1]},a&4&&Xt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],he(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function NC(n,e,t){const i=["field","key"];let s=xe(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Ne.call(this,n,f)}function u(f){Ne.call(this,n,f)}return n.$$set=f=>{e=qe(qe({},e),Zt(f)),t(2,s=xe(e,i)),"field"in f&&t(0,l=f.field),"key"in f&&t(1,o=f.key)},[l,o,s,r,a,u]}class FC extends ge{constructor(e){super(),_e(this,e,NC,PC,me,{field:0,key:1})}}function RC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new di({props:o}),ee.push(()=>de(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?Mt(s,[a&2&&{key:r[1]},a&4&&Xt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],he(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function qC(n,e,t){const i=["field","key"];let s=xe(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Ne.call(this,n,f)}function u(f){Ne.call(this,n,f)}return n.$$set=f=>{e=qe(qe({},e),Zt(f)),t(2,
<span class='flatpickr-weekday'>
`+G.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function le(){t.calendarContainer.classList.add("hasWeeks");var Y=ft("div","flatpickr-weekwrapper");Y.appendChild(ft("span","flatpickr-weekday",t.l10n.weekAbbreviation));var G=ft("div","flatpickr-weeks");return Y.appendChild(G),{weekWrapper:Y,weekNumbers:G}}function ne(Y,G){G===void 0&&(G=!0);var te=G?Y:Y-t.currentMonth;te<0&&t._hidePrevMonthArrow===!0||te>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=te,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Fe("onYearChange"),R()),F(),Fe("onMonthChange"),Nn())}function ie(Y,G){if(Y===void 0&&(Y=!0),G===void 0&&(G=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,G===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var te=Pr(t.config),oe=te.hours,Ce=te.minutes,Ie=te.seconds;m(oe,Ce,Ie)}t.redraw(),Y&&Fe("onChange")}function be(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Fe("onClose")}function Se(){t.config!==void 0&&Fe("onDestroy");for(var Y=t._handlers.length;Y--;)t._handlers[Y].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 G=t.calendarContainer.parentNode;if(G.lastChild&&G.removeChild(G.lastChild),G.parentNode){for(;G.firstChild;)G.parentNode.insertBefore(G.firstChild,G);G.parentNode.removeChild(G)}}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(te){try{delete t[te]}catch{}})}function Ve(Y){return t.calendarContainer.contains(Y)}function Be(Y){if(t.isOpen&&!t.config.inline){var G=Tn(Y),te=Ve(G),oe=G===t.input||G===t.altInput||t.element.contains(G)||Y.path&&Y.path.indexOf&&(~Y.path.indexOf(t.input)||~Y.path.indexOf(t.altInput)),Ce=!oe&&!te&&!Ve(Y.relatedTarget),Ie=!t.config.ignoredFocusElements.some(function(Pe){return Pe.contains(G)});Ce&&Ie&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function ke(Y){if(!(!Y||t.config.minDate&&Y<t.config.minDate.getFullYear()||t.config.maxDate&&Y>t.config.maxDate.getFullYear())){var G=Y,te=t.currentYear!==G;t.currentYear=G||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)),te&&(t.redraw(),Fe("onYearChange"),R())}}function Te(Y,G){var te;G===void 0&&(G=!0);var oe=t.parseDate(Y,void 0,G);if(t.config.minDate&&oe&&Mn(oe,t.config.minDate,G!==void 0?G:!t.minDateHasTime)<0||t.config.maxDate&&oe&&Mn(oe,t.config.maxDate,G!==void 0?G:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)ret
`),r=v("code"),r.textContent="multipart/form-data",a=U(`
requests, the following normalization rules are applied if the `),u=v("code"),u.textContent="json",f=U(` field
is a
`),c=v("strong"),c.textContent="plain string",d=U(`:
`),m=v("ul"),_=v("li"),_.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",h=E(),b=v("li"),b.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",y=E(),S=v("li"),S.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",C=E(),$=v("li"),$.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",T=E(),M=v("li"),D=U(O),L=U(" is converted to the json "),P=v("code"),P.textContent='{"a":1,"b":2}',N=E(),F=v("li"),F.textContent="numeric strings are converted to json number",R=E(),q=v("li"),q.textContent="double quoted strings are left as they are (aka. without normalizations)",H=E(),W=v("li"),W.textContent="any other string (empty string too) is double quoted",X=U(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your
data inside an object, eg.`),J=v("code"),J.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(ne,ie){w(ne,e,ie),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,_),g(m,h),g(m,b),g(m,y),g(m,S),g(m,C),g(m,$),g(m,T),g(m,M),g(M,D),g(M,L),g(M,P),g(m,N),g(m,F),g(m,R),g(m,q),g(m,H),g(m,W),g(i,X),g(i,J),le=!0},i(ne){le||(ne&&Qe(()=>{le&&(Z||(Z=je(e,ot,{duration:150},!0)),Z.run(1))}),le=!0)},o(ne){ne&&(Z||(Z=je(e,ot,{duration:150},!1)),Z.run(0)),le=!1},d(ne){ne&&k(e),ne&&Z&&Z.end()}}}function OT(n){let e,t,i,s,l,o,r;function a(d,m){return d[2]?MT:TT}let u=a(n),f=u(n),c=n[2]&&$d();return{c(){e=v("button"),t=v("strong"),t.textContent="String value normalizations",i=E(),f.c(),s=E(),c&&c.c(),l=ye(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,m){w(d,e,m),g(e,t),g(e,i),f.m(e,null),w(d,s,m),c&&c.m(d,m),w(d,l,m),o||(r=K(e,"click",n[4]),o=!0)},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[2]?c?m&4&&A(c,1):(c=$d(),c.c(),A(c,1),c.m(l.parentNode,l)):c&&(ae(),I(c,1,1,()=>{c=null}),ue())},d(d){d&&k(e),f.d(),d&&k(s),c&&c.d(d),d&&k(l),o=!1,r()}}}function ET(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[OT]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new di({props:o}),ee.push(()=>de(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&10?Mt(s,[a&2&&{key:r[1]},a&8&&Xt(r[3])]):{};a&260&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],he(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function DT(n,e,t){const i=["field","key"];let s=xe(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(d){l=d,t(0,l)}function f(d){Ne.call(this,n,d)}function c(d){Ne.call(this,n,d)}return n.$$set=d=>{e=qe(qe({},e),Zt(d)),t(3,s=xe(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,r,s,a,u,f,c]}class AT extends ge{constructor(e){super(),_e(this,e,DT,ET,me,{field:0,key:1})}}function IT(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=v("span"),i=U(t),s=E(),l=v("small"),r=U(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){w(a,e,u),g(e,i),w(a,s,u),w(a,l,u),g(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&se(i,t),u&1&&o!==(o=a[0].mimeType+"")&&se(r,o)},i:x,o:x,d(a){a&&k(e),a&&k(s),a&&k(l)}}}function LT(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Cd extends ge{constructor(e){super(),_e(this,e,LT,IT,me,{item:0})}}const PT=[{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
Leave empty for no restriction.`,position:"top"})),S=!0)},p(M,O){(!y||O&4194304&&l!==(l=M[22]))&&p(e,"for",l);const D={};O&4194304&&(D.id=M[22]),O&8&&(D.items=M[3]),!a&&O&1&&(a=!0,D.keyOfSelected=M[0].options.mimeTypes,he(()=>a=!1)),r.$set(D);const L={};O&16777217&&(L.$$scope={dirty:O,ctx:M}),b.$set(L)},i(M){y||(A(r.$$.fragment,M),A(b.$$.fragment,M),y=!0)},o(M){I(r.$$.fragment,M),I(b.$$.fragment,M),y=!1},d(M){M&&k(e),M&&k(o),V(r,M),M&&k(u),M&&k(f),V(b),S=!1,C()}}}function jT(n){let e;return{c(){e=v("ul"),e.innerHTML=`<li><strong>WxH</strong>
(eg. 100x50) - crop to WxH viewbox (from center)</li>
<li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li>
<li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li>
<li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li>
<li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li>
<li><strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function VT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,b,y,S,C,$,T;function M(D){n[13](D)}let O={id:n[22],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(O.value=n[0].options.thumbs),r=new Vs({props:O}),ee.push(()=>de(r,"value",M)),S=new Kn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[jT]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Thumb sizes",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),c=v("span"),c.textContent="Use comma as separator.",d=E(),m=v("button"),_=v("span"),_.textContent="Supported formats",h=E(),b=v("i"),y=E(),z(S.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[22]),p(c,"class","txt"),p(_,"class","txt link-primary"),p(b,"class","ri-arrow-drop-down-fill"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(D,L){w(D,e,L),g(e,t),g(e,i),g(e,s),w(D,o,L),j(r,D,L),w(D,u,L),w(D,f,L),g(f,c),g(f,d),g(f,m),g(m,_),g(m,h),g(m,b),g(m,y),j(S,m,null),C=!0,$||(T=Me(He.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),$=!0)},p(D,L){(!C||L&4194304&&l!==(l=D[22]))&&p(e,"for",l);const P={};L&4194304&&(P.id=D[22]),!a&&L&1&&(a=!0,P.value=D[0].options.thumbs,he(()=>a=!1)),r.$set(P);const N={};L&16777216&&(N.$$scope={dirty:L,ctx:D}),S.$set(N)},i(D){C||(A(r.$$.fragment,D),A(S.$$.fragment,D),C=!0)},o(D){I(r.$$.fragment,D),I(S.$$.fragment,D),C=!1},d(D){D&&k(e),D&&k(o),V(r,D),D&&k(u),D&&k(f),V(S),$=!1,T()}}}function zT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Max file size"),s=E(),l=v("input"),r=E(),a=v("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[22]),p(l,"type","number"),p(l,"id",o=n[22]),p(l,"step","1"),p(l,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),g(e,t),w(c,s,d),w(c,l,d),re(l,n[0].options.maxSize),w(c,r,d),w(c,a,d),u||(f=K(l,"input",n[14]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(l,"id",o),d&1&&dt(l.value)!==c[0].options.maxSize&&re(l,c[0].options.maxSize)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function Td(n){let e,t,i;return t=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[HT,({uniqueId:s})=>({22:s}),({uniqueId:s})=>s?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","col-sm-3")},m(s,l){w(s,e,l),j(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&20971521&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function HT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max select"),s=E(),l=v("input"),p(e,"for",i=n[22]),p(l,"id",o=n[22]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),l.required=!0},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),re(l,n[0].options.maxSelect),r||(a=K(l,"input",n[15]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&o!==(o=u[22])&&p(l,"id",o),f&1&&dt(l.value)!==u[0].options.maxSelect&&re(l,u[0].options.maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function BT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[qT,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[VT,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[zT,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}});let _=!n[2]&&Td(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),a=E(),u=v("div"),z(f.$$.fragment),d=E
<span class="txt">New collection</span>`,p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=K(i,"click",n[17]),s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,l()}}}function GT(n){let e,t,i;function s(o){n[18](o)}let l={id:n[29],searchable:n[3].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[3],readonly:!n[30]||n[0].id,$$slots:{afterOptions:[ZT]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Hi({props:l}),ee.push(()=>de(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&536870912&&(a.id=o[29]),r[0]&8&&(a.searchable=o[3].length>5),r[0]&8&&(a.items=o[3]),r[0]&1073741825&&(a.readonly=!o[30]||o[0].id),r[0]&16|r[1]&1&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function XT(n){let e,t,i;function s(o){n[19](o)}let l={id:n[29],items:n[8],readonly:!n[30]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Hi({props:l}),ee.push(()=>de(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&536870912&&(a.id=o[29]),r[0]&1073741824&&(a.readonly=!o[30]),!t&&r[0]&4&&(t=!0,a.keyOfSelected=o[2],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function QT(n){let e,t,i,s,l,o,r,a,u,f;return i=new pe({props:{class:"form-field required "+(n[30]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[GT,({uniqueId:c})=>({29:c}),({uniqueId:c})=>[c?536870912:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[30]?"":"readonly"),inlineError:!0,$$slots:{default:[XT,({uniqueId:c})=>({29:c}),({uniqueId:c})=>[c?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),z(i.$$.fragment),s=E(),l=v("div"),o=E(),z(r.$$.fragment),a=E(),u=v("div"),p(e,"class","separator"),p(l,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),j(i,c,d),w(c,s,d),w(c,l,d),w(c,o,d),j(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const m={};d[0]&1073741824&&(m.class="form-field required "+(c[30]?"":"readonly")),d[0]&2&&(m.name="schema."+c[1]+".options.collectionId"),d[0]&1610612761|d[1]&1&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const _={};d[0]&1073741824&&(_.class="form-field form-field-single-multiple-select "+(c[30]?"":"readonly")),d[0]&1610612740|d[1]&1&&(_.$$scope={dirty:d,ctx:c}),r.$set(_)},i(c){f||(A(i.$$.fragment,c),A(r.$$.fragment,c),f=!0)},o(c){I(i.$$.fragment,c),I(r.$$.fragment,c),f=!1},d(c){c&&k(e),c&&k(t),V(i,c),c&&k(s),c&&k(l),c&&k(o),V(r,c),c&&k(a),c&&k(u)}}}function Md(n){let e,t,i,s,l,o;return t=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[xT,({uniqueId:r})=>({29:r}),({uniqueId:r})=>[r?536870912:0]]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[e4,({uniqueId:r})=>({29:r}),({uniqueId:r})=>[r?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),i=E(),s=v("div"),z(l.$$.fragment),p(e,"class","col-sm-6"),p(s,"class","col-sm-6")},m(r,a){w(r,e,a),j(t,e,null),w(r,i,a),w(r,s,a),j(l,s,null),o=!0},p(r,a){const u={};a[0]&2&&(u.name="schema."+r[1]+".options.minSelect"),a[0]&536870913|a[1]&1&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a[0]&2&&(f.name="schema."+r[1]+".options.maxSelect"),a[0]&536870913|a[1]&1&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(t.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){I(t.$$.fragment,r),I(l.$$.fragment,r),o=!1},d(r){r&&k(e),V(t),r&&k(i),r&&k(s),V(l)}}}function xT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Min select"),s=E(),l=v("input"),p(e,"for",i=n[29]),p(l,"type","number"),p(l,"id",o=n[29]),p(l,"step","1"),p(l,"min","1"),p(l,"placeholder","No min limit")},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),re(l,n[0].options.minSelect)
`),t=v("code"),t.textContent="username",i=U(` ,
`),s=v("code"),s.textContent="email",l=U(` ,
`),o=v("code"),o.textContent="emailVisibility",r=U(` ,
`),a=v("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){w(u,e,f),w(u,t,f),w(u,i,f),w(u,s,f),w(u,l,f),w(u,o,f),w(u,r,f),w(u,a,f)},d(u){u&&k(e),u&&k(t),u&&k(i),u&&k(s),u&&k(l),u&&k(o),u&&k(r),u&&k(a)}}}function f4(n){let e,t,i,s;function l(u){n[6](u,n[17],n[18],n[19])}function o(){return n[7](n[19])}var r=n[1][n[17].type];function a(u){let f={key:u[4](u[17])};return u[17]!==void 0&&(f.field=u[17]),{props:f}}return r&&(e=Ft(r,a(n)),ee.push(()=>de(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8])),{c(){e&&z(e.$$.fragment),i=E()},m(u,f){e&&j(e,u,f),w(u,i,f),s=!0},p(u,f){n=u;const c={};if(f&1&&(c.key=n[4](n[17])),!t&&f&1&&(t=!0,c.field=n[17],he(()=>t=!1)),f&1&&r!==(r=n[1][n[17].type])){if(e){ae();const d=e;I(d.$$.fragment,1,0,()=>{V(d,1)}),ue()}r?(e=Ft(r,a(n)),ee.push(()=>de(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8]),z(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else r&&e.$set(c)},i(u){s||(e&&A(e.$$.fragment,u),s=!0)},o(u){e&&I(e.$$.fragment,u),s=!1},d(u){e&&V(e,u),u&&k(i)}}}function Ad(n,e){let t,i,s,l;function o(a){e[9](a)}let r={index:e[19],disabled:e[17].toDelete||e[17].id&&e[17].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[f4]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Nl({props:r}),ee.push(()=>de(i,"list",o)),i.$on("drag",e[10]),i.$on("sort",e[11]),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),j(i,a,u),l=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[19]),u&1&&(f.disabled=e[17].toDelete||e[17].id&&e[17].system),u&1048577&&(f.$$scope={dirty:u,ctx:e}),!s&&u&1&&(s=!0,f.list=e[0].schema,he(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){I(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function c4(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=[],_=new Map,h,b,y,S,C,$,T,M,O=n[0].$isAuth&&Dd(),D=n[0].schema;const L=F=>F[17];for(let F=0;F<D.length;F+=1){let R=Ed(n,D,F),q=L(R);_.set(q,m[F]=Ad(q,R))}b=new Q$({props:{class:"btn btn-block btn-outline"}}),b.$on("select",n[12]);function P(F){n[13](F)}let N={};return n[0]!==void 0&&(N.collection=n[0]),$=new J$({props:N}),ee.push(()=>de($,"collection",P)),{c(){e=v("div"),t=v("p"),i=U(`System fields:
`),s=v("code"),s.textContent="id",l=U(` ,
`),o=v("code"),o.textContent="created",r=U(` ,
`),a=v("code"),a.textContent="updated",u=E(),O&&O.c(),f=U(`
.`),c=E(),d=v("div");for(let F=0;F<m.length;F+=1)m[F].c();h=E(),z(b.$$.fragment),y=E(),S=v("hr"),C=E(),z($.$$.fragment),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","schema-fields")},m(F,R){w(F,e,R),g(e,t),g(t,i),g(t,s),g(t,l),g(t,o),g(t,r),g(t,a),g(t,u),O&&O.m(t,null),g(t,f),w(F,c,R),w(F,d,R);for(let q=0;q<m.length;q+=1)m[q]&&m[q].m(d,null);w(F,h,R),j(b,F,R),w(F,y,R),w(F,S,R),w(F,C,R),j($,F,R),M=!0},p(F,[R]){F[0].$isAuth?O||(O=Dd(),O.c(),O.m(t,f)):O&&(O.d(1),O=null),R&55&&(D=F[0].schema,ae(),m=bt(m,R,L,1,F,D,_,d,Bt,Ad,null,Ed),ue());const q={};!T&&R&1&&(T=!0,q.collection=F[0],he(()=>T=!1)),$.$set(q)},i(F){if(!M){for(let R=0;R<D.length;R+=1)A(m[R]);A(b.$$.fragment,F),A($.$$.fragment,F),M=!0}},o(F){for(let R=0;R<m.length;R+=1)I(m[R]);I(b.$$.fragment,F),I($.$$.fragment,F),M=!1},d(F){F&&k(e),O&&O.d(),F&&k(c),F&&k(d);for(let R=0;R<m.length;R+=1)m[R].d();F&&k(h),V(b,F),F&&k(y),F&&k(S),F&&k(C),V($,F)}}}function d4(n,e,t){let i,{collection:s=new yn}=e;const l={text:gC,number:SC,bool:TC,email:y1,url:FC,editor:jC,date:tT,select:CT,json:AT,file:JT,relation:o4};function o($){s.schema[$]&&(s.schema.splice($,1),t(0,s))}function r($="text"){const T=new kn({name:a(),type:$});T.onMountSelect=!0,s.schema.push(T),t(0,s)}function a($="field"){let T="";for(;u($+T);)++T;return $+T}function u($){return!!s.schema.find(T=>T.name===$)}function f($){return i.findIndex(T=>T===$)}function c($,T){var M;!((M=s==null?void 0:s.schema)!=null&&M.length)||$===T||!T||t(0,s.indexes=s.indexes.map(O=>B.replaceIndexColumn(O,$,T)),s)}function d($,T,M,O){M[O]=$,t(0,s)}const m=$=>o($),_=$=>c($.detail.oldName,$.detail.newName);function h($){n.$$.not_equal(s.schema,$)&&(s.schema=$,t(0,s))}const b=$=>{if(!$.detail)return;const T=$.detail.target;T.style.opacity=0,setTimeout(()=>{var M;(M=T==null?void 0:T.style)==null||M.removeProperty("opacity")},0),$.detail.dataTransfer.setDragImage(T,0,0)},y=()=>{en({})},S=$=>r($.detail);function C($){s=$,t(0,s)}return n.$$set=$=>{"collection"in $&&t(0,s=$.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&(t(0,s=s||new yn),t(0,s.schema=[],s)),n.$$.dirty&1&&(i=s.schema.filter($=>!$.toDelete)||[])},[s,l,o,r,f,c,d,m,_,h,b,y,S,C]}class p4 extends ge{constructor(e){super(),_e(this,e,d4,c4,me,{collection:0})}}const m4=n=>({isAdminOnly:n&512}),Id=n=>({isAdminOnly:n[9]}),h4=n=>({isAdminOnly:n&512}),Ld=n=>({isAdminOnly:n[9]}),_4=n=>({isAdminOnly:n&512}),Pd=n=>({isAdminOnly:n[9]});function g4(n){let e,t;return e=new pe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[v4,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&528&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),s&8&&(l.name=i[3]),s&295655&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function b4(n){let e;return{c(){e=v("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Nd(n){let e,t,i;return{c(){e=v("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-1akuazq")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[11]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Fd(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML=`<small class="txt svelte-1akuazq">Unlock and set custom rule</small>
2023-06-11 04:43:09 +08:00
<div class="icon svelte-1akuazq"><i class="ri-lock-unlock-line svelte-1akuazq"></i></div>`,p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,s||(l=K(e,"click",n[10]),s=!0)},p:x,i(o){i||(o&&Qe(()=>{i&&(t||(t=je(e,Kt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Kt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function v4(n){let e,t,i,s,l,o,r=n[9]?"- Admins only":"",a,u,f,c,d,m,_,h,b,y,S;const C=n[12].beforeLabel,$=yt(C,n,n[15],Pd),T=n[12].afterLabel,M=yt(T,n,n[15],Ld);let O=!n[9]&&Nd(n);function D(q){n[14](q)}var L=n[7];function P(q){let H={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(H.value=q[0]),{props:H}}L&&(m=Ft(L,P(n)),n[13](m),ee.push(()=>de(m,"value",D)));let N=n[9]&&Fd(n);const F=n[12].default,R=yt(F,n,n[15],Id);return{c(){e=v("div"),t=v("label"),$&&$.c(),i=E(),s=v("span"),l=U(n[2]),o=E(),a=U(r),u=E(),M&&M.c(),f=E(),O&&O.c(),d=E(),m&&z(m.$$.fragment),h=E(),N&&N.c(),b=E(),y=v("div"),R&&R.c(),p(s,"class","txt"),Q(s,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,H){w(q,e,H),g(e,t),$&&$.m(t,null),g(t,i),g(t,s),g(s,l),g(s,o),g(s,a),g(t,u),M&&M.m(t,null),g(t,f),O&&O.m(t,null),g(e,d),m&&j(m,e,null),g(e,h),N&&N.m(e,null),w(q,b,H),w(q,y,H),R&&R.m(y,null),S=!0},p(q,H){$&&$.p&&(!S||H&33280)&&wt($,C,q,q[15],S?kt(C,q[15],H,_4):St(q[15]),Pd),(!S||H&4)&&se(l,q[2]),(!S||H&512)&&r!==(r=q[9]?"- Admins only":"")&&se(a,r),(!S||H&512)&&Q(s,"txt-hint",q[9]),M&&M.p&&(!S||H&33280)&&wt(M,T,q,q[15],S?kt(T,q[15],H,h4):St(q[15]),Ld),q[9]?O&&(O.d(1),O=null):O?O.p(q,H):(O=Nd(q),O.c(),O.m(t,null)),(!S||H&262144&&c!==(c=q[18]))&&p(t,"for",c);const W={};if(H&262144&&(W.id=q[18]),H&2&&(W.baseCollection=q[1]),H&512&&(W.disabled=q[9]),H&544&&(W.placeholder=q[9]?"":q[5]),!_&&H&1&&(_=!0,W.value=q[0],he(()=>_=!1)),H&128&&L!==(L=q[7])){if(m){ae();const X=m;I(X.$$.fragment,1,0,()=>{V(X,1)}),ue()}L?(m=Ft(L,P(q)),q[13](m),ee.push(()=>de(m,"value",D)),z(m.$$.fragment),A(m.$$.fragment,1),j(m,e,h)):m=null}else L&&m.$set(W);q[9]?N?(N.p(q,H),H&512&&A(N,1)):(N=Fd(q),N.c(),A(N,1),N.m(e,null)):N&&(ae(),I(N,1,1,()=>{N=null}),ue()),R&&R.p&&(!S||H&33280)&&wt(R,F,q,q[15],S?kt(F,q[15],H,m4):St(q[15]),Id)},i(q){S||(A($,q),A(M,q),m&&A(m.$$.fragment,q),A(N),A(R,q),S=!0)},o(q){I($,q),I(M,q),m&&I(m.$$.fragment,q),I(N),I(R,q),S=!1},d(q){q&&k(e),$&&$.d(q),M&&M.d(q),O&&O.d(),n[13](null),m&&V(m),N&&N.d(),q&&k(b),q&&k(y),R&&R.d(q)}}}function y4(n){let e,t,i,s;const l=[b4,g4],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),I(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){I(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}let Rd;function k4(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,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,m=null,_=Rd,h=!1;b();async function b(){_||h||(t(8,h=!0),t(7,_=(await at(()=>import("./FilterAutocompleteInput-7af87f48.js"),["./FilterAutocompleteInput-7af87f48.js","./index-d6c84f2c.js"],import.meta.url)).default),Rd=_,t(8,h=!1))}async function y(){t(0,r=m||""),await fn(),d==null||d.focus()}async function S(){m=r,t(0,r=null)}function C(T){ee[T?"unshift":"push"](()=>{d=T,t(6,d)})}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),"placeholder"in T&&t(5,c=T.placeholder),"$$scope"in T&&t(15,l=T.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,c,d,_,h,i,y,S,s,C,$,l]}class Os extends ge{constructor(e){super(),_e(this,e,k4,y4,me,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function qd(n,e,t){const i=n.slic
2023-06-11 04:32:41 +08:00
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.auth.*</code>`,m=E(),_=v("hr"),h=E(),b=v("p"),b.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",y=E(),S=v("div"),S.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",C=E(),$=v("hr"),T=E(),M=v("p"),M.innerHTML=`Example rule:
<br/>
<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(_,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(N,F){w(N,e,F),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o);for(let R=0;R<P.length;R+=1)P[R]&&P[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,_),g(i,h),g(i,b),g(i,y),g(i,S),g(i,C),g(i,$),g(i,T),g(i,M),D=!0},p(N,F){if(F&4){L=N[2];let R;for(R=0;R<L.length;R+=1){const q=qd(N,L,R);P[R]?P[R].p(q,F):(P[R]=Vd(q),P[R].c(),P[R].m(o,null))}for(;R<P.length;R+=1)P[R].d(1);P.length=L.length}},i(N){D||(N&&Qe(()=>{D&&(O||(O=je(e,ot,{duration:150},!0)),O.run(1))}),D=!0)},o(N){N&&(O||(O=je(e,ot,{duration:150},!1)),O.run(0)),D=!1},d(N){N&&k(e),mt(P,N),N&&O&&O.end()}}}function Vd(n){let e,t=n[11]+"",i;return{c(){e=v("code"),i=U(t)},m(s,l){w(s,e,l),g(e,i)},p(s,l){l&4&&t!==(t=s[11]+"")&&se(i,t)},d(s){s&&k(e)}}}function zd(n){let e,t,i,s,l,o,r,a,u;function f(b){n[6](b)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[w4,({isAdminOnly:b})=>({10:b}),({isAdminOnly:b})=>b?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Os({props:c}),ee.push(()=>de(e,"rule",f));function d(b){n[7](b)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),s=new Os({props:m}),ee.push(()=>de(s,"rule",d));function _(b){n[8](b)}let h={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(h.rule=n[0].deleteRule),r=new Os({props:h}),ee.push(()=>de(r,"rule",_)),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment),o=E(),z(r.$$.fragment)},m(b,y){j(e,b,y),w(b,i,y),j(s,b,y),w(b,o,y),j(r,b,y),u=!0},p(b,y){const S={};y&1&&(S.collection=b[0]),y&17408&&(S.$$scope={dirty:y,ctx:b}),!t&&y&1&&(t=!0,S.rule=b[0].createRule,he(()=>t=!1)),e.$set(S);const C={};y&1&&(C.collection=b[0]),!l&&y&1&&(l=!0,C.rule=b[0].updateRule,he(()=>l=!1)),s.$set(C);const $={};y&1&&($.collection=b[0]),!a&&y&1&&(a=!0,$.rule=b[0].deleteRule,he(()=>a=!1)),r.$set($)},i(b){u||(A(e.$$.fragment,b),A(s.$$.fragment,b),A(r.$$.fragment,b),u=!0)},o(b){I(e.$$.fragment,b),I(s.$$.fragment,b),I(r.$$.fragment,b),u=!1},d(b){V(e,b),b&&k(i),V(s,b),b&&k(o),V(r,b)}}}function Hd(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=Me(He.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(s){s&&k(e),t=!1,i()}}}function w4(n){let e,t=!n[10]&&Hd();return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[10]?t&&(t.d(1),t=null):t||(t=Hd(),t.c(),t.m(e.parentNode,e))},d(i){t&&t.d(i),i&&k(e)}}}function Bd(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[S4]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Os({props:l}),ee.push(()=>de(e,"rule",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function S4(n){let e,t,i;return{c(){e=v("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg.
changing the password without requiring to enter the old one, directly updating the verified
state or email, etc.`,t=E(),i=v("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},p:x,d(s){s&&k(e),s&&k(t),s&&k(i)}}}function $4(n){var F,R;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,_,h,b,y,S,C,$,T=n[1]&&jd(n);function M(q){n[4](q)}let O={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(O.rule=n[0].listRule),f=new Os({props:O}),ee.push(()=>de(f,"rule",M));function D(q){n[5](q)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new Os({props:L}),ee.push(()=>de(m,"rule",D));let P=!((F=n[0])!=null&&F.$isView)&&zd(n),N=((R=n[0])==null?void 0:R.$isAuth)&&Bd(n);return{c(){e=v("div"),t=v("div"),i=v("p"),i.innerHTML=`All rules follow the
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
</a>.`,s=E(),l=v("button"),r=U(o),a=E(),T&&T.c(),u=E(),z(f.$$.fragment),d=E(),z(m.$$.fragment),h=E(),P&&P.c(),b=E(),N&&N.c(),y=ye(),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-sm handle")},m(q,H){w(q,e,H),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),T&&T.m(e,null),w(q,u,H),j(f,q,H),w(q,d,H),j(m,q,H),w(q,h,H),P&&P.m(q,H),w(q,b,H),N&&N.m(q,H),w(q,y,H),S=!0,C||($=K(l,"click",n[3]),C=!0)},p(q,[H]){var J,Z;(!S||H&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&se(r,o),q[1]?T?(T.p(q,H),H&2&&A(T,1)):(T=jd(q),T.c(),A(T,1),T.m(e,null)):T&&(ae(),I(T,1,1,()=>{T=null}),ue());const W={};H&1&&(W.collection=q[0]),!c&&H&1&&(c=!0,W.rule=q[0].listRule,he(()=>c=!1)),f.$set(W);const X={};H&1&&(X.collection=q[0]),!_&&H&1&&(_=!0,X.rule=q[0].viewRule,he(()=>_=!1)),m.$set(X),(J=q[0])!=null&&J.$isView?P&&(ae(),I(P,1,1,()=>{P=null}),ue()):P?(P.p(q,H),H&1&&A(P,1)):(P=zd(q),P.c(),A(P,1),P.m(b.parentNode,b)),(Z=q[0])!=null&&Z.$isAuth?N?(N.p(q,H),H&1&&A(N,1)):(N=Bd(q),N.c(),A(N,1),N.m(y.parentNode,y)):N&&(ae(),I(N,1,1,()=>{N=null}),ue())},i(q){S||(A(T),A(f.$$.fragment,q),A(m.$$.fragment,q),A(P),A(N),S=!0)},o(q){I(T),I(f.$$.fragment,q),I(m.$$.fragment,q),I(P),I(N),S=!1},d(q){q&&k(e),T&&T.d(),q&&k(u),V(f,q),q&&k(d),V(m,q),q&&k(h),P&&P.d(q),q&&k(b),N&&N.d(q),q&&k(y),C=!1,$()}}}function C4(n,e,t){let i,{collection:s=new yn}=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=B.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class T4 extends ge{constructor(e){super(),_e(this,e,C4,$4,me,{collection:0})}}function Ud(n,e,t){const i=n.slice();return i[9]=e[t],i}function M4(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-select",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Ft(o,r(n)),ee.push(()=>de(e,"value",l)),e.$on("change",n[6])),{c(){e&&z(e.$$.fragment),i=ye()},m(a,u){e&&j(e,a,u),w(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,he(()=>t=!1)),u&2&&o!==(o=a[1])){if(e){ae();const c=e;I(c.$$.fragment,1,0,()=>{V(c,1)}),ue()}o?(e=Ft(o,r(a)),ee.push(()=>de(e,"value",l)),e.$on("change",a[6]),z(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function O4(n){let e;return{c(){e=v("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Wd(n){let e,t,i=n[3],s=[];for(let l=0;l<i.length;l+=1)s[l]=Yd(Ud(n,i,l));return{c(){e=v("div"),t=v("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){w(l,e,o),g(e,t);for(let r=0;r<s.length;r+=1)s[r]&&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=Ud(l,i,r);s[r]?s[r].p(a,o):(s[r]=Yd(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&&k(e),mt(s,l)}}}function Yd(n){let e,t=n[9]+"",i;return{c(){e=v("p"),i=U(t)},m(s,l){w(s,e,l),g(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&se(i,t)},d(s){s&&k(e)}}}function E4(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[O4,M4],m=[];function _(b,y){return b[2]?0:1}l=_(n),o=m[l]=d[l](n);let h=n[3].length&&Wd(n);return{c(){e=v("label"),t=v("span"),t.textContent="Select query",s=E(),o.c(),r=E(),a=v("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>) are not supported.</
<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
<code>(ROW_NUMBER() OVER()) as id</code>.</li>
<li>Expressions must be aliased with a valid formatted field name (eg.
2023-06-11 04:43:09 +08:00
<code>MAX(balance) as maxBalance</code>).</li></ul>`,u=E(),h&&h.c(),f=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(b,y){w(b,e,y),g(e,t),w(b,s,y),m[l].m(b,y),w(b,r,y),w(b,a,y),w(b,u,y),h&&h.m(b,y),w(b,f,y),c=!0},p(b,y){(!c||y&256&&i!==(i=b[8]))&&p(e,"for",i);let S=l;l=_(b),l===S?m[l].p(b,y):(ae(),I(m[S],1,1,()=>{m[S]=null}),ue(),o=m[l],o?o.p(b,y):(o=m[l]=d[l](b),o.c()),A(o,1),o.m(r.parentNode,r)),b[3].length?h?h.p(b,y):(h=Wd(b),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},i(b){c||(A(o),c=!0)},o(b){I(o),c=!1},d(b){b&&k(e),b&&k(s),m[l].d(b),b&&k(r),b&&k(a),b&&k(u),h&&h.d(b),b&&k(f)}}}function D4(n){let e,t;return e=new pe({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[E4,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(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){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function A4(n,e,t){let i;Je(n,$i,c=>t(4,i=c));let{collection:s=new yn}=e,l,o=!1,r=[];function a(c){var _;t(3,r=[]);const d=B.getNestedVal(c,"schema",null);if(B.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=B.extractColumnsFromQuery((_=s==null?void 0:s.options)==null?void 0:_.query);B.removeByValue(m,"id"),B.removeByValue(m,"created"),B.removeByValue(m,"updated");for(let h in d)for(let b in d[h]){const y=d[h][b].message,S=m[h]||h;r.push(B.sentenize(S+": "+y))}}Gt(async()=>{t(2,o=!0);try{t(1,l=(await at(()=>import("./CodeEditor-a48bc518.js"),["./CodeEditor-a48bc518.js","./index-d6c84f2c.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&&ai("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 I4 extends ge{constructor(e){super(),_e(this,e,A4,D4,me,{collection:0})}}const L4=n=>({active:n&1}),Kd=n=>({active:n[0]});function Jd(n){let e,t,i;const s=n[15].default,l=yt(s,n,n[14],null);return{c(){e=v("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&wt(l,s,o,o[14],i?kt(s,o[14],r,null):St(o[14]),null)},i(o){i||(A(l,o),o&&Qe(()=>{i&&(t||(t=je(e,ot,{duration:150},!0)),t.run(1))}),i=!0)},o(o){I(l,o),o&&(t||(t=je(e,ot,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),o&&t&&t.end()}}}function P4(n){let e,t,i,s,l,o,r;const a=n[15].header,u=yt(a,n,n[14],Kd);let f=n[0]&&Jd(n);return{c(){e=v("div"),t=v("button"),u&&u.c(),i=E(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),Q(t,"interactive",n[3]),p(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),Q(e,"active",n[0])},m(c,d){w(c,e,d),g(e,t),u&&u.m(t,null),g(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[K(t,"click",et(n[17])),K(t,"drop",et(n[18])),K(t,"dragstart",n[19]),K(t,"dragenter",n[20]),K(t,"dragleave",n[21]),K(t,"dragover",et(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!l||d&16385)&&wt(u,a,c,c[14],l?kt(a,c[14],d,L4):St(c[14]),Kd),(!l||d&4)&&p(t,"draggable",c[2]),(!l||d&8)&&Q(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&A(f,1)):(f=Jd(c),f.c(),A(f,1),f.m(e,null)):f&&(ae(),I(f,1,1,()=>{f=null}),ue()),(!l||d&130&&s!==(s="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",s),(!l||d&131)&&Q(e,"active",c[0])},i(c){l||(A(u,c),A(f),l=!0)},o(c){I(u,c),I(f),l=!1},d(c){c&&k(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Ee(r)}}}function N4(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=$t();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function _(){return!!f}function h(){S(),t(0,f=!0),l("expand")}function b(){t(0,f=!1),clearTimeout(r),l("collapse")}function y(){l("toggle"),f?b():h()}function S(){if(d&&o.closest(".accordions")){const P=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const
2023-06-11 04:32:41 +08:00
<span class="txt">Username/Password</span>`,t=E(),i=v("div"),s=E(),f.c(),l=E(),c&&c.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){w(d,e,m),w(d,t,m),w(d,i,m),w(d,s,m),f.m(d,m),w(d,l,m),c&&c.m(d,m),w(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=Zd(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(ae(),I(c,1,1,()=>{c=null}),ue())},i(d){r||(A(c),r=!0)},o(d){I(c),r=!1},d(d){d&&k(e),d&&k(t),d&&k(i),d&&k(s),f.d(d),d&&k(l),c&&c.d(d),d&&k(o)}}}function z4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowEmailAuth,w(u,i,f),w(u,s,f),g(s,l),r||(a=K(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&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Gd(n){let e,t,i,s,l,o,r,a;return i=new pe({props:{class:"form-field "+(B.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[H4,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+(B.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[B4,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(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){w(u,e,f),g(e,t),j(i,t,null),g(e,s),g(e,l),j(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(B.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 "+(B.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&&Qe(()=>{a&&(r||(r=je(e,ot,{duration:150},!0)),r.run(1))}),a=!0)},o(u){I(i.$$.fragment,u),I(o.$$.fragment,u),u&&(r||(r=je(e,ot,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&k(e),V(i),V(o),u&&r&&r.end()}}}function H4(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function _(b){n[7](b)}let h={id:n[12],disabled:!B.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(h.value=n[0].options.exceptEmailDomains),r=new Vs({props:h}),ee.push(()=>de(r,"value",_)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("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(b,y){w(b,e,y),g(e,t),g(e,i),g(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(m=Me(He.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(b,y){(!c||y&4096&&l!==(l=b[12]))&&p(e,"for",l);const S={};y&4096&&(S.id=b[12]),y&1&&(S.disabled=!B.isEmpty(b[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=b[0].options.exceptEmailDomains,he(()=>a=!1)),r.$set(S)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){I(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,m()}}}function B4(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function _(b){n[8](b)}let h={id:n[12],disabled:!B.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(h.value=n[0].options.onlyEmailDomains),r=new Vs({props:h}),ee.push(()=>de(r,"value",_)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("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(b,y){w(b,e,y),g(e,t),g(e,i),g(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(m=Me(He.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&4096&&l!==(l=b[12]))&&p(e,"for",l);const S={};y&4096&&(S.id=b[12]),y&1&&(S.disabled=!B.isEmpty(b[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=b[0].options.onlyEmailDomains,he(()=>a=!1)),r.$set(S)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){I(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,m()}}}function U4(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[z4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Gd(n);return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=ye()},m(o,r){j(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&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=Gd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),I(l,1,1,()=>{l=null}),ue())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){I(e.$$.fragment,o),I(l),s=!1},d(o){V(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function W4(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Y4(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Xd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Me(He.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Qe(()=>{i&&(t||(t=je(e,Kt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=je(e,Kt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function K4(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowEmailAuth?Y4:W4}let u=a(n),f=u(n),c=n[2]&&Xd();return{c(){e=v("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
<span class="txt">Email/Password</span>`,t=E(),i=v("div"),s=E(),f.c(),l=E(),c&&c.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){w(d,e,m),w(d,t,m),w(d,i,m),w(d,s,m),f.m(d,m),w(d,l,m),c&&c.m(d,m),w(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=Xd(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(ae(),I(c,1,1,()=>{c=null}),ue())},i(d){r||(A(c),r=!0)},o(d){I(c),r=!1},d(d){d&&k(e),d&&k(t),d&&k(i),d&&k(s),f.d(d),d&&k(l),c&&c.d(d),d&&k(o)}}}function J4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowOAuth2Auth,w(u,i,f),w(u,s,f),g(s,l),r||(a=K(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&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Qd(n){let e,t,i;return{c(){e=v("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){w(s,e,l),i=!0},i(s){i||(s&&Qe(()=>{i&&(t||(t=je(e,ot,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=je(e,ot,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function Z4(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[J4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Qd();return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=ye()},m(o,r){j(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=Qd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),I(l,1,1,()=>{l=null}),ue())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){I(e.$$.fragment,o),I(l),s=!1},d(o){V(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function G4(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function X4(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function xd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Me(He.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Qe(()=>{i&&(t||(t=je(e,Kt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=je(e,Kt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function Q4(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowOAuth2Auth?X4:G4}let u=a(n),f=u(n),c=n[1]&&xd();return{c(){e=v("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
<span class="txt">OAuth2</span>`,t=E(),i=v("div"),s=E(),f.c(),l=E(),c&&c.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){w(d,e,m),w(d,t,m),w(d,i,m),w(d,s,m),f.m(d,m),w(d,l,m),c&&c.m(d,m),w(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=xd(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(ae(),I(c,1,1,()=>{c=null}),ue())},i(d){r||(A(c),r=!0)},o(d){I(c),r=!1},d(d){d&&k(e),d&&k(t),d&&k(i),d&&k(s),f.d(d),d&&k(l),c&&c.d(d),d&&k(o)}}}function x4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Minimum password length"),s=E(),l=v("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){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),re(l,n[0].options.minPasswordLength),r||(a=K(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&&dt(l.value)!==u[0].options.minPasswordLength&&re(l,u[0].options.minPasswordLength)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function e6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Always require email",o=E(),r=v("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){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=[K(e,"change",n[11]),Me(He.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&&k(e),c&&k(i),c&&k(s),u=!1,Ee(f)}}}function t6(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,b,y;return s=new co({props:{single:!0,$$slots:{header:[V4],default:[R4]},$$scope:{ctx:n}}}),o=new co({props:{single:!0,$$slots:{header:[K4],default:[U4]},$$scope:{ctx:n}}}),a=new co({props:{single:!0,$$slots:{header:[Q4],default:[Z4]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[x4,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),b=new pe({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[e6,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("h4"),e.textContent="Auth methods",t=E(),i=v("div"),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=v("hr"),c=E(),d=v("h4"),d.textContent="General",m=E(),z(_.$$.fragment),h=E(),z(b.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(S,C){w(S,e,C),w(S,t,C),w(S,i,C),j(s,i,null),g(i,l),j(o,i,null),g(i,r),j(a,i,null),w(S,u,C),w(S,f,C),w(S,c,C),w(S,d,C),w(S,m,C),j(_,S,C),w(S,h,C),j(b,S,C),y=!0},p(S,[C]){const $={};C&8201&&($.$$scope={dirty:C,ctx:S}),s.$set($);const T={};C&8197&&(T.$$scope={dirty:C,ctx:S}),o.$set(T);const M={};C&8195&&(M.$$scope={dirty:C,ctx:S}),a.$set(M);const O={};C&12289&&(O.$$scope={dirty:C,ctx:S}),_.$set(O);const D={};C&12289&&(D.$$scope={dirty:C,ctx:S}),b.$set(D)},i(S){y||(A(s.$$.fragment,S),A(o.$$.fragment,S),A(a.$$.fragment,S),A(_.$$.fragment,S),A(b.$$.fragment,S),y=!0)},o(S){I(s.$$.fragment,S),I(o.$$.fragment,S),I(a.$$.fragment,S),I(_.$$.fragment,S),I(b.$$.fragment,S),y=!1},d(S){S&&k(e),S&&k(t),S&&k(i),V(s),V(o),V(a),S&&k(u),S&&k(f),S&&k(c),S&&k(d),S&&k(m),V(_,S),S&&k(h),V(b,S)}}}function n6(n,e,t){let i,s,l,o;Je(n,$i,h=>t(4,o=h));let{collection:r=new yn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(h){n.$$.not_equal(r.options.exceptEmailDomains,h)&&(r.options.exceptEmailDomains=h,t(0,r))}function c(h){n.$$.not_equal(r.options.onlyEmailDomains,h)&&(r.options.onlyEmailDomains=h,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=dt(this.value),t(0,r)}function _(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=h=>{"collection"in h&&t(0,r=h.collection)},n.$$.update=()=>{var h,b,y,S;n.$$.dirty&1&&r.$isAuth&&B.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!B.isEmpty((h=o==null?void 0:o.options)==null?void 0:h.allowEmailAuth)||!B.isEmpty((b=o==null?void 0:o.options)==null?void 0:b.onlyEmailDomains)||!B.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!B.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,m,_]}class i6 extends ge{constructor(e){super(),_e(this,e,n6,t6,me,{collection:0})}}function ep(n,e,t){const i=n.slice();return i[17]=e[t],i}function tp(n,e,t){const i=n.slice();return i[17]=e[t],i}function np(n,e,t){const i=n.slice();return i[17]=e[t],i}function ip(n){let e;return{c(){e=v("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function sp(n){var r;let e,t,i,s,l=n[3]&&lp(n),o=!((r=n[2])!=null&&r.$isView)&&op(n);return{c(){e=v("h6"),e.textContent="Changes:",t=E(),i=v("ul"),l&&l.c(),s=E(),o&&o.c(),p(i,"class","changes-list svelte-xqpcsf")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),l&&l.m(i,null),g(i,s),o&&o.m(i,null)},p(a,u){var f;a[3]?l?l.p(a,u):(l=lp(a),l.c(),l.m(i,s)):l&&(l.d(1),l=null),(f=a[2])!=null&&f.$isView?o&&(o.d(1),o=null):o?o.p(a,u):(o=op
`),s=v("strong"),o=U(l),r=E(),a=v("i"),u=E(),f=v("strong"),d=U(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"),p(e,"class","svelte-xqpcsf")},m(h,b){w(h,e,b),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(h,b){var y,S;b&2&&l!==(l=((y=h[1])==null?void 0:y.name)+"")&&se(o,l),b&4&&c!==(c=((S=h[2])==null?void 0:S.name)+"")&&se(d,c)},d(h){h&&k(e)}}}function op(n){let e,t,i,s=n[5],l=[];for(let f=0;f<s.length;f+=1)l[f]=rp(np(n,s,f));let o=n[7],r=[];for(let f=0;f<o.length;f+=1)r[f]=ap(tp(n,o,f));let a=n[6],u=[];for(let f=0;f<a.length;f+=1)u[f]=up(ep(n,a,f));return{c(){for(let f=0;f<l.length;f+=1)l[f].c();e=E();for(let f=0;f<r.length;f+=1)r[f].c();t=E();for(let f=0;f<u.length;f+=1)u[f].c();i=ye()},m(f,c){for(let d=0;d<l.length;d+=1)l[d]&&l[d].m(f,c);w(f,e,c);for(let d=0;d<r.length;d+=1)r[d]&&r[d].m(f,c);w(f,t,c);for(let d=0;d<u.length;d+=1)u[d]&&u[d].m(f,c);w(f,i,c)},p(f,c){if(c&32){s=f[5];let d;for(d=0;d<s.length;d+=1){const m=np(f,s,d);l[d]?l[d].p(m,c):(l[d]=rp(m),l[d].c(),l[d].m(e.parentNode,e))}for(;d<l.length;d+=1)l[d].d(1);l.length=s.length}if(c&128){o=f[7];let d;for(d=0;d<o.length;d+=1){const m=tp(f,o,d);r[d]?r[d].p(m,c):(r[d]=ap(m),r[d].c(),r[d].m(t.parentNode,t))}for(;d<r.length;d+=1)r[d].d(1);r.length=o.length}if(c&64){a=f[6];let d;for(d=0;d<a.length;d+=1){const m=ep(f,a,d);u[d]?u[d].p(m,c):(u[d]=up(m),u[d].c(),u[d].m(i.parentNode,i))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}},d(f){mt(l,f),f&&k(e),mt(r,f),f&&k(t),mt(u,f),f&&k(i)}}}function rp(n){let e,t,i,s=n[17].name+"",l,o,r;return{c(){e=v("li"),t=U(`Multiple to single value conversion of field
`),i=v("strong"),l=U(s),o=E(),r=v("em"),r.textContent="(will keep only the last array item)",p(r,"class","txt-sm"),p(e,"class","svelte-xqpcsf")},m(a,u){w(a,e,u),g(e,t),g(e,i),g(i,l),g(e,o),g(e,r)},p(a,u){u&32&&s!==(s=a[17].name+"")&&se(l,s)},d(a){a&&k(e)}}}function ap(n){let e,t,i,s,l=n[17].originalName+"",o,r,a,u,f,c=n[17].name+"",d;return{c(){e=v("li"),t=v("div"),i=U(`Renamed field
`),s=v("strong"),o=U(l),r=E(),a=v("i"),u=E(),f=v("strong"),d=U(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"),p(e,"class","svelte-xqpcsf")},m(m,_){w(m,e,_),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,_){_&128&&l!==(l=m[17].originalName+"")&&se(o,l),_&128&&c!==(c=m[17].name+"")&&se(d,c)},d(m){m&&k(e)}}}function up(n){let e,t,i,s=n[17].name+"",l,o;return{c(){e=v("li"),t=U("Removed field "),i=v("span"),l=U(s),o=E(),p(i,"class","txt-bold"),p(e,"class","txt-danger svelte-xqpcsf")},m(r,a){w(r,e,a),g(e,t),g(e,i),g(i,l),g(e,o)},p(r,a){a&64&&s!==(s=r[17].name+"")&&se(l,s)},d(r){r&&k(e)}}}function s6(n){let e,t,i,s,l,o,r,a,u=n[6].length&&ip(),f=n[8]&&sp(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=E(),s=v("div"),l=v("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=E(),u&&u.c(),r=E(),f&&f.c(),a=ye(),p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),g(e,t),g(e,i),g(e,s),g(s,l),g(s,o),u&&u.m(s,null),w(c,r,d),f&&f.m(c,d),w(c,a,d)},p(c,d){c[6].length?u||(u=ip(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[8]?f?f.p(c,d):(f=sp(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&k(e),u&&u.d(),c&&k(r),f&&f.d(c),c&&k(a)}}}function l6(n){let e;return{c(){e=v("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function o6(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=E(),i=v("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){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[K(e,"click",n[11]),K(i,"click",n[12])],s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Ee(l)}}}function r6(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[o6],header:[l6],default:[s6]},$$scope:{ctx:n}};return e=new ln({props:i}),n[13](e),e.$on("hide",n[14]),e.$on("show",n[15]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&16777710&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[13](null),V(e,s)}}}function a6(n,e,t){let i,s,l,o,r;const a=$t();let u,f,c;async function d($,T){t(1,f=$),t(2,c=T),await fn(),i||s.length||l.length||o.length?u==null||u.show():_()}function m(){u==null||u.hide()}function _(){m(),a("confirm")}const h=()=>m(),b=()=>_();function y($){ee[$?"unshift":"push"](()=>{u=$,t(4,u)})}function S($){Ne.call(this,n,$)}function C($){Ne.call(this,n,$)}return n.$$.update=()=>{var $,T,M;n.$$.dirty&6&&t(3,i=(f==null?void 0:f.name)!=(c==null?void 0:c.name)),n.$$.dirty&4&&t(7,s=(($=c==null?void 0:c.schema)==null?void 0:$.filter(O=>O.id&&!O.toDelete&&O.originalName!=O.name))||[]),n.$$.dirty&4&&t(6,l=((T=c==null?void 0:c.schema)==null?void 0:T.filter(O=>O.id&&O.toDelete))||[]),n.$$.dirty&6&&t(5,o=((M=c==null?void 0:c.schema)==null?void 0:M.filter(O=>{var L,P,N;const D=(L=f==null?void 0:f.schema)==null?void 0:L.find(F=>F.id==O.id);return D?((P=D.options)==null?void 0:P.maxSelect)!=1&&((N=O.options)==null?void 0:N.maxSelect)==1:!1}))||[]),n.$$.dirty&12&&t(8,r=!(c!=null&&c.$isView)||i)},[m,f,c,i,u,o,l,s,r,_,d,h,b,y,S,C]}class u6 extends ge{constructor(e){super(),_e(this,e,a6,r6,me,{show:10,hide:0})}get show(){return this.$$.ctx[10]}get hide(){return this.$$.ctx[0]}}function fp(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function f6(n){let e,t,i;function s(o){n[33](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new p4({props:l}),ee.push(()=>de(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function c6(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new I4({props:l}),ee.push(()=>de(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function cp(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 T4({props:o}),ee.push(()=>de(t,"collection",l)),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),j(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],he(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){I(t.$$.fragment,r),s=!1},d(r){r&&k(e),V(t)}}}function dp(n){let e,t,i,s;function l(r){n[35](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new i6({props:o}),ee.push(()=>de(t,"collection",l)),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===Ns)},m(r,a){w(r,e,a),j(t,e,null),s=!0},
<span class="txt">Duplicate</span>`,t=E(),i=v("button"),i.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<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){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[K(e,"click",n[24]),K(i,"click",An(et(n[25])))],s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Ee(l)}}}function mp(n){let e,t,i,s;return i=new Kn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[m6]},$$scope:{ctx:n}}}),{c(){e=v("i"),t=E(),z(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(l,o){w(l,e,o),w(l,t,o),j(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){I(i.$$.fragment,l),s=!1},d(l){l&&k(e),l&&k(t),V(i,l)}}}function hp(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,c;function d(){return n[27](n[47])}return{c(){e=v("button"),t=v("i"),s=E(),l=v("span"),r=U(o),a=U(" collection"),u=E(),p(t,"class",i=ls(B.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,_){w(m,e,_),g(e,t),g(e,s),g(e,l),g(l,r),g(l,a),g(e,u),f||(c=K(e,"click",d),f=!0)},p(m,_){n=m,_[0]&64&&i!==(i=ls(B.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&p(t,"class",i),_[0]&64&&o!==(o=n[48]+"")&&se(r,o),_[0]&68&&Q(e,"selected",n[47]==n[2].type)},d(m){m&&k(e),f=!1,c()}}}function m6(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=hp(fp(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=ye()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);w(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=fp(s,t,o);i[o]?i[o].p(r,l):(i[o]=hp(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){mt(i,s),s&&k(e)}}}function _p(n){let e;return{c(){e=v("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function h6(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,b,y=(n[6][n[2].type]||"N/A")+"",S,C,$,T,M,O,D,L,P,N=n[2].$isNew&&mp(n),F=n[2].system&&_p();return{c(){e=v("label"),t=U("Name"),s=E(),l=v("input"),f=E(),c=v("div"),d=v("button"),m=v("span"),_=E(),h=v("span"),b=U("Type: "),S=U(y),C=E(),N&&N.c(),M=E(),F&&F.c(),O=ye(),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(h,"class","txt"),p(d,"type","button"),p(d,"class",$="btn btn-sm p-r-10 p-l-10 "+(n[2].$isNew?"btn-outline":"btn-transparent")),d.disabled=T=!n[2].$isNew,p(c,"class","form-field-addon")},m(R,q){w(R,e,q),g(e,t),w(R,s,q),w(R,l,q),w(R,f,q),w(R,c,q),g(c,d),g(d,m),g(d,_),g(d,h),g(h,b),g(h,S),g(d,C),N&&N.m(d,null),w(R,M,q),F&&F.m(R,q),w(R,O,q),D=!0,n[2].$isNew&&l.focus(),L||(P=K(l,"input",n[26]),L=!0)},p(R,q){(!D||q[1]&32768&&i!==(i=R[46]))&&p(e,"for",i),(!D||q[1]&32768&&o!==(o=R[46]))&&p(l,"id",o),(!D||q[0]&8192)&&(l.disabled=R[13]),(!D||q[0]&4&&r!==(r=R[2].$isNew))&&(l.autofocus=r),(!D||q[0]&4&&a!==(a=R[2].$isAuth?'eg. "users"':'eg. "posts"'))&&p(l,"placeholder",a),(!D||q[0]&4&&u!==(u=R[2].name)&&l.value!==u)&&(l.value=u),(!D||q[0]&68)&&y!==(y=(R[6][R[2].type]||"N/A")+"")&&se(S,y),R[2].$isNew?N?(N.p(R,q),q[0]&4&&A(N,1)):(N=mp(R),N.c(),A(N,1),N.m(d,null)):N&&(ae(),I(N,1,1,()=>{N=null}),ue()),(!D||q[0]&4&&$!==($="btn btn-sm p-r-10 p-l-10 "+(R[2].$isNew?"btn-outline":"btn-transparent")))&&p(d,"class",$),(!D||q[0]&4&&T!==(T=!R[2].$isNew))&&(d.disabled=T),R[2].system?F||(F=_p(),F.c(),F.m(O.parentNode,O)):F&&(F.d(1),F=null)},i(R){D||(A(N),D=!0)},o(R){I(N),D=!1},d(R){R&&k(e),R&&k(s),R&&k(l),R&&k(f),R&&k(c),N&&N.d(),R&&k(M),F&&F.d(R),R&&k(O),L=!1,P()}}}function gp(n){let e,t,i,s,l,o;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=Me(t=He.call(null,e,n[11])),l=!0)},p(r,a){t&&qt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&Qe(()=>{s&&(i||(i=je(e,Kt,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i|
2023-06-11 04:43:09 +08:00
<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){w(l,e,o),g(e,t),i||(s=K(t,"click",n[12]),i=!0)},p:x,d(l){l&&k(e),i=!1,s()}}}function k6(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],m=new Map,_,h,b,y,S,C,$=n[3];const T=L=>L[15].id;for(let L=0;L<$.length;L+=1){let P=Sp(n,$,L),N=T(P);m.set(N,d[L]=Tp(N,P))}let M=null;$.length||(M=$p(n));let O=!n[7]&&Mp(n),D={};return b=new cu({props:D}),n[13](b),b.$on("save",n[14]),{c(){e=v("aside"),t=v("header"),i=v("div"),s=v("div"),l=v("button"),l.innerHTML='<i class="ri-close-line"></i>',o=E(),r=v("input"),a=E(),u=v("hr"),f=E(),c=v("div");for(let L=0;L<d.length;L+=1)d[L].c();M&&M.c(),_=E(),O&&O.c(),h=E(),z(b.$$.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(L,P){w(L,e,P),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]&&d[N].m(c,null);M&&M.m(c,null),g(e,_),O&&O.m(e,null),w(L,h,P),j(b,L,P),y=!0,S||(C=[K(l,"click",n[10]),K(r,"input",n[11])],S=!0)},p(L,[P]){(!y||P&16)&&Q(l,"hidden",!L[4]),P&1&&r.value!==L[0]&&re(r,L[0]),(!y||P&16)&&Q(i,"active",L[4]),P&42&&($=L[3],d=bt(d,P,T,1,L,$,m,c,as,Tp,null,Sp),!$.length&&M?M.p(L,P):$.length?M&&(M.d(1),M=null):(M=$p(L),M.c(),M.m(c,null))),(!y||P&64)&&Q(c,"fade",L[6]),(!y||P&8)&&Q(c,"sidebar-content-compact",L[3].length>20),L[7]?O&&(O.d(1),O=null):O?O.p(L,P):(O=Mp(L),O.c(),O.m(e,null));const N={};b.$set(N)},i(L){y||(A(b.$$.fragment,L),y=!0)},o(L){I(b.$$.fragment,L),y=!1},d(L){L&&k(e);for(let P=0;P<d.length;P+=1)d[P].d();M&&M.d(),O&&O.d(),L&&k(h),n[13](null),V(b,L),S=!1,Ee(C)}}}function w6(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function S6(n,e,t){let i,s,l,o,r,a,u;Je(n,ui,S=>t(5,o=S)),Je(n,ci,S=>t(9,r=S)),Je(n,ko,S=>t(6,a=S)),Je(n,As,S=>t(7,u=S));let f,c="";function d(S){sn(ui,o=S,o)}const m=()=>t(0,c="");function _(){c=this.value,t(0,c)}const h=()=>f==null?void 0:f.show();function b(S){ee[S?"unshift":"push"](()=>{f=S,t(2,f)})}const y=S=>{var C;(C=S.detail)!=null&&C.isNew&&S.detail.collection&&d(S.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&w6(),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(S=>S.id==c||S.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[c,i,f,l,s,o,a,u,d,r,m,_,h,b,y]}class $6 extends ge{constructor(e){super(),_e(this,e,S6,k6,me,{})}}function Op(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Ep(n){n[18]=n[19].default}function Dp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Ap(n){let e;return{c(){e=v("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ip(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&Ap();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ye(),c&&c.c(),s=E(),l=v("button"),r=U(o),a=E(),p(l,"type","button"),p(l,"class","sidebar-item"),Q(l,"active",e[5]===e[14]),this.first=t},m(m,_){w(m,t,_),c&&c.m(m,_),w(m,s,_),w(m,l,_),g(l,r),g(l,a),u||(f=K(l,"click",d),u=!0)},p(m,_){e=m,_&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Ap(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),_&8&&o!==(o=e[15].label+"")&&se(r,o),_&40&&Q(l,"active",e[5]===e[14])},d(m){m&&k(t),c&&c.d(m),m&&k(s),m&&k(l),u=!1,f()}}}function Lp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:M6,then:T6,catch:C6,value:19,blocks:[,,,]};return gu(t=n[15].component,s),{c(){e=ye(),s.block.c()},m(l,o){w(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.an
2023-06-11 04:32:41 +08:00
form-field form-field-list form-field-file
`+(n[4].required?"required":"")+`
`+(n[9]?"dragover":"")+`
`,name:n[4].name,$$slots:{default:[KM,({uniqueId:o})=>({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),j(t,e,null),i=!0,s||(l=[K(e,"dragover",et(n[25])),K(e,"dragleave",n[26]),K(e,"drop",n[15])],s=!0)},p(o,r){const a={};r[0]&528&&(a.class=`
form-field form-field-list form-field-file
`+(o[4].required?"required":"")+`
`+(o[9]?"dragover":"")+`
`),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(A(t.$$.fragment,o),i=!0)},o(o){I(t.$$.fragment,o),i=!1},d(o){o&&k(e),V(t),s=!1,Ee(l)}}}function ZM(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileNames:u=[]}=e,{field:f=new kn}=e,c,d,m=!1,_="";function h(H){B.removeByValue(u,H),t(2,u)}function b(H){B.pushUnique(u,H),t(2,u)}function y(H){B.isEmpty(a[H])||a.splice(H,1),t(1,a)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileNames:u},bubbles:!0}))}function C(H){var X,J;H.preventDefault(),t(9,m=!1);const W=((X=H.dataTransfer)==null?void 0:X.files)||[];if(!(l||!W.length)){for(const Z of W){const le=s.length+a.length-u.length;if(((J=f.options)==null?void 0:J.maxSelect)<=le)break;a.push(Z)}t(1,a)}}Gt(async()=>{t(10,_=await ce.getAdminFileToken(o.collectionId))});const $=H=>h(H),T=H=>b(H);function M(H){r=H,t(0,r),t(6,i),t(4,f)}const O=H=>y(H);function D(H){a=H,t(1,a)}function L(H){ee[H?"unshift":"push"](()=>{c=H,t(7,c)})}const P=()=>{for(let H of c.files)a.push(H);t(1,a),t(7,c.value=null,c)},N=()=>c==null?void 0:c.click();function F(H){ee[H?"unshift":"push"](()=>{d=H,t(8,d)})}const R=()=>{t(9,m=!0)},q=()=>{t(9,m=!1)};return n.$$set=H=>{"record"in H&&t(3,o=H.record),"value"in H&&t(0,r=H.value),"uploadedFiles"in H&&t(1,a=H.uploadedFiles),"deletedFileNames"in H&&t(2,u=H.deletedFileNames),"field"in H&&t(4,f=H.field)},n.$$.update=()=>{var H,W;n.$$.dirty[0]&2&&(Array.isArray(a)||t(1,a=B.toArray(a))),n.$$.dirty[0]&4&&(Array.isArray(u)||t(2,u=B.toArray(u))),n.$$.dirty[0]&16&&t(6,i=((H=f.options)==null?void 0:H.maxSelect)>1),n.$$.dirty[0]&65&&B.isEmpty(r)&&t(0,r=i?[]:""),n.$$.dirty[0]&1&&t(5,s=B.toArray(r)),n.$$.dirty[0]&54&&t(11,l=(s.length||a.length)&&((W=f.options)==null?void 0:W.maxSelect)<=s.length+a.length-u.length),n.$$.dirty[0]&6&&(a!==-1||u!==-1)&&S()},[r,a,u,o,f,s,i,c,d,m,_,l,h,b,y,C,$,T,M,O,D,L,P,N,F,R,q]}class GM extends ge{constructor(e){super(),_e(this,e,ZM,JM,me,{record:3,value:0,uploadedFiles:1,deletedFileNames:2,field:4},null,[-1,-1])}}function Up(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function XM(n,e){e=Up(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=Up(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function Wp(n,e,t){const i=n.slice();i[6]=e[t];const s=B.toArray(i[0][i[6]]).slice(0,5);return i[7]=s,i}function Yp(n,e,t){const i=n.slice();return i[10]=e[t],i}function Kp(n){let e,t;return e=new du({props:{record:n[0],filename:n[10],size:"xs"}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&1&&(l.record=i[0]),s&3&&(l.filename=i[10]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Jp(n){let e=!B.isEmpty(n[10]),t,i,s=e&&Kp(n);return{c(){s&&s.c(),t=ye()},m(l,o){s&&s.m(l,o),w(l,t,o),i=!0},p(l,o){o&3&&(e=!B.isEmpty(l[10])),e?s?(s.p(l,o),o&3&&A(s,1)):(s=Kp(l),s.c(),A(s,1),s.m(t.parentNode,t)):s&&(ae(),I(s,1,1,()=>{s=null}),ue())},i(l){i||(A(s),i=!0)},o(l){I(s),i=!1},d(l){s&&s.d(l),l&&k(t)}}}function Zp(n){let e,t,i=n[7],s=[];for(let o=0;o<i.length;o+=1)s[o]=Jp(Yp(n,i,o));const l=o=>I(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=ye()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&3){i=o[7];let a;for(a=0;a<i.length;a+=1){const u=Yp(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Jp(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)I(s[r]);t=!1},d(o){mt(s,o),o&&k(e)}}}function QM(n){let e,t,i,s,l,o,r=B.truncate(B.displayValue(n[0],n[2]),70)+"",a,u,f,c,d=n[1],m=[];for(let h=0;h<d.length;h+=1)m[h]=Zp(Wp(n,d,h));const _=h=>I(m[h],1,1,()=>{m[h
`),O&&O.c(),d=E(),_.c(),h=ye(),p(e,"class","flex m-b-base flex-gap-10"),p(l,"class","list picker-list m-b-base svelte-1u8jhky"),p(f,"class","section-title")},m(F,R){w(F,e,R),j(t,e,null),g(e,i),C&&C.m(e,null),w(F,s,R),w(F,l,R);for(let q=0;q<o.length;q+=1)o[q]&&o[q].m(l,null);M&&M.m(l,null),w(F,u,R),w(F,f,R),g(f,c),O&&O.m(f,null),w(F,d,R),L[m].m(F,R),w(F,h,R),b=!0,y||(S=Me(a=XM.call(null,l,n[36])),y=!0)},p(F,R){var W;const q={};R[0]&4&&(q.value=F[2]),R[0]&1024&&(q.autocompleteCollection=F[10]),t.$set(q),(W=F[10])!=null&&W.$isView?C&&(C.d(1),C=null):C?C.p(F,R):(C=Qp(F),C.c(),C.m(e,null)),R[0]&145324&&($=F[3],ae(),o=bt(o,R,T,1,F,$,r,l,Bt,nm,null,Xp),ue(),!$.length&&M?M.p(F,R):$.length?M&&(M.d(1),M=null):(M=xp(F),M.c(),M.m(l,null))),a&&qt(a.update)&&R[0]&2064&&a.update.call(null,F[36]),F[5]>1?O?O.p(F,R):(O=im(F),O.c(),O.m(f,null)):O&&(O.d(1),O=null);let H=m;m=P(F),m===H?L[m].p(F,R):(ae(),I(L[H],1,1,()=>{L[H]=null}),ue(),_=L[m],_?_.p(F,R):(_=L[m]=D[m](F),_.c()),A(_,1),_.m(h.parentNode,h))},i(F){if(!b){A(t.$$.fragment,F);for(let R=0;R<$.length;R+=1)A(o[R]);A(_),b=!0}},o(F){I(t.$$.fragment,F);for(let R=0;R<o.length;R+=1)I(o[R]);I(_),b=!1},d(F){F&&k(e),V(t),C&&C.d(),F&&k(s),F&&k(l);for(let R=0;R<o.length;R+=1)o[R].d();M&&M.d(),F&&k(u),F&&k(f),O&&O.d(),F&&k(d),L[m].d(F),F&&k(h),y=!1,S()}}}function a5(n){var r;let e,t,i,s=(((r=n[10])==null?void 0:r.name)||"")+"",l,o;return{c(){e=v("h4"),t=U("Select "),i=v("strong"),l=U(s),o=U(" records")},m(a,u){w(a,e,u),g(e,t),g(e,i),g(i,l),g(e,o)},p(a,u){var f;u[0]&1024&&s!==(s=(((f=a[10])==null?void 0:f.name)||"")+"")&&se(l,s)},d(a){a&&k(e)}}}function u5(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=E(),i=v("button"),i.innerHTML='<span class="txt">Set selection</span>',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[K(e,"click",n[28]),K(i,"click",n[29])],s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Ee(l)}}}function f5(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[u5],header:[a5],default:[r5]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=qe(o,l[a]);e=new ln({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[10]};return i=new $1({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),s=!0},p(a,u){const f=u[0]&524288?Mt(l,[l[0],l[1],Xt(a[19])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&1024&&(c.collection=a[10]),i.$set(c)},i(a){s||(A(e.$$.fragment,a),A(i.$$.fragment,a),s=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),s=!1},d(a){n[39](null),V(e,a),a&&k(t),n[42](null),V(i,a)}}}const Fr=100;function c5(n,e,t){let i,s,l,o,r,a,u,f;const c=["value","field","show","hide"];let d=xe(e,c),m;Je(n,ci,Le=>t(26,m=Le));const _=$t(),h="picker_"+B.randomString(5);let{value:b}=e,{field:y}=e,S,C,$="",T=[],M=[],O=1,D=0,L=!1,P=!1;function N(){return t(2,$=""),t(3,T=[]),t(6,M=[]),R(),q(!0),S==null?void 0:S.show()}function F(){return S==null?void 0:S.hide()}async function R(){const Le=B.toArray(b);if(!s||!Le.length)return;t(24,P=!0);let $e=[];const nt=Le.slice(),At=[];for(;nt.length>0;){const jt=[];for(const Ut of nt.splice(0,Fr))jt.push(`id="${Ut}"`);At.push(ce.collection(s).getFullList(Fr,{filter:jt.join("||"),$autoCancel:!1}))}try{await Promise.all(At).then(jt=>{$e=$e.concat(...jt)}),t(6,M=[]);for(const jt of Le){const Ut=B.findByKey($e,"id",jt);Ut&&M.push(Ut)}$.trim()||t(3,T=B.filterDuplicatesByKey(M.concat(T)))}catch(jt){ce.error(jt)}t(24,P=!1)}async function q(Le=!1){if(s){t(4,L=!0),Le&&($.trim()?t(3,T=[]):t(3,T=B.toArray(M).slice()));try{const $e=Le?1:O+1,nt=B.getAllCollectionIdentifiers(o),At=await ce.collection(s).getList($e,Fr,{filter:B.normalizeSearchFilter($,nt),sort:o!=null&&o.$isView?"":"-created",$cancelKey:h+"loadList"});t(3,T=B.filterDuplicatesByKey(T.concat(At.items))),O=At.page,t(23,D=At.totalItems)}catch($e){ce.error($e)}t(4,L=!1)}}function H(Le){i==1?t(6,M=[
`,p(e,"class","list-item")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function p5(n){var d;let e,t,i,s,l,o,r,a,u,f;i=new nr({props:{record:n[20],displayFields:(d=n[2].options)==null?void 0:d.displayFields}});function c(){return n[10](n[20])}return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),o=v("button"),o.innerHTML='<i class="ri-close-line"></i>',r=E(),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"),Q(e,"dragging",n[23]),Q(e,"dragover",n[24])},m(m,_){w(m,e,_),g(e,t),j(i,t,null),g(e,s),g(e,l),g(l,o),w(m,r,_),a=!0,u||(f=[Me(He.call(null,o,"Remove")),K(o,"click",c)],u=!0)},p(m,_){var b;n=m;const h={};_&16&&(h.record=n[20]),_&4&&(h.displayFields=(b=n[2].options)==null?void 0:b.displayFields),i.$set(h),(!a||_&8388608)&&Q(e,"dragging",n[23]),(!a||_&16777216)&&Q(e,"dragover",n[24])},i(m){a||(A(i.$$.fragment,m),a=!0)},o(m){I(i.$$.fragment,m),a=!1},d(m){m&&k(e),V(i),m&&k(r),u=!1,Ee(f)}}}function fm(n,e){let t,i,s,l;function o(a){e[11](a)}let r={group:e[2].name+"_relation",index:e[22],disabled:!e[6],$$slots:{default:[p5,({dragging:a,dragover:u})=>({23:a,24:u}),({dragging:a,dragover:u})=>(a?8388608:0)|(u?16777216:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new Nl({props:r}),ee.push(()=>de(i,"list",o)),i.$on("sort",e[12]),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),j(i,a,u),l=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[22]),u&64&&(f.disabled=!e[6]),u&293601300&&(f.$$scope={dirty:u,ctx:e}),!s&&u&16&&(s=!0,f.list=e[4],he(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){I(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function m5(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d=[],m=new Map,_,h,b,y,S,C,$=n[4];const T=O=>O[20].id;for(let O=0;O<$.length;O+=1){let D=lm(n,$,O),L=T(D);m.set(L,d[O]=fm(L,D))}let M=null;return $.length||(M=rm(n)),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),f=v("div"),c=v("div");for(let O=0;O<d.length;O+=1)d[O].c();M&&M.c(),_=E(),h=v("div"),b=v("button"),b.innerHTML=`<i class="ri-magic-line"></i>
<span class="txt">Open picker</span>`,p(t,"class",i=ls(B.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",a=n[19]),p(c,"class","relations-list svelte-1ynw0pc"),p(b,"type","button"),p(b,"class","btn btn-transparent btn-sm btn-block"),p(h,"class","list-item list-item-btn"),p(f,"class","list")},m(O,D){w(O,e,D),g(e,t),g(e,s),g(e,l),g(l,r),w(O,u,D),w(O,f,D),g(f,c);for(let L=0;L<d.length;L+=1)d[L]&&d[L].m(c,null);M&&M.m(c,null),g(f,_),g(f,h),g(h,b),y=!0,S||(C=K(b,"click",n[13]),S=!0)},p(O,D){(!y||D&4&&i!==(i=ls(B.getFieldTypeIcon(O[2].type))+" svelte-1ynw0pc"))&&p(t,"class",i),(!y||D&4)&&o!==(o=O[2].name+"")&&se(r,o),(!y||D&524288&&a!==(a=O[19]))&&p(e,"for",a),D&25166325&&($=O[4],ae(),d=bt(d,D,T,1,O,$,m,c,Bt,fm,null,lm),ue(),!$.length&&M?M.p(O,D):$.length?M&&(M.d(1),M=null):(M=rm(O),M.c(),M.m(c,null)))},i(O){if(!y){for(let D=0;D<$.length;D+=1)A(d[D]);y=!0}},o(O){for(let D=0;D<d.length;D+=1)I(d[D]);y=!1},d(O){O&&k(e),O&&k(u),O&&k(f);for(let D=0;D<d.length;D+=1)d[D].d();M&&M.d(),S=!1,C()}}}function h5(n){let e,t,i,s,l={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[m5,({uniqueId:r})=>({19:r}),({uniqueId:r})=>r?524288:0]},$$scope:{ctx:n}};e=new pe({props:l}),n[14](e);let o={value:n[0],field:n[2]};return i=new d5({props:o}),n[15](i),i.$on("save",n[16]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(r,a){j(e,r,a),w(r,t,a),j(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&268959863&&(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){I(e.$$.fragment,r),I(i.$$.fragment,r),s=!1},d(r){n[14](null),V(e,r),r&&k(t),n[15](null),V(i,r)}}}const cm=100;function _5(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new kn}=e,r,a=[],u=!1,f;function c(){if(u)return!1;const M=B.toArray(s);return t(4,a=a.filter(O=>M.includes(O.id))),M.length!=a.length}async function d(){var L,P;const M=B.toArray(s);if(t(4,a=[]),!((L=o==null?void 0:o.options)!=null&&L.collectionId)||!M.length){t(5,u=!1);return}t(5,u=!0);const O=M.slice(),D=[];for(;O.length>0;){const N=[];for(const F of O.splice(0,cm))N.push(`id="${F}"`);D.push(ce.collection((P=o==null?void 0:o.options)==null?void 0:P.collectionId).getFullList(cm,{filter:N.join("||"),$autoCancel:!1}))}try{let N=[];await Promise.all(D).then(F=>{N=N.concat(...F)});for(const F of M){const R=B.findByKey(N,"id",F);R&&a.push(R)}t(4,a)}catch(N){ce.error(N)}t(5,u=!1)}function m(M){B.removeByKey(a,"id",M.id),t(4,a),_()}function _(){var M;i?t(0,s=a.map(O=>O.id)):t(0,s=((M=a[0])==null?void 0:M.id)||"")}jo(()=>{clearTimeout(f)});const h=M=>m(M);function b(M){a=M,t(4,a)}const y=()=>{_()},S=()=>l==null?void 0:l.show();function C(M){ee[M?"unshift":"push"](()=>{r=M,t(3,r)})}function $(M){ee[M?"unshift":"push"](()=>{l=M,t(1,l)})}const T=M=>{var O;t(4,a=M.detail||[]),t(0,s=i?a.map(D=>D.id):((O=a[0])==null?void 0:O.id)||"")};return n.$$set=M=>{"value"in M&&t(0,s=M.value),"picker"in M&&t(1,l=M.picker),"field"in M&&t(2,o=M.field)},n.$$.update=()=>{var M;n.$$.dirty&4&&t(6,i=((M=o.options)==null?void 0:M.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed()),n.$$.dirty&529&&c()&&(clearTimeout(f),t(9,f=setTimeout(d,0)))},[s,l,o,r,a,u,i,m,_,f,h,b,y,S,C,$,T]}class g5 extends ge{constructor(e){super(),_e(this,e,_5,h5,me,{value:0,picker:1,field:2})}}const b5=["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","ProgressSta
...
2023-06-11 04:43:09 +08:00
-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),g(e,t),w(c,s,d),w(c,l,d),re(l,n[5]),w(c,r,d),w(c,a,d),u||(f=K(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&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function G5(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,b,y,S;return s=new pe({props:{class:"form-field required",name:"clientId",$$slots:{default:[W5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"teamId",$$slots:{default:[Y5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"keyId",$$slots:{default:[K5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field required",name:"duration",$$slots:{default:[J5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),h=new pe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[Z5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),a=E(),u=v("div"),z(f.$$.fragment),c=E(),d=v("div"),z(m.$$.fragment),_=E(),z(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(C,$){w(C,e,$),g(e,t),g(t,i),j(s,i,null),g(t,l),g(t,o),j(r,o,null),g(t,a),g(t,u),j(f,u,null),g(t,c),g(t,d),j(m,d,null),g(t,_),j(h,t,null),b=!0,y||(S=K(e,"submit",et(n[17])),y=!0)},p(C,$){const T={};$&25165828&&(T.$$scope={dirty:$,ctx:C}),s.$set(T);const M={};$&25165832&&(M.$$scope={dirty:$,ctx:C}),r.$set(M);const O={};$&25165840&&(O.$$scope={dirty:$,ctx:C}),f.$set(O);const D={};$&25165888&&(D.$$scope={dirty:$,ctx:C}),m.$set(D);const L={};$&25165856&&(L.$$scope={dirty:$,ctx:C}),h.$set(L)},i(C){b||(A(s.$$.fragment,C),A(r.$$.fragment,C),A(f.$$.fragment,C),A(m.$$.fragment,C),A(h.$$.fragment,C),b=!0)},o(C){I(s.$$.fragment,C),I(r.$$.fragment,C),I(f.$$.fragment,C),I(m.$$.fragment,C),I(h.$$.fragment,C),b=!1},d(C){C&&k(e),V(s),V(r),V(f),V(m),V(h),y=!1,S()}}}function X5(n){let e;return{c(){e=v("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Q5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=U("Close"),i=E(),s=v("button"),l=v("i"),o=E(),r=v("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){w(c,e,d),g(e,t),w(c,i,d),w(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=K(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&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function x5(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[Q5],header:[X5],default:[G5]},$$scope:{ctx:n}};return e=new ln({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){z(e.$$.fragment)},m(s,l){j(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){I(e.$$.fragment,s),t=!1},d(s){n[19](null),V(e,s)}}}const po=15777e3;function eO(n,e,t){let i;const s=$t(),l="apple_secret_"+B.randomString(5);let o,r,a,u,f,c,d=!1;function m(P={}){t(2,r=P.clientId||""),t(3,a=P.teamId||""),t(4,u=P.keyId||""),t(5,f=P.privateKey||""),t(6,c=P.duration||po),en({}),o==null||o.show()}function _(){return o==null?void 0:o.hide()}async function h(){t(7,d=!0);try{const P=await ce.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),zt("Successfully generated client secret."),s("submit",P),o==null||o.hide()}catch(P){ce.error(P)}t(7,d=!1)}fu
2023-06-11 04:32:41 +08:00
`),r=v("button"),r.textContent="Restore draft",a=E(),u=v("button"),u.innerHTML='<i class="ri-close-line"></i>',f=E(),c=v("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(l,"class","flex flex-gap-xs"),p(u,"type","button"),p(u,"class","close"),p(u,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(b,y){w(b,e,y),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),g(l,r),g(t,a),g(t,u),g(e,f),g(e,c),m=!0,_||(h=[K(r,"click",n[36]),Me(He.call(null,u,"Discard draft")),K(u,"click",et(n[37]))],_=!0)},p:x,i(b){m||(d&&d.end(1),m=!0)},o(b){d=$a(e,ot,{duration:150}),m=!1},d(b){b&&k(e),b&&d&&d.end(),_=!1,Ee(h)}}}function gm(n){let e,t,i,s,l;return{c(){e=v("div"),t=v("i"),p(t,"class","ri-calendar-event-line txt-disabled"),p(e,"class","form-field-addon")},m(o,r){w(o,e,r),g(e,t),s||(l=Me(i=He.call(null,t,{text:`Created: ${n[3].created}
Updated: ${n[3].updated}`,position:"left"})),s=!0)},p(o,r){i&&qt(i.update)&&r[0]&8&&i.update.call(null,{text:`Created: ${o[3].created}
Updated: ${o[3].updated}`,position:"left"})},d(o){o&&k(e),s=!1,l()}}}function cO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h=!n[6]&&gm(n);return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="id",l=E(),o=v("span"),a=E(),h&&h.c(),u=E(),f=v("input"),p(t,"class",ls(B.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[69]),p(f,"type","text"),p(f,"id",c=n[69]),p(f,"placeholder","Leave empty to auto generate..."),p(f,"minlength","15"),f.readOnly=d=!n[6]},m(b,y){w(b,e,y),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),w(b,a,y),h&&h.m(b,y),w(b,u,y),w(b,f,y),re(f,n[3].id),m||(_=K(f,"input",n[38]),m=!0)},p(b,y){y[2]&128&&r!==(r=b[69])&&p(e,"for",r),b[6]?h&&(h.d(1),h=null):h?h.p(b,y):(h=gm(b),h.c(),h.m(u.parentNode,u)),y[2]&128&&c!==(c=b[69])&&p(f,"id",c),y[0]&64&&d!==(d=!b[6])&&(f.readOnly=d),y[0]&8&&f.value!==b[3].id&&re(f,b[3].id)},d(b){b&&k(e),b&&k(a),h&&h.d(b),b&&k(u),b&&k(f),m=!1,_()}}}function bm(n){var u,f;let e,t,i,s,l;function o(c){n[39](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new z6({props:r}),ee.push(()=>de(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&vm();return{c(){z(e.$$.fragment),i=E(),a&&a.c(),s=ye()},m(c,d){j(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,s,d),l=!0},p(c,d){var _,h;const m={};d[0]&64&&(m.isNew=c[6]),d[0]&1&&(m.collection=c[0]),!t&&d[0]&8&&(t=!0,m.record=c[3],he(()=>t=!1)),e.$set(m),(h=(_=c[0])==null?void 0:_.schema)!=null&&h.length?a||(a=vm(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){I(e.$$.fragment,c),l=!1},d(c){V(e,c),c&&k(i),a&&a.d(c),c&&k(s)}}}function vm(n){let e;return{c(){e=v("hr")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function dO(n){let e,t,i;function s(o){n[52](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new g5({props:l}),ee.push(()=>de(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[66]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[66].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function pO(n){let e,t,i,s,l;function o(f){n[49](f,n[66])}function r(f){n[50](f,n[66])}function a(f){n[51](f,n[66])}let u={field:n[66],record:n[3]};return n[3][n[66].name]!==void 0&&(u.value=n[3][n[66].name]),n[4][n[66].name]!==void 0&&(u.uploadedFiles=n[4][n[66].name]),n[5][n[66].name]!==void 0&&(u.deletedFileNames=n[5][n[66].name]),e=new GM({props:u}),ee.push(()=>de(e,"value",o)),ee.push(()=>de(e,"uploadedFiles",r)),ee.push(()=>de(e,"deletedFileNames",a)),{c(){z(e.$$.fragment)},m(f,c){j(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[66]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[66].name],he(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[66].name],he(()=>i=!1)),!s&&c[0]&33&&(s=!0,d.deletedFileNames=n[5][n[66].name],he(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){I(e.$$.fragment,f),l=!1},d(f){V(e,f)}}}function mO(n){let e,t,i;function s(o){n[48](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new wM({props:l}),ee.push(()=>de(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[66]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[66].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function hO(n){let e,t,i;function s(o){n[47](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new bM({props:l}),ee.push(()=>de(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[66]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[66].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function _O(n){let e,t,i;function s(o){n[46](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new mM({props:l}),ee.push(()=>de(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[30]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function $m(n){let e,t,i;return{c(){e=v("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){w(s,e,l),t||(i=K(e,"click",n[31]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function $O(n){let e,t,i,s,l,o,r,a=n[0].$isAuth&&!n[2].verified&&n[2].email&&Sm(n),u=n[0].$isAuth&&n[2].email&&$m(n);return{c(){a&&a.c(),e=E(),u&&u.c(),t=E(),i=v("button"),i.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,s=E(),l=v("button"),l.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<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),w(f,e,c),u&&u.m(f,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),o||(r=[K(i,"click",n[32]),K(l,"click",An(et(n[33])))],o=!0)},p(f,c){f[0].$isAuth&&!f[2].verified&&f[2].email?a?a.p(f,c):(a=Sm(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].$isAuth&&f[2].email?u?u.p(f,c):(u=$m(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&k(e),u&&u.d(f),f&&k(t),f&&k(i),f&&k(s),f&&k(l),o=!1,Ee(r)}}}function Cm(n){let e,t,i,s,l,o;return{c(){e=v("div"),t=v("button"),t.textContent="Account",i=E(),s=v("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),Q(t,"active",n[12]===ss),p(s,"type","button"),p(s,"class","tab-item"),Q(s,"active",n[12]===wl),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),g(e,t),g(e,i),g(e,s),l||(o=[K(t,"click",n[34]),K(s,"click",n[35])],l=!0)},p(r,a){a[0]&4096&&Q(t,"active",r[12]===ss),a[0]&4096&&Q(s,"active",r[12]===wl)},d(r){r&&k(e),l=!1,Ee(o)}}}function CO(n){var h;let e,t=n[6]?"New":"Edit",i,s,l,o=((h=n[0])==null?void 0:h.name)+"",r,a,u,f,c,d,m=!n[6]&&wm(n),_=n[0].$isAuth&&!n[6]&&Cm(n);return{c(){e=v("h4"),i=U(t),s=E(),l=v("strong"),r=U(o),a=U(" record"),u=E(),m&&m.c(),f=E(),_&&_.c(),c=ye(),p(e,"class","panel-title svelte-qc5ngu")},m(b,y){w(b,e,y),g(e,i),g(e,s),g(e,l),g(l,r),g(e,a),w(b,u,y),m&&m.m(b,y),w(b,f,y),_&&_.m(b,y),w(b,c,y),d=!0},p(b,y){var S;(!d||y[0]&64)&&t!==(t=b[6]?"New":"Edit")&&se(i,t),(!d||y[0]&1)&&o!==(o=((S=b[0])==null?void 0:S.name)+"")&&se(r,o),b[6]?m&&(ae(),I(m,1,1,()=>{m=null}),ue()):m?(m.p(b,y),y[0]&64&&A(m,1)):(m=wm(b),m.c(),A(m,1),m.m(f.parentNode,f)),b[0].$isAuth&&!b[6]?_?_.p(b,y):(_=Cm(b),_.c(),_.m(c.parentNode,c)):_&&(_.d(1),_=null)},i(b){d||(A(m),d=!0)},o(b){I(m),d=!1},d(b){b&&k(e),b&&k(u),m&&m.d(b),b&&k(f),_&&_.d(b),b&&k(c)}}}function TO(n){let e,t,i,s,l,o=n[6]?"Create":"Save changes",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),r=U(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[10],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[15]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[13]||n[10],Q(s,"btn-loading",n[10])},m(c,d){w(c,e,d),g(e,t),w(c,i,d),w(c,s,d),g(s,l),g(l,r),u||(f=K(e,"click",n[29]),u=!0)},p(c,d){d[0]&1024&&(e.disabled=c[10]),d[0]&64&&o!==(o=c[6]?"Create":"Save changes")&&se(r,o),d[0]&9216&&a!==(a=!c[13]||c[10])&&(s.disabled=a),d[0]&1024&&Q(s,"btn-loading",c[10])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function MO(n){var s;let e,t,i={class:`
record-panel
`+(n[14]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((s=n[0])!=null&&s.$isAuth&&!n[6]?"colored-header":"")+`
`,beforeHide:n[53],$$slots:{footer:[TO],header:[CO],default:[SO]},$$scope:{ctx:n}};return e=new ln({props:i}),n[54](e),e.$on("hide",n[55]),e.$on("show",n[56]),{c(){z(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&16449&&(r.class=`
record-panel
`+(l[14]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((a=l[0])!=null&&a.$isAuth&&!l[6]?"colored-header":"")+`
`),o[0]&2176&&(r.beforeHide=l[53]),o[0]&14077|o[2]&256&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[54](null),V(e,l)}}}const ss="form",wl="providers";function OO(n,e,t){let i,s,l,o;const r=$t(),a="record_"+B.randomString(5);let{collection:u}=e,f,c=null,d=null,m=null,_=!1,h=!1,b={},y={},S=JSON.stringify(null),C=S,$=ss,T=!0,M=!1;function O(ve){return L(ve),t(11,h=!0),t(12,$=ss),f==null?void 0:f.show()}function D(){return f==null?void 0:f.hide()}async function L(ve){t(27,M=!1),en({}),t(2,c=ve||new ki),t(3,d=c.$clone()),t(4,b={}),t(5,y={}),await fn(),t(9,m=F()),!m||H(d,m)?t(9,m=null):(delete m.password,delete m.passwordConfirm),t(25,S=JSON.stringify(d)),t(27,M=!0)}async function P(ve){var Fe,Xe;en({}),t(2,c=ve||new ki),t(4,b={}),t(5,y={});const De=((Xe=(Fe=u==null?void 0:u.schema)==null?void 0:Fe.filter(Ot=>Ot.type!="file"))==null?void 0:Xe.map(Ot=>Ot.name))||[];for(let Ot in ve.$export())De.includes(Ot)||t(3,d[Ot]=ve[Ot],d);await fn(),t(25,S=JSON.stringify(d)),W()}function N(){return"record_draft_"+((u==null?void 0:u.id)||"")+"_"+((c==null?void 0:c.id)||"")}function F(ve){try{const De=window.localStorage.getItem(N());if(De)return new ki(JSON.parse(De))}catch{}return ve}function R(ve){window.localStorage.setItem(N(),ve)}function q(){m&&(t(3,d=m),t(9,m=null))}function H(ve,De){var $n;const Fe=ve==null?void 0:ve.$clone(),Xe=De==null?void 0:De.$clone(),Ot=($n=u==null?void 0:u.schema)==null?void 0:$n.filter(Nn=>Nn.type==="file");for(let Nn of Ot)Fe==null||delete Fe[Nn.name],Xe==null||delete Xe[Nn.name];return Fe==null||delete Fe.password,Fe==null||delete Fe.passwordConfirm,Xe==null||delete Xe.password,Xe==null||delete Xe.passwordConfirm,JSON.stringify(Fe)==JSON.stringify(Xe)}function W(){t(9,m=null),window.localStorage.removeItem(N())}function X(ve=!0){if(_||!o||!(u!=null&&u.id))return;t(10,_=!0);const De=Z();let Fe;T?Fe=ce.collection(u.id).create(De):Fe=ce.collection(u.id).update(d.id,De),Fe.then(Xe=>{zt(T?"Successfully created record.":"Successfully updated record."),W(),ve?(t(11,h=!1),D()):P(Xe),r("save",Xe)}).catch(Xe=>{ce.error(Xe)}).finally(()=>{t(10,_=!1)})}function J(){c!=null&&c.id&&pn("Do you really want to delete the selected record?",()=>ce.collection(c.collectionId).delete(c.id).then(()=>{D(),zt("Successfully deleted record."),r("delete",c)}).catch(ve=>{ce.error(ve)}))}function Z(){const ve=(d==null?void 0:d.$export())||{},De=new FormData,Fe={id:ve.id};for(const Xe of(u==null?void 0:u.schema)||[])Fe[Xe.name]=!0;u!=null&&u.isAuth&&(Fe.username=!0,Fe.email=!0,Fe.emailVisibility=!0,Fe.password=!0,Fe.passwordConfirm=!0,Fe.verified=!0);for(const Xe in ve)Fe[Xe]&&(typeof ve[Xe]>"u"&&(ve[Xe]=null),B.addValueToFormData(De,Xe,ve[Xe]));for(const Xe in b){const Ot=B.toArray(b[Xe]);for(const $n of Ot)De.append(Xe,$n)}for(const Xe in y){const Ot=B.toArray(y[Xe]);for(const $n of Ot)De.append(Xe+"."+$n,"")}return De}function le(){!(u!=null&&u.id)||!(c!=null&&c.email)||pn(`Do you really want to sent verification email to ${c.email}?`,()=>ce.collection(u.id).requestVerification(c.email).then(()=>{zt(`Successfully sent verification email to ${c.email}.`)}).catch(ve=>{ce.error(ve)}))}function ne(){!(u!=null&&u.id)||!(c!=null&&c.email)||pn(`Do you really want to sent password reset email to ${c.email}?`,()=>ce.collection(u.id).requestPasswordReset(c.email).then(()=>{zt(`Successfully sent password reset email to ${c.email}.`)}).catch(ve=>{ce.error(ve)}))}function ie(){l?pn("You have unsaved changes. Do you really want to discard them?",()=>{be()}):be()}async function be(){const ve=c==null?void 0:c.$clone();if(ve){ve.id="",ve.created="",ve.updated="";const De=(u==null?void 0:u.schema)||[];for(const Fe of De)Fe.type==="file"&&delete ve[Fe.name]}W(),O(ve),await fn(),t(25,S="")}function Se(ve){(ve.ctrlKey||ve.metaKey)&&ve.code=="KeyS"&&(ve.preventDefault(),ve.stopPropagation(),X(!1))}const Ve=()=>D(),Be=()=>le(),ke=()=>ne(),Te=()=>ie(),Ze=()=>J(),ht=()=>t(12,$=ss),Ge=()=>t(12,$=wl),Ye=()=>q(),we=()=>W();function fe(){d.id=this.value,t(3,d)}function ze(ve){d=ve,t(3,d)}fu
`},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function _E(n){let e,t,i;return{c(){e=v("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){w(s,e,l),t||(i=K(e,"click",n[40]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function gE(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[39]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function th(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[36](n[55])}return{c(){e=v("td"),t=v("div"),i=v("input"),o=E(),r=v("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){w(d,e,m),g(e,t),g(t,i),g(t,o),g(t,r),u||(f=[K(i,"change",c),K(t,"click",An(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&&k(e),u=!1,Ee(f)}}}function nh(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new Fl({props:{value:n[55].id}});let c=n[2].$isAuth&&ih(n);return{c(){e=v("td"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),a=U(r),u=E(),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){w(d,e,m),g(e,t),g(t,i),j(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 _={};m[0]&16&&(_.value=d[55].id),s.$set(_),(!f||m[0]&16)&&r!==(r=d[55].id+"")&&se(a,r),d[2].$isAuth?c?c.p(d,m):(c=ih(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(s.$$.fragment,d),f=!0)},o(d){I(s.$$.fragment,d),f=!1},d(d){d&&k(e),V(s),c&&c.d()}}}function ih(n){let e;function t(l,o){return l[55].verified?vE:bE}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(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&&k(e)}}}function bE(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){w(s,e,l),t||(i=Me(He.call(null,e,"Unverified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function vE(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){w(s,e,l),t||(i=Me(He.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function sh(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&lh(n),o=i&&oh(n);return{c(){l&&l.c(),t=E(),o&&o.c(),s=ye()},m(r,a){l&&l.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,s,a)},p(r,a){a[0]&128&&(e=!r[7].includes("@username")),e?l?l.p(r,a):(l=lh(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=oh(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&k(t),o&&o.d(r),r&&k(s)}}}function lh(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!B.isEmpty(o[55].username)),t?kE:yE}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(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&&k(e),l.d()}}}function yE(n){let e,t=n[55].username+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].username)},m(l,o){w(l,e,o),g(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&se(i,t),o[0]&16&&s!==(s=l[55].username)&&p(e,"title",s)},d(l){l&&k(e)}}}function kE(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function oh(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!B.isEmpty(o[55].email)),t?SE:wE}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(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&&k(e),l.d()}}}function wE(n){let e,t=n[55].email+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].email)},m(l,o){w(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){w(s,e,l),t||(i=K(e,"click",n[18]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function NE(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,_,h,b,y,S,C,$,T,M,O,D,L,P,N=!n[10]&&_h(n);c=new Zo({}),c.$on("refresh",n[16]);let F=!n[2].$isView&&gh(n);y=new Jo({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[19]);function R(W){n[21](W)}function q(W){n[22](W)}let H={collection:n[2]};return n[0]!==void 0&&(H.filter=n[0]),n[1]!==void 0&&(H.sort=n[1]),T=new AE({props:H}),n[20](T),ee.push(()=>de(T,"filter",R)),ee.push(()=>de(T,"sort",q)),T.$on("select",n[23]),T.$on("new",n[24]),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Collections",s=E(),l=v("div"),r=U(o),a=E(),u=v("div"),N&&N.c(),f=E(),z(c.$$.fragment),d=E(),m=v("div"),_=v("button"),_.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,h=E(),F&&F.c(),b=E(),z(y.$$.fragment),S=E(),C=v("div"),$=E(),z(T.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(_,"type","button"),p(_,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p(C,"class","clearfix m-b-base")},m(W,X){w(W,e,X),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),j(c,u,null),g(e,d),g(e,m),g(m,_),g(m,h),F&&F.m(m,null),w(W,b,X),j(y,W,X),w(W,S,X),w(W,C,X),w(W,$,X),j(T,W,X),D=!0,L||(P=K(_,"click",n[17]),L=!0)},p(W,X){(!D||X[0]&4)&&o!==(o=W[2].name+"")&&se(r,o),W[10]?N&&(N.d(1),N=null):N?N.p(W,X):(N=_h(W),N.c(),N.m(u,f)),W[2].$isView?F&&(F.d(1),F=null):F?F.p(W,X):(F=gh(W),F.c(),F.m(m,null));const J={};X[0]&1&&(J.value=W[0]),X[0]&4&&(J.autocompleteCollection=W[2]),y.$set(J);const Z={};X[0]&4&&(Z.collection=W[2]),!M&&X[0]&1&&(M=!0,Z.filter=W[0],he(()=>M=!1)),!O&&X[0]&2&&(O=!0,Z.sort=W[1],he(()=>O=!1)),T.$set(Z)},i(W){D||(A(c.$$.fragment,W),A(y.$$.fragment,W),A(T.$$.fragment,W),D=!0)},o(W){I(c.$$.fragment,W),I(y.$$.fragment,W),I(T.$$.fragment,W),D=!1},d(W){W&&k(e),N&&N.d(),V(c),F&&F.d(),W&&k(b),V(y,W),W&&k(S),W&&k(C),W&&k($),n[20](null),V(T,W),L=!1,P()}}}function FE(n){let e,t,i,s,l;return{c(){e=v("h1"),e.textContent="Create your first collection to add records!",t=E(),i=v("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){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=K(i,"click",n[14]),s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,l()}}}function RE(n){let e;return{c(){e=v("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function qE(n){let e,t,i;function s(r,a){return r[10]?RE:FE}let l=s(n),o=l(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=E(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(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&&k(e),o.d()}}}function jE(n){let e;return{c(){e=v("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function VE(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[PE,LE,IE],m=[];function _(C,$){return C[3]&&!C[9].length?0:C[9].length?2:1}e=_(n),t=m[e]=d[e](n);let h={};s=new cu({props:h}),n[25](s);let b={};o=new I6({props:b}),n[26](o);let y={collection:n[2]};a=new $1({props:y}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let S={collection:n[2]};return f=new lE({props:S}),n[30](f),{c(){t.c(),i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment)},m(C,$){m[e].m(C,$),w(C,i,$),j(s,C,$),w(C,l,$),j(o,C,$),w(C,r,$),j(a,C,$),w(C,u,$),j(f,C,$),c=!0},p(C,$){let T=e;e=_(C),e===T?m[e].p(C,$):(ae(),I(m[T],1,1,()=>{m[T]=null}),ue(),t=m[e],t?t.p(C,$):(t=m[e]=d[e](C),t.c()),A(t,1),t.m(i.parentNode,i));const M={};s.$set(M);const O={};o.$set(O);const D={};$[0]&4&&(D.collection=C[2]),a.$set(D);const L={};$[0]&4&&(L.collection=C[2]),f.$set(L)},i(C){c||(A(t),A(s.$$.fragment,C),A(o.$$.fragment,C),A(a.$$.fragment,C),A(f.$$.fragment,C),c=!0)},o(C){I(t),I(s.$$.fragment,C),I(o.$$.fragment,C),I(a.$$.fragment,C),I(f.$$.fragment,C),c=!1},d(C){m[e].d(C),C&&k(i),n[25](null),V(s,C),C&&k(l),n[26](null),V(o,C),C&&k(r),n[27](null),V(a,C),C&&k(u),n[30](null),V(f,C)}}}function zE(n,e,t){let i,s,l,o,r,a,u;Je(n,ui,ie=>t(2,s=ie)),Je(n,Tt,ie=>t(31,l=ie)),Je(n,ko,ie=>t(3,o=ie)),Je(n,Ca,ie=>t(13,r=ie)),Je(n,ci,ie=>t(9,a=ie)),Je(n,As,ie=>t(10,u=ie));const f=new URLSearchParams(r);let c,d,m,_,h,b=f.get("filter")||"",y=f.get("sort")||"-created",S=f.get("collectionId")||(s==null?void 0:s.id);function C(){t(11,S=s==null?void 0:s.id),t(0,b=""),t(1,y="-created"),$()}async function $(){if(!y)return;const ie=B.getAllCollectionIdentifiers(s),be=y.split(",").map(Se=>Se.startsWith("+")||Se.startsWith("-")?Se.substring(1):Se);be.filter(Se=>ie.includes(Se)).length!=be.length&&(ie.includes("created")?t(1,y="-created"):t(1,y=""))}Iy(S);const T=()=>c==null?void 0:c.show(),M=()=>c==null?void 0:c.show(s),O=()=>h==null?void 0:h.load(),D=()=>d==null?void 0:d.show(s),L=()=>m==null?void 0:m.show(),P=ie=>t(0,b=ie.detail);function N(ie){ee[ie?"unshift":"push"](()=>{h=ie,t(8,h)})}function F(ie){b=ie,t(0,b)}function R(ie){y=ie,t(1,y)}const q=ie=>{s.$isView?_.show(ie==null?void 0:ie.detail):m==null||m.show(ie==null?void 0:ie.detail)},H=()=>m==null?void 0:m.show();function W(ie){ee[ie?"unshift":"push"](()=>{c=ie,t(4,c)})}function X(ie){ee[ie?"unshift":"push"](()=>{d=ie,t(5,d)})}function J(ie){ee[ie?"unshift":"push"](()=>{m=ie,t(6,m)})}const Z=()=>h==null?void 0:h.reloadLoadedPages(),le=()=>h==null?void 0:h.reloadLoadedPages();function ne(ie){ee[ie?"unshift":"push"](()=>{_=ie,t(7,_)})}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")!=S&&Ey(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&S!=s.id&&C(),n.$$.dirty[0]&4&&s!=null&&s.id&&$(),n.$$.dirty[0]&7&&(y||b||s!=null&&s.id)){const ie=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:b,sort:y}).toString();ji("/collections?"+ie)}n.$$.dirty[0]&4&&sn(Tt,l=(s==null?void 0:s.name)||"Collections",l)},[b,y,s,o,c,d,m,_,h,a,u,S,i,r,T,M,O,D,L,P,N,F,R,q,H,W,X,J,Z,le,ne]}class HE extends ge{constructor(e){super(),_e(this,e,zE,VE,me,{},null,[-1,-1])}}function BE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,b,y,S,C,$,T,M,O,D,L,P,N;return{c(){e=v("aside"),t=v("div"),i=v("div"),i.textContent="System",s=E(),l=v("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
<span class="txt">Application</span>`,o=E(),r=v("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=E(),u=v("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=E(),c=v("a"),c.innerHTML=`<i class="ri-archive-line"></i>
<span class="txt">Backups</span>`,d=E(),m=v("div"),m.innerHTML='<span class="txt">Sync</span>',_=E(),h=v("a"),h.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,b=E(),y=v("a"),y.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,S=E(),C=v("div"),C.textContent="Authentication",$=E(),T=v("a"),T.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,M=E(),O=v("a"),O.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,D=E(),L=v("a"),L.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"href","/settings/backups"),p(c,"class","sidebar-list-item"),p(m,"class","sidebar-title"),p(h,"href","/settings/export-collections"),p(h,"class","sidebar-list-item"),p(y,"href","/settings/import-collections"),p(y,"class","sidebar-list-item"),p(C,"class","sidebar-title"),p(T,"href","/settings/auth-providers"),p(T,"class","sidebar-list-item"),p(O,"href","/settings/tokens"),p(O,"class","sidebar-list-item"),p(L,"href","/settings/admins"),p(L,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(F,R){w(F,e,R),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,_),g(t,h),g(t,b),g(t,y),g(t,S),g(t,C),g(t,$),g(t,T),g(t,M),g(t,O),g(t,D),g(t,L),P||(N=[Me(Vn.call(null,l,{path:"/settings"})),Me(on.call(null,l)),Me(Vn.call(null,r,{path:"/settings/mail/?.*"})),Me(on.call(null,r)),Me(Vn.call(null,u,{path:"/settings/storage/?.*"})),Me(on.call(null,u)),Me(Vn.call(null,c,{path:"/settings/backups/?.*"})),Me(on.call(null,c)),Me(Vn.call(null,h,{path:"/settings/export-collections/?.*"})),Me(on.call(null,h)),Me(Vn.call(null,y,{path:"/settings/import-collections/?.*"})),Me(on.call(null,y)),Me(Vn.call(null,T,{path:"/settings/auth-providers/?.*"})),Me(on.call(null,T)),Me(Vn.call(null,O,{path:"/settings/tokens/?.*"})),Me(on.call(null,O)),Me(Vn.call(null,L,{path:"/settings/admins/?.*"})),Me(on.call(null,L))],P=!0)},p:x,i:x,o:x,d(F){F&&k(e),P=!1,Ee(N)}}}class Ti extends ge{constructor(e){super(),_e(this,e,null,BE,me,{})}}function bh(n,e,t){const i=n.slice();return i[30]=e[t],i}function vh(n){let e,t;return e=new pe({props:{class:"form-field readonly",name:"id",$$slots:{default:[UE,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(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){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function UE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="id",o=E(),r=v("div"),a=v("i"),f=E(),c=v("input"),p(t,"class",B.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(b,y){w(b,e,y),g(e,t),g(e,i),g(e,s),w(b,o,y),w(b,r,y),g(r,a),w(b,f,y),w(b,c,y),_||(h=Me(u=He.call(null,a,{text:`Created: ${n[1].created}
Updated: ${n[1].updated}`,position:"left"})),_=!0)},p(b,y){y[0]&536870912&&l!==(l=b[29])&&p(e,"for",l),u&&qt(u.update)&&y[0]&2&&u.update.call(null,{text:`Created: ${b[1].created}
Updated: ${b[1].updated}`,position:"left"}),y[0]&536870912&&d!==(d=b[29])&&p(c,"id",d),y[0]&2&&m!==(m=b[1].id)&&c.value!==m&&(c.value=m)},d(b){b&&k(e),b&&k(o),b&&k(r),b&&k(f),b&&k(c),_=!1,h()}}}function yh(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=v("button"),t=v("img"),s=E(),hn(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){w(u,e,f),g(e,t),g(e,s),o||(r=K(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&&k(e),o=!1,r()}}}function WE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Email",o=E(),r=v("input"),p(t,"class",B.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){w(c,e,d),g(e,t),g(e,i),g(e,s),w(c,o,d),w(c,r,d),re(r,n[3]),u||(f=K(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&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function kh(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[YE,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(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){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function YE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[29]),p(s,"for",o=n[29])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),g(s,l),r||(a=K(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&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function wh(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[KE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[JE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(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){w(f,e,c),g(e,t),g(t,i),j(s,i,null),g(t,l),g(t,o),j(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&&Qe(()=>{u&&(a||(a=je(t,ot,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(s.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=je(t,ot,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),V(s),V(r),f&&a&&a.end()}}}function KE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password",o=E(),r=v("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){w(c,e,d),g(e,t),g(e,i),g(e,s),w(c,o,d),w(c,r,d),re(r,n[8]),u||(f=K(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&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function JE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password confirm",o=E(),r=v("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){w(c,e,d),g(e,t),g(e,i),g(e,s),w(c,o,d),w(c,r,d),re(r,n[9]),u||(f=K(r,"input",n[21]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[15]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function QE(n){let e,t,i,s,l,o,r=n[1].$isNew?"Create":"Save changes",a,u,f,c,d,m=!n[1].$isNew&&Sh(n);return{c(){m&&m.c(),e=E(),t=v("button"),i=v("span"),i.textContent="Cancel",s=E(),l=v("button"),o=v("span"),a=U(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),w(_,e,h),w(_,t,h),g(t,i),w(_,s,h),w(_,l,h),g(l,o),g(o,a),f=!0,c||(d=K(t,"click",n[16]),c=!0)},p(_,h){_[1].$isNew?m&&(ae(),I(m,1,1,()=>{m=null}),ue()):m?(m.p(_,h),h[0]&2&&A(m,1)):(m=Sh(_),m.c(),A(m,1),m.m(e.parentNode,e)),(!f||h[0]&64)&&(t.disabled=_[6]),(!f||h[0]&2)&&r!==(r=_[1].$isNew?"Create":"Save changes")&&se(a,r),(!f||h[0]&1088&&u!==(u=!_[10]||_[6]))&&(l.disabled=u),(!f||h[0]&64)&&Q(l,"btn-loading",_[6])},i(_){f||(A(m),f=!0)},o(_){I(m),f=!1},d(_){m&&m.d(_),_&&k(e),_&&k(t),_&&k(s),_&&k(l),c=!1,d()}}}function xE(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[QE],header:[GE],default:[ZE]},$$scope:{ctx:n}};return e=new ln({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){z(e.$$.fragment)},m(s,l){j(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){I(e.$$.fragment,s),t=!1},d(s){n[23](null),V(e,s)}}}function eD(n,e,t){let i;const s=$t(),l="admin_"+B.randomString(5);let o,r=new os,a=!1,u=!1,f=0,c="",d="",m="",_=!1;function h(W){return y(W),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(W){t(1,r=W!=null&&W.$clone?W.$clone():new os),S()}function S(){t(4,_=!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=""),en({})}function C(){if(a||!i)return;t(6,a=!0);const W={email:c,avatar:f};(r.$isNew||_)&&(W.password=d,W.passwordConfirm=m);let X;r.$isNew?X=ce.admins.create(W):X=ce.admins.update(r.id,W),X.then(async J=>{var Z;t(7,u=!1),b(),zt(r.$isNew?"Successfully created admin.":"Successfully updated admin."),((Z=ce.authStore.model)==null?void 0:Z.id)===J.id&&ce.authStore.save(ce.authStore.token,J),s("save",J)}).catch(J=>{ce.error(J)}).finally(()=>{t(6,a=!1)})}function $(){r!=null&&r.id&&pn("Do you really want to delete the selected admin?",()=>ce.admins.delete(r.id).then(()=>{t(7,u=!1),b(),zt("Successfully deleted admin."),s("delete",r)}).catch(W=>{ce.error(W)}))}const T=()=>$(),M=()=>b(),O=W=>t(2,f=W);function D(){c=this.value,t(3,c)}function L(){_=this.checked,t(4,_)}function P(){d=this.value,t(8,d)}function N(){m=this.value,t(9,m)}const F=()=>i&&u?(pn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function R(W){ee[W?"unshift":"push"](()=>{o=W,t(5,o)})}function q(W){Ne.call(this,n,W)}function H(W){Ne.call(this,n,W)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.$isNew&&c!=""||_||c!==r.email||f!==r.avatar)},[b,r,f,c,_,o,a,u,d,m,i,l,C,$,h,T,M,O,D,L,P,N,F,R,q,H]}class tD extends ge{constructor(e){super(),_e(this,e,eD,xE,me,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function $h(n,e,t){const i=n.slice();return i[24]=e[t],i}function nD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function iD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="email",p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:x,d(l){l&&k(e)}}}function sD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="created",p(t,"class",B.getFieldTypeIcon("date"
`},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Th(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[17]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Mh(n){let e;return{c(){e=v("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Oh(n,e){let t,i,s,l,o,r,a,u,f,c,d,m=e[24].id+"",_,h,b,y,S,C=e[24].email+"",$,T,M,O,D,L,P,N,F,R,q,H,W,X;f=new Fl({props:{value:e[24].id}});let J=e[24].id===e[7].id&&Mh();D=new Si({props:{date:e[24].created}}),N=new Si({props:{date:e[24].updated}});function Z(){return e[15](e[24])}function le(...ne){return e[16](e[24],...ne)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("figure"),l=v("img"),r=E(),a=v("td"),u=v("div"),z(f.$$.fragment),c=E(),d=v("span"),_=U(m),h=E(),J&&J.c(),b=E(),y=v("td"),S=v("span"),$=U(C),M=E(),O=v("td"),z(D.$$.fragment),L=E(),P=v("td"),z(N.$$.fragment),F=E(),R=v("td"),R.innerHTML='<i class="ri-arrow-right-line"></i>',q=E(),hn(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(S,"class","txt txt-ellipsis"),p(S,"title",T=e[24].email),p(y,"class","col-type-email col-field-email"),p(O,"class","col-type-date col-field-created"),p(P,"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(ne,ie){w(ne,t,ie),g(t,i),g(i,s),g(s,l),g(t,r),g(t,a),g(a,u),j(f,u,null),g(u,c),g(u,d),g(d,_),g(a,h),J&&J.m(a,null),g(t,b),g(t,y),g(y,S),g(S,$),g(t,M),g(t,O),j(D,O,null),g(t,L),g(t,P),j(N,P,null),g(t,F),g(t,R),g(t,q),H=!0,W||(X=[K(t,"click",Z),K(t,"keydown",le)],W=!0)},p(ne,ie){e=ne,(!H||ie&16&&!hn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const be={};ie&16&&(be.value=e[24].id),f.$set(be),(!H||ie&16)&&m!==(m=e[24].id+"")&&se(_,m),e[24].id===e[7].id?J||(J=Mh(),J.c(),J.m(a,null)):J&&(J.d(1),J=null),(!H||ie&16)&&C!==(C=e[24].email+"")&&se($,C),(!H||ie&16&&T!==(T=e[24].email))&&p(S,"title",T);const Se={};ie&16&&(Se.date=e[24].created),D.$set(Se);const Ve={};ie&16&&(Ve.date=e[24].updated),N.$set(Ve)},i(ne){H||(A(f.$$.fragment,ne),A(D.$$.fragment,ne),A(N.$$.fragment,ne),H=!0)},o(ne){I(f.$$.fragment,ne),I(D.$$.fragment,ne),I(N.$$.fragment,ne),H=!1},d(ne){ne&&k(t),V(f),J&&J.d(),V(D),V(N),W=!1,Ee(X)}}}function aD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,b,y,S,C,$,T=[],M=new Map,O;function D(Z){n[11](Z)}let L={class:"col-type-text",name:"id",$$slots:{default:[nD]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new an({props:L}),ee.push(()=>de(o,"sort",D));function P(Z){n[12](Z)}let N={class:"col-type-email col-field-email",name:"email",$$slots:{default:[iD]},$$scope:{ctx:n}};n[2]!==void 0&&(N.sort=n[2]),u=new an({props:N}),ee.push(()=>de(u,"sort",P));function F(Z){n[13](Z)}let R={class:"col-type-date col-field-created",name:"created",$$slots:{default:[sD]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),d=new an({props:R}),ee.push(()=>de(d,"sort",F));function q(Z){n[14](Z)}let H={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[lD]},$$scope:{ctx:n}};n[2]!==void 0&&(H.sort=n[2]),h=new an({props:H}),ee.push(()=>de(h,"sort",q));let W=n[4];const X=Z=>Z[24].id;for(let Z=0;Z<W.length;Z+=1){let le=$h(n,W,Z),ne=X(le);M.set(ne,T[Z]=Oh(ne,le))}let J=null;return W.length||(J=Ch(n)),{c(){e=v("table"),t=v("thead"),i=v("tr"),s=v("th"),l=E(),z(o.$$.fragment),a=E(),z(u.$$.fragment),c=E(),z(d.$$.fragment),_=E(),z(h.$$.fragment),y=E(),S=v("th"),C=E(),$=v("tbody");for(let Z=0;Z<T.length;Z+=1)T[Z].c();J&&J.c(),p(s,"class","min-width"),p(S,"class","col-type-action min-width"),p(e,"class","table"),Q(e,"table-loading",n[5])},m(Z,le){w(Z,e,le),g(e,t),g(t,i),g(i,s),g(i,l),j(o,i,null),g(i,a),j(u,i,null),g(i,c),j(d,i,null),g(i,_),j(h,i,null),g(i,y),g(i,S),g(e,C),g(e,$);
<span class="txt">New admin</span>`,m=E(),z(_.$$.fragment),h=E(),b=v("div"),y=E(),z(S.$$.fragment),C=E(),D&&D.c(),$=ye(),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(b,"class","clearfix m-b-base")},m(L,P){w(L,e,P),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),g(e,r),j(a,e,null),g(e,u),g(e,f),g(e,c),g(e,d),w(L,m,P),j(_,L,P),w(L,h,P),w(L,b,P),w(L,y,P),j(S,L,P),w(L,C,P),D&&D.m(L,P),w(L,$,P),T=!0,M||(O=K(d,"click",n[9]),M=!0)},p(L,P){(!T||P&64)&&se(o,L[6]);const N={};P&2&&(N.value=L[1]),_.$set(N);const F={};P&134217918&&(F.$$scope={dirty:P,ctx:L}),S.$set(F),L[4].length?D?D.p(L,P):(D=Eh(L),D.c(),D.m($.parentNode,$)):D&&(D.d(1),D=null)},i(L){T||(A(a.$$.fragment,L),A(_.$$.fragment,L),A(S.$$.fragment,L),T=!0)},o(L){I(a.$$.fragment,L),I(_.$$.fragment,L),I(S.$$.fragment,L),T=!1},d(L){L&&k(e),V(a),L&&k(m),V(_,L),L&&k(h),L&&k(b),L&&k(y),V(S,L),L&&k(C),D&&D.d(L),L&&k($),M=!1,O()}}}function fD(n){let e,t,i,s,l,o;e=new Ti({}),i=new wn({props:{$$slots:{default:[uD]},$$scope:{ctx:n}}});let r={};return l=new tD({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),w(a,s,u),j(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!1},d(a){V(e,a),a&&k(t),V(i,a),a&&k(s),n[18](null),V(l,a)}}}function cD(n,e,t){let i,s,l;Je(n,Ca,N=>t(21,i=N)),Je(n,Tt,N=>t(6,s=N)),Je(n,Ra,N=>t(7,l=N)),sn(Tt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){t(5,u=!0),t(4,a=[]);const N=B.normalizeSearchFilter(f,["id","email","created","updated"]);return ce.admins.getFullList(100,{sort:c||"-created",filter:N}).then(F=>{t(4,a=F),t(5,u=!1)}).catch(F=>{F!=null&&F.isAbort||(t(5,u=!1),console.warn(F),m(),ce.error(F,!1))})}function m(){t(4,a=[])}const _=()=>d(),h=()=>r==null?void 0:r.show(),b=N=>t(1,f=N.detail);function y(N){c=N,t(2,c)}function S(N){c=N,t(2,c)}function C(N){c=N,t(2,c)}function $(N){c=N,t(2,c)}const T=N=>r==null?void 0:r.show(N),M=(N,F)=>{(F.code==="Enter"||F.code==="Space")&&(F.preventDefault(),r==null||r.show(N))},O=()=>t(1,f="");function D(N){ee[N?"unshift":"push"](()=>{r=N,t(3,r)})}const L=()=>d(),P=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const N=new URLSearchParams({filter:f,sort:c}).toString();ji("/settings/admins?"+N),d()}},[d,f,c,r,a,u,s,l,_,h,b,y,S,C,$,T,M,O,D,L,P]}class dD extends ge{constructor(e){super(),_e(this,e,cD,fD,me,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function pD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=E(),l=v("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){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),re(l,n[0]),l.focus(),r||(a=K(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&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function mD(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Password"),s=E(),l=v("input"),r=E(),a=v("div"),u=v("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){w(d,e,m),g(e,t),w(d,s,m),w(d,l,m),re(l,n[1]),w(d,r,m),w(d,a,m),g(a,u),f||(c=[K(l,"input",n[5]),Me(on.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&&k(e),d&&k(s),d&&k(l),d&&k(r),d&&k(a),f=!1,Ee(c)}}}function hD(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:[pD,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new pe({prop
<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){w(d,e,m),g(e,t),g(e,i),j(s,e,null),g(e,l),j(o,e,null),g(e,r),g(e,a),u=!0,f||(c=K(e,"submit",et(n[3])),f=!0)},p(d,m){const _={};m&769&&(_.$$scope={dirty:m,ctx:d}),s.$set(_);const h={};m&770&&(h.$$scope={dirty:m,ctx:d}),o.$set(h),(!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){I(s.$$.fragment,d),I(o.$$.fragment,d),u=!1},d(d){d&&k(e),V(s),V(o),f=!1,c()}}}function _D(n){let e,t;return e=new gb({props:{$$slots:{default:[hD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function gD(n,e,t){let i;Je(n,Ca,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),ce.admins.authWithPassword(l,o).then(()=>{Na(),ji("/")}).catch(()=>{Ds("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 bD extends ge{constructor(e){super(),_e(this,e,gD,_D,me,{})}}function vD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,b,y,S,C,$,T;i=new pe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[kD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[wD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[SD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[$D,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}});let M=n[3]&&Dh(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),c=E(),d=v("div"),m=v("div"),_=E(),M&&M.c(),h=E(),b=v("button"),y=v("span"),y.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(m,"class","flex-fill"),p(y,"class","txt"),p(b,"type","submit"),p(b,"class","btn btn-expanded"),b.disabled=S=!n[3]||n[2],Q(b,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(O,D){w(O,e,D),g(e,t),j(i,t,null),g(e,s),g(e,l),j(o,l,null),g(e,r),j(a,e,null),g(e,u),j(f,e,null),g(e,c),g(e,d),g(d,m),g(d,_),M&&M.m(d,null),g(d,h),g(d,b),g(b,y),C=!0,$||(T=K(b,"click",n[13]),$=!0)},p(O,D){const L={};D&1572865&&(L.$$scope={dirty:D,ctx:O}),i.$set(L);const P={};D&1572865&&(P.$$scope={dirty:D,ctx:O}),o.$set(P);const N={};D&1572865&&(N.$$scope={dirty:D,ctx:O}),a.$set(N);const F={};D&1572865&&(F.$$scope={dirty:D,ctx:O}),f.$set(F),O[3]?M?M.p(O,D):(M=Dh(O),M.c(),M.m(d,h)):M&&(M.d(1),M=null),(!C||D&12&&S!==(S=!O[3]||O[2]))&&(b.disabled=S),(!C||D&4)&&Q(b,"btn-loading",O[2])},i(O){C||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(a.$$.fragment,O),A(f.$$.fragment,O),C=!0)},o(O){I(i.$$.fragment,O),I(o.$$.fragment,O),I(a.$$.fragment,O),I(f.$$.fragment,O),C=!1},d(O){O&&k(e),V(i),V(o),V(a),V(f),M&&M.d(),$=!1,T()}}}function yD(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function kD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Application name"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),re(l,n[0].meta.appName),r||(a=K(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&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function wD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Application url"),s=E(),l=v("inpu
<div class="breadcrumb-item">Application</div></nav>`,t=E(),i=v("div"),s=v("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(m,_){w(m,e,_),w(m,t,_),w(m,i,_),g(i,s),c[l].m(s,null),r=!0,a||(u=K(s,"submit",et(n[4])),a=!0)},p(m,_){let h=l;l=d(m),l===h?c[l].p(m,_):(ae(),I(c[h],1,1,()=>{c[h]=null}),ue(),o=c[l],o?o.p(m,_):(o=c[l]=f[l](m),o.c()),A(o,1),o.m(s,null))},i(m){r||(A(o),r=!0)},o(m){I(o),r=!1},d(m){m&&k(e),m&&k(t),m&&k(i),c[l].d(),a=!1,u()}}}function TD(n){let e,t,i,s;return e=new Ti({}),i=new wn({props:{$$slots:{default:[CD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&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){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){V(e,l),l&&k(t),V(i,l)}}}function MD(n,e,t){let i,s,l,o;Je(n,As,M=>t(14,s=M)),Je(n,So,M=>t(15,l=M)),Je(n,Tt,M=>t(16,o=M)),sn(Tt,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const M=await ce.settings.getAll()||{};_(M)}catch(M){ce.error(M)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const M=await ce.settings.update(B.filterRedactedProps(a));_(M),zt("Successfully saved application settings.")}catch(M){ce.error(M)}t(2,f=!1)}}function _(M={}){var O,D;sn(So,l=(O=M==null?void 0:M.meta)==null?void 0:O.appName,l),sn(As,s=!!((D=M==null?void 0:M.meta)!=null&&D.hideControls),s),t(0,a={meta:(M==null?void 0:M.meta)||{},logs:(M==null?void 0:M.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function h(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function b(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function S(){a.logs.maxDays=dt(this.value),t(0,a)}function C(){a.meta.hideControls=this.checked,t(0,a)}const $=()=>h(),T=()=>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,h,r,c,b,y,S,C,$,T]}class OD extends ge{constructor(e){super(),_e(this,e,MD,TD,me,{})}}function ED(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=qe(l,s[o]);return{c(){e=v("input"),ri(e,l)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[7](e),re(e,n[0]),t||(i=K(e,"input",n[8]),t=!0)},p(o,r){ri(e,l=Mt(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&re(e,o[0])},d(o){o&&k(e),n[7](null),t=!1,i()}}}function DD(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=qe(a,r[u]);return{c(){e=v("div"),t=v("button"),t.innerHTML='<i class="ri-key-line"></i>',i=E(),s=v("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ri(s,a)},m(u,f){w(u,e,f),g(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[Me(He.call(null,t,{position:"left",text:"Set new value"})),K(t,"click",n[6])],l=!0)},p(u,f){ri(s,a=Mt(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&k(e),u&&k(i),u&&k(s),l=!1,Ee(o)}}}function AD(n){let e;function t(l,o){return l[3]?DD:ED}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){s.d(l),l&&k(e)}}}function ID(n,e,t){const i=["value","mask"];let s=xe(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await fn(),r==null||r.focus()}const f=()=>u();function c(m){ee[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=m=>{e=qe(qe({},e),Zt(m)),t(5,s=xe(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 mu extends ge{constructor(e){super(),_e(this,e,ID,AD,me,{value:0,mask:1})}}function LD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h;return{c(){e=v("label"),t=U("Subject"),s=E(),l=v("input"),r=E(),a=v("div"),u=U(`Available placeholder parameters:
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=U(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,m=U("."),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(b,y){w(b,e,y),g(e,t),w(b,s,y),w(b,l,y),re(l,n[0].subject),w(b,r,y),w(b,a,y),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),_||(h=[K(l,"input",n[13]),K(f,"click",n[14]),K(d,"click",n[15])],_=!0)},p(b,y){y[1]&1&&i!==(i=b[31])&&p(e,"for",i),y[1]&1&&o!==(o=b[31])&&p(l,"id",o),y[0]&1&&l.value!==b[0].subject&&re(l,b[0].subject)},d(b){b&&k(e),b&&k(s),b&&k(l),b&&k(r),b&&k(a),_=!1,Ee(h)}}}function PD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,b,y;return{c(){e=v("label"),t=U("Action URL"),s=E(),l=v("input"),r=E(),a=v("div"),u=U(`Available placeholder parameters:
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=U(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,m=U(`,
`),_=v("button"),_.textContent=`{TOKEN}
`,h=U("."),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(_,"type","button"),p(_,"class","label label-sm link-primary txt-mono"),p(_,"title","Required parameter"),p(a,"class","help-block")},m(S,C){w(S,e,C),g(e,t),w(S,s,C),w(S,l,C),re(l,n[0].actionUrl),w(S,r,C),w(S,a,C),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),g(a,_),g(a,h),b||(y=[K(l,"input",n[16]),K(f,"click",n[17]),K(d,"click",n[18]),K(_,"click",n[19])],b=!0)},p(S,C){C[1]&1&&i!==(i=S[31])&&p(e,"for",i),C[1]&1&&o!==(o=S[31])&&p(l,"id",o),C[0]&1&&l.value!==S[0].actionUrl&&re(l,S[0].actionUrl)},d(S){S&&k(e),S&&k(s),S&&k(l),S&&k(r),S&&k(a),b=!1,Ee(y)}}}function ND(n){let e,t,i,s;return{c(){e=v("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){w(l,e,o),re(e,n[0].body),i||(s=K(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&&k(e),i=!1,s()}}}function FD(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=Ft(o,r(n)),ee.push(()=>de(e,"value",l))),{c(){e&&z(e.$$.fragment),i=ye()},m(a,u){e&&j(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,he(()=>t=!1)),u[0]&16&&o!==(o=a[4])){if(e){ae();const c=e;I(c.$$.fragment,1,0,()=>{V(c,1)}),ue()}o?(e=Ft(o,r(a)),ee.push(()=>de(e,"value",l)),z(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function RD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,b,y,S,C,$;const T=[FD,ND],M=[];function O(D,L){return D[4]&&!D[5]?0:1}return l=O(n),o=M[l]=T[l](n),{c(){e=v("label"),t=U("Body (HTML)"),s=E(),o.c(),r=E(),a=v("div"),u=U(`Available placeholder parameters:
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=U(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,m=U(`,
`),_=v("button"),_.textContent=`{TOKEN}
`,h=U(`,
`),b=v("button"),b.textContent=`{ACTION_URL}
2023-06-11 04:43:09 +08:00
`,y=U("."),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(_,"type","button"),p(_,"class","label label-sm link-primary txt-mono"),p(b,"type","button"),p(b,"class","label label-sm link-primary txt-mono"),p(b,"title","Required parameter"),p(a,"class","help-block")},m(D,L){w(D,e,L),g(e,t),w(D,s,L),M[l].m(D,L),w(D,r,L),w(D,a,L),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),g(a,_),g(a,h),g(a,b),g(a,y),S=!0,C||($=[K(f,"click",n[22]),K(d,"click",n[23]),K(_,"click",n[24]),K(b,"click",n[25])],C=!0)},p(D,L){(!S||L[1]&1&&i!==(i=D[31]))&&p(e,"for",i);let P=l;l=O(D),l===P?M[l].p(D,L):(ae(),I(M[P],1,1,()=>{M[P]=null}),ue(),o=M[l],o?o.p(D,L):(o=M[l]=T[l](D),o.c()),A(o,1),o.m(r.parentNode,r))},i(D){S||(A(o),S=!0)},o(D){I(o),S=!1},d(D){D&&k(e),D&&k(s),M[l].d(D),D&&k(r),D&&k(a),C=!1,Ee($)}}}function qD(n){let e,t,i,s,l,o;return e=new pe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[LD,({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:[PD,({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:[RD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(r,a){j(e,r,a),w(r,t,a),j(i,r,a),w(r,s,a),j(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),I(l.$$.fragment,r),o=!1},d(r){V(e,r),r&&k(t),V(i,r),r&&k(s),V(l,r)}}}function Ah(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Me(He.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Qe(()=>{i&&(t||(t=je(e,Kt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Kt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function jD(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Ah();return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),l=U(n[2]),o=E(),r=v("div"),a=E(),f&&f.c(),u=ye(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),g(e,t),g(e,i),g(e,s),g(s,l),w(c,o,d),w(c,r,d),w(c,a,d),f&&f.m(c,d),w(c,u,d)},p(c,d){d[0]&4&&se(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=Ah(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(ae(),I(f,1,1,()=>{f=null}),ue())},d(c){c&&k(e),c&&k(o),c&&k(r),c&&k(a),f&&f.d(c),c&&k(u)}}}function VD(n){let e,t;const i=[n[8]];let s={$$slots:{header:[jD],default:[qD]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=qe(s,i[l]);return e=new co({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){z(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,o){const r=o[0]&256?Mt(i,[Xt(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){I(e.$$.fragment,l),t=!1},d(l){n[26](null),V(e,l)}}}let Ih;function zD(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=xe(e,s),o;Je(n,$i,Z=>t(12,o=Z));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=Ih,d=!1;function m(){f==null||f.expand()}function _(){f==null||f.collapse()}function h(){f==null||f.collapseSiblings()}async function b(){c||d||(t(5,d=!0),t(4,c=(await at(()=>import("./CodeEditor-a48bc518.js"),["./CodeEditor-a48bc518.js","./index-d6c84f2c.js"],import.meta.url)).default),Ih=c,t(5,d=!1))}function y(Z){B.copyToClipboard(Z),yo(`Copied ${Z} to clipboard`,2e3)}b();function S(){u.subject=this.value,t(0,u)}const C=()=>y("{APP_NAME}"),$=()=>y("{APP_URL}");function T(){u.action
2023-06-11 04:32:41 +08:00
<span class="txt">Send test email</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[26]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function aA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("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){w(u,e,f),g(e,t),w(u,i,f),w(u,s,f),g(s,l),r||(a=[K(e,"click",n[24]),K(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&&k(e),u&&k(i),u&&k(s),r=!1,Ee(a)}}}function uA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,b;const y=[XD,GD],S=[];function C($,T){return $[2]?0:1}return d=C(n),m=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[5]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=E(),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){w($,e,T),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),w($,r,T),w($,a,T),g(a,u),g(u,f),g(u,c),S[d].m(u,null),_=!0,h||(b=K(u,"submit",et(n[27])),h=!0)},p($,T){(!_||T[0]&32)&&se(o,$[5]);let M=d;d=C($),d===M?S[d].p($,T):(ae(),I(S[M],1,1,()=>{S[M]=null}),ue(),m=S[d],m?m.p($,T):(m=S[d]=y[d]($),m.c()),A(m,1),m.m(u,null))},i($){_||(A(m),_=!0)},o($){I(m),_=!1},d($){$&&k(e),$&&k(r),$&&k(a),S[d].d(),h=!1,b()}}}function fA(n){let e,t,i,s,l,o;e=new Ti({}),i=new wn({props:{$$slots:{default:[uA]},$$scope:{ctx:n}}});let r={};return l=new ZD({props:r}),n[28](l),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),w(a,s,u),j(l,a,u),o=!0},p(a,u){const f={};u[0]&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){I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!1},d(a){V(e,a),a&&k(t),V(i,a),a&&k(s),n[28](null),V(l,a)}}}function cA(n,e,t){let i,s,l;Je(n,Tt,J=>t(5,l=J));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];sn(Tt,l="Mail settings",l);let a,u={},f={},c=!1,d=!1;m();async function m(){t(2,c=!0);try{const J=await ce.settings.getAll()||{};h(J)}catch(J){ce.error(J)}t(2,c=!1)}async function _(){if(!(d||!s)){t(3,d=!0);try{const J=await ce.settings.update(B.filterRedactedProps(f));h(J),en({}),zt("Successfully saved mail settings.")}catch(J){ce.error(J)}t(3,d=!1)}}function h(J={}){t(0,f={meta:(J==null?void 0:J.meta)||{},smtp:(J==null?void 0:J.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function b(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function y(){f.meta.senderName=this.value,t(0,f)}function S(){f.meta.senderAddress=this.value,t(0,f)}function C(J){n.$$.not_equal(f.meta.verificationTemplate,J)&&(f.meta.verificationTemplate=J,t(0,f))}function $(J){n.$$.not_equal(f.meta.resetPasswordTemplate,J)&&(f.meta.resetPasswordTemplate=J,t(0,f))}function T(J){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,J)&&(f.meta.confirmEmailChangeTemplate=J,t(0,f))}function M(){f.smtp.enabled=this.checked,t(0,f)}function O(){f.smtp.host=this.value,t(0,f)}function D(){f.smtp.port=dt(this.value),t(0,f)}function L(J){n.$$.not_equal(f.smtp.tls,J)&&(f.smtp.tls=J,t(0,f))}function P(J){n.$$.not_equal(f.smtp.authMethod,J)&&(f.smtp.authMethod=J,t(0,f))}function N(){f.smtp.username=this.value,t(0,f)}function F(J){n.$$.not_equal(f.smtp.password,J)&&(f.smtp.password=J,t(0,f))}const R=()=>b(),q=()=>_(),H=()=>a==null?void 0:a.show(),W=()=>_();function X(J){ee[J?"unshift":"push"]((
from the
`),r=v("strong"),u=U(a),f=U(`
to the
`),c=v("strong"),m=U(d),_=U(`.
`),h=v("br"),b=U(`
There are numerous command line tools that can help you, such as:
`),y=v("a"),y.textContent=`rclone
`,S=U(`,
`),C=v("a"),C.textContent=`s5cmd
`,$=U(", etc."),T=E(),M=v("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener noreferrer"),p(y,"class","txt-bold"),p(C,"href","https://github.com/peak/s5cmd"),p(C,"target","_blank"),p(C,"rel","noopener noreferrer"),p(C,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(M,"class","clearfix m-t-base")},m(P,N){w(P,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,_),g(l,h),g(l,b),g(l,y),g(l,S),g(l,C),g(l,$),g(e,T),g(e,M),D=!0},p(P,N){var F;(!D||N&1)&&a!==(a=(F=P[0].s3)!=null&&F.enabled?"S3 storage":"local file system")&&se(u,a),(!D||N&2)&&d!==(d=P[1].s3.enabled?"S3 storage":"local file system")&&se(m,d)},i(P){D||(P&&Qe(()=>{D&&(O||(O=je(e,ot,{duration:150},!0)),O.run(1))}),D=!0)},o(P){P&&(O||(O=je(e,ot,{duration:150},!1)),O.run(0)),D=!1},d(P){P&&k(e),P&&O&&O.end()}}}function CA(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&jh(n);return{c(){t&&t.c(),e=ye()},m(s,l){t&&t.m(s,l),w(s,e,l)},p(s,l){var o;((o=s[0].s3)==null?void 0:o.enabled)!=s[1].s3.enabled?t?(t.p(s,l),l&3&&A(t,1)):(t=jh(s),t.c(),A(t,1),t.m(e.parentNode,e)):t&&(ae(),I(t,1,1,()=>{t=null}),ue())},d(s){t&&t.d(s),s&&k(e)}}}function Vh(n){let e;function t(l,o){return l[4]?OA:l[5]?MA:TA}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function TA(n){let e;return{c(){e=v("div"),e.innerHTML=`<i class="ri-checkbox-circle-line txt-success"></i>
<span class="txt">S3 connected successfully</span>`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function MA(n){let e,t,i,s;return{c(){e=v("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;w(l,e,o),i||(s=Me(t=He.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&qt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function OA(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function zh(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){w(l,e,o),g(e,t),i||(s=K(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&k(e),i=!1,s()}}}function EA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,b;const y=[$A,SA],S=[];function C($,T){return $[2]?0:1}return d=C(n),m=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[7]),r=E(),a=v("div"),u=v("form"),f=v("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=E(),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){w($,e,T),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),w($,r,T),w($,a,T),g(a,u),g(u,f),g(u,c),S[d].m(u,null),_=!0,h||(b=K(u,"submit",et(n[16])),h=!0)},p($,T){(!_||T&128)&&se(o,$[7]);let M=d;d=C($),d===M?S[d].p($,T):(ae(),I(S[M],1,1,()=>{S[M]=null}),ue(),m=S[d],m?m.p($,T):(m=S[d]=y[d]($),m.c()),A(m,1),m.m(u,null))},i($){_||(A(m),_=!0)},o($){I(m),_=!1},d($){$&&k(e),$&&k(r),$&&k(a),S[d].d(),h=!1,b()}}}function DA(n){let e,t,i,s;return e=new Ti({}),i=new wn({props:{$$slots:{default:[EA]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){V(e,l),l&&k(t),V(i,l)}}}const AA="s3_test_request";function IA(n,e,t){let i,s,l;Je(n,Tt,M=>t(7,l=M)),sn(Tt,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const M=await ce.settings.getAll()||{};_(M)}catch(M){ce.error(M)}t(2,a=!1)}async function m(){if(!(u||!s)){t(3,u=!0);try{ce.cancelRequest(AA);const M=await ce.settings.update(B.filterRedactedProps(r));en({}),await _(M),Na(),c?Oy("Successfully saved but failed to establish S3 connection."):zt("Successfully saved files storage settings.")}catch(M){ce.error(M)}t(3,u=!1)}}async function _(M={}){t(1,r={s3:(M==null?void 0:M.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function h(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function b(M){n.$$.not_equal(r.s3,M)&&(r.s3=M,t(1,r))}function y(M){f=M,t(4,f)}function S(M){c=M,t(5,c)}const C=()=>h(),$=()=>m(),T=()=>m();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,m,h,i,b,y,S,C,$,T]}class LA extends ge{constructor(e){super(),_e(this,e,IA,DA,me,{})}}function PA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[1].enabled,w(u,i,f),w(u,s,f),g(s,l),r||(a=K(e,"change",n[11]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&2&&(e.checked=u[1].enabled),f&1048576&&o!==(o=u[20])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function NA(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Client ID"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=r=n[1].enabled},m(f,c){w(f,e,c),g(e,t),w(f,s,c),w(f,l,c),re(l,n[1].clientId),a||(u=K(l,"input",n[12]),a=!0)},p(f,c){c&1048576&&i!==(i=f[20])&&p(e,"for",i),c&1048576&&o!==(o=f[20])&&p(l,"id",o),c&2&&r!==(r=f[1].enabled)&&(l.required=r),c&2&&l.value!==f[1].clientId&&re(l,f[1].clientId)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function FA(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(u.value=n[1].clientSecret),l=new mu({props:u}),ee.push(()=>de(l,"value",a)),{c(){e=v("label"),t=U("Client secret"),s=E(),z(l.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),g(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),c&2&&(d.required=f[1].enabled),!o&&c&2&&(o=!0,d.value=f[1].clientSecret,he(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function Hh(n){let e,t,i,s;function l(a){n[14](a)}var o=n[3].optionsComponent;function r(a){let u={key:a[3].key};return a[1]!==void 0&&(u.config=a[1]),{props:u}}return o&&(t=Ft(o,r(n)),ee.push(()=>de(t,"config",l))),{c(){e=v("div"),t&&z(t.$$.fragment),p(e,"class","col-lg-12")},m(a,u){w(a,e,u),t&&j(t,e,null),s=!0},p(a,u){const f={};if(u&8&&(f.key=a[3].key),!i&&u&2&&(i=!0,f.config=a[
another PocketBase environment.</p>`,t=E(),i=v("div"),s=v("button"),s.innerHTML='<span class="txt">Copy</span>',l=E(),z(o.$$.fragment),r=E(),a=v("div"),u=v("div"),f=E(),c=v("button"),c.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-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(h,b){w(h,e,b),w(h,t,b),w(h,i,b),g(i,s),g(i,l),j(o,i,null),n[8](i),w(h,r,b),w(h,a,b),g(a,u),g(a,f),g(a,c),d=!0,m||(_=[K(s,"click",n[7]),K(i,"keydown",n[9]),K(c,"click",n[10])],m=!0)},p(h,b){const y={};b&4&&(y.content=h[2]),o.$set(y)},i(h){d||(A(o.$$.fragment,h),d=!0)},o(h){I(o.$$.fragment,h),d=!1},d(h){h&&k(e),h&&k(t),h&&k(i),V(o),n[8](null),h&&k(r),h&&k(a),m=!1,Ee(_)}}}function rI(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function aI(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[rI,oI],_=[];function h(b,y){return b[1]?0:1}return f=h(n),c=_[f]=m[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[3]),r=E(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(b,y){w(b,e,y),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),w(b,r,y),w(b,a,y),g(a,u),_[f].m(u,null),d=!0},p(b,y){(!d||y&8)&&se(o,b[3]);let S=f;f=h(b),f===S?_[f].p(b,y):(ae(),I(_[S],1,1,()=>{_[S]=null}),ue(),c=_[f],c?c.p(b,y):(c=_[f]=m[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){I(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),_[f].d()}}}function uI(n){let e,t,i,s;return e=new Ti({}),i=new wn({props:{$$slots:{default:[aI]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){V(e,l),l&&k(t),V(i,l)}}}function fI(n,e,t){let i,s;Je(n,Tt,b=>t(3,s=b)),sn(Tt,s="Export collections",s);const l="export_"+B.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await ce.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let b of r)delete b.created,delete b.updated}catch(b){ce.error(b)}t(1,a=!1)}function f(){B.downloadJson(r,"pb_schema")}function c(){B.copyToClipboard(i),yo("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(b){ee[b?"unshift":"push"](()=>{o=b,t(0,o)})}const _=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const y=window.getSelection(),S=document.createRange();S.selectNodeContents(o),y.removeAllRanges(),y.addRange(S)}},h=()=>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 cI extends ge{constructor(e){super(),_e(this,e,fI,uI,me,{})}}function t_(n,e,t){const i=n.slice();return i[14]=e[t],i}function n_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function i_(n,e,t){const i=n.slice();return i[14]=e[t],i}function s_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function l_(n,e,t){const i=n.slice();return i[14]=e[t],i}function o_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function r_(n,e,t){const i=n.slice();return i[30]=e[t],i}function dI(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&a_(),a=n[0].name!==n[1].name&&u_(n);return{c(){e=v("div"),r&&r.c(),t=E(),a&&a.c(),i=E(),s=v("strong"),o=U(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),g(e,t),a&&a.m(e,null),g(e,i),g(e,s),g(s,o)},p(u,f){u[9]?r||(r=a_(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=u_(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&se(o,l)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function pI(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Deleted",t=E(),i=v("strong"),l=U(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),g(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?voi
<th width="10%" class="svelte-lmkr38">Old</th>
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=E(),o=v("tbody");for(let $=0;$<_.length;$+=1)_[$].c();r=E(),h&&h.c(),a=E();for(let $=0;$<y.length;$+=1)y[$].c();u=E();for(let $=0;$<C.length;$+=1)C[$].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m($,T){w($,e,T),d.m(e,null),w($,t,T),w($,i,T),g(i,s),g(i,l),g(i,o);for(let M=0;M<_.length;M+=1)_[M]&&_[M].m(o,null);g(o,r),h&&h.m(o,null),g(o,a);for(let M=0;M<y.length;M+=1)y[M]&&y[M].m(o,null);g(o,u);for(let M=0;M<C.length;M+=1)C[M]&&C[M].m(o,null)},p($,T){if(c===(c=f($))&&d?d.p($,T):(d.d(1),d=c($),d&&(d.c(),d.m(e,null))),T[0]&7203){m=$[11];let M;for(M=0;M<m.length;M+=1){const O=r_($,m,M);_[M]?_[M].p(O,T):(_[M]=f_(O),_[M].c(),_[M].m(o,r))}for(;M<_.length;M+=1)_[M].d(1);_.length=m.length}if($[2]||$[5]?h?h.p($,T):(h=c_($),h.c(),h.m(o,a)):h&&(h.d(1),h=null),T[0]&4248){b=$[7];let M;for(M=0;M<b.length;M+=1){const O=i_($,b,M);y[M]?y[M].p(O,T):(y[M]=__(O),y[M].c(),y[M].m(o,u))}for(;M<y.length;M+=1)y[M].d(1);y.length=b.length}if(T[0]&4352){S=$[8];let M;for(M=0;M<S.length;M+=1){const O=t_($,S,M);C[M]?C[M].p(O,T):(C[M]=b_(O),C[M].c(),C[M].m(o,null))}for(;M<C.length;M+=1)C[M].d(1);C.length=S.length}},i:x,o:x,d($){$&&k(e),d.d(),$&&k(t),$&&k(i),mt(_,$),h&&h.d(),mt(y,$),mt(C,$)}}}function zn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function gn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function _I(n,e,t){let i,s,l,{collectionA:o=new yn}=e,{collectionB:r=new yn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],m=[];const _=Object.keys(new yn().$export()).filter(y=>!["schema","created","updated"].includes(y));function h(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(y=>!f.find(S=>y.id==S.id))))}function b(y){return typeof y>"u"?"":B.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&h(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find(S=>y.id==S.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find(S=>S.id==y.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(y=>!u.find(S=>S.id==y.id))),n.$$.dirty[0]&7&&t(9,l=B.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,m,l,s,_,b]}class gI extends ge{constructor(e){super(),_e(this,e,_I,hI,me,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function v_(n,e,t){const i=n.slice();return i[17]=e[t],i}function y_(n){let e,t;return e=new gI({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function bI(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=y_(v_(n,i,o));const l=o=>I(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=ye()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=v_(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=y_(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)I(s[r]);t=!1},d(o){mt(s,o),o&&k(e)}}}function vI(n){let e;return{c(){e=v("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function yI(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=U("Close"),i=E(),s=v("button"),l=v("span"),l.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-t
- ${$.join(`
- `)}`,()=>{_()}):_()}async function _(){if(!u){t(4,u=!0);try{await ce.collections.import(o,a),zt("Successfully imported collections configuration."),i("submit")}catch($){ce.error($)}t(4,u=!1),c()}}const h=()=>m(),b=()=>!u;function y($){ee[$?"unshift":"push"](()=>{s=$,t(1,s)})}function S($){Ne.call(this,n,$)}function C($){Ne.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,m,f,l,o,h,b,y,S,C]}class SI extends ge{constructor(e){super(),_e(this,e,wI,kI,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function k_(n,e,t){const i=n.slice();return i[32]=e[t],i}function w_(n,e,t){const i=n.slice();return i[35]=e[t],i}function S_(n,e,t){const i=n.slice();return i[32]=e[t],i}function $I(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,b,y,S,C,$,T,M,O;a=new pe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[TI,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let D=!1,L=n[6]&&n[1].length&&!n[7]&&C_(),P=n[6]&&n[1].length&&n[7]&&T_(n),N=n[13].length&&R_(n),F=!!n[0]&&q_(n);return{c(){e=v("input"),t=E(),i=v("div"),s=v("p"),l=U(`Paste below the collections configuration you want to import or
`),o=v("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=E(),z(a.$$.fragment),u=E(),f=E(),L&&L.c(),c=E(),P&&P.c(),d=E(),N&&N.c(),m=E(),_=v("div"),F&&F.c(),h=E(),b=v("div"),y=E(),S=v("button"),C=v("span"),C.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(b,"class","flex-fill"),p(C,"class","txt"),p(S,"type","button"),p(S,"class","btn btn-expanded btn-warning m-l-auto"),S.disabled=$=!n[14],p(_,"class","flex m-t-base")},m(R,q){w(R,e,q),n[19](e),w(R,t,q),w(R,i,q),g(i,s),g(s,l),g(s,o),w(R,r,q),j(a,R,q),w(R,u,q),w(R,f,q),L&&L.m(R,q),w(R,c,q),P&&P.m(R,q),w(R,d,q),N&&N.m(R,q),w(R,m,q),w(R,_,q),F&&F.m(_,null),g(_,h),g(_,b),g(_,y),g(_,S),g(S,C),T=!0,M||(O=[K(e,"change",n[20]),K(o,"click",n[21]),K(S,"click",n[26])],M=!0)},p(R,q){(!T||q[0]&4096)&&Q(o,"btn-loading",R[12]);const H={};q[0]&64&&(H.class="form-field "+(R[6]?"":"field-error")),q[0]&65|q[1]&1536&&(H.$$scope={dirty:q,ctx:R}),a.$set(H),R[6]&&R[1].length&&!R[7]?L||(L=C_(),L.c(),L.m(c.parentNode,c)):L&&(L.d(1),L=null),R[6]&&R[1].length&&R[7]?P?P.p(R,q):(P=T_(R),P.c(),P.m(d.parentNode,d)):P&&(P.d(1),P=null),R[13].length?N?N.p(R,q):(N=R_(R),N.c(),N.m(m.parentNode,m)):N&&(N.d(1),N=null),R[0]?F?F.p(R,q):(F=q_(R),F.c(),F.m(_,h)):F&&(F.d(1),F=null),(!T||q[0]&16384&&$!==($=!R[14]))&&(S.disabled=$)},i(R){T||(A(a.$$.fragment,R),A(D),T=!0)},o(R){I(a.$$.fragment,R),I(D),T=!1},d(R){R&&k(e),n[19](null),R&&k(t),R&&k(i),R&&k(r),V(a,R),R&&k(u),R&&k(f),L&&L.d(R),R&&k(c),P&&P.d(R),R&&k(d),N&&N.d(R),R&&k(m),R&&k(_),F&&F.d(),M=!1,Ee(O)}}}function CI(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function $_(n){let e;return{c(){e=v("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function TI(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&$_();return{c(){e=v("label"),t=U("Collections"),s=E(),l=v("textarea"),r=E(),c&&c.c(),a=ye(),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){w(d,e,m),g(e,t),w(d,s,m),w(d,l,m),re(l,n[0]),w(d,r,m),c&&c.m(d,m),w(d,a,m),u||(f=K(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=$_(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),c&&c.d(d),d&&k(a),u=!1,f()}}}function C_(n){let e;return{c(){e=v("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function T_(n){let e,t,i,s,l,o=n[9].length&&M_(n),r=n[4].length&&D_(n),a=n[8].length&&P_(n);return{c(){e=v("h5"),e.textContent="Detected changes",t=E(),i=v("div"),o&&o.c(),s=E(),r&&r.c(),l=E(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),o&&o.m(i,null),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=M_(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=D_(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=P_(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),u&&k(t),u&&k(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function M_(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=S_(n,s,o),a=l(r);t.set(a,e[o]=E_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ye()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=bt(e,r,l,1,o,s,t,i.parentNode,as,E_,i,S_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function O_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=v("small"),t=U("("),s=U(i),l=U(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&se(s,i)},d(o){o&&k(e)}}}function E_(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&O_(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Deleted",s=E(),l=v("strong"),r=U(o),a=E(),f&&f.c(),u=E(),p(i,"class","label label-danger list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){w(c,t,d),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+"")&&se(r,o),e[32].id?f?f.p(e,d):(f=O_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&k(t),f&&f.d()}}}function D_(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=w_(n,s,o),a=l(r);t.set(a,e[o]=L_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ye()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=bt(e,r,l,1,o,s,t,i.parentNode,as,L_,i,w_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function A_(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=v("strong"),i=U(t),s=E(),l=v("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),g(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&se(i,t)},d(o){o&&k(e),o&&k(s),o&&k(l)}}}function I_(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=v("small"),t=U("("),s=U(i),l=U(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&se(s,i)},d(o){o&&k(e)}}}function L_(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&&A_(e),m=e[35].new.id&&I_(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Changed",s=E(),l=v("div"),d&&d.c(),o=E(),r=v("strong"),u=U(a),f=E(),m&&m.c(),c=E(),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){w(_,t,h),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=_,e[35].old.name!==e[35].new.name?d?d.p(e,h):(d=A_(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),h[0]&16&&a!==(a=e[35].new.name+"")&&se(u,a),e[35].new.id?m?m.p(e,h):(m=I_(e),m.c(),m.m(l,null)):m&&(m.d(1),m=null)},d(_){_&&k(t),d&&d.d(),m&&m.d()}}}function P_(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=k_(n,s,o),a=l(r);t.set(a,e[o]=F_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ye()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=bt(e,r,l,1,o,s,t,i.parentNode,as,F_,i,k_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function N_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=v("small"),t=U("("),s=U(i),l=U(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r
imported with different IDs. You can replace them in the import if you want
to.</string>`,l=E(),o=v("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){w(u,e,f),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),r||(a=K(o,"click",n[24]),r=!0)},p:x,d(u){u&&k(e),r=!1,a()}}}function q_(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[25]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function MI(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[CI,$I],_=[];function h(b,y){return b[5]?0:1}return f=h(n),c=_[f]=m[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[15]),r=E(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(b,y){w(b,e,y),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),w(b,r,y),w(b,a,y),g(a,u),_[f].m(u,null),d=!0},p(b,y){(!d||y[0]&32768)&&se(o,b[15]);let S=f;f=h(b),f===S?_[f].p(b,y):(ae(),I(_[S],1,1,()=>{_[S]=null}),ue(),c=_[f],c?c.p(b,y):(c=_[f]=m[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){I(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),_[f].d()}}}function OI(n){let e,t,i,s,l,o;e=new Ti({}),i=new wn({props:{$$slots:{default:[MI]},$$scope:{ctx:n}}});let r={};return l=new SI({props:r}),n[27](l),l.$on("submit",n[28]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),w(a,s,u),j(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!1},d(a){V(e,a),a&&k(t),V(i,a),a&&k(s),n[27](null),V(l,a)}}}function EI(n,e,t){let i,s,l,o,r,a,u;Je(n,Tt,Z=>t(15,u=Z)),sn(Tt,u="Import collections",u);let f,c,d="",m=!1,_=[],h=[],b=!0,y=[],S=!1;C();async function C(){t(5,S=!0);try{t(2,h=await ce.collections.getFullList(200));for(let Z of h)delete Z.created,delete Z.updated}catch(Z){ce.error(Z)}t(5,S=!1)}function $(){if(t(4,y=[]),!!i)for(let Z of _){const le=B.findByKey(h,"id",Z.id);!(le!=null&&le.id)||!B.hasCollectionChanges(le,Z,b)||y.push({new:Z,old:le})}}function T(){t(1,_=[]);try{t(1,_=JSON.parse(d))}catch{}Array.isArray(_)?t(1,_=B.filterDuplicatesByKey(_)):t(1,_=[]);for(let Z of _)delete Z.created,delete Z.updated,Z.schema=B.filterDuplicatesByKey(Z.schema)}function M(){var Z,le;for(let ne of _){const ie=B.findByKey(h,"name",ne.name)||B.findByKey(h,"id",ne.id);if(!ie)continue;const be=ne.id,Se=ie.id;ne.id=Se;const Ve=Array.isArray(ie.schema)?ie.schema:[],Be=Array.isArray(ne.schema)?ne.schema:[];for(const ke of Be){const Te=B.findByKey(Ve,"name",ke.name);Te&&Te.id&&(ke.id=Te.id)}for(let ke of _)if(Array.isArray(ke.schema))for(let Te of ke.schema)(Z=Te.options)!=null&&Z.collectionId&&((le=Te.options)==null?void 0:le.collectionId)===be&&(Te.options.collectionId=Se)}t(0,d=JSON.stringify(_,null,4))}function O(Z){t(12,m=!0);const le=new FileReader;le.onload=async ne=>{t(12,m=!1),t(10,f.value="",f),t(0,d=ne.target.result),await fn(),_.length||(Ds("Invalid collections configuration."),D())},le.onerror=ne=>{console.warn(ne),Ds("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},le.readAsText(Z)}function D(){t(0,d=""),t(10,f.value="",f),en({})}function L(Z){ee[Z?"unshift":"push"](()=>{f=Z,t(10,f)})}const P=()=>{f.files.length&&O(f.files[0])},N=()=>{f.click()};function F(){d=this.value,t(0,d)}function R(){b=this.checked,t(3,b)}const q=()=>M(),H=()=>D(),W=()=>c==null?void 0:c.show(h,_,b);function X(Z){ee[Z?"unshift":"push"](()=>{c=Z,t(11,c)})}const J=()=>D();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&T(),n.$$.dirty[0]&3&&t(6,i=!!d&&_.length&&_.length===_.filter(Z=>!!Z.id&&!!Z.name).length),n.$$.dirty[0]&78&&t(9,s=h.filter(Z=>i&&b&&!B.findByKey(_,"id",Z.id)
<div class="content"><p>Please note that during the backup other concurrent write requests may fail since the
database will be temporary &quot;locked&quot; (this usually happens only during the ZIP generation).</p>
<p class="txt-bold">If you are using S3 storage for the collections file upload, you&#39;ll have to backup them
separately since they are not locally stored and will not be included in the final backup!</p></div>`,t=E(),i=v("form"),z(s.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),j(s,i,null),l=!0,o||(r=K(i,"submit",et(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),s.$set(f)},i(a){l||(A(s.$$.fragment,a),l=!0)},o(a){I(s.$$.fragment,a),l=!1},d(a){a&&k(e),a&&k(t),a&&k(i),V(s),o=!1,r()}}}function LI(n){let e;return{c(){e=v("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function PI(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),l.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[4]),p(s,"class","btn btn-expanded"),s.disabled=n[3],Q(s,"btn-loading",n[3])},m(a,u){w(a,e,u),g(e,t),w(a,i,u),w(a,s,u),g(s,l),o||(r=K(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(s.disabled=a[3]),u&8&&Q(s,"btn-loading",a[3])},d(a){a&&k(e),a&&k(i),a&&k(s),o=!1,r()}}}function NI(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[PI],header:[LI],default:[II]},$$scope:{ctx:n}};return e=new ln({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&8&&(o.beforeOpen=s[8]),l&8&&(o.beforeHide=s[9]),l&65548&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[10](null),V(e,s)}}}function FI(n,e,t){const i=$t(),s="backup_create_"+B.randomString(5);let l,o="",r=!1,a;function u(S){en({}),t(3,r=!1),t(2,o=S||""),l==null||l.show()}function f(){return l==null?void 0:l.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await ce.backups.create(o,{$cancelKey:s}),t(3,r=!1),f(),i("submit"),zt("Successfully generated new backup.")}catch(S){S.isAbort||ce.error(S)}clearTimeout(a),t(3,r=!1)}}jo(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(yo("A backup has already been started, please wait."),!1):!0,_=()=>(r&&yo("The backup was started but may take a while to complete. You can come back later.",4500),!0);function h(S){ee[S?"unshift":"push"](()=>{l=S,t(1,l)})}function b(S){Ne.call(this,n,S)}function y(S){Ne.call(this,n,S)}return[f,l,o,r,s,c,u,d,m,_,h,b,y]}class RI extends ge{constructor(e){super(),_e(this,e,FI,NI,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function qI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Backup name"),s=E(),l=v("input"),p(e,"for",i=n[14]),p(l,"type","text"),p(l,"id",o=n[14]),l.required=!0},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),re(l,n[2]),r||(a=K(l,"input",n[9]),r=!0)},p(u,f){f&16384&&i!==(i=u[14])&&p(e,"for",i),f&16384&&o!==(o=u[14])&&p(l,"id",o),f&4&&l.value!==u[2]&&re(l,u[2])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function jI(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,b;return u=new Fl({props:{value:n[1]}}),m=new pe({props:{class:"form-field required m-0",name:"name",$$slots:{default:[qI,({uniqueId:y})=>({14:y}),({uniqueId:y})=>y?16384:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.innerHTML=`<div class="icon"><i class="ri-alert-line"></i></div>
<div class="content"><p>Please proceed with caution.</p>
<p>The restore operation will replace your existing <code>pb_data</code> with the one from the backup
and will restart the application process!</p>
<p class="txt-bold">Backup restore is still experimental and currently works only on UNIX based systems.</p></div>`,t=E(),i=v("div"),s=U(`Type the backup name
`),l=v("div"),o=v("span"),r=U(n[1]),a=E(),z(u.$$.fragment),f=U(`
to confirm:`),c=E(),d=v("form"),z(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(l,"class","label"),p(i,"class","content m-b-sm"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(y,S){w(y,e,S),w(y,t,S),w(y,i,S),g(i,s),g(i,l),g(l,o),g(o,r),g(l,a),j(u,l,null),g(i,f),w(y,c,S),w(y,d,S),j(m,d,null),_=!0,h||(b=K(d,"submit",et(n[7])),h=!0)},p(y,S){(!_||S&2)&&se(r,y[1]);const C={};S&2&&(C.value=y[1]),u.$set(C);const $={};S&49156&&($.$$scope={dirty:S,ctx:y}),m.$set($)},i(y){_||(A(u.$$.fragment,y),A(m.$$.fragment,y),_=!0)},o(y){I(u.$$.fragment,y),I(m.$$.fragment,y),_=!1},d(y){y&&k(e),y&&k(t),y&&k(i),V(u),y&&k(c),y&&k(d),V(m),h=!1,b()}}}function VI(n){let e,t,i,s;return{c(){e=v("h4"),t=U("Restore "),i=v("strong"),s=U(n[1]),p(e,"class","center txt-break")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(i,s)},p(l,o){o&2&&se(s,l[1])},d(l){l&&k(e)}}}function zI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=U("Cancel"),i=E(),s=v("button"),l=v("span"),l.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(u,f){w(u,e,f),g(e,t),w(u,i,f),w(u,s,f),g(s,l),r||(a=K(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&Q(s,"btn-loading",u[4])},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function HI(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[zI],header:[VI],default:[jI]},$$scope:{ctx:n}};return e=new ln({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&32822&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[11](null),V(e,s)}}}function BI(n,e,t){let i;const s="backup_restore_"+B.randomString(5);let l,o="",r="",a=!1;function u(y){en({}),t(2,r=""),t(1,o=y),t(4,a=!1),l==null||l.show()}function f(){return l==null?void 0:l.hide()}async function c(){var y;if(!(!i||a)){t(4,a=!0);try{await ce.backups.restore(o),setTimeout(()=>{window.location.reload()},1e3)}catch(S){S!=null&&S.isAbort||(t(4,a=!1),Ds(((y=S.response)==null?void 0:y.message)||S.message))}}}function d(){r=this.value,t(2,r)}const m=()=>!a;function _(y){ee[y?"unshift":"push"](()=>{l=y,t(3,l)})}function h(y){Ne.call(this,n,y)}function b(y){Ne.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[f,o,r,l,a,i,s,c,u,d,m,_,h,b]}class UI extends ge{constructor(e){super(),_e(this,e,BI,HI,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function j_(n,e,t){const i=n.slice();return i[22]=e[t],i}function V_(n,e,t){const i=n.slice();return i[19]=e[t],i}function WI(n){let e=[],t=new Map,i,s,l=n[3];const o=a=>a[22].key;for(let a=0;a<l.length;a+=1){let u=j_(n,l,a),f=o(u);t.set(f,e[a]=H_(f,u))}let r=null;return l.length||(r=z_()),{c(){for(let a=0;a<e.length;a+=1)e[a].c();i=ye(),r&&r.c()},m(a,u){for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(a,u);w(a,i,u),r&&r.m(a,u),s=!0},p(a,u){u&876&&(l=a[3],ae(),e=bt(e,u,o,1,a,l,t,i.parentNode,Bt,H_,i,j_),ue(),!l.length&&r?r.p(a,u):l.length?r&&(r.d(1),r=null):(r=z_(),r.c(),r.m(i.parentNode,i)))},i(a){if(!s){for(let u=0;u<l.length;u+=1)A(e[u]);s=!0}},o(a){for(let u=0;u<e.length;u+=1)I(e[u]);s=!1},d(a){for(let u=0;u<e.length;u+=1)e[u].d(a);a&&k(i),r&&r.d(a)}}}function YI(n){let e,t=Array(n[3].length||1),i=[];for(let s=0;s<t.length;s+=1)i[s]=B_(V_(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=ye()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);w(s,e,l)},p(s,l){if(l&8){t=Array(s[3].length||1);let o;for(o=0;o<t.length;o+=1){const r=V_(s,t,o);i[o]?i[o].p(r,l):(i[o]=B_(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:x,o:x,d(s){mt(i,s),s&&k(e)}}}function z_(n){let e;return{c(){e=v("div"),e.innerHTML=`<span class="txt">No backups yet.</sp
`,p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function H_(n,e){let t,i,s,l,o,r=e[22].key+"",a,u,f,c,d=B.formattedFileSize(e[22].size)+"",m,_,h,b,y,S,C,$,T,M,O,D,L,P,N,F,R,q,H,W;function X(){return e[10](e[22])}function J(){return e[11](e[22])}function Z(){return e[12](e[22])}return{key:n,first:null,c(){t=v("div"),i=v("i"),s=E(),l=v("div"),o=v("span"),a=U(r),u=E(),f=v("span"),c=U("("),m=U(d),_=U(")"),h=E(),b=v("div"),y=v("button"),S=v("i"),$=E(),T=v("button"),M=v("i"),D=E(),L=v("button"),P=v("i"),F=E(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(f,"class","size txt-hint txt-nowrap"),p(l,"class","content"),p(S,"class","ri-download-line"),p(y,"type","button"),p(y,"class","btn btn-sm btn-circle btn-hint btn-transparent"),y.disabled=C=e[6][e[22].key]||e[5][e[22].key],p(y,"aria-label","Download"),Q(y,"btn-loading",e[5][e[22].key]),p(M,"class","ri-restart-line"),p(T,"type","button"),p(T,"class","btn btn-sm btn-circle btn-hint btn-transparent"),T.disabled=O=e[6][e[22].key],p(T,"aria-label","Restore"),p(P,"class","ri-delete-bin-7-line"),p(L,"type","button"),p(L,"class","btn btn-sm btn-circle btn-hint btn-transparent"),L.disabled=N=e[6][e[22].key],p(L,"aria-label","Delete"),Q(L,"btn-loading",e[6][e[22].key]),p(b,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(le,ne){w(le,t,ne),g(t,i),g(t,s),g(t,l),g(l,o),g(o,a),g(l,u),g(l,f),g(f,c),g(f,m),g(f,_),g(t,h),g(t,b),g(b,y),g(y,S),g(b,$),g(b,T),g(T,M),g(b,D),g(b,L),g(L,P),g(t,F),q=!0,H||(W=[Me(He.call(null,y,"Download")),K(y,"click",et(X)),Me(He.call(null,T,"Restore")),K(T,"click",et(J)),Me(He.call(null,L,"Delete")),K(L,"click",et(Z))],H=!0)},p(le,ne){e=le,(!q||ne&8)&&r!==(r=e[22].key+"")&&se(a,r),(!q||ne&8)&&d!==(d=B.formattedFileSize(e[22].size)+"")&&se(m,d),(!q||ne&104&&C!==(C=e[6][e[22].key]||e[5][e[22].key]))&&(y.disabled=C),(!q||ne&40)&&Q(y,"btn-loading",e[5][e[22].key]),(!q||ne&72&&O!==(O=e[6][e[22].key]))&&(T.disabled=O),(!q||ne&72&&N!==(N=e[6][e[22].key]))&&(L.disabled=N),(!q||ne&72)&&Q(L,"btn-loading",e[6][e[22].key])},i(le){q||(le&&Qe(()=>{q&&(R||(R=je(t,ot,{duration:150},!0)),R.run(1))}),q=!0)},o(le){le&&(R||(R=je(t,ot,{duration:150},!1)),R.run(0)),q=!1},d(le){le&&k(t),le&&R&&R.end(),H=!1,Ee(W)}}}function B_(n){let e;return{c(){e=v("div"),e.innerHTML=`<span class="skeleton-loader"></span>
`,p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function KI(n){let e,t,i;return{c(){e=v("span"),t=E(),i=v("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function JI(n){let e,t,i;return{c(){e=v("i"),t=E(),i=v("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function ZI(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h;const b=[YI,WI],y=[];function S(D,L){return D[4]?0:1}i=S(n),s=y[i]=b[i](n);function C(D,L){return D[7]?JI:KI}let $=C(n),T=$(n),M={};f=new RI({props:M}),n[14](f),f.$on("submit",n[15]);let O={};return d=new UI({props:O}),n[16](d),{c(){e=v("div"),t=v("div"),s.c(),l=E(),o=v("div"),r=v("button"),T.c(),u=E(),z(f.$$.fragment),c=E(),z(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(D,L){w(D,e,L),g(e,t),y[i].m(t,null),g(e,l),g(e,o),g(o,r),T.m(r,null),w(D,u,L),j(f,D,L),w(D,c,L),j(d,D,L),m=!0,_||(h=K(r,"click",n[13]),_=!0)},p(D,[L]){let P=i;i=S(D),i===P?y[i].p(D,L):(ae(),I(y[P],1,1,()=>{y[P]=null}),ue(),s=y[i],s?s.p(D,L):(s=y[i]=b[i](D),s.c()),A(s,1),s.m(t,null)),$!==($=C(D))&&(T.d(1),T=$(D),T&&(T.c(),T.m(r,null))),(!m||L&144&&a!==(a=D[4]||!D[7]))&&(r.disabled=a);const N={};f.$set(N);const F={};d.$set(F)},i(D){m||(A(s),A(f.$$.fragment,D),A(d.$$.fragment,D),m=!0)},o(D){I(s),I(f.$$.fragment,D),I(d.$$.fragment,D),m=!1},d(D){D&&k(e),y[i].d(),T.d(),D&&k(u),n[14](null),V(f,D),D&&k(c),n[16](null),V(d,D),_=!1,h()}}}function GI(n,e,t){let i,s,l=[],o=!1,r={},a={},u=!0;f(),_();async function f(){t(4,o=!0);try{t(3,l=await ce.backups.getFullList()),l.sort((M,O)=>M.modified<O.modified?1:M.modified>O.modified?-1:0),t(4,o=!1)}catch(M){M.isAbort||(ce.error(M),t(4,o=!1))}}async function c(M){if(!r[M]){t(5,r[M]=!0,r);try{const O=await ce.getAdminFileToken(),D=ce.backups.getDownloadUrl(O,M);B.download(D)}catch(O){O.isAbort||ce.error(O)}delete r[M],t(5,r)}}function d(M){pn(`Do you really want to delete ${M}?`,()=>m(M))}async function m(M){if(!a[M]){t(6,a[M]=!0,a);try{await ce.backups.delete(M),B.removeByKey(l,"name",M),f(),zt(`Successfully deleted ${M}.`)}catch(O){O.isAbort||ce.error(O)}delete a[M],t(6,a)}}async function _(){var M;try{const O=await ce.health.check({$autoCancel:!1}),D=u;t(7,u=((M=O==null?void 0:O.data)==null?void 0:M.canBackup)||!1),D!=u&&u&&f()}catch{}}Gt(()=>{let M=setInterval(()=>{_()},3e3);return()=>{clearInterval(M)}});const h=M=>c(M.key),b=M=>s.show(M.key),y=M=>d(M.key),S=()=>i==null?void 0:i.show();function C(M){ee[M?"unshift":"push"](()=>{i=M,t(1,i)})}const $=()=>{f()};function T(M){ee[M?"unshift":"push"](()=>{s=M,t(2,s)})}return[f,i,s,l,o,r,a,u,c,d,h,b,y,S,C,$,T]}class XI extends ge{constructor(e){super(),_e(this,e,GI,ZI,me,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function QI(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function xI(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function U_(n){var H,W,X;let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,b,y,S,C,$,T,M,O;t=new pe({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[e8,({uniqueId:J})=>({32:J}),({uniqueId:J})=>[0,J?2:0]]},$$scope:{ctx:n}}});let D=n[2]&&W_(n);function L(J){n[25](J)}function P(J){n[26](J)}function N(J){n[27](J)}let F={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(H=n[0].backups)==null?void 0:H.s3};n[1].backups.s3!==void 0&&(F.config=n[1].backups.s3),n[7]!==void 0&&(F.isTesting=n[7]),n[8]!==void 0&&(F.testError=n[8]),r=new T1({props:F}),ee.push(()=>de(r,"config",L)),ee.push(()=>de(r,"isTesting",P)),ee.push(()=>de(r,"testError",N));let R=((X=(W=n[1].backups)==null?void 0:W.s3)==null?voi
<span class="txt">S3 connected successfully</span>`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function l8(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
2023-06-11 04:43:09 +08:00
<span class="txt">Failed to establish S3 connection</span>`,p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Me(t=He.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&qt(t.update)&&o[0]&256&&t.update.call(null,(r=l[8].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function o8(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function K_(n){let e,t,i,s,l;return{c(){e=v("button"),t=v("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),g(e,t),s||(l=K(e,"click",n[28]),s=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&k(e),s=!1,l()}}}function r8(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,b,y,S,C,$,T,M,O,D,L;m=new Zo({props:{class:"btn-sm",tooltip:"Reload backups list"}}),m.$on("refresh",n[15]);let P={};h=new XI({props:P}),n[16](h);function N(H,W){return H[6]?xI:QI}let F=N(n),R=F(n),q=n[6]&&!n[4]&&U_(n);return{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[10]),r=E(),a=v("div"),u=v("div"),f=v("div"),c=v("span"),c.textContent="Backup and restore your PocketBase data",d=E(),z(m.$$.fragment),_=E(),z(h.$$.fragment),b=E(),y=v("hr"),S=E(),C=v("button"),$=v("span"),$.textContent="Backups options",T=E(),R.c(),M=E(),q&&q.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-5"),p($,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-secondary"),C.disabled=n[4],Q(C,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(H,W){w(H,e,W),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),w(H,r,W),w(H,a,W),g(a,u),g(u,f),g(f,c),g(f,d),j(m,f,null),g(u,_),j(h,u,null),g(u,b),g(u,y),g(u,S),g(u,C),g(C,$),g(C,T),R.m(C,null),g(u,M),q&&q.m(u,null),O=!0,D||(L=[K(C,"click",n[17]),K(u,"submit",et(n[11]))],D=!0)},p(H,W){(!O||W[0]&1024)&&se(o,H[10]);const X={};h.$set(X),F!==(F=N(H))&&(R.d(1),R=F(H),R&&(R.c(),R.m(C,null))),(!O||W[0]&16)&&(C.disabled=H[4]),(!O||W[0]&16)&&Q(C,"btn-loading",H[4]),H[6]&&!H[4]?q?(q.p(H,W),W[0]&80&&A(q,1)):(q=U_(H),q.c(),A(q,1),q.m(u,null)):q&&(ae(),I(q,1,1,()=>{q=null}),ue())},i(H){O||(A(m.$$.fragment,H),A(h.$$.fragment,H),A(q),O=!0)},o(H){I(m.$$.fragment,H),I(h.$$.fragment,H),I(q),O=!1},d(H){H&&k(e),H&&k(r),H&&k(a),V(m),n[16](null),V(h),R.d(),q&&q.d(),D=!1,Ee(L)}}}function a8(n){let e,t,i,s;return e=new Ti({}),i=new wn({props:{$$slots:{default:[r8]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,o){const r={};o[0]&2047|o[1]&4&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){V(e,l),l&&k(t),V(i,l)}}}function u8(n,e,t){let i,s;Je(n,Tt,Z=>t(10,s=Z)),sn(Tt,s="Backups",s);let l,o={},r={},a=!1,u=!1,f="",c=!1,d=!1,m=!1,_=null;h();async function h(){t(4,a=!0);try{const Z=await ce.settings.getAll()||{};y(Z)}catch(Z){ce.error(Z)}t(4,a=!1)}async function b(){if(!(u||!i)){t(5,u=!0);try{const Z=await ce.settings.update(B.filterRedactedProps(r));await C(),y(Z),zt("Successfully saved application settings.")}catch(Z){ce.error(Z)}t(5,u=!1)}}function y(Z={}){t(1,r={backups:(Z==null?void 0:Z.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function C(){await(l==null?void 0:l.loadBackups())}const $=()=>C();function T(Z){ee[Z?"unshift":"push"](()=>{l=Z,t(3,l)})}const M=()=>t(6,d=!d);function O(){c=this.checked,t(2,c)}function D(){r.backups.cron=this.value,t(1,r),t(2,c)}const L=()=>{t(1,r.backups.cron="0 0 * * *",r)},P=()=>{t(1,r.backups.cron="0 0 * * 0",r)},N=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},F=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function R(){r.backups.cronMaxKeep=dt(this.value),t(1,r),t(2,c)}functio
2023-06-11 04:32:41 +08:00
<span class="txt">Manage admins</span>`,t=E(),i=v("hr"),s=E(),l=v("button"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[Me(on.call(null,e)),K(l,"click",n[7])],o=!0)},p:x,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),o=!1,Ee(r)}}}function X_(n){let e,t,i;return t=new pu({props:{scriptSrc:"./libs/tinymce/tinymce.min.js",conf:B.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(s,l){w(s,e,l),j(t,e,null),i=!0},p:x,i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function T8(n){var b;let e,t,i,s,l,o,r,a,u,f,c,d,m;document.title=e=B.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let _=((b=n[0])==null?void 0:b.id)&&n[1]&&G_(n);o=new u0({props:{routes:c8}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new v8({}),f=new $8({});let h=n[1]&&!n[2]&&X_(n);return{c(){t=E(),i=v("div"),_&&_.c(),s=E(),l=v("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),c=E(),h&&h.c(),d=ye(),p(l,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),_&&_.m(i,null),g(i,s),g(i,l),j(o,l,null),g(l,r),j(a,l,null),w(y,u,S),j(f,y,S),w(y,c,S),h&&h.m(y,S),w(y,d,S),m=!0},p(y,[S]){var C;(!m||S&24)&&e!==(e=B.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),(C=y[0])!=null&&C.id&&y[1]?_?(_.p(y,S),S&3&&A(_,1)):(_=G_(y),_.c(),A(_,1),_.m(i,s)):_&&(ae(),I(_,1,1,()=>{_=null}),ue()),y[1]&&!y[2]?h?(h.p(y,S),S&6&&A(h,1)):(h=X_(y),h.c(),A(h,1),h.m(d.parentNode,d)):h&&(ae(),I(h,1,1,()=>{h=null}),ue())},i(y){m||(A(_),A(o.$$.fragment,y),A(a.$$.fragment,y),A(f.$$.fragment,y),A(h),m=!0)},o(y){I(_),I(o.$$.fragment,y),I(a.$$.fragment,y),I(f.$$.fragment,y),I(h),m=!1},d(y){y&&k(t),y&&k(i),_&&_.d(),V(o),V(a),y&&k(u),V(f,y),y&&k(c),h&&h.d(y),y&&k(d)}}}function M8(n,e,t){let i,s,l,o;Je(n,As,h=>t(10,i=h)),Je(n,So,h=>t(3,s=h)),Je(n,Ra,h=>t(0,l=h)),Je(n,Tt,h=>t(4,o=h));let r,a=!1,u=!1;function f(h){var b,y,S,C;((b=h==null?void 0:h.detail)==null?void 0:b.location)!==r&&(t(1,a=!!((S=(y=h==null?void 0:h.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(C=h==null?void 0:h.detail)==null?void 0:C.location,sn(Tt,o="",o),en({}),v1())}function c(){ji("/")}async function d(){var h,b;if(l!=null&&l.id)try{const y=await ce.settings.getAll({$cancelKey:"initialAppSettings"});sn(So,s=((h=y==null?void 0:y.meta)==null?void 0:h.appName)||"",s),sn(As,i=!!((b=y==null?void 0:y.meta)!=null&&b.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}function m(){ce.logout()}const _=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&d()},[l,a,u,s,o,f,c,m,_]}class O8 extends ge{constructor(e){super(),_e(this,e,M8,T8,me,{})}}new O8({target:document.getElementById("app")});export{Ee as A,zt as B,B as C,ji as D,ye as E,gb as F,mg as G,Gt as H,Je as I,ci as J,$t as K,ee as L,g1 as M,bt as N,zo as O,as as P,Bt as Q,mt as R,ge as S,yn as T,zr as U,I as a,E as b,z as c,V as d,v as e,p as f,w as g,g as h,_e as i,Me as j,ae as k,on as l,j as m,ue as n,k as o,ce as p,pe as q,Q as r,me as s,A as t,K as u,et as v,U as w,se as x,x as y,re as z};