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

229 lines
1.1 MiB
JavaScript
Raw Normal View History

2025-03-29 03:07:16 +08:00
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-DX_FKS_7.js","./index--SLWvmJB.js","./ListApiDocs-D0yImgcl.js","./FieldsQueryParam-DwxRL0Rs.js","./ListApiDocs-ByASLUZu.css","./ViewApiDocs-D4a8_sUh.js","./CreateApiDocs-BcCSdgB_.js","./UpdateApiDocs-21rQKldB.js","./AuthMethodsDocs-B8vzQ_Or.js","./AuthWithPasswordDocs-COrJuoFm.js","./AuthWithOAuth2Docs-DhCHmHNj.js","./AuthWithOtpDocs-65RLBkb4.js","./AuthRefreshDocs-BMi7FyEm.js","./CodeEditor-CXGm1WBS.js"])))=>i.map(i=>d[i]);
2025-03-20 19:46:40 +08:00
var Fy=Object.defineProperty;var qy=(n,e,t)=>e in n?Fy(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var dt=(n,e,t)=>qy(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function te(){}const lo=n=>n;function He(n,e){for(const t in e)n[t]=e[t];return n}function jy(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Zb(n){return n()}function df(){return Object.create(null)}function De(n){n.forEach(Zb)}function It(n){return typeof n=="function"}function ke(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let wo;function vn(n,e){return n===e?!0:(wo||(wo=document.createElement("a")),wo.href=e,n===wo.href)}function Hy(n){return Object.keys(n).length===0}function cu(n,...e){if(n==null){for(const i of e)i(void 0);return te}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Gb(n){let e;return cu(n,t=>e=t)(),e}function Xe(n,e,t){n.$$.on_destroy.push(cu(e,t))}function At(n,e,t,i){if(n){const l=Xb(n,e,t,i);return n[0](l)}}function Xb(n,e,t,i){return n[1]&&i?He(t.ctx.slice(),n[1](i(e))):t.ctx}function Nt(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r<o;r+=1)s[r]=e.dirty[r]|l[r];return s}return e.dirty|l}return e.dirty}function Pt(n,e,t,i,l,s){if(l){const o=Xb(e,t,i,s);n.p(o,l)}}function Rt(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 Jt(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function st(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 zs(n){return n??""}function Mn(n,e,t){return n.set(t),e}function $e(n){return n&&It(n.destroy)?n.destroy:te}function pf(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const Qb=typeof window<"u";let Cr=Qb?()=>window.performance.now():()=>Date.now(),du=Qb?n=>requestAnimationFrame(n):te;const Gl=new Set;function xb(n){Gl.forEach(e=>{e.c(n)||(Gl.delete(e),e.f())}),Gl.size!==0&&du(xb)}function $r(n){let e;return Gl.size===0&&du(xb),{promise:new Promise(t=>{Gl.add(e={c:n,f:t})}),abort(){Gl.delete(e)}}}function y(n,e){n.appendChild(e)}function e0(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function zy(n){const e=b("style");return e.textContent="/* empty */",Uy(e0(n),e),e.sheet}function Uy(n,e){return y(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function v(n){n.parentNode&&n.parentNode.removeChild(n)}function ct(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function b(n){return document.createElement(n)}function W(n){return document.createTextNode(n)}function $(){return W(" ")}function ge(){return W("")}function Y(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function it(n){return function(e){return e.preventDefault(),n.call(this,e)}}function xt(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 Vy=["width","height"];function ei(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
2025-02-21 22:54:51 +08:00
`;for(let _=0;_<=1;_+=a){const k=e+(t-e)*s(_);u+=_*100+`%{${o(k,1-k)}}
`}const f=u+`100% {${o(t,1-t)}}
2025-03-25 00:38:14 +08:00
}`,c=`__svelte_${Ky(f)}_${r}`,d=e0(n),{stylesheet:m,rules:h}=ur.get(d)||Jy(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${c} ${i}ms linear ${l}ms 1 both`,fr+=1,c}function Vs(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),fr-=l,fr||Zy())}function Zy(){du(()=>{fr||(ur.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&v(e)}),ur.clear())})}function Gy(n,e,t,i){if(!e)return te;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return te;const{delay:s=0,duration:o=300,easing:r=lo,start:a=Cr()+s,end:u=a+o,tick:f=te,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,h;function g(){c&&(h=Us(n,0,1,o,s,r,c)),s||(m=!0)}function _(){c&&Vs(n,h),d=!1}return $r(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),_()),!d)return!1;if(m){const S=k-a,C=0+1*r(S/o);f(C,1-C)}return!0}),g(),f(0,1),_}function Xy(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,n0(n,l)}}function n0(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let Bs;function qi(n){Bs=n}function so(){if(!Bs)throw new Error("Function called outside component initialization");return Bs}function an(n){so().$$.on_mount.push(n)}function Qy(n){so().$$.after_update.push(n)}function oo(n){so().$$.on_destroy.push(n)}function yt(){const n=so();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=t0(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Ae(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Kl=[],ie=[];let Xl=[];const Pa=[],i0=Promise.resolve();let Ra=!1;function l0(){Ra||(Ra=!0,i0.then(pu))}function mn(){return l0(),i0}function tt(n){Xl.push(n)}function Ce(n){Pa.push(n)}const Zr=new Set;let zl=0;function pu(){if(zl!==0)return;const n=Bs;do{try{for(;zl<Kl.length;){const e=Kl[zl];zl++,qi(e),xy(e.$$)}}catch(e){throw Kl.length=0,zl=0,e}for(qi(null),Kl.length=0,zl=0;ie.length;)ie.pop()();for(let e=0;e<Xl.length;e+=1){const t=Xl[e];Zr.has(t)||(Zr.add(t),t())}Xl.length=0}while(Kl.length);for(;Pa.length;)Pa.pop()();Ra=!1,Zr.clear(),qi(n)}function xy(n){if(n.fragment!==null){n.update(),De(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(tt)}}function ev(n){const e=[],t=[];Xl.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Xl=e}let ks;function mu(){return ks||(ks=Promise.resolve(),ks.then(()=>{ks=null})),ks}function $l(n,e,t){n.dispatchEvent(t0(`${e?"intro":"outro"}${t}`))}const Go=new Set;let Si;function re(){Si={r:0,c:[],p:Si}}function ae(){Si.r||De(Si.c),Si=Si.p}function M(n,e){n&&n.i&&(Go.delete(n),n.i(e))}function D(n,e,t,i){if(n&&n.o){if(Go.has(n))return;Go.add(n),Si.c.push(()=>{Go.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const hu={duration:0};function s0(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function u(){o&&Vs(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=lo,tick:g=te,css:_}=l||hu;_&&(o=Us(n,0,1,m,d,h,_,a++)),g(0,1);const k=Cr()+d,S=k+m;r&&r.abort(),s=!0,tt(()=>$l(n,!0,"start")),r=$r(C=>{if(s){if(C>=S)return g(1,0),$l(n,!0,"end"),u(),s=!1;if(C>=k){const T=h((C-k)/m);g(T,1-T)}}return s})}let c=!1;return{start(){c||(c=!0,Vs(n),It(l)?(l=l(i),mu().then(f)):f())},invalidate(){c=!1},end(){s&&(u(),s=!1)}}}function _u(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=Si;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=lo,tick:m=te,css:h}=l||hu;h&&(o=Us(n,1,0,c,f,d,h));const g=Cr()+f,_=g+c;tt(()=>$l(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),$r(k=>{if(s){if(k>=_)return m(0,1
2025-02-21 22:54:51 +08:00
`),t+=i.map(l=>{let s="";return l.name.includes("(")||l.name.includes(" ")?s+=l.name:s+="`"+l.name+"`",l.collate&&(s+=" COLLATE "+l.collate),l.sort&&(s+=" "+l.sort.toUpperCase()),s}).join(`,
`),i.length>1&&(t+=`
2025-03-20 19:46:40 +08:00
`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=U.parseIndex(e);return i.tableName=t,U.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=U.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?U.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return U.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,hidden:!1,required:!1},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const u=e[a];u===null?s.delete(a):s.set(a,u)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}let Va,_l;const Ba="app-tooltip";function Bf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function nl(){return _l=_l||document.querySelector("."+Ba),_l||(_l=document.createElement("div"),_l.classList.add(Ba),document.body.appendChild(_l)),_l}function rk(n,e){let t=nl();if(!t.classList.contains("active")||!(e!=null&&e.text)){Wa();return}t.textContent=e.text,t.className=Ba+" 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,l=t.offsetWidth,s=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=s.top+s.height/2-i/2,r=s.left-l-a):e.position=="right"?(o=s.top+s.height/2-i/2,r=s.right+a):e.position=="top"?(o=s.top-i-a,r=s.left+s.width/2-l/2):e.position=="top-left"?(o=s.top-i-a,r=s.left):e.position=="top-right"?(o=s.top-i-a,r=s.right-l):e.position=="bottom-left"?(o=s.top+s.height+a,r=s.left):e.position=="bottom-right"?(o=s.top+s.height+a,r=s.right-l):(o=s.top+s.height+a,r=s.left+s.width/2-l/2),r+l>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-l),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 Wa(){clearTimeout(Va),nl().classList.remove("active"),nl().activeNode=void 0}function pw(n,e){nl().activeNode=n,clearTimeout(Va),Va=setTimeout(()=>{nl().classList.add("active"),rk(n,e)},isNaN(e.delay)?0:e.delay)}function Fe(n,e){let t=Bf(e);function i(){pw(n,t)}function l(){Wa()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&U.isFocusable(n))&&n.addEventListener("click",l),nl(),{update(s){var o,r;t=Bf(s),(r=(o=nl())==null?void 0:o.activeNode)!=null&&r.contains(n)&&rk(n,t)},destroy(){var s,o;(o=(s=nl())==null?void 0:s.activeNode)!=null&&o.contains(n)&&Wa(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function Lr(n){const e=n-1;return e*e*e+1}function Ys(n,{delay:e=0,duration:t=400,easing:i=lo}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function Hn(n,{delay:e=0,duration:t=400,easing:i=Lr,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=pf(l),[m,h]=pf(s);return{delay:e,duration:t,easing:i,css:(g,_)=>`
2025-02-21 22:54:51 +08:00
transform: ${u} translate(${(1-g)*c}${d}, ${(1-g)*m}${h});
2025-03-20 19:46:40 +08:00
opacity: ${a-f*_}`}}function pt(n,{delay:e=0,duration:t=400,easing:i=Lr,axis:l="y"}={}){const s=getComputedStyle(n),o=+s.opacity,r=l==="y"?"height":"width",a=parseFloat(s[r]),u=l==="y"?["top","bottom"]:["left","right"],f=u.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),c=parseFloat(s[`padding${f[0]}`]),d=parseFloat(s[`padding${f[1]}`]),m=parseFloat(s[`margin${f[0]}`]),h=parseFloat(s[`margin${f[1]}`]),g=parseFloat(s[`border${f[0]}Width`]),_=parseFloat(s[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*o};${r}: ${k*a}px;padding-${u[0]}: ${k*c}px;padding-${u[1]}: ${k*d}px;margin-${u[0]}: ${k*m}px;margin-${u[1]}: ${k*h}px;border-${u[0]}-width: ${k*g}px;border-${u[1]}-width: ${k*_}px;`}}function Ct(n,{delay:e=0,duration:t=400,easing:i=Lr,start:l=0,opacity:s=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-l,f=r*(1-s);return{delay:e,duration:t,easing:i,css:(c,d)=>`
2025-02-21 22:54:51 +08:00
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
2025-03-20 19:46:40 +08:00
`}}const mw=n=>({}),Wf=n=>({}),hw=n=>({}),Yf=n=>({});function Kf(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,C=n[4]&&!n[2]&&Jf(n);const T=n[19].header,O=At(T,n,n[18],Yf);let E=n[4]&&n[2]&&Zf(n);const L=n[19].default,I=At(L,n,n[18],null),A=n[19].footer,N=At(A,n,n[18],Wf);return{c(){e=b("div"),t=b("div"),l=$(),s=b("div"),o=b("div"),C&&C.c(),r=$(),O&&O.c(),a=$(),E&&E.c(),u=$(),f=b("div"),I&&I.c(),c=$(),d=b("div"),N&&N.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(s,"class",m="overlay-panel "+n[1]+" "+n[8]),x(s,"popup",n[2]),p(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(P,R){w(P,e,R),y(e,t),y(e,l),y(e,s),y(s,o),C&&C.m(o,null),y(o,r),O&&O.m(o,null),y(o,a),E&&E.m(o,null),y(s,u),y(s,f),I&&I.m(f,null),n[21](f),y(s,c),y(s,d),N&&N.m(d,null),_=!0,k||(S=[Y(t,"click",it(n[20])),Y(f,"scroll",n[22])],k=!0)},p(P,R){n=P,n[4]&&!n[2]?C?(C.p(n,R),R[0]&20&&M(C,1)):(C=Jf(n),C.c(),M(C,1),C.m(o,r)):C&&(re(),D(C,1,1,()=>{C=null}),ae()),O&&O.p&&(!_||R[0]&262144)&&Pt(O,T,n,n[18],_?Nt(T,n[18],R,hw):Rt(n[18]),Yf),n[4]&&n[2]?E?E.p(n,R):(E=Zf(n),E.c(),E.m(o,null)):E&&(E.d(1),E=null),I&&I.p&&(!_||R[0]&262144)&&Pt(I,L,n,n[18],_?Nt(L,n[18],R,null):Rt(n[18]),null),N&&N.p&&(!_||R[0]&262144)&&Pt(N,A,n,n[18],_?Nt(A,n[18],R,mw):Rt(n[18]),Wf),(!_||R[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!_||R[0]&262)&&x(s,"popup",n[2]),(!_||R[0]&4)&&x(e,"padded",n[2]),(!_||R[0]&1)&&x(e,"active",n[0])},i(P){_||(P&&tt(()=>{_&&(i||(i=je(t,Ys,{duration:Gi,opacity:0},!0)),i.run(1))}),M(C),M(O,P),M(I,P),M(N,P),P&&tt(()=>{_&&(g&&g.end(1),h=s0(s,Hn,n[2]?{duration:Gi,y:-10}:{duration:Gi,x:50}),h.start())}),_=!0)},o(P){P&&(i||(i=je(t,Ys,{duration:Gi,opacity:0},!1)),i.run(0)),D(C),D(O,P),D(I,P),D(N,P),h&&h.invalidate(),P&&(g=_u(s,Hn,n[2]?{duration:Gi,y:10}:{duration:Gi,x:50})),_=!1},d(P){P&&v(e),P&&i&&i.end(),C&&C.d(),O&&O.d(P),E&&E.d(),I&&I.d(P),n[21](null),N&&N.d(P),P&&g&&g.end(),k=!1,De(S)}}}function Jf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line" aria-hidden="true"></i>',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){w(o,e,r),i=!0,l||(s=Y(e,"click",it(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Ys,{duration:Gi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Ys,{duration:Gi},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Zf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line txt-lg" aria-hidden="true"></i>',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){w(l,e,s),t||(i=Y(e,"click",it(n[5])),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function _w(n){let e,t,i,l,s=n[0]&&Kf(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[Y(window,"resize",n[10]),Y(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&M(s,1)):(s=Kf(o),s.c(),M(s,1),s.m(e,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){t||(M(s),t=!0)},o(o){D(s),t=!1},d(o){o&&v(e),s&&s.d(),n[23](null),i=!1,De(l)}}}let gl,la=[];function ak(){return gl=gl||document.querySelector(".overlays"),gl||(gl=document.createElement("div"),gl.classList.add("overlays"),document.body.appendChild(gl)),gl}let Gi=150;function Gf(){return 1e3+ak().querySelectorAll(".overlay-panel-container.active").length}function gw(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=yt(),h="op_"+U.randomString(10);let g,_,k,S,C="",T=o;function O(){typeof c=="function"&&c()===!1||t(0,o=!0)}function E(){typeof d=="function"&&d()===!1||t(0,o=!1)}function L(){return o}async function I(G){t(17,T=G),G?(k=document.activeElement,m("show"),g==null||g.focus()):(clearTimeout(S),m("hide"),k==null||k.focus()),await mn(),A()}function A(){g&&(o?t(6,g.
2025-02-21 22:54:51 +08:00
`)})),o=!0)},p(a,u){i&&It(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(_r).join(`
2025-03-29 03:07:16 +08:00
`)})},i(a){s||(a&&tt(()=>{s&&(l||(l=je(t,Ct,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=je(t,Ct,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&v(e),a&&l&&l.end(),o=!1,r()}}}function mc(n){let e,t,i=_r(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=W(i),s=$(),p(e,"class","help-block help-block-error")},m(a,u){w(a,e,u),y(e,t),y(t,l),y(e,s),r=!0},p(a,u){(!r||u&8)&&i!==(i=_r(a[12])+"")&&oe(l,i)},i(a){r||(a&&tt(()=>{r&&(o||(o=je(e,pt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=je(e,pt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function y3(n){let e,t,i,l,s,o,r;const a=n[9].default,u=At(a,n,n[8],pc),f=[k3,b3],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=f[i](n),{c(){e=b("div"),u&&u.c(),t=$(),l.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,h){w(m,e,h),u&&u.m(e,null),y(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=Y(e,"click",n[10]),o=!0)},p(m,[h]){u&&u.p&&(!s||h&256)&&Pt(u,a,m,m[8],s?Nt(a,m[8],h,g3):Rt(m[8]),pc);let g=i;i=d(m),i===g?c[i].p(m,h):(re(),D(c[g],1,1,()=>{c[g]=null}),ae(),l=c[i],l?l.p(m,h):(l=c[i]=f[i](m),l.c()),M(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&x(e,"error",m[3].length)},i(m){s||(M(u,m),M(l),s=!0)},o(m){D(u,m),D(l),s=!1},d(m){m&&v(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const hc="Invalid value";function _r(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||hc:n||hc}function v3(n,e,t){let i;Xe(n,Sn,g=>t(7,i=g));let{$$slots:l={},$$scope:s}=e;const o="field_"+U.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){Wn(r)}an(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(g){Ae.call(this,n,g)}function h(g){ie[g?"unshift":"push"](()=>{f=g,t(2,f)})}return n.$$set=g=>{"name"in g&&t(5,r=g.name),"inlineError"in g&&t(0,a=g.inlineError),"class"in g&&t(1,u=g.class),"$$scope"in g&&t(8,s=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=U.toArray(U.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,s,l,m,h]}class pe extends Se{constructor(e){super(),we(this,e,v3,y3,ke,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}const w3=n=>({}),_c=n=>({});function gc(n){let e,t,i,l,s,o;return{c(){e=b("a"),e.innerHTML='<i class="ri-book-open-line txt-sm"></i> <span class="txt">Docs</span>',t=$(),i=b("span"),i.textContent="|",l=$(),s=b("a"),o=b("span"),o.textContent="PocketBase v0.26.5",p(e,"href","https://pocketbase.io/docs"),p(e,"target","_blank"),p(e,"rel","noopener noreferrer"),p(i,"class","delimiter"),p(o,"class","txt"),p(s,"href","https://github.com/pocketbase/pocketbase/releases"),p(s,"target","_blank"),p(s,"rel","noopener noreferrer"),p(s,"title","Releases")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),w(r,l,a),w(r,s,a),y(s,o)},d(r){r&&(v(e),v(t),v(i),v(l),v(s))}}}function S3(n){var m;let e,t,i,l,s,o,r;const a=n[4].default,u=At(a,n,n[3],null),f=n[4].footer,c=At(f,n,n[3],_c);let d=((m=n[2])==null?void 0:m.id)&&gc();return{c(){e=b("div"),t=b("main"),u&&u.c(),i=$(),l=b("footer"),c&&c.c(),s=$(),d&&d.c(),p(t,"class","page-content"),p(l,"class","page-footer"),p(e,"class",o="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(h,g){w(h,e,g),y(e,t),u&&u.m(t,null),y(e,i),y(e,l),c&&c.m(l,null),y(l,s),d&&d.m(l,null),r=!0},p(h,[g]){var _;u&&u.p&&(!r||g&8)&&Pt(u,a,h,h[3],r?Nt(a,h[3],g,null):Rt(h[3]),null),c&&c.p&&(!r||g&8)&&Pt(c,f,h,h[3],r?Nt(f,h[3],g,w3):Rt(h[3]),_c),(_=h[2])!=null&&_.id?d||(d=gc(),d.c(),d.m(l,null)):d&&(d.d(1),d=null),(!r||g&2&&o!==(o="page-wrapper "+h[1]))&&p(e,"class",o),(!r||g&3)&&x(e,"center-content",h[0])},i(h){r||(M(u,h),M(c,h),r=!0)},o(h){D(u,h),D(c,h),r=!1},d(h){h&&v(e),u&&u.d(h),c&&c.d(h),d&&d.d()}}}function T3(n,e,t){let i;Xe(n,Nr,a=>t(2,i=a));let{$$slots:l={},$$scope:s}=e,{center:o=!1}=e,{class:r=""}=e;return n.$$set=a=>{"center"in a&&t(0,o=a.center),"class"in a&&t(1,r=a.class),"$$scope"in a&&t(3,s=a.$$scope)},[o,r,i,s,l]}class ii extends Se{constructor(e){super(),we(this,e,T3,S3,ke,{center:0,class:1})}}function C3(n){let e,t
2025-02-21 22:54:51 +08:00
* @kurkle/color v0.3.4
* https://github.com/kurkle/color#readme
* (c) 2024 Jukka Kurkela
* Released under the MIT License
2025-03-20 19:46:40 +08:00
*/function po(n){return n+.5|0}const Qi=(n,e,t)=>Math.max(Math.min(n,t),e);function Ms(n){return Qi(po(n*2.55),0,255)}function il(n){return Qi(po(n*255),0,255)}function Fi(n){return Qi(po(n/2.55)/100,0,1)}function Lc(n){return Qi(po(n*100),0,100)}const Zn={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},Ja=[..."0123456789ABCDEF"],t4=n=>Ja[n&15],n4=n=>Ja[(n&240)>>4]+Ja[n&15],Do=n=>(n&240)>>4===(n&15),i4=n=>Do(n.r)&&Do(n.g)&&Do(n.b)&&Do(n.a);function l4(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Zn[n[1]]*17,g:255&Zn[n[2]]*17,b:255&Zn[n[3]]*17,a:e===5?Zn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Zn[n[1]]<<4|Zn[n[2]],g:Zn[n[3]]<<4|Zn[n[4]],b:Zn[n[5]]<<4|Zn[n[6]],a:e===9?Zn[n[7]]<<4|Zn[n[8]]:255})),t}const s4=(n,e)=>n<255?e(n):"";function o4(n){var e=i4(n)?t4:n4;return n?"#"+e(n.r)+e(n.g)+e(n.b)+s4(n.a,e):void 0}const r4=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ck(n,e,t){const i=e*Math.min(t,1-t),l=(s,o=(s+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[l(0),l(8),l(4)]}function a4(n,e,t){const i=(l,s=(l+n/60)%6)=>t-t*e*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function u4(n,e,t){const i=Ck(n,1,.5);let l;for(e+t>1&&(l=1/(e+t),e*=l,t*=l),l=0;l<3;l++)i[l]*=1-e-t,i[l]+=e;return i}function f4(n,e,t,i,l){return n===l?(e-t)/i+(e<t?6:0):e===l?(t-n)/i+2:(n-e)/i+4}function Ru(n){const t=n.r/255,i=n.g/255,l=n.b/255,s=Math.max(t,i,l),o=Math.min(t,i,l),r=(s+o)/2;let a,u,f;return s!==o&&(f=s-o,u=r>.5?f/(2-s-o):f/(s+o),a=f4(t,i,l,f,s),a=a*60+.5),[a|0,u||0,r]}function Fu(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(il)}function qu(n,e,t){return Fu(Ck,n,e,t)}function c4(n,e,t){return Fu(u4,n,e,t)}function d4(n,e,t){return Fu(a4,n,e,t)}function $k(n){return(n%360+360)%360}function p4(n){const e=r4.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Ms(+e[5]):il(+e[5]));const l=$k(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=c4(l,s,o):e[1]==="hsv"?i=d4(l,s,o):i=qu(l,s,o),{r:i[0],g:i[1],b:i[2],a:t}}function m4(n,e){var t=Ru(n);t[0]=$k(t[0]+e),t=qu(t),n.r=t[0],n.g=t[1],n.b=t[2]}function h4(n){if(!n)return;const e=Ru(n),t=e[0],i=Lc(e[1]),l=Lc(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${l}%, ${Fi(n.a)})`:`hsl(${t}, ${i}%, ${l}%)`}const Ac={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"},Nc={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:"
2025-02-21 22:54:51 +08:00
* Chart.js v4.4.8
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
2025-03-20 19:46:40 +08:00
*/function Ni(){}const S4=(()=>{let n=0;return()=>n++})();function Ut(n){return n==null}function cn(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 vt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function wn(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function _i(n,e){return wn(n)?n:e}function Mt(n,e){return typeof n>"u"?e:n}const T4=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function ut(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function ht(n,e,t,i){let l,s,o;if(cn(n))for(s=n.length,l=0;l<s;l++)e.call(t,n[l],l);else if(vt(n))for(o=Object.keys(n),s=o.length,l=0;l<s;l++)e.call(t,n[o[l]],o[l])}function gr(n,e){let t,i,l,s;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(l=n[t],s=e[t],l.datasetIndex!==s.datasetIndex||l.index!==s.index)return!1;return!0}function br(n){if(cn(n))return n.map(br);if(vt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let l=0;for(;l<i;++l)e[t[l]]=br(n[t[l]]);return e}return n}function Mk(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function C4(n,e,t,i){if(!Mk(n))return;const l=e[n],s=t[n];vt(l)&&vt(s)?Gs(l,s,i):e[n]=br(s)}function Gs(n,e,t){const i=cn(e)?e:[e],l=i.length;if(!vt(n))return n;t=t||{};const s=t.merger||C4;let o;for(let r=0;r<l;++r){if(o=i[r],!vt(o))continue;const a=Object.keys(o);for(let u=0,f=a.length;u<f;++u)s(a[u],n,o,t)}return n}function Ns(n,e){return Gs(n,e,{merger:$4})}function $4(n,e,t){if(!Mk(n))return;const i=e[n],l=t[n];vt(i)&&vt(l)?Ns(i,l):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=br(l))}const Rc={"":n=>n,x:n=>n.x,y:n=>n.y};function O4(n){const e=n.split("."),t=[];let i="";for(const l of e)i+=l,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function M4(n){const e=O4(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function kr(n,e){return(Rc[e]||(Rc[e]=M4(e)))(n)}function ju(n){return n.charAt(0).toUpperCase()+n.slice(1)}const yr=n=>typeof n<"u",sl=n=>typeof n=="function",Fc=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function E4(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const yn=Math.PI,Ci=2*yn,D4=Ci+yn,vr=Number.POSITIVE_INFINITY,I4=yn/180,ci=yn/2,bl=yn/4,qc=yn*2/3,Ek=Math.log10,ol=Math.sign;function Ol(n,e,t){return Math.abs(n-e)<t}function jc(n){const e=Math.round(n);n=Ol(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Ek(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function L4(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((l,s)=>l-s).pop(),e}function A4(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function Xs(n){return!A4(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function N4(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function P4(n,e,t){let i,l,s;for(i=0,l=n.length;i<l;i++)s=n[i][t],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function Tl(n){return n*(yn/180)}function R4(n){return n*(180/yn)}function Hc(n){if(!wn(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function F4(n,e){const t=e.x-n.x,i=e.y-n.y,l=Math.sqrt(t*t+i*i);let s=Math.atan2(i,t);return s<-.5*yn&&(s+=Ci),{angle:s,distance:l}}function Za(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function q4(n,e){return(n-e+D4)%Ci-yn}function ki(n){return(n%Ci+Ci)%Ci}function Dk(n,e,t,i){const l=ki(n),s=ki(e),o=ki(t),r=ki(s-l),a=ki(o-l),u=ki(l-s),f=ki(l-o);return l===s||l===o||i&&s===o||r>a&&u<f}function di(n,e,t){return Math.max(e,Math.min(t,n))}function j4(n){return di(n,-32768,32767)}function Ik(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Hu(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,l=0,s;for(;i-l>1;)s=l+i>>1,t(s)?l=s:i=s;return{lo:l,hi:i}}const Cl=(n,e,t,i)=>Hu(n,t,i?l=>{const s=n[l][e];return s<t||s===t&&n[l+1][e]===t}:l=>n[l][e]<t),H4=(n,
2025-02-21 22:54:51 +08:00
* Chart.js v4.4.8
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
2025-03-20 19:46:40 +08:00
*/class XS{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,l){const s=t.listeners[l],o=t.duration;s.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=Ak.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,l)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,r=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(s[o]=s[s.length-1],s.pop());r&&(l.draw(),this._notify(l,i,e,"progress")),s.length||(i.running=!1,this._notify(l,i,e,"complete"),i.initial=!1),t+=s.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,l)=>Math.max(i,l._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 l=i.length-1;for(;l>=0;--l)i[l].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Pi=new XS;const ld="transparent",QS={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Wc(n||ld),l=i.valid&&Wc(e||ld);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class xS{constructor(e,t,i,l){const s=t[i];l=No([e.to,l,s,e.from]);const o=No([e.from,s,l]);this._active=!0,this._fn=e.fn||QS[e.type||typeof o],this._easing=Ps[e.easing]||Ps.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=l,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const l=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=No([e.to,t,l,e.from]),this._from=No([e.from,l,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,l=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||t<i),!this._active){this._target[l]=r,this._notify(!0);return}if(t<0){this._target[l]=s;return}a=t/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[l]=this._fn(s,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 l=0;l<i.length;l++)i[l][t]()}}class Yk{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!vt(e))return;const t=Object.keys(on.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(l=>{const s=e[l];if(!vt(s))return;const o={};for(const r of t)o[r]=s[r];(cn(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=tT(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&eT(e.options.$animations,i).then(()=>{e.options=i},()=>{}),s}_createAnimations(e,t){const i=this._properties,l=[],s=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){l.push(...this._animateOptions(e,t));continue}const f=t[u];let c=s[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}s[u]=c=new xS(d,e,u,f),l.push(c)}return l}update(e,t){if(this._properties.size
2025-02-21 22:54:51 +08:00
`)>-1?n.split(`
2025-03-20 19:46:40 +08:00
`):n}function Z6(n,e){const{element:t,datasetIndex:i,index:l}=e,s=n.getDatasetMeta(i).controller,{label:o,value:r}=s.getLabelAndValue(l);return{chart:n,label:o,parsed:s.getParsed(l),raw:n.data.datasets[i].data[l],formattedValue:r,dataset:s.getDataset(),dataIndex:l,datasetIndex:i,element:t}}function Pd(n,e){const t=n.chart.ctx,{body:i,footer:l,title:s}=n,{boxWidth:o,boxHeight:r}=e,a=Ti(e.bodyFont),u=Ti(e.titleFont),f=Ti(e.footerFont),c=s.length,d=l.length,m=i.length,h=rl(e.padding);let g=h.height,_=0,k=i.reduce((T,O)=>T+O.before.length+O.lines.length+O.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=m*T+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const C=function(T){_=Math.max(_,t.measureText(T).width+S)};return t.save(),t.font=u.string,ht(n.title,C),t.font=a.string,ht(n.beforeBody.concat(n.afterBody),C),S=e.displayColors?o+2+e.boxPadding:0,ht(i,T=>{ht(T.before,C),ht(T.lines,C),ht(T.after,C)}),S=0,t.font=f.string,ht(n.footer,C),t.restore(),_+=h.width,{width:_,height:g}}function G6(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function X6(n,e,t,i){const{x:l,width:s}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&l+s+o>e.width||n==="right"&&l-s-o<0)return!0}function Q6(n,e,t,i){const{x:l,width:s}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=l<=(r+a)/2?"left":"right":l<=s/2?u="left":l>=o-s/2&&(u="right"),X6(u,n,e,t)&&(u="center"),u}function Rd(n,e,t){const i=t.yAlign||e.yAlign||G6(n,t);return{xAlign:t.xAlign||e.xAlign||Q6(n,e,t,i),yAlign:i}}function x6(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function eC(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function Fd(n,e,t,i){const{caretSize:l,caretPadding:s,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=l+s,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=ir(o);let h=x6(e,r);const g=eC(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+l:r==="right"&&(h+=Math.max(c,m)+l),{x:di(h,0,i.width-e.width),y:di(g,0,i.height-e.height)}}function Vo(n,e,t){const i=rl(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function qd(n){return gi([],Ri(n))}function tC(n,e,t){return Nl(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function jd(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const ay={beforeTitle:Ni,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return t[e.dataIndex]}return""},afterTitle:Ni,beforeBody:Ni,beforeLabel:Ni,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let e=n.dataset.label||"";e&&(e+=": ");const t=n.formattedValue;return Ut(t)||(e+=t),e},labelColor(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:Ni,afterBody:Ni,beforeFooter:Ni,footer:Ni,afterFooter:Ni};function An(n,e,t,i){const l=n[e].call(t,i);return typeof l>"u"?ay[e].call(t,i):l}class nu extends Ll{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,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void
2025-02-21 22:54:51 +08:00
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
2025-03-20 19:46:40 +08:00
*/const aC={datetime:Qe.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Qe.TIME_WITH_SECONDS,minute:Qe.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Jk._date.override({_id:"luxon",_create:function(n){return Qe.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return aC},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Qe.fromFormat(n,e,t):n=Qe.fromISO(n,t):n instanceof Date?n=Qe.fromJSDate(n,t):i==="object"&&!(n instanceof Qe)&&(n=Qe.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function uC(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var uy={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
2025-02-21 22:54:51 +08:00
* http://hammerjs.github.io/
*
* Copyright (c) 2016 Jorik Tangelder;
2025-03-20 19:46:40 +08:00
* Licensed under the MIT license */(function(n){(function(e,t,i,l){var s=["","webkit","Moz","MS","ms","o"],o=t.createElement("div"),r="function",a=Math.round,u=Math.abs,f=Date.now;function c(K,Q,ne){return setTimeout(C(K,ne),Q)}function d(K,Q,ne){return Array.isArray(K)?(m(K,ne[Q],ne),!0):!1}function m(K,Q,ne){var me;if(K)if(K.forEach)K.forEach(Q,ne);else if(K.length!==l)for(me=0;me<K.length;)Q.call(ne,K[me],me,K),me++;else for(me in K)K.hasOwnProperty(me)&&Q.call(ne,K[me],me,K)}function h(K,Q,ne){var me="DEPRECATED METHOD: "+Q+`
2025-02-21 22:54:51 +08:00
`+ne+` AT
2025-03-20 19:46:40 +08:00
`;return function(){var Le=new Error("get-stack-trace"),Ze=Le&&Le.stack?Le.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",mt=e.console&&(e.console.warn||e.console.log);return mt&&mt.call(e.console,me,Ze),K.apply(this,arguments)}}var g;typeof Object.assign!="function"?g=function(Q){if(Q===l||Q===null)throw new TypeError("Cannot convert undefined or null to object");for(var ne=Object(Q),me=1;me<arguments.length;me++){var Le=arguments[me];if(Le!==l&&Le!==null)for(var Ze in Le)Le.hasOwnProperty(Ze)&&(ne[Ze]=Le[Ze])}return ne}:g=Object.assign;var _=h(function(Q,ne,me){for(var Le=Object.keys(ne),Ze=0;Ze<Le.length;)(!me||me&&Q[Le[Ze]]===l)&&(Q[Le[Ze]]=ne[Le[Ze]]),Ze++;return Q},"extend","Use `assign`."),k=h(function(Q,ne){return _(Q,ne,!0)},"merge","Use `assign`.");function S(K,Q,ne){var me=Q.prototype,Le;Le=K.prototype=Object.create(me),Le.constructor=K,Le._super=me,ne&&g(Le,ne)}function C(K,Q){return function(){return K.apply(Q,arguments)}}function T(K,Q){return typeof K==r?K.apply(Q&&Q[0]||l,Q):K}function O(K,Q){return K===l?Q:K}function E(K,Q,ne){m(N(Q),function(me){K.addEventListener(me,ne,!1)})}function L(K,Q,ne){m(N(Q),function(me){K.removeEventListener(me,ne,!1)})}function I(K,Q){for(;K;){if(K==Q)return!0;K=K.parentNode}return!1}function A(K,Q){return K.indexOf(Q)>-1}function N(K){return K.trim().split(/\s+/g)}function P(K,Q,ne){if(K.indexOf&&!ne)return K.indexOf(Q);for(var me=0;me<K.length;){if(ne&&K[me][ne]==Q||!ne&&K[me]===Q)return me;me++}return-1}function R(K){return Array.prototype.slice.call(K,0)}function q(K,Q,ne){for(var me=[],Le=[],Ze=0;Ze<K.length;){var mt=K[Ze][Q];P(Le,mt)<0&&me.push(K[Ze]),Le[Ze]=mt,Ze++}return me=me.sort(function(pn,Cn){return pn[Q]>Cn[Q]}),me}function F(K,Q){for(var ne,me,Le=Q[0].toUpperCase()+Q.slice(1),Ze=0;Ze<s.length;){if(ne=s[Ze],me=ne?ne+Le:Q,me in K)return me;Ze++}return l}var B=1;function J(){return B++}function V(K){var Q=K.ownerDocument||K;return Q.defaultView||Q.parentWindow||e}var Z=/mobile|tablet|ip(ad|hone|od)|android/i,G="ontouchstart"in e,ce=F(e,"PointerEvent")!==l,de=G&&Z.test(navigator.userAgent),ue="touch",Te="pen",Ke="mouse",Je="kinect",ft=25,et=1,xe=2,We=4,at=8,Vt=1,Ve=2,Ee=4,ot=8,Ie=16,Ye=Ve|Ee,ve=ot|Ie,nt=Ye|ve,Ht=["x","y"],Pe=["clientX","clientY"];function Oe(K,Q){var ne=this;this.manager=K,this.callback=Q,this.element=K.element,this.target=K.options.inputTarget,this.domHandler=function(me){T(K.options.enable,[K])&&ne.handler(me)},this.init()}Oe.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(V(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&L(this.element,this.evEl,this.domHandler),this.evTarget&&L(this.target,this.evTarget,this.domHandler),this.evWin&&L(V(this.element),this.evWin,this.domHandler)}};function _t(K){var Q,ne=K.options.inputClass;return ne?Q=ne:ce?Q=cl:de?Q=se:G?Q=Ge:Q=Ui,new Q(K,zt)}function zt(K,Q,ne){var me=ne.pointers.length,Le=ne.changedPointers.length,Ze=Q&et&&me-Le===0,mt=Q&(We|at)&&me-Le===0;ne.isFirst=!!Ze,ne.isFinal=!!mt,Ze&&(K.session={}),ne.eventType=Q,Lt(K,ne),K.emit("hammer.input",ne),K.recognize(ne),K.session.prevInput=ne}function Lt(K,Q){var ne=K.session,me=Q.pointers,Le=me.length;ne.firstInput||(ne.firstInput=Zt(Q)),Le>1&&!ne.firstMultiple?ne.firstMultiple=Zt(Q):Le===1&&(ne.firstMultiple=!1);var Ze=ne.firstInput,mt=ne.firstMultiple,fn=mt?mt.center:Ze.center,pn=Q.center=hn(me);Q.timeStamp=f(),Q.deltaTime=Q.timeStamp-Ze.timeStamp,Q.angle=kt(fn,pn),Q.distance=oi(fn,pn),Ne(ne,Q),Q.offsetDirection=Mi(Q.deltaX,Q.deltaY);var Cn=dn(Q.deltaTime,Q.deltaX,Q.deltaY);Q.overallVelocityX=Cn.x,Q.overallVelocityY=Cn.y,Q.overallVelocity=u(Cn.x)>u(Cn.y)?Cn.x:Cn.y,Q.scale=mt?un(mt.pointers,me):1,Q.rotation=mt?Yn(mt.pointers,me):0,Q.maxPointers=ne.prevInput?Q.pointers.length>ne.prevInput.maxPointers?Q.pointers.length:ne.prevInput.maxPointers:Q.pointers.length,qt(ne,Q);var hi=K.element;I(Q.srcEvent.target,hi)&&(hi=
2025-02-21 22:54:51 +08:00
* chartjs-plugin-zoom v2.2.0
* https://www.chartjs.org/chartjs-plugin-zoom/2.2.0/
* (c) 2016-2024 chartjs-plugin-zoom Contributors
* Released under the MIT License
2025-03-20 19:46:40 +08:00
*/const eo=n=>n&&n.enabled&&n.modifierKey,fy=(n,e)=>n&&e[n+"Key"],Xu=(n,e)=>n&&!e[n+"Key"];function al(n,e,t){return n===void 0?!0:typeof n=="string"?n.indexOf(e)!==-1:typeof n=="function"?n({chart:t}).indexOf(e)!==-1:!1}function ya(n,e){return typeof n=="function"&&(n=n({chart:e})),typeof n=="string"?{x:n.indexOf("x")!==-1,y:n.indexOf("y")!==-1}:{x:!1,y:!1}}function cC(n,e){let t;return function(){return clearTimeout(t),t=setTimeout(n,e),e}}function dC({x:n,y:e},t){const i=t.scales,l=Object.keys(i);for(let s=0;s<l.length;s++){const o=i[l[s]];if(e>=o.top&&e<=o.bottom&&n>=o.left&&n<=o.right)return o}return null}function cy(n,e,t){const{mode:i="xy",scaleMode:l,overScaleMode:s}=n||{},o=dC(e,t),r=ya(i,t),a=ya(l,t);if(s){const f=ya(s,t);for(const c of["x","y"])f[c]&&(a[c]=r[c],r[c]=!1)}if(o&&a[o.axis])return[o];const u=[];return ht(t.scales,function(f){r[f.axis]&&u.push(f)}),u}const lu=new WeakMap;function Kt(n){let e=lu.get(n);return e||(e={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},lu.set(n,e)),e}function pC(n){lu.delete(n)}function dy(n,e,t,i){const l=Math.max(0,Math.min(1,(n-e)/t||0)),s=1-l;return{min:i*l,max:i*s}}function py(n,e){const t=n.isHorizontal()?e.x:e.y;return n.getValueForPixel(t)}function my(n,e,t){const i=n.max-n.min,l=i*(e-1),s=py(n,t);return dy(s,n.min,i,l)}function mC(n,e,t){const i=py(n,t);if(i===void 0)return{min:n.min,max:n.max};const l=Math.log10(n.min),s=Math.log10(n.max),o=Math.log10(i),r=s-l,a=r*(e-1),u=dy(o,l,r,a);return{min:Math.pow(10,l+u.min),max:Math.pow(10,s-u.max)}}function hC(n,e){return e&&(e[n.id]||e[n.axis])||{}}function Kd(n,e,t,i,l){let s=t[i];if(s==="original"){const o=n.originalScaleLimits[e.id][i];s=Mt(o.options,o.scale)}return Mt(s,l)}function _C(n,e,t){const i=n.getValueForPixel(e),l=n.getValueForPixel(t);return{min:Math.min(i,l),max:Math.max(i,l)}}function gC(n,{min:e,max:t,minLimit:i,maxLimit:l},s){const o=(n-t+e)/2;e-=o,t+=o;const r=s.min.options??s.min.scale,a=s.max.options??s.max.scale,u=n/1e6;return Ol(e,r,u)&&(e=r),Ol(t,a,u)&&(t=a),e<i?(e=i,t=Math.min(i+n,l)):t>l&&(t=l,e=Math.max(l-n,i)),{min:e,max:t}}function Pl(n,{min:e,max:t},i,l=!1){const s=Kt(n.chart),{options:o}=n,r=hC(n,i),{minRange:a=0}=r,u=Kd(s,n,r,"min",-1/0),f=Kd(s,n,r,"max",1/0);if(l==="pan"&&(e<u||t>f))return!0;const c=n.max-n.min,d=l?Math.max(t-e,a):c;if(l&&d===a&&c<=a)return!0;const m=gC(d,{min:e,max:t,minLimit:u,maxLimit:f},s.originalScaleLimits[n.id]);return o.min=m.min,o.max=m.max,s.updatedScaleLimits[n.id]=m,n.parse(m.min)!==n.min||n.parse(m.max)!==n.max}function bC(n,e,t,i){const l=my(n,e,t),s={min:n.min+l.min,max:n.max-l.max};return Pl(n,s,i,!0)}function kC(n,e,t,i){const l=mC(n,e,t);return Pl(n,l,i,!0)}function yC(n,e,t,i){Pl(n,_C(n,e,t),i,!0)}const Jd=n=>n===0||isNaN(n)?0:n<0?Math.min(Math.round(n),-1):Math.max(Math.round(n),1);function vC(n){const t=n.getLabels().length-1;n.min>0&&(n.min-=1),n.max<t&&(n.max+=1)}function wC(n,e,t,i){const l=my(n,e,t);n.min===n.max&&e<1&&vC(n);const s={min:n.min+Jd(l.min),max:n.max-Jd(l.max)};return Pl(n,s,i,!0)}function SC(n){return n.isHorizontal()?n.width:n.height}function TC(n,e,t){const l=n.getLabels().length-1;let{min:s,max:o}=n;const r=Math.max(o-s,1),a=Math.round(SC(n)/Math.max(r,10)),u=Math.round(Math.abs(e/a));let f;return e<-a?(o=Math.min(o+u,l),s=r===1?o:o-r,f=o===l):e>a&&(s=Math.max(0,s-u),o=r===1?s:s+r,f=s===0),Pl(n,{min:s,max:o},t)||f}const CC={second:500,minute:30*1e3,hour:30*60*1e3,day:12*60*60*1e3,week:3.5*24*60*60*1e3,month:15*24*60*60*1e3,quarter:60*24*60*60*1e3,year:182*24*60*60*1e3};function hy(n,e,t,i=!1){const{min:l,max:s,options:o}=n,r=o.time&&o.time.round,a=CC[r]||0,u=n.getValueForPixel(n.getPixelForValue(l+a)-e),f=n.getValueForPixel(n.getPixelForValue(s+a)-e);return isNaN(u)||isNaN(f)?!0:Pl(n,{min:u,max:f},t,i?"pan":!1)}function Zd(n,e,t){return hy(n,e,t,!0)}const su={category:wC,default:bC,logarithmic:kC},ou={default:yC},ru={category:TC,default:hy,logarithmic:Zd,timeseries:Zd};function $C(n,e,t){const{id:i,options:{min:l,max:s}}=n;if(!e[i]||!t[i])return!0;const o=t[i];return o.min!==l||o.max
2025-03-29 03:07:16 +08:00
`),i=b("div");for(let o=0;o<s.length;o+=1)s[o].c();p(i,"class","inline-flex flex-gap-5"),p(e,"class",n[0])},m(o,r){w(o,e,r),y(e,t),y(e,i);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(i,null)},p(o,[r]){r&1&&p(e,"class",o[0])},i:te,o:te,d(o){o&&v(e),ct(s,o)}}}function C$(n,e,t){let{class:i=""}=e;return n.$$set=l=>{"class"in l&&t(0,i=l.class)},[i]}class Sy extends Se{constructor(e){super(),we(this,e,C$,T$,ke,{class:0})}}function $$(n){let e,t,i,l,s,o,r,a,u,f,c;return t=new pe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[M$,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[E$,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field form-field-toggle",name:"logs.logIP",$$slots:{default:[D$,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field form-field-toggle",name:"logs.logAuthId",$$slots:{default:[I$,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),z(t.$$.fragment),i=$(),z(l.$$.fragment),s=$(),z(o.$$.fragment),r=$(),z(a.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(d,m){w(d,e,m),j(t,e,null),y(e,i),j(l,e,null),y(e,s),j(o,e,null),y(e,r),j(a,e,null),u=!0,f||(c=Y(e,"submit",it(n[7])),f=!0)},p(d,m){const h={};m&25165826&&(h.$$scope={dirty:m,ctx:d}),t.$set(h);const g={};m&25165826&&(g.$$scope={dirty:m,ctx:d}),l.$set(g);const _={};m&25165826&&(_.$$scope={dirty:m,ctx:d}),o.$set(_);const k={};m&25165826&&(k.$$scope={dirty:m,ctx:d}),a.$set(k)},i(d){u||(M(t.$$.fragment,d),M(l.$$.fragment,d),M(o.$$.fragment,d),M(a.$$.fragment,d),u=!0)},o(d){D(t.$$.fragment,d),D(l.$$.fragment,d),D(o.$$.fragment,d),D(a.$$.fragment,d),u=!1},d(d){d&&v(e),H(t),H(l),H(o),H(a),f=!1,c()}}}function O$(n){let e;return{c(){e=b("div"),e.innerHTML='<div class="loader"></div>',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function M$(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Max days retention"),l=$(),s=b("input"),r=$(),a=b("div"),a.innerHTML="Set to <code>0</code> to disable logs persistence.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),_e(s,n[1].logs.maxDays),w(c,r,d),w(c,a,d),u||(f=Y(s,"input",n[11]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&2&&gt(s.value)!==c[1].logs.maxDays&&_e(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function E$(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return f=new Sy({}),{c(){e=b("label"),t=W("Min log level"),l=$(),s=b("input"),o=$(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",u=$(),z(f.$$.fragment),p(e,"for",i=n[23]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,g){w(h,e,g),y(e,t),w(h,l,g),w(h,s,g),_e(s,n[1].logs.minLevel),w(h,o,g),w(h,r,g),y(r,a),y(r,u),j(f,r,null),c=!0,d||(m=Y(s,"input",n[12]),d=!0)},p(h,g){(!c||g&8388608&&i!==(i=h[23]))&&p(e,"for",i),g&2&&gt(s.value)!==h[1].logs.minLevel&&_e(s,h[1].logs.minLevel)},i(h){c||(M(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&(v(e),v(l),v(s),v(o),v(r)),H(f),d=!1,m()}}}function D$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[1].logs.logIP,w(u,i,f),w(u,l,f),y(l,s),r||(a=Y(e,"change",n[13]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logIP),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function I$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Enable Auth Id logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[1].logs.logAuthId,w(u,i,f),w(u,l,f),y(l,s),r||(a=Y(e,"change",n[14]),r=!0)},p(u,f){f&8388608&&t!==(
2025-03-20 19:46:40 +08:00
`);for(let s=0;s<l.length;s+=1)l[s].c();p(e,"class","help-block")},m(s,o){w(s,e,o),y(e,t);for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(e,null)},p(s,o){if(o&264){i=fe(s[3]);let r;for(r=0;r<i.length;r+=1){const a=$p(s,i,r);l[r]?l[r].p(a,o):(l[r]=Mp(a),l[r].c(),l[r].m(e,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=i.length}},d(s){s&&v(e),ct(l,s)}}}function Mp(n){let e,t="{"+n[25]+"}",i,l,s,o;function r(){return n[15](n[25])}return{c(){e=b("button"),i=W(t),l=W(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){w(a,e,u),y(e,i),w(a,l,u),s||(o=Y(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t="{"+n[25]+"}")&&oe(i,t)},d(a){a&&(v(e),v(l)),s=!1,o()}}}function n8(n){var d;let e,t,i,l,s,o,r,a,u,f,c=((d=n[3])==null?void 0:d.length)>0&&Op(n);return{c(){e=b("label"),t=W("Subject"),l=$(),s=b("input"),r=$(),c&&c.c(),a=ge(),p(e,"for",i=n[24]),p(s,"type","text"),p(s,"id",o=n[24]),p(s,"spellcheck","false"),s.required=!0},m(m,h){w(m,e,h),y(e,t),w(m,l,h),w(m,s,h),_e(s,n[0].subject),w(m,r,h),c&&c.m(m,h),w(m,a,h),u||(f=Y(s,"input",n[14]),u=!0)},p(m,h){var g;h&16777216&&i!==(i=m[24])&&p(e,"for",i),h&16777216&&o!==(o=m[24])&&p(s,"id",o),h&1&&s.value!==m[0].subject&&_e(s,m[0].subject),((g=m[3])==null?void 0:g.length)>0?c?c.p(m,h):(c=Op(m),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(m){m&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(m),u=!1,f()}}}function i8(n){let e,t,i,l;return{c(){e=b("textarea"),p(e,"id",t=n[24]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(s,o){w(s,e,o),_e(e,n[0].body),i||(l=Y(e,"input",n[17]),i=!0)},p(s,o){o&16777216&&t!==(t=s[24])&&p(e,"id",t),o&1&&_e(e,s[0].body)},i:te,o:te,d(s){s&&v(e),i=!1,l()}}}function l8(n){let e,t,i,l;function s(a){n[16](a)}var o=n[5];function r(a,u){let f={id:a[24],language:"html"};return a[0].body!==void 0&&(f.value=a[0].body),{props:f}}return o&&(e=Bt(o,r(n)),ie.push(()=>be(e,"value",s))),{c(){e&&z(e.$$.fragment),i=ge()},m(a,u){e&&j(e,a,u),w(a,i,u),l=!0},p(a,u){if(u&32&&o!==(o=a[5])){if(e){re();const f=e;D(f.$$.fragment,1,0,()=>{H(f,1)}),ae()}o?(e=Bt(o,r(a)),ie.push(()=>be(e,"value",s)),z(e.$$.fragment),M(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else if(o){const f={};u&16777216&&(f.id=a[24]),!t&&u&1&&(t=!0,f.value=a[0].body,Ce(()=>t=!1)),e.$set(f)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&H(e,a)}}}function Ep(n){let e,t,i=fe(n[3]),l=[];for(let s=0;s<i.length;s+=1)l[s]=Dp(Cp(n,i,s));return{c(){e=b("div"),t=W(`Available placeholder parameters:
2025-03-29 03:07:16 +08:00
`);for(let s=0;s<l.length;s+=1)l[s].c();p(e,"class","help-block")},m(s,o){w(s,e,o),y(e,t);for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(e,null)},p(s,o){if(o&264){i=fe(s[3]);let r;for(r=0;r<i.length;r+=1){const a=Cp(s,i,r);l[r]?l[r].p(a,o):(l[r]=Dp(a),l[r].c(),l[r].m(e,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=i.length}},d(s){s&&v(e),ct(l,s)}}}function Dp(n){let e,t="{"+n[25]+"}",i,l,s,o;function r(){return n[18](n[25])}return{c(){e=b("button"),i=W(t),l=W(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){w(a,e,u),y(e,i),w(a,l,u),s||(o=Y(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t="{"+n[25]+"}")&&oe(i,t)},d(a){a&&(v(e),v(l)),s=!1,o()}}}function s8(n){var h;let e,t,i,l,s,o,r,a,u;const f=[l8,i8],c=[];function d(g,_){return g[5]&&!g[6]?0:1}s=d(n),o=c[s]=f[s](n);let m=((h=n[3])==null?void 0:h.length)>0&&Ep(n);return{c(){e=b("label"),t=W("Body (HTML)"),l=$(),o.c(),r=$(),m&&m.c(),a=ge(),p(e,"for",i=n[24])},m(g,_){w(g,e,_),y(e,t),w(g,l,_),c[s].m(g,_),w(g,r,_),m&&m.m(g,_),w(g,a,_),u=!0},p(g,_){var S;(!u||_&16777216&&i!==(i=g[24]))&&p(e,"for",i);let k=s;s=d(g),s===k?c[s].p(g,_):(re(),D(c[k],1,1,()=>{c[k]=null}),ae(),o=c[s],o?o.p(g,_):(o=c[s]=f[s](g),o.c()),M(o,1),o.m(r.parentNode,r)),((S=g[3])==null?void 0:S.length)>0?m?m.p(g,_):(m=Ep(g),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null)},i(g){u||(M(o),u=!0)},o(g){D(o),u=!1},d(g){g&&(v(e),v(l),v(r),v(a)),c[s].d(g),m&&m.d(g)}}}function o8(n){let e,t,i,l;return e=new pe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[n8,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[s8,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=$(),z(i.$$.fragment)},m(s,o){j(e,s,o),w(s,t,o),j(i,s,o),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".subject"),o&1090519049&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&2&&(a.name=s[1]+".body"),o&1090519145&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(e,s),H(i,s)}}}function Ip(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=$e(Fe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function r8(n){let e,t,i,l,s,o,r,a,u,f=n[7]&&Ip();return{c(){e=b("div"),t=b("i"),i=$(),l=b("span"),s=W(n[2]),o=$(),r=b("div"),a=$(),f&&f.c(),u=ge(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,l),y(l,s),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&4&&oe(s,c[2]),c[7]?f?d&128&&M(f,1):(f=Ip(),f.c(),M(f,1),f.m(u.parentNode,u)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(v(e),v(o),v(r),v(a),v(u)),f&&f.d(c)}}}function a8(n){let e,t;const i=[n[9]];let l={$$slots:{header:[r8],default:[o8]},$$scope:{ctx:n}};for(let s=0;s<i.length;s+=1)l=He(l,i[s]);return e=new zi({props:l}),n[19](e),e.$on("expand",n[20]),e.$on("collapse",n[21]),e.$on("toggle",n[22]),{c(){z(e.$$.fragment)},m(s,o){j(e,s,o),t=!0},p(s,[o]){const r=o&512?wt(i,[Ft(s[9])]):{};o&1073742063&&(r.$$scope={dirty:o,ctx:s}),e.$set(r)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[19](null),H(e,s)}}}let Lp;function u8(n,e,t){let i;const l=["key","title","config","placeholders","expand","collapse","collapseSiblings"];let s=st(e,l),o;Xe(n,Sn,R=>t(13,o=R));let{key:r}=e,{title:a}=e,{config:u={}}=e,{placeholders:f=[]}=e,c,d=Lp,m=!1;function h(){c==null||c.expand()}function g(){c==null||c.collapse()}function _(){c==null||c.collapseSiblings()}async function k(){d||m||(t(6,m=!0),t(5,d=(await Tt(async()=>{const{default:R}=await import("./CodeEditor-CXGm1WBS.js");return{default:R}},__vite__mapDeps([13,1]),import.meta.url)).d
2025-03-20 19:46:40 +08:00
<code>email != &#39;&#39;</code>.`,l=$(),s=b("p"),s.textContent="Leave the rule empty to require MFA for everyone."},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,l,r),w(o,s,r)},p:te,d(o){o&&(v(e),v(t),v(i),v(l),v(s))}}}function D8(n){let e,t,i,l,s,o,r,a,u;l=new pe({props:{class:"form-field form-field-toggle",name:"mfa.enabled",$$slots:{default:[M8,({uniqueId:d})=>({5:d}),({uniqueId:d})=>d?32:0]},$$scope:{ctx:n}}});function f(d){n[4](d)}let c={label:"MFA rule",formKey:"mfa.rule",superuserToggle:!1,disabled:!n[0].mfa.enabled,placeholder:"Leave empty to require MFA for everyone",collection:n[0],$$slots:{default:[E8]},$$scope:{ctx:n}};return n[0].mfa.rule!==void 0&&(c.rule=n[0].mfa.rule),r=new ll({props:c}),ie.push(()=>be(r,"rule",f)),{c(){e=b("div"),e.innerHTML=`<p class="txt-bold">This feature is experimental and may change in the future.</p> <p>Multi-factor authentication (MFA) requires the user to authenticate with any 2 different auth
2025-02-21 22:54:51 +08:00
methods (otp, identity/password, oauth2) before issuing an auth token.
2025-03-20 19:46:40 +08:00
<a href="https://pocketbase.io/docs/authentication#multi-factor-authentication" target="_blank" rel="noopener noreferrer" class="txt-sm link-hint" title="Learn more"><em>(Learn more)</em> </a>.</p>`,t=$(),i=b("div"),z(l.$$.fragment),s=$(),o=b("div"),z(r.$$.fragment),p(e,"class","content m-b-sm"),p(o,"class","content"),x(o,"fade",!n[0].mfa.enabled),p(i,"class","grid")},m(d,m){w(d,e,m),w(d,t,m),w(d,i,m),j(l,i,null),y(i,s),y(i,o),j(r,o,null),u=!0},p(d,m){const h={};m&97&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const g={};m&1&&(g.disabled=!d[0].mfa.enabled),m&1&&(g.collection=d[0]),m&64&&(g.$$scope={dirty:m,ctx:d}),!a&&m&1&&(a=!0,g.rule=d[0].mfa.rule,Ce(()=>a=!1)),r.$set(g),(!u||m&1)&&x(o,"fade",!d[0].mfa.enabled)},i(d){u||(M(l.$$.fragment,d),M(r.$$.fragment,d),u=!0)},o(d){D(l.$$.fragment,d),D(r.$$.fragment,d),u=!1},d(d){d&&(v(e),v(t),v(i)),H(l),H(r)}}}function I8(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function L8(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Vp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=$e(Fe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function A8(n){let e,t,i,l,s,o;function r(c,d){return c[0].mfa.enabled?L8:I8}let a=r(n),u=a(n),f=n[1]&&Vp();return{c(){e=b("div"),e.innerHTML='<i class="ri-shield-check-line"></i> <span class="txt">Multi-factor authentication (MFA)</span>',t=$(),i=b("div"),l=$(),u.c(),s=$(),f&&f.c(),o=ge(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),u.m(c,d),w(c,s,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[1]?f?d&2&&M(f,1):(f=Vp(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function N8(n){let e,t;return e=new zi({props:{single:!0,$$slots:{header:[A8],default:[D8]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,l){j(e,i,l),t=!0},p(i,[l]){const s={};l&67&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function P8(n,e,t){let i,l;Xe(n,Sn,a=>t(2,l=a));let{collection:s}=e;function o(){s.mfa.enabled=this.checked,t(0,s)}function r(a){n.$$.not_equal(s.mfa.rule,a)&&(s.mfa.rule=a,t(0,s))}return n.$$set=a=>{"collection"in a&&t(0,s=a.collection)},n.$$.update=()=>{n.$$.dirty&4&&t(1,i=!U.isEmpty(l==null?void 0:l.mfa))},[s,i,l,o,r]}class R8 extends Se{constructor(e){super(),we(this,e,P8,N8,ke,{collection:0})}}const F8=n=>({}),Bp=n=>({});function Wp(n,e,t){const i=n.slice();return i[50]=e[t],i}const q8=n=>({}),Yp=n=>({});function Kp(n,e,t){const i=n.slice();return i[50]=e[t],i[54]=t,i}function Jp(n){let e,t,i;return{c(){e=b("div"),t=W(n[2]),i=$(),p(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5]&&!n[6])},m(l,s){w(l,e,s),y(e,t),y(e,i)},p(l,s){s[0]&4&&oe(t,l[2]),s[0]&96&&x(e,"link-hint",!l[5]&&!l[6])},d(l){l&&v(e)}}}function j8(n){let e,t=n[50]+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&1&&t!==(t=l[50]+"")&&oe(i,t)},i:te,o:te,d(l){l&&v(e)}}}function H8(n){let e,t,i;const l=[{item:n[50]},n[11]];var s=n[10];function o(r,a){let u={};for(let f=0;f<l.length;f+=1)u=He(u,l[f]);return a!==void 0&&a[0]&2049&&(u=He(u,wt(l,[a[0]&1&&{item:r[50]},a[0]&2048&&Ft(r[11])]))),{props:u}}return s&&(e=Bt(s,o(n))),{c(){e&&z(e.$$.fragment),t=ge()},m(r,a){e&&j(e,r,a),w(r,t,a),i=!0},p(r,a){if(a[0]&1024&&s!==(s=r[10])){if(e){re();const u=e;D(u.$$.fragment,1,0,()=>{H(u,1)}),ae()}s?(e=Bt(s,o(r,a)),z(e.$$.fragment),M(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&2049?wt(l,[a[0]&1&&{item:r[50]},a[0]&2048&&Ft(r[11])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},
2025-02-21 22:54:51 +08:00
...
2025-03-20 19:46:40 +08:00
-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),_e(s,n[5]),w(c,r,d),w(c,a,d),u||(f=Y(s,"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(s,"id",o),d&32&&_e(s,c[5])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function d5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S;return l=new pe({props:{class:"form-field required",name:"clientId",$$slots:{default:[r5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"teamId",$$slots:{default:[a5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"keyId",$$slots:{default:[u5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field required",name:"duration",$$slots:{default:[f5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),g=new pe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[c5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),z(l.$$.fragment),s=$(),o=b("div"),z(r.$$.fragment),a=$(),u=b("div"),z(f.$$.fragment),c=$(),d=b("div"),z(m.$$.fragment),h=$(),z(g.$$.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,T){w(C,e,T),y(e,t),y(t,i),j(l,i,null),y(t,s),y(t,o),j(r,o,null),y(t,a),y(t,u),j(f,u,null),y(t,c),y(t,d),j(m,d,null),y(t,h),j(g,t,null),_=!0,k||(S=Y(e,"submit",it(n[17])),k=!0)},p(C,T){const O={};T&25165828&&(O.$$scope={dirty:T,ctx:C}),l.$set(O);const E={};T&25165832&&(E.$$scope={dirty:T,ctx:C}),r.$set(E);const L={};T&25165840&&(L.$$scope={dirty:T,ctx:C}),f.$set(L);const I={};T&25165888&&(I.$$scope={dirty:T,ctx:C}),m.$set(I);const A={};T&25165856&&(A.$$scope={dirty:T,ctx:C}),g.$set(A)},i(C){_||(M(l.$$.fragment,C),M(r.$$.fragment,C),M(f.$$.fragment,C),M(m.$$.fragment,C),M(g.$$.fragment,C),_=!0)},o(C){D(l.$$.fragment,C),D(r.$$.fragment,C),D(f.$$.fragment,C),D(m.$$.fragment,C),D(g.$$.fragment,C),_=!1},d(C){C&&v(e),H(l),H(r),H(f),H(m),H(g),k=!1,S()}}}function p5(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function m5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=W("Close"),i=$(),l=b("button"),s=b("i"),o=$(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],x(l,"btn-loading",n[7])},m(c,d){w(c,e,d),y(e,t),w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(l.disabled=a),d&128&&x(l,"btn-loading",c[7])},d(c){c&&(v(e),v(i),v(l)),u=!1,f()}}}function h5(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[m5],header:[p5],default:[d5]},$$scope:{ctx:n}};return e=new tn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){z(e.$$.fragment)},m(l,s){j(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),H(e,l)}}}const ar=15777e3;function _5(n,e,t){let i;const l=yt(),s="apple_secret_"+U.randomString(5);let o,r,a,u,f,c,d=!1;function m(N={}){t(2,r=N.clientId||""),t(3,a=N.teamId||""),t(4,u=N.keyId||""),t(5,f=N.privateKey||""),t(6,c=N.duration||ar),Yt({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function g(){t(7,d=!0);try{const N=await he.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),en("Successfully generated client secret."),l("submit",N),o==null||o.hide()}catch(N){he.error(N)}t(7,d=!1)}function _(){r=
2025-03-29 03:07:16 +08:00
is a direct result of the trusted server code-&gt;token exchange response.</em>`,i=$(),z(l.$$.fragment),s=$(),z(o.$$.fragment),p(t,"class","txt-hint txt-sm m-b-xs"),p(e,"class","content")},m(u,f){w(u,e,f),y(e,t),y(e,i),j(l,e,null),y(e,s),j(o,e,null),a=!0},p(u,f){const c={};f&2&&(c.name=u[1]+".extra.jwksURL"),f&24577&&(c.$$scope={dirty:f,ctx:u}),l.$set(c);const d={};f&2&&(d.name=u[1]+".extra.issuers"),f&24577&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(M(l.$$.fragment,u),M(o.$$.fragment,u),u&&tt(()=>{a&&(r||(r=je(e,pt,{delay:10,duration:150},!0)),r.run(1))}),a=!0)},o(u){D(l.$$.fragment,u),D(o.$$.fragment,u),u&&(r||(r=je(e,pt,{delay:10,duration:150},!1)),r.run(0)),a=!1},d(u){u&&v(e),H(l),H(o),u&&r&&r.end()}}}function j5(n){let e,t,i,l;return t=new pe({props:{class:"form-field required",name:n[1]+".userInfoURL",$$slots:{default:[U5,({uniqueId:s})=>({13:s}),({uniqueId:s})=>s?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),z(t.$$.fragment),p(e,"class","content")},m(s,o){w(s,e,o),j(t,e,null),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".userInfoURL"),o&24577&&(r.$$scope={dirty:o,ctx:s}),t.$set(r)},i(s){l||(M(t.$$.fragment,s),s&&tt(()=>{l&&(i||(i=je(e,pt,{delay:10,duration:150},!0)),i.run(1))}),l=!0)},o(s){D(t.$$.fragment,s),s&&(i||(i=je(e,pt,{delay:10,duration:150},!1)),i.run(0)),l=!1},d(s){s&&v(e),H(t),s&&i&&i.end()}}}function H5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="JWKS verification URL",i=$(),l=b("i"),o=$(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(r,"type","url"),p(r,"id",a=n[13])},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,l),w(c,o,d),w(c,r,d),_e(r,n[0].extra.jwksURL),u||(f=[$e(Fe.call(null,l,{text:"URL to the public token verification keys.",position:"top"})),Y(r,"input",n[9])],u=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].extra.jwksURL&&_e(r,c[0].extra.jwksURL)},d(c){c&&(v(e),v(o),v(r)),u=!1,De(f)}}}function z5(n){let e,t,i,l,s,o,r,a,u,f,c;function d(h){n[10](h)}let m={id:n[13]};return n[0].extra.issuers!==void 0&&(m.value=n[0].extra.issuers),r=new ho({props:m}),ie.push(()=>be(r,"value",d)),{c(){e=b("label"),t=b("span"),t.textContent="Issuers",i=$(),l=b("i"),o=$(),z(r.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13])},m(h,g){w(h,e,g),y(e,t),y(e,i),y(e,l),w(h,o,g),j(r,h,g),u=!0,f||(c=$e(Fe.call(null,l,{text:"Comma separated list of accepted values for the iss token claim validation.",position:"top"})),f=!0)},p(h,g){(!u||g&8192&&s!==(s=h[13]))&&p(e,"for",s);const _={};g&8192&&(_.id=h[13]),!a&&g&1&&(a=!0,_.value=h[0].extra.issuers,Ce(()=>a=!1)),r.$set(_)},i(h){u||(M(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(v(e),v(o)),H(r,h),f=!1,c()}}}function U5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("User info URL"),l=$(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),_e(s,n[0].userInfoURL),r||(a=Y(s,"input",n[8]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].userInfoURL&&_e(s,u[0].userInfoURL)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function V5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),s.textContent="Support PKCE",o=$(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].pkce,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[Y(e,"change",n[11]),$e(Fe.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if they don't support PKCE.",position:"right"}))],u=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,De(f)}}}function B5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;e=new pe({props:{class:"form-field required",name:n[1]+".displayName",$$slots:{default:[N5,({uni
2025-03-20 19:46:40 +08:00
`),_&&_.c(),o=$(),r=b("div");for(let N=0;N<S.length;N+=1)S[N].c();a=$(),u=b("button"),u.innerHTML='<span class="txt">+</span> <span class="txt">New index</span>',f=$(),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(N,P){w(N,e,P),y(e,t),y(e,l),y(e,s),_&&_.m(e,null),w(N,o,P),w(N,r,P);for(let R=0;R<S.length;R+=1)S[R]&&S[R].m(r,null);y(r,a),y(r,u),w(N,f,P),j(c,N,P),m=!0,h||(g=Y(u,"click",n[5]),h=!0)},p(N,[P]){var q,F,B,J,V;if((!m||P&1)&&i!==(i=(((F=(q=N[0])==null?void 0:q.indexes)==null?void 0:F.length)||0)+"")&&oe(l,i),(J=(B=N[2])==null?void 0:B.indexes)!=null&&J.message?_?(_.p(N,P),P&4&&M(_,1)):(_=Fm(N),_.c(),M(_,1),_.m(e,null)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),P&7){k=fe(((V=N[0])==null?void 0:V.indexes)||[]);let Z;for(Z=0;Z<k.length;Z+=1){const G=Rm(N,k,Z);S[Z]?S[Z].p(G,P):(S[Z]=jm(G),S[Z].c(),S[Z].m(r,a))}for(;Z<S.length;Z+=1)S[Z].d(1);S.length=k.length}const R={};!d&&P&1&&(d=!0,R.collection=N[0],Ce(()=>d=!1)),c.$set(R)},i(N){m||(M(_),M(c.$$.fragment,N),m=!0)},o(N){D(_),D(c.$$.fragment,N),m=!1},d(N){N&&(v(e),v(o),v(r),v(f)),_&&_.d(),ct(S,N),n[6](null),H(c,N),h=!1,g()}}}const Hm=n=>n.name;function hM(n,e,t){let i;Xe(n,Sn,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let g=0;g<l.indexes.length;g++)if(l.indexes[g]==m){t(0,l.indexes[g]=h,l),Wn("indexes."+g);return}l.indexes.push(h),t(0,l)}const r=(m,h)=>s==null?void 0:s.show(m,h),a=()=>s==null?void 0:s.show();function u(m){ie[m?"unshift":"push"](()=>{s=m,t(1,s)})}function f(m){l=m,t(0,l)}const c=m=>{for(let h=0;h<l.indexes.length;h++)if(l.indexes[h]==m.detail){l.indexes.splice(h,1),Wn("indexes."+h);break}t(0,l)},d=m=>{var h;(h=i.indexes)!=null&&h.message&&Wn("indexes"),o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,u,f,c,d]}class _M extends Se{constructor(e){super(),we(this,e,hM,mM,ke,{collection:0})}}function zm(n,e,t){const i=n.slice();return i[5]=e[t],i}function Um(n){let e,t,i,l,s,o,r;function a(){return n[3](n[5])}return{c(){e=b("button"),t=b("i"),i=$(),l=b("span"),l.textContent=`${n[5].label}`,s=$(),p(t,"class","icon "+n[5].icon+" svelte-1gz9b6p"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item svelte-1gz9b6p")},m(u,f){w(u,e,f),y(e,t),y(e,i),y(e,l),y(e,s),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u},d(u){u&&v(e),o=!1,r()}}}function gM(n){let e,t=fe(n[1]),i=[];for(let l=0;l<t.length;l+=1)i[l]=Um(zm(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ge()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);w(l,e,s)},p(l,s){if(s&6){t=fe(l[1]);let o;for(o=0;o<t.length;o+=1){const r=zm(l,t,o);i[o]?i[o].p(r,s):(i[o]=Um(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(l){l&&v(e),ct(i,l)}}}function bM(n){let e,t,i,l,s,o,r,a;return o=new En({props:{class:"dropdown field-types-dropdown",$$slots:{default:[gM]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("i"),i=$(),l=b("div"),l.textContent="New field",s=$(),z(o.$$.fragment),p(t,"class","ri-add-line"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"tabindex","0"),p(e,"role","button"),p(e,"class",r="field-types-btn "+n[0]+" svelte-1gz9b6p")},m(u,f){w(u,e,f),y(e,t),y(e,i),y(e,l),y(e,s),j(o,e,null),a=!0},p(u,[f]){const c={};f&256&&(c.$$scope={dirty:f,ctx:u}),o.$set(c),(!a||f&1&&r!==(r="field-types-btn "+u[0]+" svelte-1gz9b6p"))&&p(e,"class",r)},i(u){a||(M(o.$$.fragment,u),a=!0)},o(u){D(o.$$.fragment,u),a=!1},d(u){u&&v(e),H(o)}}}function kM(n,e,t){let{class:i=""}=e;const l=yt(),s=[{label:"Plain text",value:"text",icon:U.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:U.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:U.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:U.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:U.getFieldTypeIcon("email")},{label:"URL",value:"url",icon:U.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:U.getFieldTypeIcon("date")},{label:"Autod
2025-02-21 22:54:51 +08:00
<span class='flatpickr-weekday'>
`+ee.join("</span><span class='flatpickr-weekday'>")+`
</span>
2025-03-20 19:46:40 +08:00
`}}function ce(){t.calendarContainer.classList.add("hasWeeks");var X=Ot("div","flatpickr-weekwrapper");X.appendChild(Ot("span","flatpickr-weekday",t.l10n.weekAbbreviation));var ee=Ot("div","flatpickr-weeks");return X.appendChild(ee),{weekWrapper:X,weekNumbers:ee}}function de(X,ee){ee===void 0&&(ee=!0);var le=ee?X:X-t.currentMonth;le<0&&t._hidePrevMonthArrow===!0||le>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=le,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Dt("onYearChange"),q()),R(),Dt("onMonthChange"),Vi())}function ue(X,ee){if(X===void 0&&(X=!0),ee===void 0&&(ee=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,ee===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var le=La(t.config),ye=le.hours,qe=le.minutes,Be=le.seconds;m(ye,qe,Be)}t.redraw(),X&&Dt("onChange")}function Te(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Dt("onClose")}function Ke(){t.config!==void 0&&Dt("onDestroy");for(var X=t._handlers.length;X--;)t._handlers[X].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 ee=t.calendarContainer.parentNode;if(ee.lastChild&&ee.removeChild(ee.lastChild),ee.parentNode){for(;ee.firstChild;)ee.parentNode.insertBefore(ee.firstChild,ee);ee.parentNode.removeChild(ee)}}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(le){try{delete t[le]}catch{}})}function Je(X){return t.calendarContainer.contains(X)}function ft(X){if(t.isOpen&&!t.config.inline){var ee=Un(X),le=Je(ee),ye=ee===t.input||ee===t.altInput||t.element.contains(ee)||X.path&&X.path.indexOf&&(~X.path.indexOf(t.input)||~X.path.indexOf(t.altInput)),qe=!ye&&!le&&!Je(X.relatedTarget),Be=!t.config.ignoredFocusElements.some(function(rt){return rt.contains(ee)});qe&&Be&&(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 et(X){if(!(!X||t.config.minDate&&X<t.config.minDate.getFullYear()||t.config.maxDate&&X>t.config.maxDate.getFullYear())){var ee=X,le=t.currentYear!==ee;t.currentYear=ee||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)),le&&(t.redraw(),Dt("onYearChange"),q())}}function xe(X,ee){var le;ee===void 0&&(ee=!0);var ye=t.parseDate(X,void 0,ee);if(t.config.minDate&&ye&&Vn(ye,t.config.minDate,ee!==void 0?ee:!t.minDateHasTime)<0||t.config.maxDate&&ye&&Vn(ye,t.config.maxDate,ee!==void 0?ee:!t.maxDateHasTime)>0)return!1;if(!t.config.
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&512&&s!==(s=_[9]))&&p(e,"for",s);const S={};k&512&&(S.id=_[9]),k&1&&(S.disabled=!U.isEmpty(_[0].onlyDomains)),!a&&k&1&&(a=!0,S.value=_[0].exceptDomains,Ce(()=>a=!1)),r.$set(S)},i(_){c||(M(r.$$.fragment,_),c=!0)},o(_){D(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),H(r,_),d=!1,m()}}}function cE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function h(_){n[4](_)}let g={id:n[9]+".onlyDomains",disabled:!U.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(g.value=n[0].onlyDomains),r=new ho({props:g}),ie.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=$(),l=b("i"),o=$(),z(r.$$.fragment),u=$(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]+".onlyDomains"),p(f,"class","help-block")},m(_,k){w(_,e,k),y(e,t),y(e,i),y(e,l),w(_,o,k),j(r,_,k),w(_,u,k),w(_,f,k),c=!0,d||(m=$e(Fe.call(null,l,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&512&&s!==(s=_[9]+".onlyDomains"))&&p(e,"for",s);const S={};k&512&&(S.id=_[9]+".onlyDomains"),k&1&&(S.disabled=!U.isEmpty(_[0].exceptDomains)),!a&&k&1&&(a=!0,S.value=_[0].onlyDomains,Ce(()=>a=!1)),r.$set(S)},i(_){c||(M(r.$$.fragment,_),c=!0)},o(_){D(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),H(r,_),d=!1,m()}}}function dE(n){let e,t,i,l,s,o,r;return i=new pe({props:{class:"form-field",name:"fields."+n[1]+".exceptDomains",$$slots:{default:[fE,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"fields."+n[1]+".onlyDomains",$$slots:{default:[cE,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),z(i.$$.fragment),l=$(),s=b("div"),z(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),y(e,t),j(i,t,null),y(e,l),y(e,s),j(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".exceptDomains"),u&1537&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".onlyDomains"),u&1537&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(M(i.$$.fragment,a),M(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&v(e),H(i),H(o)}}}function pE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[dE]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=He(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new li({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Ft(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function mE(n,e,t){const i=["field","key"];let l=st(e,i),{field:s}=e,{key:o=""}=e;function r(m){n.$$.not_equal(s.exceptDomains,m)&&(s.exceptDomains=m,t(0,s))}function a(m){n.$$.not_equal(s.onlyDomains,m)&&(s.onlyDomains=m,t(0,s))}function u(m){s=m,t(0,s)}function f(m){Ae.call(this,n,m)}function c(m){Ae.call(this,n,m)}function d(m){Ae.call(this,n,m)}return n.$$set=m=>{e=He(He({},e),Jt(m)),t(2,l=st(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,u,f,c,d]}class Oy extends Se{constructor(e){super(),we(this,e,mE,pE,ke,{field:0,key:1})}}function hE(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=W(t),l=$(),s=b("small"),r=W(o),p(e,"class","txt"),p(s,"class","txt-hint")},m(a,u){w(a,e,u),y(e,i),w(a,l,u),w(a,s,u),y(s,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&oe(i,t),u&1&&o!==(o=a[0].mimeType+"")&&oe(r,o)},i:te,o:te,d(a){a&&(v(e),v(l),v(s))}}}function _E(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class sh extends Se{constructor(e){super(),we(this,e,_E,hE,ke,{item:0})}}const gE=[{ext:"",mimeType:"application/octet-stream"},{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:".apk",mimeType:"application/vnd.android.package-archive"},{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.
Leave empty for no restriction.`,position:"top"})),S=!0)},p(E,L){(!k||L&8388608&&s!==(s=E[23]))&&p(e,"for",s);const I={};L&8388608&&(I.id=E[23]),L&8&&(I.items=E[3]),!a&&L&1&&(a=!0,I.keyOfSelected=E[0].mimeTypes,Ce(()=>a=!1)),r.$set(I);const A={};L&33554433&&(A.$$scope={dirty:L,ctx:E}),_.$set(A)},i(E){k||(M(r.$$.fragment,E),M(_.$$.fragment,E),k=!0)},o(E){D(r.$$.fragment,E),D(_.$$.fragment,E),k=!1},d(E){E&&(v(e),v(o),v(u),v(f)),H(r,E),H(_),S=!1,C()}}}function wE(n){let e;return{c(){e=b("ul"),e.innerHTML=`<li><strong>WxH</strong>
2025-02-21 22:54:51 +08:00
(e.g. 100x50) - crop to WxH viewbox (from center)</li> <li><strong>WxHt</strong>
(e.g. 100x50t) - crop to WxH viewbox (from top)</li> <li><strong>WxHb</strong>
(e.g. 100x50b) - crop to WxH viewbox (from bottom)</li> <li><strong>WxHf</strong>
(e.g. 100x50f) - fit inside a WxH viewbox (without cropping)</li> <li><strong>0xH</strong>
(e.g. 0x50) - resize to H height preserving the aspect ratio</li> <li><strong>Wx0</strong>
2025-03-20 19:46:40 +08:00
(e.g. 100x0) - resize to W width preserving the aspect ratio</li>`,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function SE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,C,T,O;function E(I){n[12](I)}let L={id:n[23],placeholder:"e.g. 50x50, 480x720"};return n[0].thumbs!==void 0&&(L.value=n[0].thumbs),r=new ho({props:L}),ie.push(()=>be(r,"value",E)),S=new En({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[wE]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=$(),l=b("i"),o=$(),z(r.$$.fragment),u=$(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=$(),m=b("button"),h=b("span"),h.textContent="Supported formats",g=$(),_=b("i"),k=$(),z(S.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(_,"class","ri-arrow-drop-down-fill"),p(_,"aria-hidden","true"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(I,A){w(I,e,A),y(e,t),y(e,i),y(e,l),w(I,o,A),j(r,I,A),w(I,u,A),w(I,f,A),y(f,c),y(f,d),y(f,m),y(m,h),y(m,g),y(m,_),y(m,k),j(S,m,null),C=!0,T||(O=$e(Fe.call(null,l,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(I,A){(!C||A&8388608&&s!==(s=I[23]))&&p(e,"for",s);const N={};A&8388608&&(N.id=I[23]),!a&&A&1&&(a=!0,N.value=I[0].thumbs,Ce(()=>a=!1)),r.$set(N);const P={};A&33554432&&(P.$$scope={dirty:A,ctx:I}),S.$set(P)},i(I){C||(M(r.$$.fragment,I),M(S.$$.fragment,I),C=!0)},o(I){D(r.$$.fragment,I),D(S.$$.fragment,I),C=!1},d(I){I&&(v(e),v(o),v(u),v(f)),H(r,I),H(S),T=!1,O()}}}function TE(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=W("Max file size"),l=$(),s=b("input"),a=$(),u=b("div"),u.textContent="Must be in bytes.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"min","0"),p(s,"max",Number.MAX_SAFE_INTEGER),s.value=r=n[0].maxSize||"",p(s,"placeholder","Default to max ~5MB"),p(u,"class","help-block")},m(d,m){w(d,e,m),y(e,t),w(d,l,m),w(d,s,m),w(d,a,m),w(d,u,m),f||(c=Y(s,"input",n[13]),f=!0)},p(d,m){m&8388608&&i!==(i=d[23])&&p(e,"for",i),m&8388608&&o!==(o=d[23])&&p(s,"id",o),m&1&&r!==(r=d[0].maxSize||"")&&s.value!==r&&(s.value=r)},d(d){d&&(v(e),v(l),v(s),v(a),v(u)),f=!1,c()}}}function oh(n){let e,t,i;return t=new pe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[CE,({uniqueId:l})=>({23:l}),({uniqueId:l})=>l?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),z(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){w(l,e,s),j(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="fields."+l[1]+".maxSelect"),s&41943041&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&v(e),H(t)}}}function CE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Max select"),l=$(),s=b("input"),p(e,"for",i=n[23]),p(s,"id",o=n[23]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),p(s,"max",Number.MAX_SAFE_INTEGER),s.required=!0,p(s,"placeholder","Default to single")},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),_e(s,n[0].maxSelect),r||(a=Y(s,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&gt(s.value)!==u[0].maxSelect&&_e(s,u[0].maxSelect)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function $E(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),s.textContent="Protected",r=$(),a=b("small"),a.innerHTML=`it will require View API rule permissions and file token to be accessible
<a href="https://pocketbase.io/docs/files-handling#protected-files" class="toggle-info" target="_blank" rel="noopener">(Learn more)</a>`,p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(l,"for",o=n[23]),p(a,"class","txt-hint")},m(c,d){w(c,e,d),e.checked=n[0].protected,w(c,i,d),w(c,l,d),y(l,s),w(c,r,d),w(c,a,d),u||(f=Y(e,"change",n[15]),u=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].protected),d&8388608&&o!==(o=c[23])&&p(l,"for",o)},d(c){c&&(v(e),v(i),v(l),v(r),v(a)),u=!1,f()}}}function OE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;i=new pe({props:{class:"form-field",name:"fields."+n[1]+".mimeTypes",$$slots:{default:[vE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"fields."+n[1]+".thumbs",$$slots:{default:[SE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field",name:"fields."+n[1]+".maxSize",$$slots:{default:[TE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}});let _=!n[2]&&oh(n);return h=new pe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".protected",$$slots:{default:[$E,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),z(i.$$.fragment),l=$(),s=b("div"),z(o.$$.fragment),a=$(),u=b("div"),z(f.$$.fragment),d=$(),_&&_.c(),m=$(),z(h.$$.fragment),p(t,"class","col-sm-12"),p(s,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(u,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(k,S){w(k,e,S),y(e,t),j(i,t,null),y(e,l),y(e,s),j(o,s,null),y(e,a),y(e,u),j(f,u,null),y(e,d),_&&_.m(e,null),y(e,m),j(h,e,null),g=!0},p(k,S){const C={};S&2&&(C.name="fields."+k[1]+".mimeTypes"),S&41943049&&(C.$$scope={dirty:S,ctx:k}),i.$set(C);const T={};S&2&&(T.name="fields."+k[1]+".thumbs"),S&41943041&&(T.$$scope={dirty:S,ctx:k}),o.$set(T),(!g||S&4&&r!==(r=k[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const O={};S&2&&(O.name="fields."+k[1]+".maxSize"),S&41943041&&(O.$$scope={dirty:S,ctx:k}),f.$set(O),(!g||S&4&&c!==(c=k[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),k[2]?_&&(re(),D(_,1,1,()=>{_=null}),ae()):_?(_.p(k,S),S&4&&M(_,1)):(_=oh(k),_.c(),M(_,1),_.m(e,m));const E={};S&2&&(E.name="fields."+k[1]+".protected"),S&41943041&&(E.$$scope={dirty:S,ctx:k}),h.$set(E)},i(k){g||(M(i.$$.fragment,k),M(o.$$.fragment,k),M(f.$$.fragment,k),M(_),M(h.$$.fragment,k),g=!0)},o(k){D(i.$$.fragment,k),D(o.$$.fragment,k),D(f.$$.fragment,k),D(_),D(h.$$.fragment,k),g=!1},d(k){k&&v(e),H(i),H(o),H(f),_&&_.d(),H(h)}}}function ME(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{options:[OE],default:[kE,({interactive:r})=>({24:r}),({interactive:r})=>r?16777216:0]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=He(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new li({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&34?wt(l,[a&2&&{key:r[1]},a&32&&Ft(r[5])]):{};a&50331663&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function EE(n,e,t){const i=["field","key"];let l=st(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=gE.slice(),u=s.maxSelect<=1,f=u;function c(){t(0,s.maxSelect=1,s),t(0,s.thumbs=[],s),t(0,s.mimeTypes=[],s),t(2,u=!0),t(6,f=u)}function d(){if(U.isEmpty(s.mimeTypes))return;const P=[];for(const R of s.mimeTypes)a.find(q=>q.mimeType===R)||P.push({mimeType:R});P.length&&t(3,a=a.concat(P))}function m(P){n.$$.not_equal(s.mimeTypes,P)&&(s.mimeTypes=P,t(0,s),t(6,f),t(2,u))}const h=()=>{t(0,s.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},g=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml
2025-02-21 22:54:51 +08:00
`),r=b("code"),r.textContent="multipart/form-data",a=W(`
requests, the following normalization rules are applied if the `),u=b("code"),u.textContent="json",f=W(` field
is a
`),c=b("strong"),c.textContent="plain string",d=W(`:
2025-03-20 19:46:40 +08:00
`),m=b("ul"),h=b("li"),h.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",g=$(),_=b("li"),_.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",k=$(),S=b("li"),S.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",C=$(),T=b("li"),T.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",O=$(),E=b("li"),I=W(L),A=W(" is converted to the json "),N=b("code"),N.textContent='{"a":1,"b":2}',P=$(),R=b("li"),R.textContent="numeric strings are converted to json number",q=$(),F=b("li"),F.textContent="double quoted strings are left as they are (aka. without normalizations)",B=$(),J=b("li"),J.textContent="any other string (empty string too) is double quoted",V=W(`
2025-02-21 22:54:51 +08:00
Alternatively, if you want to avoid the string value normalizations, you can wrap your
2025-03-20 19:46:40 +08:00
data inside an object, eg.`),Z=b("code"),Z.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(de,ue){w(de,e,ue),y(e,t),y(t,i),y(i,l),y(i,s),y(i,o),y(i,r),y(i,a),y(i,u),y(i,f),y(i,c),y(i,d),y(i,m),y(m,h),y(m,g),y(m,_),y(m,k),y(m,S),y(m,C),y(m,T),y(m,O),y(m,E),y(E,I),y(E,A),y(E,N),y(m,P),y(m,R),y(m,q),y(m,F),y(m,B),y(m,J),y(i,V),y(i,Z),ce=!0},i(de){ce||(de&&tt(()=>{ce&&(G||(G=je(e,pt,{duration:150},!0)),G.run(1))}),ce=!0)},o(de){de&&(G||(G=je(e,pt,{duration:150},!1)),G.run(0)),ce=!1},d(de){de&&v(e),de&&G&&G.end()}}}function NE(n){let e,t,i,l,s,o,r,a,u,f,c;e=new pe({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[IE,({uniqueId:_})=>({10:_}),({uniqueId:_})=>_?1024:0]},$$scope:{ctx:n}}});function d(_,k){return _[2]?AE:LE}let m=d(n),h=m(n),g=n[2]&&rh();return{c(){z(e.$$.fragment),t=$(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=$(),h.c(),r=$(),g&&g.c(),a=ge(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(_,k){j(e,_,k),w(_,t,k),w(_,i,k),y(i,l),y(i,s),h.m(i,null),w(_,r,k),g&&g.m(_,k),w(_,a,k),u=!0,f||(c=Y(i,"click",n[5]),f=!0)},p(_,k){const S={};k&2&&(S.name="fields."+_[1]+".maxSize"),k&3073&&(S.$$scope={dirty:k,ctx:_}),e.$set(S),m!==(m=d(_))&&(h.d(1),h=m(_),h&&(h.c(),h.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm "+(_[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),_[2]?g?k&4&&M(g,1):(g=rh(),g.c(),M(g,1),g.m(a.parentNode,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae())},i(_){u||(M(e.$$.fragment,_),M(g),u=!0)},o(_){D(e.$$.fragment,_),D(g),u=!1},d(_){_&&(v(t),v(i),v(r),v(a)),H(e,_),h.d(),g&&g.d(_),f=!1,c()}}}function PE(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[NE]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=He(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new li({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&10?wt(l,[a&2&&{key:r[1]},a&8&&Ft(r[3])]):{};a&2055&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function RE(n,e,t){const i=["field","key"];let l=st(e,i),{field:s}=e,{key:o=""}=e,r=!1;const a=h=>t(0,s.maxSize=parseInt(h.target.value,10),s),u=()=>{t(2,r=!r)};function f(h){s=h,t(0,s)}function c(h){Ae.call(this,n,h)}function d(h){Ae.call(this,n,h)}function m(h){Ae.call(this,n,h)}return n.$$set=h=>{e=He(He({},e),Jt(h)),t(3,l=st(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,r,l,a,u,f,c,d,m]}class FE extends Se{constructor(e){super(),we(this,e,RE,PE,ke,{field:0,key:1})}}function qE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Min"),l=$(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10])},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),_e(s,n[0].min),r||(a=Y(s,"input",n[4]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&p(e,"for",i),f&1024&&o!==(o=u[10])&&p(s,"id",o),f&1&&gt(s.value)!==u[0].min&&_e(s,u[0].min)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function jE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Max"),l=$(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"min",r=n[0].min)},m(f,c){w(f,e,c),y(e,t),w(f,l,c),w(f,s,c),_e(s,n[0].max),a||(u=Y(s,"input",n[5]),a=!0)},p(f,c){c&1024&&i!==(i=f[10])&&p(e,"for",i),c&1024&&o!==(o=f[10])&&p(s,"id",o),c&1&&r!==(r=f[0].min)&&p(s,"min",r),c&1&&gt(s.value)!==f[0].max&&_e(s,f[0].max)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function HE(n){let e,t,i,l,s,o,r;return i=new pe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[qE,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[jE,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),z(i.$$.fragment),
2025-02-21 22:54:51 +08:00
2025-03-20 19:46:40 +08:00
`),position:"top"})),c=!0)},p(g,_){var S,C;s&&It(s.update)&&_&20&&s.update.call(null,{text:[`Whether on ${((S=g[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,g[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((C=g[4])==null?void 0:C.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(`
2025-02-21 22:54:51 +08:00
2025-03-20 20:30:00 +08:00
`),position:"top"}),(!f||_&16777216&&o!==(o=g[24]))&&p(e,"for",o);const k={};_&16777216&&(k.id=g[24]),!u&&_&1&&(u=!0,k.keyOfSelected=g[0].cascadeDelete,Ce(()=>u=!1)),a.$set(k)},i(g){f||(M(a.$$.fragment,g),f=!0)},o(g){D(a.$$.fragment,g),f=!1},d(g){g&&(v(e),v(r)),H(a,g),c=!1,d()}}}function rD(n){let e,t,i,l,s,o=!n[2]&&ah(n);return l=new pe({props:{class:"form-field",name:"fields."+n[1]+".cascadeDelete",$$slots:{default:[oD,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=$(),i=b("div"),z(l.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){w(r,e,a),o&&o.m(e,null),y(e,t),y(e,i),j(l,i,null),s=!0},p(r,a){r[2]?o&&(re(),D(o,1,1,()=>{o=null}),ae()):o?(o.p(r,a),a&4&&M(o,1)):(o=ah(r),o.c(),M(o,1),o.m(e,t));const u={};a&2&&(u.name="fields."+r[1]+".cascadeDelete"),a&83886101&&(u.$$scope={dirty:a,ctx:r}),l.$set(u)},i(r){s||(M(o),M(l.$$.fragment,r),s=!0)},o(r){D(o),D(l.$$.fragment,r),s=!1},d(r){r&&v(e),o&&o.d(),H(l)}}}function aD(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[rD],default:[iD,({interactive:f})=>({25:f}),({interactive:f})=>f?33554432:0]},$$scope:{ctx:n}};for(let f=0;f<o.length;f+=1)a=He(a,o[f]);n[0]!==void 0&&(a.field=n[0]),e=new li({props:a}),ie.push(()=>be(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]);let u={};return l=new lf({props:u}),n[21](l),l.$on("save",n[22]),{c(){z(e.$$.fragment),i=$(),z(l.$$.fragment)},m(f,c){j(e,f,c),w(f,i,c),j(l,f,c),s=!0},p(f,[c]){const d=c&258?wt(o,[c&2&&{key:f[1]},c&256&&Ft(f[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],Ce(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(f){s||(M(e.$$.fragment,f),M(l.$$.fragment,f),s=!0)},o(f){D(e.$$.fragment,f),D(l.$$.fragment,f),s=!1},d(f){f&&v(i),H(e,f),n[21](null),H(l,f)}}}function uD(n,e,t){let i,l;const s=["field","key"];let o=st(e,s),r;Xe(n,Dn,R=>t(10,r=R));let{field:a}=e,{key:u=""}=e;const f=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,m=a.maxSelect<=1,h=m;function g(){t(0,a.maxSelect=1,a),t(0,a.collectionId=null,a),t(0,a.cascadeDelete=!1,a),t(2,m=!0),t(9,h=m)}const _=R=>t(0,a.minSelect=R.target.value<<0,a);function k(){a.maxSelect=gt(this.value),t(0,a),t(9,h),t(2,m)}function S(R){n.$$.not_equal(a.cascadeDelete,R)&&(a.cascadeDelete=R,t(0,a),t(9,h),t(2,m))}const C=()=>d==null?void 0:d.show();function T(R){n.$$.not_equal(a.collectionId,R)&&(a.collectionId=R,t(0,a),t(9,h),t(2,m))}function O(R){m=R,t(2,m)}function E(R){a=R,t(0,a),t(9,h),t(2,m)}function L(R){Ae.call(this,n,R)}function I(R){Ae.call(this,n,R)}function A(R){Ae.call(this,n,R)}function N(R){ie[R?"unshift":"push"](()=>{d=R,t(3,d)})}const P=R=>{var q,F;(F=(q=R==null?void 0:R.detail)==null?void 0:q.collection)!=null&&F.id&&R.detail.collection.type!="view"&&t(0,a.collectionId=R.detail.collection.id,a)};return n.$$set=R=>{e=He(He({},e),Jt(R)),t(8,o=st(e,s)),"field"in R&&t(0,a=R.field),"key"in R&&t(1,u=R.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(R=>!R.system&&R.type!="view")),n.$$.dirty&516&&h!=m&&(t(9,h=m),m?(t(0,a.minSelect=0,a),t(0,a.maxSelect=1,a)):t(0,a.maxSelect=999,a)),n.$$.dirty&1&&typeof a.maxSelect>"u"&&g(),n.$$.dirty&1025&&t(4,l=r.find(R=>R.id==a.collectionId)||null)},[a,u,m,d,l,i,f,c,o,h,r,_,k,S,C,T,O,E,L,I,A,N,P]}class fD extends Se{constructor(e){super(),we(this,e,uD,aD,ke,{field:0,key:1})}}function uh(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function fh(n){let e,t;return e=new En({props:{class:"dropdown dropdown-block options-dropdown dropdown-left m-t-0 p-0",$$slots:{default:[dD]},$$scope:{ctx:n}}}),e.$on("hide",n[21]),{c(){z(e.$$.fragment)},m(i,l){j(e,i,l),t=!0},p(i,l){const s={};l&33554547&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function cD(n){let e,t,i=n[22]+"",l,s,o,r,a,u,f;function c(){return n[15](n[22])}return{c(){e=b("div"),t=b("span"),l=W(i),s=$(),o=b("div"),r=$(),a=b("button"),a.innerHTML='<i class="ri-close-lin
2025-02-21 22:54:51 +08:00
<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, e.g.
<code>MAX(balance) as maxBalance</code>.</li> <li>Combined/multi-spaced expressions must be wrapped in parenthesis, e.g.
2025-03-29 03:07:16 +08:00
<code>(MAX(balance) + 1) as maxBalance</code>.</li></ul>`,u=$(),g&&g.c(),f=ge(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,k){w(_,e,k),y(e,t),w(_,l,k),m[s].m(_,k),w(_,r,k),w(_,a,k),w(_,u,k),g&&g.m(_,k),w(_,f,k),c=!0},p(_,k){(!c||k&256&&i!==(i=_[8]))&&p(e,"for",i);let S=s;s=h(_),s===S?m[s].p(_,k):(re(),D(m[S],1,1,()=>{m[S]=null}),ae(),o=m[s],o?o.p(_,k):(o=m[s]=d[s](_),o.c()),M(o,1),o.m(r.parentNode,r)),_[3].length?g?g.p(_,k):(g=_h(_),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(_){c||(M(o),c=!0)},o(_){D(o),c=!1},d(_){_&&(v(e),v(l),v(r),v(a),v(u),v(f)),m[s].d(_),g&&g.d(_)}}}function UD(n){let e,t;return e=new pe({props:{class:"form-field required "+(n[3].length?"error":""),name:"viewQuery",$$slots:{default:[zD,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,l){j(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function VD(n,e,t){let i;Xe(n,Sn,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){t(3,r=[]);const d=U.getNestedVal(c,"fields",null);if(U.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=U.extractColumnsFromQuery(l==null?void 0:l.viewQuery);U.removeByValue(m,"id"),U.removeByValue(m,"created"),U.removeByValue(m,"updated");for(let h in d)for(let g in d[h]){const _=d[h][g].message,k=m[h]||h;r.push(U.sentenize(k+": "+_))}}an(async()=>{t(2,o=!0);try{t(1,s=(await Tt(async()=>{const{default:c}=await import("./CodeEditor-CXGm1WBS.js");return{default:c}},__vite__mapDeps([13,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(l.viewQuery,c)&&(l.viewQuery=c,t(0,l))}const f=()=>{r.length&&Wn("fields")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,u,f]}class BD extends Se{constructor(e){super(),we(this,e,VD,UD,ke,{collection:0})}}function bh(n,e,t){const i=n.slice();return i[15]=e[t],i}function kh(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,C,T,O,E,L,I,A=fe(n[4]),N=[];for(let P=0;P<A.length;P+=1)N[P]=vh(bh(n,A,P));return{c(){e=b("div"),t=b("div"),i=b("div"),l=b("p"),l.textContent="The following record fields are available:",s=$(),o=b("div");for(let P=0;P<N.length;P+=1)N[P].c();r=$(),a=b("hr"),u=$(),f=b("p"),f.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",c=$(),d=b("div"),d.innerHTML="<code>@request.headers.*</code> <code>@request.query.*</code> <code>@request.body.*</code> <code>@request.auth.*</code>",m=$(),h=b("hr"),g=$(),_=b("p"),_.innerHTML=`You could also add constraints and query other collections using the
2025-03-20 19:46:40 +08:00
<em>@collection</em> filter:`,k=$(),S=b("div"),S.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",C=$(),T=b("hr"),O=$(),E=b("p"),E.innerHTML=`Example rule:
<br/> <code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,p(l,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(_,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(T,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(P,R){w(P,e,R),y(e,t),y(t,i),y(i,l),y(i,s),y(i,o);for(let q=0;q<N.length;q+=1)N[q]&&N[q].m(o,null);y(i,r),y(i,a),y(i,u),y(i,f),y(i,c),y(i,d),y(i,m),y(i,h),y(i,g),y(i,_),y(i,k),y(i,S),y(i,C),y(i,T),y(i,O),y(i,E),I=!0},p(P,R){if(R&24){A=fe(P[4]);let q;for(q=0;q<A.length;q+=1){const F=bh(P,A,q);N[q]?N[q].p(F,R):(N[q]=vh(F),N[q].c(),N[q].m(o,null))}for(;q<N.length;q+=1)N[q].d(1);N.length=A.length}},i(P){I||(P&&tt(()=>{I&&(L||(L=je(e,pt,{duration:150},!0)),L.run(1))}),I=!0)},o(P){P&&(L||(L=je(e,pt,{duration:150},!1)),L.run(0)),I=!1},d(P){P&&v(e),ct(N,P),P&&L&&L.end()}}}function yh(n){let e,t=n[15]+"",i;return{c(){e=b("code"),i=W(t)},m(l,s){w(l,e,s),y(e,i)},p(l,s){s&16&&t!==(t=l[15]+"")&&oe(i,t)},d(l){l&&v(e)}}}function vh(n){let e=!n[3].includes(n[15]),t,i=e&&yh(n);return{c(){i&&i.c(),t=ge()},m(l,s){i&&i.m(l,s),w(l,t,s)},p(l,s){s&24&&(e=!l[3].includes(l[15])),e?i?i.p(l,s):(i=yh(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){l&&v(t),i&&i.d(l)}}}function wh(n){let e,t,i,l,s,o,r,a,u;function f(_){n[8](_)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[WD,({isSuperuserOnly:_})=>({14:_}),({isSuperuserOnly:_})=>_?16384:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new ll({props:c}),ie.push(()=>be(e,"rule",f));function d(_){n[9](_)}let m={label:"Update rule",formKey:"updateRule",collection:n[0],$$slots:{afterLabel:[YD,({isSuperuserOnly:_})=>({14:_}),({isSuperuserOnly:_})=>_?16384:0]},$$scope:{ctx:n}};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new ll({props:m}),ie.push(()=>be(l,"rule",d));function h(_){n[10](_)}let g={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(g.rule=n[0].deleteRule),r=new ll({props:g}),ie.push(()=>be(r,"rule",h)),{c(){z(e.$$.fragment),i=$(),z(l.$$.fragment),o=$(),z(r.$$.fragment)},m(_,k){j(e,_,k),w(_,i,k),j(l,_,k),w(_,o,k),j(r,_,k),u=!0},p(_,k){const S={};k&1&&(S.collection=_[0]),k&278528&&(S.$$scope={dirty:k,ctx:_}),!t&&k&1&&(t=!0,S.rule=_[0].createRule,Ce(()=>t=!1)),e.$set(S);const C={};k&1&&(C.collection=_[0]),k&278528&&(C.$$scope={dirty:k,ctx:_}),!s&&k&1&&(s=!0,C.rule=_[0].updateRule,Ce(()=>s=!1)),l.$set(C);const T={};k&1&&(T.collection=_[0]),!a&&k&1&&(a=!0,T.rule=_[0].deleteRule,Ce(()=>a=!1)),r.$set(T)},i(_){u||(M(e.$$.fragment,_),M(l.$$.fragment,_),M(r.$$.fragment,_),u=!0)},o(_){D(e.$$.fragment,_),D(l.$$.fragment,_),D(r.$$.fragment,_),u=!1},d(_){_&&(v(i),v(o)),H(e,_),H(l,_),H(r,_)}}}function Sh(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){w(l,e,s),t||(i=$e(Fe.call(null,e,{text:"The main record fields hold the values that are going to be inserted in the database.",position:"top"})),t=!0)},d(l){l&&v(e),t=!1,i()}}}function WD(n){let e,t=!n[14]&&Sh();return{c(){t&&t.c(),e=ge()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[14]?t&&(t.d(1),t=null):t||(t=Sh(),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function Th(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){w(l,e,s),t||(i=$e(Fe.call(null,e,{text:`The main record fields represent the old/existing record field values.
To target the newly submitted ones you can use @request.body.*`,position:"top"})),t=!0)},d(l){l&&v(e),t=!1,i()}}}function YD(n){let e,t=!n[14]&&Th();return{c(){t&&t.c(),e=ge()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[14]?t&&(t.d(1),t=null):t||(t=Th(),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function Ch(n){let e,t,i,l,s,o,r,a,u,f,c;function d(_,k){return _[2]?JD:KD}let m=d(n),h=m(n),g=n[2]&&$h(n);return{c(){e=b("hr"),t=$(),i=b("button"),l=b("strong"),l.textContent="Additional auth collection rules",s=$(),h.c(),r=$(),g&&g.c(),a=ge(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm m-b-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(_,k){w(_,e,k),w(_,t,k),w(_,i,k),y(i,l),y(i,s),h.m(i,null),w(_,r,k),g&&g.m(_,k),w(_,a,k),u=!0,f||(c=Y(i,"click",n[11]),f=!0)},p(_,k){m!==(m=d(_))&&(h.d(1),h=m(_),h&&(h.c(),h.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm m-b-sm "+(_[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),_[2]?g?(g.p(_,k),k&4&&M(g,1)):(g=$h(_),g.c(),M(g,1),g.m(a.parentNode,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae())},i(_){u||(M(g),u=!0)},o(_){D(g),u=!1},d(_){_&&(v(e),v(t),v(i),v(r),v(a)),h.d(),g&&g.d(_),f=!1,c()}}}function KD(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function JD(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function $h(n){let e,t,i,l,s,o,r,a;function u(m){n[12](m)}let f={label:"Authentication rule",formKey:"authRule",placeholder:"",collection:n[0],$$slots:{default:[ZD]},$$scope:{ctx:n}};n[0].authRule!==void 0&&(f.rule=n[0].authRule),t=new ll({props:f}),ie.push(()=>be(t,"rule",u));function c(m){n[13](m)}let d={label:"Manage rule",formKey:"manageRule",placeholder:"",required:n[0].manageRule!==null,collection:n[0],$$slots:{default:[GD]},$$scope:{ctx:n}};return n[0].manageRule!==void 0&&(d.rule=n[0].manageRule),s=new ll({props:d}),ie.push(()=>be(s,"rule",c)),{c(){e=b("div"),z(t.$$.fragment),l=$(),z(s.$$.fragment),p(e,"class","block")},m(m,h){w(m,e,h),j(t,e,null),y(e,l),j(s,e,null),a=!0},p(m,h){const g={};h&1&&(g.collection=m[0]),h&262144&&(g.$$scope={dirty:h,ctx:m}),!i&&h&1&&(i=!0,g.rule=m[0].authRule,Ce(()=>i=!1)),t.$set(g);const _={};h&1&&(_.required=m[0].manageRule!==null),h&1&&(_.collection=m[0]),h&262144&&(_.$$scope={dirty:h,ctx:m}),!o&&h&1&&(o=!0,_.rule=m[0].manageRule,Ce(()=>o=!1)),s.$set(_)},i(m){a||(M(t.$$.fragment,m),M(s.$$.fragment,m),m&&tt(()=>{a&&(r||(r=je(e,pt,{duration:150},!0)),r.run(1))}),a=!0)},o(m){D(t.$$.fragment,m),D(s.$$.fragment,m),m&&(r||(r=je(e,pt,{duration:150},!1)),r.run(0)),a=!1},d(m){m&&v(e),H(t),H(s),m&&r&&r.end()}}}function ZD(n){let e,t,i,l,s,o,r;return{c(){e=b("p"),e.textContent=`This rule is executed every time before authentication allowing you to restrict who
can authenticate.`,t=$(),i=b("p"),i.innerHTML=`For example, to allow only verified users you can set it to
<code>verified = true</code>.`,l=$(),s=b("p"),s.textContent="Leave it empty to allow anyone with an account to authenticate.",o=$(),r=b("p"),r.textContent='To disable authentication entirely you can change it to "Set superusers only".'},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,l,u),w(a,s,u),w(a,o,u),w(a,r,u)},p:te,d(a){a&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r))}}}function GD(n){let e,t,i;return{c(){e=b("p"),e.innerHTML=`This rule is executed in addition to the <code>create</code> and <code>update</code> API
rules.`,t=$(),i=b("p"),i.textContent=`It enables superuser-like permissions to allow fully managing the auth record(s), eg.
2025-02-21 22:54:51 +08:00
changing the password without requiring to enter the old one, directly updating the
2025-03-20 19:46:40 +08:00
verified state or email, etc.`},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:te,d(l){l&&(v(e),v(t),v(i))}}}function XD(n){var R,q;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,g,_,k,S,C,T,O=n[1]&&kh(n);function E(F){n[6](F)}let L={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(L.rule=n[0].listRule),f=new ll({props:L}),ie.push(()=>be(f,"rule",E));function I(F){n[7](F)}let A={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(A.rule=n[0].viewRule),m=new ll({props:A}),ie.push(()=>be(m,"rule",I));let N=((R=n[0])==null?void 0:R.type)!=="view"&&wh(n),P=((q=n[0])==null?void 0:q.type)==="auth"&&Ch(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the
2025-02-21 22:54:51 +08:00
<a href="https://pocketbase.io/docs/api-rules-and-filters" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
2025-03-20 19:46:40 +08:00
</a>.`,l=$(),s=b("button"),r=W(o),a=$(),O&&O.c(),u=$(),z(f.$$.fragment),d=$(),z(m.$$.fragment),g=$(),N&&N.c(),_=$(),P&&P.c(),k=ge(),p(s,"type","button"),p(s,"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(F,B){w(F,e,B),y(e,t),y(t,i),y(t,l),y(t,s),y(s,r),y(e,a),O&&O.m(e,null),w(F,u,B),j(f,F,B),w(F,d,B),j(m,F,B),w(F,g,B),N&&N.m(F,B),w(F,_,B),P&&P.m(F,B),w(F,k,B),S=!0,C||(T=Y(s,"click",n[5]),C=!0)},p(F,[B]){var Z,G;(!S||B&2)&&o!==(o=F[1]?"Hide available fields":"Show available fields")&&oe(r,o),F[1]?O?(O.p(F,B),B&2&&M(O,1)):(O=kh(F),O.c(),M(O,1),O.m(e,null)):O&&(re(),D(O,1,1,()=>{O=null}),ae());const J={};B&1&&(J.collection=F[0]),!c&&B&1&&(c=!0,J.rule=F[0].listRule,Ce(()=>c=!1)),f.$set(J);const V={};B&1&&(V.collection=F[0]),!h&&B&1&&(h=!0,V.rule=F[0].viewRule,Ce(()=>h=!1)),m.$set(V),((Z=F[0])==null?void 0:Z.type)!=="view"?N?(N.p(F,B),B&1&&M(N,1)):(N=wh(F),N.c(),M(N,1),N.m(_.parentNode,_)):N&&(re(),D(N,1,1,()=>{N=null}),ae()),((G=F[0])==null?void 0:G.type)==="auth"?P?(P.p(F,B),B&1&&M(P,1)):(P=Ch(F),P.c(),M(P,1),P.m(k.parentNode,k)):P&&(re(),D(P,1,1,()=>{P=null}),ae())},i(F){S||(M(O),M(f.$$.fragment,F),M(m.$$.fragment,F),M(N),M(P),S=!0)},o(F){D(O),D(f.$$.fragment,F),D(m.$$.fragment,F),D(N),D(P),S=!1},d(F){F&&(v(e),v(u),v(d),v(g),v(_),v(k)),O&&O.d(),H(f,F),H(m,F),N&&N.d(F),P&&P.d(F),C=!1,T()}}}function QD(n,e,t){let i,l,{collection:s}=e,o=!1,r=s.manageRule!==null||s.authRule!=="";const a=()=>t(1,o=!o);function u(k){n.$$.not_equal(s.listRule,k)&&(s.listRule=k,t(0,s))}function f(k){n.$$.not_equal(s.viewRule,k)&&(s.viewRule=k,t(0,s))}function c(k){n.$$.not_equal(s.createRule,k)&&(s.createRule=k,t(0,s))}function d(k){n.$$.not_equal(s.updateRule,k)&&(s.updateRule=k,t(0,s))}function m(k){n.$$.not_equal(s.deleteRule,k)&&(s.deleteRule=k,t(0,s))}const h=()=>{t(2,r=!r)};function g(k){n.$$.not_equal(s.authRule,k)&&(s.authRule=k,t(0,s))}function _(k){n.$$.not_equal(s.manageRule,k)&&(s.manageRule=k,t(0,s))}return n.$$set=k=>{"collection"in k&&t(0,s=k.collection)},n.$$.update=()=>{var k;n.$$.dirty&1&&t(4,i=U.getAllCollectionIdentifiers(s)),n.$$.dirty&1&&t(3,l=(k=s.fields)==null?void 0:k.filter(S=>S.hidden).map(S=>S.name))},[s,o,r,l,i,a,u,f,c,d,m,h,g,_]}class xD extends Se{constructor(e){super(),we(this,e,QD,XD,ke,{collection:0})}}function Oh(n,e,t){const i=n.slice();return i[27]=e[t],i}function Mh(n,e,t){const i=n.slice();return i[30]=e[t],i}function Eh(n,e,t){const i=n.slice();return i[33]=e[t],i}function Dh(n,e,t){const i=n.slice();return i[33]=e[t],i}function Ih(n,e,t){const i=n.slice();return i[33]=e[t],i}function Lh(n){let e,t,i,l,s,o,r=n[9].length&&Ah();return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=$(),l=b("div"),s=b("p"),s.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=$(),r&&r.c(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(a,u){w(a,e,u),y(e,t),y(e,i),y(e,l),y(l,s),y(l,o),r&&r.m(l,null)},p(a,u){a[9].length?r||(r=Ah(),r.c(),r.m(l,null)):r&&(r.d(1),r=null)},d(a){a&&v(e),r&&r.d()}}}function Ah(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Nh(n){let e,t,i,l,s,o,r=n[5]&&Ph(n),a=!n[4]&&Rh(n),u=fe(n[3]),f=[];for(let m=0;m<u.length;m+=1)f[m]=Hh(Mh(n,u,m));let c=fe(n[7]),d=[];for(let m=0;m<c.length;m+=1)d[m]=zh(Oh(n,c,m));return{c(){e=b("h6"),e.textContent="Changes:",t=$(),i=b("ul"),r&&r.c(),l=$(),a&&a.c(),s=$();for(let m=0;m<f.length;m+=1)f[m].c();o=$();for(let m=0;m<d.length;m+=1)d[m].c();p(i,"class","changes-list svelte-xqpcsf")},m(m,h){w(m,e,h),w(m,t,h),w(m,i,h),r&&r.m(i,null),y(i,l),a&&a.m(i,null),y(i,s);for(let g=0;g<f.length;g+=1)f[g]&&f[g].m(i,null);y(i,o);for(let g=0;g<d.length;g+=1)d[g]&&d[g].m(i,null)},p(m,h){if(m[5]?r?r.p(m,h):(r=Ph(m),r.c(),r.m(i,l)):r&&(r.d(1),r=null),m[4]?a&&(a.d(1),a=null):a?a.p(m,h):(a=Rh(m),a.c(),a.m(i,s)),h[0]&8){u=fe(m[3]);let g;for(g=0;g<u.length;g+=1){const _=Mh(m,u,g);f[g]?f[g].p(_,h):(f[g]=Hh(_),f[g].c(),f[g].m(i,o))}for(;g<f.length;g+=1)f[g].d(1);f.length=u.length}if(h[0]&8320){c=fe(m[7]);let g;for(g=0;g<c.length;g+=1){const _=Oh(m,c,g);d[g]?d[g].p(_,h):(d[g]=zh(_),d[g].c(),d[g].m(i,null))}for(;g<d.length;g+=1)d[g].d(1);d.length=c.length}},d(m){m&&(v(e),v(t),v(i)),r&&r.d(),a&&a.d(),ct(f,m),ct(d,m)}}}function Ph(n){var m,h;let e,t,i,l,s=((m=n[1])==null?void 0:m.name)+"",o,r,a,u,f,c=((h=n[2])==null?void 0:h.name)+"",d;return{c(){e=b("li"),t=b("div"),i=W(`Renamed collection
`),l=b("strong"),o=W(s),r=$(),a=b("i"),u=$(),f=b("strong"),d=W(c),p(l,"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(g,_){w(g,e,_),y(e,t),y(t,i),y(t,l),y(l,o),y(t,r),y(t,a),y(t,u),y(t,f),y(f,d)},p(g,_){var k,S;_[0]&2&&s!==(s=((k=g[1])==null?void 0:k.name)+"")&&oe(o,s),_[0]&4&&c!==(c=((S=g[2])==null?void 0:S.name)+"")&&oe(d,c)},d(g){g&&v(e)}}}function Rh(n){let e,t,i,l=fe(n[8]),s=[];for(let f=0;f<l.length;f+=1)s[f]=Fh(Ih(n,l,f));let o=fe(n[10]),r=[];for(let f=0;f<o.length;f+=1)r[f]=qh(Dh(n,o,f));let a=fe(n[9]),u=[];for(let f=0;f<a.length;f+=1)u[f]=jh(Eh(n,a,f));return{c(){for(let f=0;f<s.length;f+=1)s[f].c();e=$();for(let f=0;f<r.length;f+=1)r[f].c();t=$();for(let f=0;f<u.length;f+=1)u[f].c();i=ge()},m(f,c){for(let d=0;d<s.length;d+=1)s[d]&&s[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[0]&256){l=fe(f[8]);let d;for(d=0;d<l.length;d+=1){const m=Ih(f,l,d);s[d]?s[d].p(m,c):(s[d]=Fh(m),s[d].c(),s[d].m(e.parentNode,e))}for(;d<s.length;d+=1)s[d].d(1);s.length=l.length}if(c[0]&1024){o=fe(f[10]);let d;for(d=0;d<o.length;d+=1){const m=Dh(f,o,d);r[d]?r[d].p(m,c):(r[d]=qh(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[0]&512){a=fe(f[9]);let d;for(d=0;d<a.length;d+=1){const m=Eh(f,a,d);u[d]?u[d].p(m,c):(u[d]=jh(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){f&&(v(e),v(t),v(i)),ct(s,f),ct(r,f),ct(u,f)}}}function Fh(n){let e,t,i,l=n[33].name+"",s,o,r;return{c(){e=b("li"),t=W(`Multiple to single value conversion of field
`),i=b("strong"),s=W(l),o=$(),r=b("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),y(e,t),y(e,i),y(i,s),y(e,o),y(e,r)},p(a,u){u[0]&256&&l!==(l=a[33].name+"")&&oe(s,l)},d(a){a&&v(e)}}}function qh(n){let e,t,i,l,s=n[33]._originalName+"",o,r,a,u,f,c=n[33].name+"",d;return{c(){e=b("li"),t=b("div"),i=W(`Renamed field
`),l=b("strong"),o=W(s),r=$(),a=b("i"),u=$(),f=b("strong"),d=W(c),p(l,"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,h){w(m,e,h),y(e,t),y(t,i),y(t,l),y(l,o),y(t,r),y(t,a),y(t,u),y(t,f),y(f,d)},p(m,h){h[0]&1024&&s!==(s=m[33]._originalName+"")&&oe(o,s),h[0]&1024&&c!==(c=m[33].name+"")&&oe(d,c)},d(m){m&&v(e)}}}function jh(n){let e,t,i,l=n[33].name+"",s,o;return{c(){e=b("li"),t=W("Removed field "),i=b("span"),s=W(l),o=$(),p(i,"class","txt-bold"),p(e,"class","txt-danger svelte-xqpcsf")},m(r,a){w(r,e,a),y(e,t),y(e,i),y(i,s),y(e,o)},p(r,a){a[0]&512&&l!==(l=r[33].name+"")&&oe(s,l)},d(r){r&&v(e)}}}function Hh(n){let e,t,i,l=n[30].prop+"",s,o,r,a,u,f,c,d,m=(n[30].oldRule===null?"null (superusers only)":n[30].oldRule||'""')+"",h,g,_,k,S,C,T,O,E=(n[30].newRule===null?"null (superusers only)":n[30].newRule||'""')+"",L;return{c(){e=b("li"),t=W("Changed API rule "),i=b("code"),s=W(l),o=W(`:
`),r=b("br"),a=$(),u=b("small"),f=b("strong"),f.textContent="Old",c=W(`:
`),d=b("span"),h=W(m),g=$(),_=b("br"),k=$(),S=b("small"),C=b("strong"),C.textContent="New",T=W(`:
`),O=b("span"),L=W(E),p(i,"class","txt-sm"),p(d,"class","txt-preline"),p(u,"class","txt-mono txt-hint"),p(O,"class","txt-preline"),p(S,"class","txt-mono txt-success"),p(e,"class","svelte-xqpcsf")},m(I,A){w(I,e,A),y(e,t),y(e,i),y(i,s),y(e,o),y(e,r),y(e,a),y(e,u),y(u,f),y(u,c),y(u,d),y(d,h),y(e,g),y(e,_),y(e,k),y(e,S),y(S,C),y(S,T),y(S,O),y(O,L)},p(I,A){A[0]&8&&l!==(l=I[30].prop+"")&&oe(s,l),A[0]&8&&m!==(m=(I[30].oldRule===null?"null (superusers only)":I[30].oldRule||'""')+"")&&oe(h,m),A[0]&8&&E!==(E=(I[30].newRule===null?"null (superusers only)":I[30].newRule||'""')+"")&&oe(L,E)},d(I){I&&v(e)}}}function zh(n){let e,t,i,l=n[27].name+"",s,o,r,a,u=n[27].oldHost+"",f,c,d,m,h,g=n[27].newHost+"",_,k,S,C,T,O,E,L,I,A,N,P,R,q,F,B,J;return{c(){e=b("li"),t=W("Changed "),i=b("code"),s=W(l),o=W(` host
`),r=b("div"),a=b("strong"),f=W(u),c=$(),d=b("i"),m=$(),h=b("strong"),_=W(g),k=$(),S=b("br"),C=$(),T=b("em"),O=W(`If the old and new OIDC configuration is not for the same provider consider deleting
2025-02-21 22:54:51 +08:00
all old `),E=b("code"),E.textContent="_externalAuths",L=W(` records associated to the current
collection and provider, otherwise it may result in account linking errors.
`),I=b("a"),A=W("Review existing "),N=b("code"),N.textContent="_externalAuths",P=W(` records
2025-03-20 19:46:40 +08:00
`),R=b("i"),q=$(),B=W("."),J=$(),p(a,"class","txt-strikethrough txt-hint"),p(d,"class","ri-arrow-right-line txt-sm"),p(h,"class","txt"),p(r,"class","inline-flex m-l-5"),p(E,"class","txt-sm"),p(N,"class","txt-sm"),p(R,"class","ri-external-link-line txt-sm"),p(I,"href",F=n[13](n[27].name)),p(I,"target","_blank"),p(T,"class","txt-hint"),p(e,"class","svelte-xqpcsf")},m(V,Z){w(V,e,Z),y(e,t),y(e,i),y(i,s),y(e,o),y(e,r),y(r,a),y(a,f),y(r,c),y(r,d),y(r,m),y(r,h),y(h,_),y(e,k),y(e,S),y(e,C),y(e,T),y(T,O),y(T,E),y(T,L),y(T,I),y(I,A),y(I,N),y(I,P),y(I,R),y(I,q),y(T,B),y(e,J)},p(V,Z){Z[0]&128&&l!==(l=V[27].name+"")&&oe(s,l),Z[0]&128&&u!==(u=V[27].oldHost+"")&&oe(f,u),Z[0]&128&&g!==(g=V[27].newHost+"")&&oe(_,g),Z[0]&128&&F!==(F=V[13](V[27].name))&&p(I,"href",F)},d(V){V&&v(e)}}}function eI(n){let e,t,i=(n[5]||n[9].length||n[10].length)&&Lh(n),l=n[11]&&Nh(n);return{c(){i&&i.c(),e=$(),l&&l.c(),t=ge()},m(s,o){i&&i.m(s,o),w(s,e,o),l&&l.m(s,o),w(s,t,o)},p(s,o){s[5]||s[9].length||s[10].length?i?i.p(s,o):(i=Lh(s),i.c(),i.m(e.parentNode,e)):i&&(i.d(1),i=null),s[11]?l?l.p(s,o):(l=Nh(s),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},d(s){s&&(v(e),v(t)),i&&i.d(s),l&&l.d(s)}}}function tI(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function nI(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=$(),i=b("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),l||(s=[Y(e,"click",n[15]),Y(i,"click",n[16])],l=!0)},p:te,d(o){o&&(v(e),v(t),v(i)),l=!1,De(s)}}}function iI(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[nI],header:[tI],default:[eI]},$$scope:{ctx:n}};return e=new tn({props:i}),n[17](e),e.$on("hide",n[18]),e.$on("show",n[19]),{c(){z(e.$$.fragment)},m(l,s){j(e,l,s),t=!0},p(l,s){const o={};s[0]&4030|s[1]&512&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[17](null),H(e,l)}}}function lI(n,e,t){let i,l,s,o,r,a,u;const f=yt();let c,d,m,h,g=[],_=[];async function k(F,B,J=!0){t(1,d=F),t(2,m=B),h=J,await O(),I(),await mn(),i||o.length||r.length||a.length||g.length||_.length?c==null||c.show():C()}function S(){c==null||c.hide()}function C(){S(),f("confirm",h)}const T=["oidc","oidc2","oidc3"];async function O(){var F,B,J,V;t(7,g=[]);for(let Z of T){let G=(B=(F=d==null?void 0:d.oauth2)==null?void 0:F.providers)==null?void 0:B.find(Te=>Te.name==Z),ce=(V=(J=m==null?void 0:m.oauth2)==null?void 0:J.providers)==null?void 0:V.find(Te=>Te.name==Z);if(!G||!ce)continue;let de=new URL(G.authURL).host,ue=new URL(ce.authURL).host;de!=ue&&await E(Z)&&g.push({name:Z,oldHost:de,newHost:ue})}}async function E(F){try{return await he.collection("_externalAuths").getFirstListItem(he.filter("collectionRef={:collectionId} && provider={:provider}",{collectionId:m==null?void 0:m.id,provider:F})),!0}catch{}return!1}function L(F){return`#/collections?collection=_externalAuths&filter=collectionRef%3D%22${m==null?void 0:m.id}%22+%26%26+provider%3D%22${F}%22`}function I(){if(t(3,_=[]),window.location.protocol!="https:")return;const F=["listRule","viewRule"];l||F.push("createRule","updateRule","deleteRule"),s&&F.push("manageRule","authRule");let B,J;for(let V of F)B=d==null?void 0:d[V],J=m==null?void 0:m[V],B!==J&&_.push({prop:V,oldRule:B,newRule:J})}const A=()=>S(),N=()=>C();function P(F){ie[F?"unshift":"push"](()=>{c=F,t(6,c)})}function R(F){Ae.call(this,n,F)}function q(F){Ae.call(this,n,F)}return n.$$.update=()=>{var F,B,J;n.$$.dirty[0]&6&&t(5,i=(d==null?void 0:d.name)!=(m==null?void 0:m.name)),n.$$.dirty[0]&4&&t(4,l=(m==null?void 0:m.type)==="view"),n.$$.dirty[0]&4&&(s=(m==null?void 0:m.type)==="auth"),n.$$.dirty[0]&20&&t(10,o=!l&&((F=m==null?void 0:m.fields)==null?void 0:F.filter(V=>V.id&&!V._toDelete&&V._originalName!=V.name))||[]),n.$$.dirty[0]&20&&t(9,r=!l&&((B=m==null?void 0:m.fields)==null?
`+U.truncate(JSON.stringify(U.truncateObject(A_(n[0],"expand")),null,2),800,!0),class:"code",position:"left"})),Y(l,"click",xt(n[1])),Y(l,"keydown",xt(n[2]))],u=!0)},p(c,[d]){const m={};d&1&&(m.record=c[0]),t.$set(m),(!a||d&1&&o!==(o="#/collections?collection="+c[0].collectionId+"&recordId="+c[0].id))&&p(l,"href",o),r&&It(r.update)&&d&1&&r.update.call(null,{text:`Open relation record in new tab:
`+U.truncate(JSON.stringify(U.truncateObject(A_(c[0],"expand")),null,2),800,!0),class:"code",position:"left"})},i(c){a||(M(t.$$.fragment,c),a=!0)},o(c){D(t.$$.fragment,c),a=!1},d(c){c&&v(e),H(t),u=!1,De(f)}}}function A_(n,...e){const t=Object.assign({},n);for(let i of e)delete t[i];return t}function lL(n,e,t){let{record:i}=e;function l(o){Ae.call(this,n,o)}function s(o){Ae.call(this,n,o)}return n.$$set=o=>{"record"in o&&t(0,i=o.record)},[i,l,s]}class Ur extends Se{constructor(e){super(),we(this,e,lL,iL,ke,{record:0})}}function N_(n,e,t){const i=n.slice();return i[19]=e[t],i[9]=t,i}function P_(n,e,t){const i=n.slice();return i[14]=e[t],i}function R_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function F_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function sL(n){const e=n.slice(),t=U.toArray(e[3]);e[17]=t;const i=e[2]?10:500;return e[18]=i,e}function oL(n){var s,o;const e=n.slice(),t=U.toArray(e[3]);e[10]=t;const i=U.toArray((o=(s=e[0])==null?void 0:s.expand)==null?void 0:o[e[1].name]);e[11]=i;const l=e[2]?20:500;return e[12]=l,e}function rL(n){const e=n.slice(),t=U.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[6]=t,e}function aL(n){let e,t;return{c(){e=b("div"),t=W(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,l){w(i,e,l),y(e,t)},p(i,l){l&8&&oe(t,i[3])},i:te,o:te,d(i){i&&v(e)}}}function uL(n){let e,t=U.truncate(n[3])+"",i,l;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=U.truncate(n[3]))},m(s,o){w(s,e,o),y(e,i)},p(s,o){o&8&&t!==(t=U.truncate(s[3])+"")&&oe(i,t),o&8&&l!==(l=U.truncate(s[3]))&&p(e,"title",l)},i:te,o:te,d(s){s&&v(e)}}}function fL(n){let e,t=[],i=new Map,l,s,o=fe(n[17].slice(0,n[18]));const r=u=>u[9]+u[19];for(let u=0;u<o.length;u+=1){let f=N_(n,o,u),c=r(f);i.set(c,t[u]=q_(c,f))}let a=n[17].length>n[18]&&j_();return{c(){e=b("div");for(let u=0;u<t.length;u+=1)t[u].c();l=$(),a&&a.c(),p(e,"class","inline-flex"),x(e,"multiple",n[1].maxSelect!=1)},m(u,f){w(u,e,f);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(e,null);y(e,l),a&&a.m(e,null),s=!0},p(u,f){f&13&&(o=fe(u[17].slice(0,u[18])),re(),t=bt(t,f,r,1,u,o,i,e,Wt,q_,l,N_),ae()),u[17].length>u[18]?a||(a=j_(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!s||f&2)&&x(e,"multiple",u[1].maxSelect!=1)},i(u){if(!s){for(let f=0;f<o.length;f+=1)M(t[f]);s=!0}},o(u){for(let f=0;f<t.length;f+=1)D(t[f]);s=!1},d(u){u&&v(e);for(let f=0;f<t.length;f+=1)t[f].d();a&&a.d()}}}function cL(n){let e,t,i,l,s;const o=[wL,vL],r=[];function a(f,c){return f[11].length?0:1}t=a(n),i=r[t]=o[t](n);let u=n[10].length>n[12]&&U_();return{c(){e=b("div"),i.c(),l=$(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){w(f,e,c),r[t].m(e,null),y(e,l),u&&u.m(e,null),s=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(re(),D(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),M(i,1),i.m(e,l)),f[10].length>f[12]?u||(u=U_(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){s||(M(i),s=!0)},o(f){D(i),s=!1},d(f){f&&v(e),r[t].d(),u&&u.d()}}}function dL(n){let e,t=[],i=new Map,l=fe(U.toArray(n[3]));const s=o=>o[9]+o[7];for(let o=0;o<l.length;o+=1){let r=F_(n,l,o),a=s(r);i.set(a,t[o]=V_(a,r))}return{c(){e=b("div");for(let o=0;o<t.length;o+=1)t[o].c();p(e,"class","inline-flex")},m(o,r){w(o,e,r);for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(e,null)},p(o,r){r&8&&(l=fe(U.toArray(o[3])),t=bt(t,r,s,1,o,l,i,e,ni,V_,null,F_))},i:te,o:te,d(o){o&&v(e);for(let r=0;r<t.length;r+=1)t[r].d()}}}function pL(n){let e,t;return e=new RI({props:{date:n[3]}}),{c(){z(e.$$.fragment)},m(i,l){j(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.date=i[3]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function mL(n){let e,t,i,l;const s=[TL,SL],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ge()},m(a,u){o[e].m(a,u),w(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function hL(n){let e,t=U.truncate(n[3])+"",i,l,s;return{c(){e=b("a"),i=W(t),p(e,"cl
2025-02-21 22:54:51 +08:00
`),position:"left"})),i=!0)},p(s,[o]){t&&It(t.update)&&o&1&&t.update.call(null,{text:s[0].join(`
2025-03-20 19:46:40 +08:00
`),position:"left"})},i:te,o:te,d(s){s&&v(e),i=!1,l()}}}const RL="yyyy-MM-dd HH:mm:ss.SSS";function FL(n,e,t){let i,l;Xe(n,Dn,a=>t(2,l=a));let{record:s}=e,o=[];function r(){t(0,o=[]);const a=i.fields||[];for(let u of a)u.type=="autodate"&&o.push(u.name+": "+U.formatToLocalDate(s[u.name],RL)+" Local")}return n.$$set=a=>{"record"in a&&t(1,s=a.record)},n.$$.update=()=>{n.$$.dirty&6&&(i=s&&l.find(a=>a.id==s.collectionId)),n.$$.dirty&2&&s&&r()},[o,s,l]}class qL extends Se{constructor(e){super(),we(this,e,FL,PL,ke,{record:1})}}function J_(n,e,t){const i=n.slice();return i[9]=e[t],i}function jL(n){let e;return{c(){e=b("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function HL(n){let e,t=fe(n[1]),i=[];for(let l=0;l<t.length;l+=1)i[l]=Z_(J_(n,t,l));return{c(){e=b("div");for(let l=0;l<i.length;l+=1)i[l].c();p(e,"class","list")},m(l,s){w(l,e,s);for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(e,null)},p(l,s){if(s&58){t=fe(l[1]);let o;for(o=0;o<t.length;o+=1){const r=J_(l,t,o);i[o]?i[o].p(r,s):(i[o]=Z_(r),i[o].c(),i[o].m(e,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(l){l&&v(e),ct(i,l)}}}function zL(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function Z_(n){let e,t,i,l,s,o,r=n[4](n[9].provider)+"",a,u,f,c,d=n[9].providerId+"",m,h,g,_,k,S;function C(){return n[6](n[9])}return{c(){var T;e=b("div"),t=b("figure"),i=b("img"),s=$(),o=b("span"),a=W(r),u=$(),f=b("div"),c=W("ID: "),m=W(d),h=$(),g=b("button"),g.innerHTML='<i class="ri-close-line"></i>',_=$(),vn(i.src,l="./images/oauth2/"+((T=n[3](n[9].provider))==null?void 0:T.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(g,"type","button"),p(g,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(T,O){w(T,e,O),y(e,t),y(t,i),y(e,s),y(e,o),y(o,a),y(e,u),y(e,f),y(f,c),y(f,m),y(e,h),y(e,g),y(e,_),k||(S=Y(g,"click",C),k=!0)},p(T,O){var E;n=T,O&2&&!vn(i.src,l="./images/oauth2/"+((E=n[3](n[9].provider))==null?void 0:E.logo))&&p(i,"src",l),O&2&&r!==(r=n[4](n[9].provider)+"")&&oe(a,r),O&2&&d!==(d=n[9].providerId+"")&&oe(m,d)},d(T){T&&v(e),k=!1,S()}}}function UL(n){let e;function t(s,o){var r;return s[2]?zL:(r=s[0])!=null&&r.id&&s[1].length?HL:jL}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:te,o:te,d(s){s&&v(e),l.d(s)}}}function VL(n,e,t){const i=yt();let{record:l}=e,s=[],o=!1;function r(d){return tf.find(m=>m.key==d)||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||U.sentenize(d,!1)}async function u(){if(!(l!=null&&l.id)){t(1,s=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,s=await he.collection("_externalAuths").getFullList({filter:he.filter("collectionRef = {:collectionId} && recordRef = {:recordId}",{collectionId:l.collectionId,recordId:l.id})}))}catch(d){he.error(d)}t(2,o=!1)}function f(d){!(l!=null&&l.id)||!d||kn(`Do you really want to unlink the ${a(d.provider)} provider?`,()=>he.collection("_externalAuths").delete(d.id).then(()=>{en(`Successfully unlinked the ${a(d.provider)} provider.`),i("unlink",d.provider),u()}).catch(m=>{he.error(m)}))}u();const c=d=>f(d);return n.$$set=d=>{"record"in d&&t(0,l=d.record)},[l,s,o,r,a,f,c]}class BL extends Se{constructor(e){super(),we(this,e,VL,UL,ke,{record:0})}}function WL(n){let e,t,i,l,s,o,r,a,u,f;return s=new $i({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=W(n[1]),l=$(),z(s.$$.fragment),o=$(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),y(e,t),y(t,i),n[6](t),y(e,l),j(s,e,null),y(e,o),y(e,r),a=!0,u||(f=[$e(Fe.call(null,r,"Refresh")),Y(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&oe(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(M(s.$$.fragment,c),a=!0)},o(c){D(s.$$.fragment,c),a=!1},d(c){c&
2025-02-21 22:54:51 +08:00
(record: `+n[44].id+")")),Y(e,"click",it(function(){It(n[20](n[44],n[48]))&&n[20](n[44],n[48]).apply(this,arguments)}))],s=!0)},p(f,c){n=f,a===(a=r(n,c))&&u?u.p(n,c):(u.d(1),u=a(n),u&&(u.c(),u.m(e,i))),l&&It(l.update)&&c[0]&32&&l.update.call(null,n[48]+`
2025-03-20 19:46:40 +08:00
(record: `+n[44].id+")"),c[0]&589856&&x(e,"thumb-warning",n[16](n[44],n[48]))},d(f){f&&v(e),u.d(),s=!1,De(o)}}}function ug(n,e){let t,i,l=fe(e[45]),s=[];for(let o=0;o<l.length;o+=1)s[o]=ag(lg(e,l,o));return{key:n,first:null,c(){t=ge();for(let o=0;o<s.length;o+=1)s[o].c();i=ge(),this.first=t},m(o,r){w(o,t,r);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);w(o,i,r)},p(o,r){if(e=o,r[0]&1638432){l=fe(e[45]);let a;for(a=0;a<l.length;a+=1){const u=lg(e,l,a);s[a]?s[a].p(u,r):(s[a]=ag(u),s[a].c(),s[a].m(i.parentNode,i))}for(;a<s.length;a+=1)s[a].d(1);s.length=l.length}},d(o){o&&(v(t),v(i)),ct(s,o)}}}function fg(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader loader-sm active"></span>',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function vA(n){let e,t;function i(r,a){if(r[15])return bA;if(!r[6])return gA}let l=i(n),s=l&&l(n),o=n[6]&&fg();return{c(){s&&s.c(),e=$(),o&&o.c(),t=ge()},m(r,a){s&&s.m(r,a),w(r,e,a),o&&o.m(r,a),w(r,t,a)},p(r,a){l===(l=i(r))&&s?s.p(r,a):(s&&s.d(1),s=l&&l(r),s&&(s.c(),s.m(e.parentNode,e))),r[6]?o||(o=fg(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(v(e),v(t)),s&&s.d(r),o&&o.d(r)}}}function wA(n){let e,t,i,l;const s=[_A,hA],o=[];function r(a,u){return a[7].length?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ge()},m(a,u){o[e].m(a,u),w(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function SA(n){let e,t;return{c(){e=b("h4"),t=W(n[0])},m(i,l){w(i,e,l),y(e,t)},p(i,l){l[0]&1&&oe(t,i[0])},d(i){i&&v(e)}}}function cg(n){let e,t;return e=new pe({props:{class:"form-field file-picker-size-select",$$slots:{default:[TA,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,l){j(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function TA(n){let e,t,i;function l(o){n[28](o)}let s={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(s.keyOfSelected=n[12]),e=new In({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function CA(n){var h;let e,t,i,l=U.hasImageExtension((h=n[9])==null?void 0:h.name),s,o,r,a,u,f,c,d,m=l&&cg(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=$(),m&&m.c(),s=$(),o=b("button"),r=b("span"),a=W(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[13]},m(g,_){w(g,e,_),y(e,t),w(g,i,_),m&&m.m(g,_),w(g,s,_),w(g,o,_),y(o,r),y(r,a),f=!0,c||(d=[Y(e,"click",n[2]),Y(o,"click",n[21])],c=!0)},p(g,_){var k;(!f||_[0]&64)&&(e.disabled=g[6]),_[0]&512&&(l=U.hasImageExtension((k=g[9])==null?void 0:k.name)),l?m?(m.p(g,_),_[0]&512&&M(m,1)):(m=cg(g),m.c(),M(m,1),m.m(s.parentNode,s)):m&&(re(),D(m,1,1,()=>{m=null}),ae()),(!f||_[0]&2)&&oe(a,g[1]),(!f||_[0]&8192&&u!==(u=!g[13]))&&(o.disabled=u)},i(g){f||(M(m),f=!0)},o(g){D(m),f=!1},d(g){g&&(v(e),v(i),v(s),v(o)),m&&m.d(g),c=!1,De(d)}}}function $A(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[CA],header:[SA],default:[wA]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=He(o,s[a]);e=new tn({props:o}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]);let r={collection:n[8]};return i=new rf({props:r}),n[36](i),i.$on("save",n[37]),i.$on("delete",n[38]),{c(){z(e.$$.fragment),t=$(),z(i.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),l=!0},p(a,u){const f=u[0]&4194304?wt(s,[s[0],s[1],Ft(a[22])]):{};u[0]&131059|u[1]&8388608&&(f.$$scope={dirty:u,ctx:a}),e.$
2025-02-21 22:54:51 +08:00
form-field form-field-list form-field-file
`+(n[4].required?"required":"")+`
`+(n[9]?"dragover":"")+`
2025-03-20 19:46:40 +08:00
`,name:n[4].name,$$slots:{default:[JA,({uniqueId:o})=>({30:o}),({uniqueId:o})=>[o?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),z(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),j(t,e,null),i=!0,l||(s=[Y(e,"dragover",it(n[27])),Y(e,"dragleave",n[28]),Y(e,"drop",n[14])],l=!0)},p(o,r){const a={};r[0]&528&&(a.class=`
2025-02-21 22:54:51 +08:00
form-field form-field-list form-field-file
`+(o[4].required?"required":"")+`
`+(o[9]?"dragover":"")+`
2025-03-29 03:07:16 +08:00
`),r[0]&16&&(a.name=o[4].name),r[0]&1073743359|r[1]&256&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(M(t.$$.fragment,o),i=!0)},o(o){D(t.$$.fragment,o),i=!1},d(o){o&&v(e),H(t),l=!1,De(s)}}}function GA(n,e,t){let i,l,s,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,m=!1;function h(V){U.removeByValue(f,V),t(2,f)}function g(V){U.pushUnique(f,V),t(2,f)}function _(V){U.isEmpty(u[V])||u.splice(V,1),t(1,u)}function k(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function S(V){var G;V.preventDefault(),t(9,m=!1);const Z=((G=V.dataTransfer)==null?void 0:G.files)||[];if(!(s||!Z.length)){for(const ce of Z){const de=l.length+u.length-f.length;if(r.maxSelect<=de)break;u.push(ce)}t(1,u)}}async function C(V){try{let Z=await he.getSuperuserFileToken(o.collectionId),G=he.files.getURL(o,V,{token:Z});window.open(G,"_blank","noreferrer, noopener")}catch(Z){console.warn("openInNewTab file token failure:",Z)}}const T=V=>C(V),O=V=>C(V),E=V=>h(V),L=V=>g(V);function I(V){a=V,t(0,a),t(6,i),t(4,r)}const A=V=>_(V);function N(V){u=V,t(1,u)}function P(V){ie[V?"unshift":"push"](()=>{c=V,t(7,c)})}const R=()=>{for(let V of c.files)u.push(V);t(1,u),t(7,c.value=null,c)},q=()=>c==null?void 0:c.click();function F(V){ie[V?"unshift":"push"](()=>{d=V,t(8,d)})}const B=()=>{t(9,m=!0)},J=()=>{t(9,m=!1)};return n.$$set=V=>{"record"in V&&t(3,o=V.record),"field"in V&&t(4,r=V.field),"value"in V&&t(0,a=V.value),"uploadedFiles"in V&&t(1,u=V.uploadedFiles),"deletedFileNames"in V&&t(2,f=V.deletedFileNames)},n.$$.update=()=>{n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=U.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=U.toArray(f))),n.$$.dirty[0]&16&&t(6,i=r.maxSelect>1),n.$$.dirty[0]&65&&U.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=U.toArray(a)),n.$$.dirty[0]&54&&t(10,s=(l.length||u.length)&&r.maxSelect<=l.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&k()},[a,u,f,o,r,l,i,c,d,m,s,h,g,_,S,C,T,O,E,L,I,A,N,P,R,q,F,B,J]}class XA extends Se{constructor(e){super(),we(this,e,GA,ZA,ke,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function QA(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function xA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function e7(n){let e,t,i,l;function s(a,u){return a[4]?xA:QA}let o=s(n),r=o(n);return{c(){e=b("span"),r.c(),p(e,"class","json-state svelte-p6ecb8")},m(a,u){w(a,e,u),r.m(e,null),i||(l=$e(t=Fe.call(null,e,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),i=!0)},p(a,u){o!==(o=s(a))&&(r.d(1),r=o(a),r&&(r.c(),r.m(e,null))),t&&It(t.update)&&u&16&&t.update.call(null,{position:"left",text:a[4]?"Valid JSON":"Invalid JSON"})},d(a){a&&v(e),r.d(),i=!1,l()}}}function t7(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function n7(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=Bt(l,s(n)),e.$on("change",n[5])),{c(){e&&z(e.$$.fragment),t=ge()},m(o,r){e&&j(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){re();const a=e;D(a.$$.fragment,1,0,()=>{H(a,1)}),ae()}l?(e=Bt(l,s(o)),e.$on("change",o[5]),z(e.$$.fragment),M(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&M(e.$$.fragment,o),i=!0)},o(o){e&&D(e.$$.fragment,o),i=!1},d(o){o&&v(t),e&&H(e,o)}}}function i7(n){let e,t,i,l,s,o;e=new si({props:{uniqueId:n[6],field:n[1],$$slots:{default:[e7]},$$scope:{ctx:n}}});const r=[n7,t7],a=[];function u(f,c){return f[3]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){z(e.$$.fragment),t=$(),l.c(),s=ge()},m(f,c){j(e,f,c),w(f,t,c),a[i].m(f,c),w(f,s,c),o=!0},p(f,c){const d={};c&64&&(d.uniqueId=f[6]),c&2&&(d.field=f[1]),c&144&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);let m=i;i=u(f),i===m?a[i].p(f,c):(re(),
2025-03-20 19:46:40 +08:00
`),A&&A.c(),m=$(),g.c(),_=ge(),p(e,"class","flex m-b-base flex-gap-10"),p(s,"class","list picker-list m-b-base svelte-1u8jhky"),p(c,"class","section-title")},m(q,F){w(q,e,F),j(t,e,null),y(e,i),T&&T.m(e,null),w(q,l,F),w(q,s,F);for(let B=0;B<o.length;B+=1)o[B]&&o[B].m(s,null);L&&L.m(s,null),y(s,a),I&&I.m(s,null),w(q,f,F),w(q,c,F),y(c,d),A&&A.m(c,null),w(q,m,F),P[h].m(q,F),w(q,_,F),k=!0,S||(C=$e(u=h7.call(null,s,n[38])),S=!0)},p(q,F){const B={};F[0]&4&&(B.value=q[2]),F[0]&32&&(B.autocompleteCollection=q[5]),t.$set(B),q[12]?T&&(T.d(1),T=null):T?T.p(q,F):(T=vg(q),T.c(),T.m(e,null)),F[0]&548756&&(O=fe(q[8]),re(),o=bt(o,F,E,1,q,O,r,s,Wt,$g,a,yg),ae(),!O.length&&L?L.p(q,F):O.length?L&&(L.d(1),L=null):(L=wg(q),L.c(),L.m(s,a))),q[14]?I||(I=Og(),I.c(),I.m(s,null)):I&&(I.d(1),I=null),u&&It(u.update)&&F[0]&8200&&u.update.call(null,q[38]),q[4]>1?A?A.p(q,F):(A=Mg(q),A.c(),A.m(c,null)):A&&(A.d(1),A=null);let J=h;h=R(q),h===J?P[h].p(q,F):(re(),D(P[J],1,1,()=>{P[J]=null}),ae(),g=P[h],g?g.p(q,F):(g=P[h]=N[h](q),g.c()),M(g,1),g.m(_.parentNode,_))},i(q){if(!k){M(t.$$.fragment,q);for(let F=0;F<O.length;F+=1)M(o[F]);M(g),k=!0}},o(q){D(t.$$.fragment,q);for(let F=0;F<o.length;F+=1)D(o[F]);D(g),k=!1},d(q){q&&(v(e),v(l),v(s),v(f),v(c),v(m),v(_)),H(t),T&&T.d();for(let F=0;F<o.length;F+=1)o[F].d();L&&L.d(),I&&I.d(),A&&A.d(),P[h].d(q),S=!1,C()}}}function $7(n){var r;let e,t,i,l=(((r=n[5])==null?void 0:r.name)||"")+"",s,o;return{c(){e=b("h4"),t=W("Select "),i=b("strong"),s=W(l),o=W(" records")},m(a,u){w(a,e,u),y(e,t),y(e,i),y(i,s),y(e,o)},p(a,u){var f;u[0]&32&&l!==(l=(((f=a[5])==null?void 0:f.name)||"")+"")&&oe(s,l)},d(a){a&&v(e)}}}function O7(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=$(),i=b("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),l||(s=[Y(e,"click",n[30]),Y(i,"click",n[31])],l=!0)},p:te,d(o){o&&(v(e),v(t),v(i)),l=!1,De(s)}}}function M7(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[21]];let o={$$slots:{footer:[O7],header:[$7],default:[C7]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=He(o,s[a]);e=new tn({props:o}),n[41](e),e.$on("hide",n[42]),e.$on("show",n[43]);let r={collection:n[5]};return i=new rf({props:r}),n[44](i),i.$on("save",n[45]),i.$on("delete",n[46]),{c(){z(e.$$.fragment),t=$(),z(i.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),l=!0},p(a,u){const f=u[0]&2097152?wt(s,[s[0],s[1],Ft(a[21])]):{};u[0]&32764|u[1]&268435456&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&32&&(c.collection=a[5]),i.$set(c)},i(a){l||(M(e.$$.fragment,a),M(i.$$.fragment,a),l=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),l=!1},d(a){a&&v(t),n[41](null),H(e,a),n[44](null),H(i,a)}}}const Zo=50;function E7(n,e,t){let i,l,s,o,r,a,u,f;const c=["value","field","show","hide"];let d=st(e,c),m;Xe(n,Dn,Pe=>t(28,m=Pe));const h=yt(),g="picker_"+U.randomString(5);let{value:_}=e,{field:k}=e,S,C,T="",O=[],E=[],L=1,I=0,A=!1,N=!1,P={};function R(){return t(2,T=""),t(8,O=[]),t(6,E=[]),B(),J(!0),S==null?void 0:S.show()}function q(){return S==null?void 0:S.hide()}function F(){var _t;let Pe=[];const Oe=(_t=s==null?void 0:s.fields)==null?void 0:_t.filter(zt=>!zt.hidden&&zt.presentable&&zt.type=="relation");for(const zt of Oe)Pe=Pe.concat(U.getExpandPresentableRelFields(zt,m,2));return Pe.join(",")}async function B(){const Pe=U.toArray(_);if(!l||!Pe.length)return;t(26,N=!0);let Oe=[];const _t=Pe.slice(),zt=[];for(;_t.length>0;){const Lt=[];for(const Ne of _t.splice(0,Zo))Lt.push(`id="${Ne}"`);zt.push(he.collection(l).getFullList({batch:Zo,filter:Lt.join("||"),fields:"*:excerpt(200)",expand:F(),requestKey:null}))}try{await Promise.all(zt).then(Lt=>{Oe=Oe.concat(...Lt)}),t(6,E=[]);for(const Lt of Pe){const Ne=U.findByKey(Oe,"id",Lt);Ne&&E.push(Ne)}T.trim()||t(8,O=U.filterDuplicatesByKey(E.concat(O))),t(26,N=!1)}catch(Lt){Lt.isAbort||(he.error(Lt),t(26,N=!1))}}async function J(Pe=!1){if(l){t(3,A=!0),Pe&&(T.trim()?t(8,O=[]):t(8,O=U.toArray(E).slice()));try{co
`),s=b("strong"),r=W(o),a=W(":"),u=$(),z(f.$$.fragment),p(t,"class","content"),p(e,"id",n[8])},m(h,g){w(h,e,g),y(e,t),y(t,i),y(i,l),y(i,s),y(s,r),y(s,a),y(e,u),j(f,e,null),c=!0,d||(m=Y(e,"submit",it(n[9])),d=!0)},p(h,g){(!c||g&2)&&o!==(o=U.displayValue(h[1])+"")&&oe(r,o);const _={};g&3145761&&(_.$$scope={dirty:g,ctx:h}),f.$set(_)},i(h){c||(M(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&v(e),H(f),d=!1,m()}}}function nN(n){let e,t,i,l=n[3].authStore.token+"",s,o,r,a,u,f;return r=new $i({props:{value:n[3].authStore.token}}),u=new eN({props:{class:"m-b-0",js:`
2025-02-21 22:54:51 +08:00
import PocketBase from 'pocketbase';
const token = "...";
const pb = new PocketBase('${n[7]}');
pb.authStore.save(token, null);
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final token = "...";
final pb = PocketBase('${n[7]}');
pb.authStore.save(token, null);
2025-03-20 19:46:40 +08:00
`}}),{c(){e=b("div"),t=b("div"),i=b("span"),s=W(l),o=$(),z(r.$$.fragment),a=$(),z(u.$$.fragment),p(i,"class","txt token-holder svelte-1i56uix"),p(t,"class","content txt-bold"),p(e,"class","alert alert-success")},m(c,d){w(c,e,d),y(e,t),y(t,i),y(i,s),y(t,o),j(r,t,null),w(c,a,d),j(u,c,d),f=!0},p(c,d){(!f||d&8)&&l!==(l=c[3].authStore.token+"")&&oe(s,l);const m={};d&8&&(m.value=c[3].authStore.token),r.$set(m);const h={};d&128&&(h.js=`
2025-02-21 22:54:51 +08:00
import PocketBase from 'pocketbase';
const token = "...";
const pb = new PocketBase('${c[7]}');
pb.authStore.save(token, null);
`),d&128&&(h.dart=`
import 'package:pocketbase/pocketbase.dart';
final token = "...";
final pb = PocketBase('${c[7]}');
pb.authStore.save(token, null);
2025-03-20 19:46:40 +08:00
`),u.$set(h)},i(c){f||(M(r.$$.fragment,c),M(u.$$.fragment,c),f=!0)},o(c){D(r.$$.fragment,c),D(u.$$.fragment,c),f=!1},d(c){c&&(v(e),v(a)),H(r),H(u,c)}}}function iN(n){let e,t,i,l,s,o,r,a,u,f;return{c(){var c,d;e=b("label"),t=W("Token duration (in seconds)"),l=$(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","number"),p(s,"id",o=n[20]),p(s,"placeholder",r="Default to the collection setting ("+(((d=(c=n[0])==null?void 0:c.authToken)==null?void 0:d.duration)||0)+"s)"),p(s,"min","0"),p(s,"step","1"),s.value=a=n[5]||""},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),u||(f=Y(s,"input",n[14]),u=!0)},p(c,d){var m,h;d&1048576&&i!==(i=c[20])&&p(e,"for",i),d&1048576&&o!==(o=c[20])&&p(s,"id",o),d&1&&r!==(r="Default to the collection setting ("+(((h=(m=c[0])==null?void 0:m.authToken)==null?void 0:h.duration)||0)+"s)")&&p(s,"placeholder",r),d&32&&a!==(a=c[5]||"")&&s.value!==a&&(s.value=a)},d(c){c&&(v(e),v(l),v(s)),u=!1,f()}}}function lN(n){let e,t,i,l,s,o;const r=[nN,tN],a=[];function u(f,c){var d,m;return(m=(d=f[3])==null?void 0:d.authStore)!=null&&m.token?0:1}return i=u(n),l=a[i]=r[i](n),{c(){e=b("div"),t=$(),l.c(),s=ge(),p(e,"class","clearfix")},m(f,c){w(f,e,c),w(f,t,c),a[i].m(f,c),w(f,s,c),o=!0},p(f,c){let d=i;i=u(f),i===d?a[i].p(f,c):(re(),D(a[d],1,1,()=>{a[d]=null}),ae(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),M(l,1),l.m(s.parentNode,s))},i(f){o||(M(l),o=!0)},o(f){D(l),o=!1},d(f){f&&(v(e),v(t),v(s)),a[i].d(f)}}}function sN(n){let e;return{c(){e=b("h4"),e.textContent="Impersonate auth token"},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function oN(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Generate token",p(t,"class","txt"),p(e,"type","submit"),p(e,"form",n[8]),p(e,"class","btn btn-expanded"),e.disabled=n[6],x(e,"btn-loading",n[6])},m(s,o){w(s,e,o),y(e,t),i||(l=Y(e,"click",n[13]),i=!0)},p(s,o){o&64&&(e.disabled=s[6]),o&64&&x(e,"btn-loading",s[6])},d(s){s&&v(e),i=!1,l()}}}function rN(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Generate a new one",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded"),e.disabled=n[6]},m(s,o){w(s,e,o),y(e,t),i||(l=Y(e,"click",n[12]),i=!0)},p(s,o){o&64&&(e.disabled=s[6])},d(s){s&&v(e),i=!1,l()}}}function aN(n){let e,t,i,l,s,o;function r(f,c){var d,m;return(m=(d=f[3])==null?void 0:d.authStore)!=null&&m.token?rN:oN}let a=r(n),u=a(n);return{c(){e=b("button"),t=b("span"),t.textContent="Close",i=$(),u.c(),l=ge(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[6]},m(f,c){w(f,e,c),y(e,t),w(f,i,c),u.m(f,c),w(f,l,c),s||(o=Y(e,"click",n[2]),s=!0)},p(f,c){c&64&&(e.disabled=f[6]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l.parentNode,l)))},d(f){f&&(v(e),v(i),v(l)),u.d(f),s=!1,o()}}}function uN(n){let e,t,i={overlayClose:!1,escClose:!n[6],beforeHide:n[15],popup:!0,$$slots:{footer:[aN],header:[sN],default:[lN]},$$scope:{ctx:n}};return e=new tn({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){z(e.$$.fragment)},m(l,s){j(e,l,s),t=!0},p(l,[s]){const o={};s&64&&(o.escClose=!l[6]),s&64&&(o.beforeHide=l[15]),s&2097387&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),H(e,l)}}}function fN(n,e,t){let i;const l=yt(),s="impersonate_"+U.randomString(5);let{collection:o}=e,{record:r}=e,a,u=0,f=!1,c;function d(){r&&(g(),a==null||a.show())}function m(){a==null||a.hide(),g()}async function h(){if(!(f||!o||!r)){t(6,f=!0);try{t(3,c=await he.collection(o.name).impersonate(r.id,u)),l("submit",c)}catch(L){he.error(L)}t(6,f=!1)}}function g(){t(5,u=0),t(3,c=void 0)}const _=()=>g(),k=()=>h(),S=L=>t(5,u=L.target.value<<0),C=()=>!f;function T(L){ie[L?"unshift":"push"](()=>{a=L,t(4,a)})}function O(L){Ae.call(this,n,L)}function E(L){Ae.call(this,n,L)}return n.$$set=L=>{"collection"in L&&t(0,o=L.collection),"record"in L&&t(1,r=L.record)},n.$$.update=()=>{n.$$.dirty&8&&t(7,i=U.getApiExampleUrl(c==null?void 0:c.baseURL))},[o,r,m,c,a,u,f,i,s,h,g,d,_,k,S,C,T,O,E]}class cN extends Se{constructor(e){super(),we(this,e,fN,uN,ke,{collectio
`),r=b("button"),r.textContent="Restore draft",a=$(),u=b("button"),u.innerHTML='<i class="ri-close-line"></i>',f=$(),c=b("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(s,"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(_,k){w(_,e,k),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),y(s,r),y(t,a),y(t,u),y(e,f),y(e,c),m=!0,h||(g=[Y(r,"click",n[48]),$e(Fe.call(null,u,"Discard draft")),Y(u,"click",it(n[49]))],h=!0)},p:te,i(_){m||(d&&d.end(1),m=!0)},o(_){_&&(d=_u(e,pt,{duration:150})),m=!1},d(_){_&&v(e),_&&d&&d.end(),h=!1,De(g)}}}function Yg(n){let e,t,i;return t=new qL({props:{record:n[3]}}),{c(){e=b("div"),z(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){w(l,e,s),j(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&v(e),H(t)}}}function dN(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,C=!n[6]&&Yg(n);return{c(){var T,O,E;e=b("label"),t=b("i"),i=$(),l=b("span"),l.textContent="id",s=$(),o=b("span"),a=$(),C&&C.c(),u=$(),f=b("input"),p(t,"class",zs(U.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[87]),p(f,"type","text"),p(f,"id",c=n[87]),p(f,"placeholder",d=!n[7]&&!U.isEmpty((T=n[19])==null?void 0:T.autogeneratePattern)?"Leave empty to auto generate...":""),p(f,"minlength",m=((O=n[19])==null?void 0:O.min)||null),p(f,"maxlength",h=((E=n[19])==null?void 0:E.max)||null),f.readOnly=g=!n[6]},m(T,O){w(T,e,O),y(e,t),y(e,i),y(e,l),y(e,s),y(e,o),w(T,a,O),C&&C.m(T,O),w(T,u,O),w(T,f,O),_e(f,n[3].id),_=!0,k||(S=Y(f,"input",n[50]),k=!0)},p(T,O){var E,L,I;(!_||O[2]&33554432&&r!==(r=T[87]))&&p(e,"for",r),T[6]?C&&(re(),D(C,1,1,()=>{C=null}),ae()):C?(C.p(T,O),O[0]&64&&M(C,1)):(C=Yg(T),C.c(),M(C,1),C.m(u.parentNode,u)),(!_||O[2]&33554432&&c!==(c=T[87]))&&p(f,"id",c),(!_||O[0]&524416&&d!==(d=!T[7]&&!U.isEmpty((E=T[19])==null?void 0:E.autogeneratePattern)?"Leave empty to auto generate...":""))&&p(f,"placeholder",d),(!_||O[0]&524288&&m!==(m=((L=T[19])==null?void 0:L.min)||null))&&p(f,"minlength",m),(!_||O[0]&524288&&h!==(h=((I=T[19])==null?void 0:I.max)||null))&&p(f,"maxlength",h),(!_||O[0]&64&&g!==(g=!T[6]))&&(f.readOnly=g),O[0]&8&&f.value!==T[3].id&&_e(f,T[3].id)},i(T){_||(M(C),_=!0)},o(T){D(C),_=!1},d(T){T&&(v(e),v(a),v(u),v(f)),C&&C.d(T),k=!1,S()}}}function Kg(n){let e,t,i,l,s;function o(u){n[51](u)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new nA({props:r}),ie.push(()=>be(e,"record",o));let a=n[16].length&&Jg();return{c(){z(e.$$.fragment),i=$(),a&&a.c(),l=ge()},m(u,f){j(e,u,f),w(u,i,f),a&&a.m(u,f),w(u,l,f),s=!0},p(u,f){const c={};f[0]&64&&(c.isNew=u[6]),f[0]&1&&(c.collection=u[0]),!t&&f[0]&8&&(t=!0,c.record=u[3],Ce(()=>t=!1)),e.$set(c),u[16].length?a||(a=Jg(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(u){s||(M(e.$$.fragment,u),s=!0)},o(u){D(e.$$.fragment,u),s=!1},d(u){u&&(v(i),v(l)),H(e,u),a&&a.d(u)}}}function Jg(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function pN(n){let e,t,i;function l(o){n[65](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new m7({props:s}),ie.push(()=>be(e,"value",l)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function mN(n){let e,t,i;function l(o){n[64](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new R7({props:s}),ie.push(()=>be(e,"value",l)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].na
2025-02-21 22:54:51 +08:00
record-panel
`+(n[20]?"overlay-panel-xl":"overlay-panel-lg")+`
`+(n[9]&&!n[17]&&!n[6]?"colored-header":"")+`
2025-03-20 19:46:40 +08:00
`,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[66],$$slots:{footer:[IN],header:[EN],default:[CN]},$$scope:{ctx:n}};e=new tn({props:s}),n[67](e),e.$on("hide",n[68]),e.$on("show",n[69]);let o=n[9]&&i1(n);return{c(){z(e.$$.fragment),t=$(),o&&o.c(),i=ge()},m(r,a){j(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),l=!0},p(r,a){const u={};a[0]&1180224&&(u.class=`
2025-02-21 22:54:51 +08:00
record-panel
`+(r[20]?"overlay-panel-xl":"overlay-panel-lg")+`
`+(r[9]&&!r[17]&&!r[6]?"colored-header":"")+`
2025-03-20 19:46:40 +08:00
`),a[0]&128&&(u.btnClose=!r[7]),a[0]&128&&(u.escClose=!r[7]),a[0]&128&&(u.overlayClose=!r[7]),a[0]&16640&&(u.beforeHide=r[66]),a[0]&1031165|a[2]&67108864&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[9]?o?(o.p(r,a),a[0]&512&&M(o,1)):(o=i1(r),o.c(),M(o,1),o.m(i.parentNode,i)):o&&(re(),D(o,1,1,()=>{o=null}),ae())},i(r){l||(M(e.$$.fragment,r),M(o),l=!0)},o(r){D(e.$$.fragment,r),D(o),l=!1},d(r){r&&(v(t),v(i)),n[67](null),H(e,r),o&&o.d(r)}}}const El="form",io="providers";function AN(n,e,t){let i,l,s,o,r,a,u,f;const c=yt(),d="record_"+U.randomString(5);let{collection:m}=e,h,g,_={},k={},S=null,C=!1,T=!1,O={},E={},L=JSON.stringify(_),I=L,A=El,N=!0,P=!0,R=m,q=[];const F=["id"],B=F.concat("email","emailVisibility","verified","tokenKey","password");function J(se){return de(se),t(14,T=!0),t(15,A=El),h==null?void 0:h.show()}function V(){return h==null?void 0:h.hide()}function Z(){t(14,T=!1),V()}function G(){t(35,R=m),h!=null&&h.isActive()&&(Je(JSON.stringify(k)),Z())}async function ce(se){if(!se)return null;let Me=typeof se=="string"?se:se==null?void 0:se.id;if(Me)try{return await he.collection(m.id).getOne(Me)}catch(Re){Re.isAbort||(Z(),console.warn("resolveModel:",Re),Oi(`Unable to load record with id "${Me}"`))}return typeof se=="object"?se:null}async function de(se){t(7,P=!0),Yt({}),t(4,O={}),t(5,E={}),t(2,_=typeof se=="string"?{id:se,collectionId:m==null?void 0:m.id,collectionName:m==null?void 0:m.name}:se||{}),t(3,k=structuredClone(_)),t(2,_=await ce(se)||{}),t(3,k=structuredClone(_)),await mn(),t(12,S=Ke()),!S||et(k,S)?t(12,S=null):(delete S.password,delete S.passwordConfirm),t(33,L=JSON.stringify(k)),t(7,P=!1)}async function ue(se){var Re,ze;Yt({}),t(2,_=se||{}),t(4,O={}),t(5,E={});const Me=((ze=(Re=m==null?void 0:m.fields)==null?void 0:Re.filter(Ge=>Ge.type!="file"))==null?void 0:ze.map(Ge=>Ge.name))||[];for(let Ge in se)Me.includes(Ge)||t(3,k[Ge]=se[Ge],k);await mn(),t(33,L=JSON.stringify(k)),xe()}function Te(){return"record_draft_"+((m==null?void 0:m.id)||"")+"_"+((_==null?void 0:_.id)||"")}function Ke(se){try{const Me=window.localStorage.getItem(Te());if(Me)return JSON.parse(Me)}catch{}return se}function Je(se){try{window.localStorage.setItem(Te(),se)}catch(Me){console.warn("updateDraft failure:",Me),window.localStorage.removeItem(Te())}}function ft(){S&&(t(3,k=S),t(12,S=null))}function et(se,Me){var jt;const Re=structuredClone(se||{}),ze=structuredClone(Me||{}),Ge=(jt=m==null?void 0:m.fields)==null?void 0:jt.filter(Tn=>Tn.type==="file");for(let Tn of Ge)delete Re[Tn.name],delete ze[Tn.name];const nn=["expand","password","passwordConfirm"];for(let Tn of nn)delete Re[Tn],delete ze[Tn];return JSON.stringify(Re)==JSON.stringify(ze)}function xe(){t(12,S=null),window.localStorage.removeItem(Te())}async function We(se=!0){var Me;if(!(C||!u||!(m!=null&&m.id))){t(13,C=!0);try{const Re=Vt();let ze;if(N?ze=await he.collection(m.id).create(Re):ze=await he.collection(m.id).update(k.id,Re),en(N?"Successfully created record.":"Successfully updated record."),xe(),l&&(k==null?void 0:k.id)==((Me=he.authStore.record)==null?void 0:Me.id)&&Re.get("password"))return he.logout();se?Z():ue(ze),c("save",{isNew:N,record:ze})}catch(Re){he.error(Re)}t(13,C=!1)}}function at(){_!=null&&_.id&&kn("Do you really want to delete the selected record?",()=>he.collection(_.collectionId).delete(_.id).then(()=>{Z(),en("Successfully deleted record."),c("delete",_)}).catch(se=>{he.error(se)}))}function Vt(){const se=structuredClone(k||{}),Me=new FormData,Re={},ze={};for(const Ge of(m==null?void 0:m.fields)||[])Ge.type=="autodate"||i&&Ge.type=="password"||(Re[Ge.name]=!0,Ge.type=="json"&&(ze[Ge.name]=!0));i&&se.password&&(Re.password=!0),i&&se.passwordConfirm&&(Re.passwordConfirm=!0);for(const Ge in se)if(Re[Ge]){if(typeof se[Ge]>"u"&&(se[Ge]=null),ze[Ge]&&se[Ge]!=="")try{JSON.parse(se[Ge])}catch(nn){const jt={};throw jt[Ge]={code:"invalid_json",message:nn.toString()},new jn({status:400,response:{data:jt}})}U.addValueToFormData(Me,Ge,se[Ge])}for(const Ge in O){const nn=U.toArray(O[Ge]);for(const jt of nn)Me.append(Ge+"+",jt)}for(const Ge in E){const nn=U.toArray(
`);for(let O=0;O<T.length;O+=1)T[O].c();p(e,"for",i=n[16]),p(u,"type","button"),p(u,"class","btn btn-sm btn-hint btn-transparent btn-clear"),x(u,"hidden",U.isEmpty(n[0].trustedProxy.headers)),p(a,"class","form-field-addon"),p(c,"class","help-block")},m(O,E){w(O,e,E),y(e,t),w(O,l,E),j(s,O,E),w(O,r,E),w(O,a,E),y(a,u),w(O,f,E),w(O,c,E),y(c,d),y(d,m);for(let L=0;L<T.length;L+=1)T[L]&&T[L].m(d,null);h=!0,g||(_=Y(u,"click",n[12]),g=!0)},p(O,E){(!h||E&65536&&i!==(i=O[16]))&&p(e,"for",i);const L={};if(E&65536&&(L.id=O[16]),!o&&E&1&&(o=!0,L.value=O[0].trustedProxy.headers,Ce(()=>o=!1)),s.$set(L),(!h||E&1)&&x(u,"hidden",U.isEmpty(O[0].trustedProxy.headers)),E&68){C=fe(O[2]);let I;for(I=0;I<C.length;I+=1){const A=T1(O,C,I);T[I]?T[I].p(A,E):(T[I]=C1(A),T[I].c(),T[I].m(d,null))}for(;I<T.length;I+=1)T[I].d(1);T.length=C.length}},i(O){h||(M(s.$$.fragment,O),h=!0)},o(O){D(s.$$.fragment,O),h=!1},d(O){O&&(v(e),v(l),v(r),v(a),v(f),v(c)),H(s,O),ct(T,O),g=!1,_()}}}function OP(n){let e,t,i,l,s,o,r,a,u,f,c;function d(h){n[14](h)}let m={items:n[7]};return n[0].trustedProxy.useLeftmostIP!==void 0&&(m.keyOfSelected=n[0].trustedProxy.useLeftmostIP),r=new In({props:m}),ie.push(()=>be(r,"keyOfSelected",d)),{c(){e=b("label"),t=b("span"),t.textContent="IP priority selection",i=$(),l=b("i"),o=$(),z(r.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[16])},m(h,g){w(h,e,g),y(e,t),y(e,i),y(e,l),w(h,o,g),j(r,h,g),u=!0,f||(c=$e(Fe.call(null,l,{text:"This is in case the proxy returns more than 1 IP as header value. The rightmost IP is usually considered to be the more trustworthy but this could vary depending on the proxy.",position:"right"})),f=!0)},p(h,g){(!u||g&65536&&s!==(s=h[16]))&&p(e,"for",s);const _={};!a&&g&1&&(a=!0,_.keyOfSelected=h[0].trustedProxy.useLeftmostIP,Ce(()=>a=!1)),r.$set(_)},i(h){u||(M(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(v(e),v(o)),H(r,h),f=!1,c()}}}function MP(n){let e,t,i,l,s,o,r=(n[1].realIP||"N/A")+"",a,u,f,c,d,m,h,g,_,k,S=(n[1].possibleProxyHeader||"N/A")+"",C,T,O,E,L,I,A,N,P,R,q,F,B;return A=new pe({props:{class:"form-field m-b-0",name:"trustedProxy.headers",$$slots:{default:[$P,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),R=new pe({props:{class:"form-field m-0",name:"trustedProxy.useLeftmostIP",$$slots:{default:[OP,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("span"),l.textContent="Resolved user IP:",s=$(),o=b("strong"),a=W(r),u=$(),f=b("i"),c=$(),d=b("br"),m=$(),h=b("div"),g=b("span"),g.textContent="Detected proxy header:",_=$(),k=b("strong"),C=W(S),T=$(),O=b("div"),O.innerHTML=`<p>When PocketBase is deployed on platforms like Fly or it is accessible through proxies such as
2025-02-21 22:54:51 +08:00
NGINX, requests from different users will originate from the same IP address (the IP of the proxy
connecting to your PocketBase app).</p> <p>In this case to retrieve the actual user IP (used for rate limiting, logging, etc.) you need to
properly configure your proxy and list below the trusted headers that PocketBase could use to
2025-03-20 19:46:40 +08:00
extract the user IP.</p> <p class="txt-bold">When using such proxy, to avoid spoofing it is recommended to:</p> <ul class="m-t-0 txt-bold"><li>use headers that are controlled only by the proxy and cannot be manually set by the users</li> <li>make sure that the PocketBase server can be accessed only through the proxy</li></ul> <p>You can clear the headers field if PocketBase is not deployed behind a proxy.</p>`,E=$(),L=b("div"),I=b("div"),z(A.$$.fragment),N=$(),P=b("div"),z(R.$$.fragment),p(f,"class","ri-information-line txt-sm link-hint"),p(i,"class","inline-flex flex-gap-5"),p(h,"class","inline-flex flex-gap-5"),p(t,"class","content"),p(e,"class","alert alert-info m-b-sm"),p(O,"class","content m-b-sm"),p(I,"class","col-lg-9"),p(P,"class","col-lg-3"),p(L,"class","grid grid-sm")},m(J,V){w(J,e,V),y(e,t),y(t,i),y(i,l),y(i,s),y(i,o),y(o,a),y(i,u),y(i,f),y(t,c),y(t,d),y(t,m),y(t,h),y(h,g),y(h,_),y(h,k),y(k,C),w(J,T,V),w(J,O,V),w(J,E,V),w(J,L,V),y(L,I),j(A,I,null),y(L,N),y(L,P),j(R,P,null),q=!0,F||(B=$e(Fe.call(null,f,`Must show your actual IP.
If not, set the correct proxy header.`)),F=!0)},p(J,V){(!q||V&2)&&r!==(r=(J[1].realIP||"N/A")+"")&&oe(a,r),(!q||V&2)&&S!==(S=(J[1].possibleProxyHeader||"N/A")+"")&&oe(C,S);const Z={};V&1114117&&(Z.$$scope={dirty:V,ctx:J}),A.$set(Z);const G={};V&1114113&&(G.$$scope={dirty:V,ctx:J}),R.$set(G)},i(J){q||(M(A.$$.fragment,J),M(R.$$.fragment,J),q=!0)},o(J){D(A.$$.fragment,J),D(R.$$.fragment,J),q=!1},d(J){J&&(v(e),v(T),v(O),v(E),v(L)),H(A),H(R),F=!1,B()}}}function EP(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm txt-hint")},m(l,s){w(l,e,s),t||(i=$e(Fe.call(null,e,"The configured proxy header doesn't match with the detected one.")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function DP(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm txt-warning")},m(l,s){w(l,e,s),t||(i=$e(Fe.call(null,e,`Detected proxy header.
It is recommend to list it as trusted.`)),t=!0)},d(l){l&&v(e),t=!1,i()}}}function IP(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function LP(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function $1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=$e(Fe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function AP(n){let e,t,i,l,s,o,r,a,u,f,c;function d(C,T){if(T&43&&(o=null),!C[3]&&C[1].possibleProxyHeader)return DP;if(o==null&&(o=!!(C[3]&&!C[5]&&!C[0].trustedProxy.headers.includes(C[1].possibleProxyHeader))),o)return EP}let m=d(n,-1),h=m&&m(n);function g(C,T){return C[3]?LP:IP}let _=g(n),k=_(n),S=n[4]&&$1();return{c(){e=b("div"),t=b("i"),i=$(),l=b("span"),l.textContent="User IP proxy headers",s=$(),h&&h.c(),r=$(),a=b("div"),u=$(),k.c(),f=$(),S&&S.c(),c=ge(),p(t,"class","ri-route-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(a,"class","flex-fill")},m(C,T){w(C,e,T),y(e,t),y(e,i),y(e,l),y(e,s),h&&h.m(e,null),w(C,r,T),w(C,a,T),w(C,u,T),k.m(C,T),w(C,f,T),S&&S.m(C,T),w(C,c,T)},p(C,T){m!==(m=d(C,T))&&(h&&h.d(1),h=m&&m(C),h&&(h.c(),h.m(e,null))),_!==(_=g(C))&&(k.d(1),k=_(C),k&&(k.c(),k.m(f.parentNode,f))),C[4]?S?T&16&&M(S,1):(S=$1(),S.c(),M(S,1),S.m(c.parentNode,c)):S&&(re(),D(S,1,1,()=>{S=null}),ae())},d(C){C&&(v(e),v(r),v(a),v(u),v(f),v(c)),h&&h.d(),k.d(C),S&&S.d(C)}}}function NP(n){let e,t;return e=new zi({props:{single:!0,$$slots:{header:[AP],default:[MP]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,l){j(e,i,l),t=!0},p(i,[l]){const s={};l&1048639&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function PP(n,e,t){let i,l,s,o,r,a;Xe(n,Sn,C=>t(10,a=C));const u=["X-Forwarded-For","Fly-Client-IP","CF-Connecting-IP"];let{formSettings:f}=e,{healthData:c}=e,d="";function m(C){t(0,f.trustedProxy.headers=[C],f)}const h=[{label:"Use leftmost IP",value:!0},{label:"Use rightmost IP",value:!1}];function g(C){n.$$.not_equal(f.trustedProxy.headers,C)&&(f.trustedProxy.headers=C,t(0,f))}const _=()=>t(0,f.trustedProxy.headers=[],f),k=C=>m(C);function S(C){n.$$.not_equal(f.trustedProxy.useLeftmostIP,C)&&(f.trustedProxy.useLeftmostIP=C,t(0,f))}return n.$$set=C=>{"formSettings"in C&&t(0,f=C.formSettings),"healthData"in C&&t(1,c=C.healthData)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=JSON.stringify(f)),n.$$.dirty&768&&d!=i&&t(8,d=i),n.$$.dirty&768&&t(5,l=d!=i),n.$$.dirty&1024&&t(4,s=!U.isEmpty(a==null?void 0:a.trustedProxy)),n.$$.dirty&1&&t(3,o=!U.isEmpty(f.trustedProxy.headers)),n.$$.dirty&2&&t(2,r=c.possibleProxyHeader?[c.possibleProxyHeader].concat(u.filter(C=>C!=c.possibleProxyHeader)):u)},[f,c,r,o,s,l,m,h,d,i,a,g,_,k,S]}class RP extends Se{constructor(e){super(),we(this,e,PP,NP,ke,{formSettings:0,healthData:1})}}function O1(n,e,t){const i=n.slice();return i[5]=e[t],i}function M1(n){let e,t=(n[5].label||"")+"",i,l;return{c(){e=b("option"),i=W(t),e.__value=l=n[5].value,_e(e,e.__value)},m(s,o){w(s,e,o),y(e,i)},p(s,o){o&2&&t!==(t=(s[5].label||"")+"")&&oe(i,t),o&2&&l!==(l=s[5].value)&&(e.__value=l,_e(e,e.__value))},d(s){s&&v(e)}}}function FP(n){let e,t,i,l,s,o,r=[{type:t=n[3].type||"text"},{list:n[2]},{value:n[0]},n[3]],a={};for(let c=0;c<r.length;c+=1)a=He(a,r[c]);let u=fe(n[1]),f=[];for(let c=0;c<u.length;c+=1)f[c]=M1(O1(n,u,c));return{c(){e=b("input"),i=$(),l=b("datalist");for(let c=0;c<f.length;c+=1)f[c].c();ei(e,a),p(l,"id",n[2])},m(c,d){w(c,e,d),"value"in a&&(e.value=a.value),e.autofocus&&e.focus(),w(c,i,d),w(c,l,d);for(let m=0;m<f.length;m+=1)f[m]&&f[m].m(l,null);s||(o=Y(e,"input",n[4]),s=!0)},p(c,[d]){if(ei(e,a=wt(r,[d&8&&t!==(t=c[3].type||"text")&&{type:t},{list:c[2]},d&1&&e.value!==c[0]&&{value:c[0]},d&8&&c[3]])),"value"in a&&(e.value=a.value),d&2){u=fe(c[1]
"auth"), only the matching audience rule is taken in consideration.`,o=$(),r=b("hr"),a=$(),u=b("p"),u.textContent="The rate limit label could be in one of the following formats:",f=$(),c=b("ul"),d=b("li"),d.innerHTML=`<code>[METHOD ]/my/path</code> - full exact route match (
2025-02-21 22:54:51 +08:00
<strong>must be without trailing slash </strong>; &quot;METHOD&quot; is optional).
<br/> For example:
2025-03-20 19:46:40 +08:00
<ul class="m-0"><li class="m-0"><code>/hello</code> - matches <code>GET /hello</code>, <code>POST /hello</code>, etc.</li> <li class="m-0"><code>POST /hello</code> - matches only <code>POST /hello</code></li></ul>`,m=$(),h=b("li"),h.innerHTML=`<code>[METHOD ]/my/prefix<strong>/</strong></code> - path prefix (
2025-02-21 22:54:51 +08:00
<strong>must end with trailing slash;</strong>
&quot;METHOD&quot; is optional). For example:
<ul class="m-0"><li class="m-0"><code>/hello/</code> - matches <code>GET /hello</code>,
<code>POST /hello/a/b/c</code>, etc.</li> <li class="m-0"><code>POST /hello/</code> - matches <code>POST /hello</code>,
2025-03-20 19:46:40 +08:00
<code>POST /hello/a/b/c</code>, etc.</li></ul>`,g=$(),_=b("li"),k=b("code"),k.textContent="collectionName:predefinedTag",S=W(` - targets a specific action of a single collection. To
apply the rule for all collections you can use the `),C=b("code"),C.textContent="*",T=W(` wildcard. For example:
2025-02-21 22:54:51 +08:00
`),O=b("code"),O.textContent="posts:create",E=W(", "),L=b("code"),L.textContent="users:listAuthMethods",I=W(", "),A=b("code"),A.textContent="*:auth",N=W(`.
`),P=b("br"),R=W(`
The predifined collection tags are (`),q=b("em"),q.textContent="there should be autocomplete once you start typing",F=W(`):
2025-03-20 19:46:40 +08:00
`),B=b("ul");for(let Z=0;Z<V.length;Z+=1)V[Z].c();p(r,"class","m-t-xs m-b-xs"),p(d,"class","m-b-sm"),p(h,"class","m-b-sm")},m(Z,G){w(Z,e,G),w(Z,t,G),w(Z,i,G),w(Z,l,G),w(Z,s,G),w(Z,o,G),w(Z,r,G),w(Z,a,G),w(Z,u,G),w(Z,f,G),w(Z,c,G),y(c,d),y(c,m),y(c,h),y(c,g),y(c,_),y(_,k),y(_,S),y(_,C),y(_,T),y(_,O),y(_,E),y(_,L),y(_,I),y(_,A),y(_,N),y(_,P),y(_,R),y(_,q),y(_,F),y(_,B);for(let ce=0;ce<V.length;ce+=1)V[ce]&&V[ce].m(B,null)},p(Z,G){if(G&64){J=fe(Z[6]);let ce;for(ce=0;ce<J.length;ce+=1){const de=E1(Z,J,ce);V[ce]?V[ce].p(de,G):(V[ce]=N1(de),V[ce].c(),V[ce].m(B,null))}for(;ce<V.length;ce+=1)V[ce].d(1);V.length=J.length}},d(Z){Z&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r),v(a),v(u),v(f),v(c)),ct(V,Z)}}}function XP(n){let e;return{c(){e=b("h4"),e.textContent="Rate limit label format",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function QP(n){let e,t,i;return{c(){e=b("button"),e.textContent="Close",p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=Y(e,"click",n[18]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function xP(n){let e,t,i,l;e=new zi({props:{single:!0,$$slots:{header:[JP],default:[WP]},$$scope:{ctx:n}}});let s={$$slots:{footer:[QP],header:[XP],default:[GP]},$$scope:{ctx:n}};return i=new tn({props:s}),n[19](i),{c(){z(e.$$.fragment),t=$(),z(i.$$.fragment)},m(o,r){j(e,o,r),w(o,t,r),j(i,o,r),l=!0},p(o,[r]){const a={};r&536870943&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};r&536870920&&(u.$$scope={dirty:r,ctx:o}),i.$set(u)},i(o){l||(M(e.$$.fragment,o),M(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&v(t),H(e,o),n[19](null),H(i,o)}}}function eR(n,e,t){let i,l,s;Xe(n,Dn,A=>t(20,l=A)),Xe(n,Sn,A=>t(1,s=A));let{formSettings:o}=e;const r=[{value:"",label:"All"},{value:"@guest",label:"Guest only"},{value:"@auth",label:"Auth only"}],a=[{value:"*:list"},{value:"*:view"},{value:"*:create"},{value:"*:update"},{value:"*:delete"},{value:"*:file",description:"targets the files download endpoint"},{value:"*:listAuthMethods"},{value:"*:authRefresh"},{value:"*:auth",description:"targets all auth methods"},{value:"*:authWithPassword"},{value:"*:authWithOAuth2"},{value:"*:authWithOTP"},{value:"*:requestOTP"},{value:"*:requestPasswordReset"},{value:"*:confirmPasswordReset"},{value:"*:requestVerification"},{value:"*:confirmVerification"},{value:"*:requestEmailChange"},{value:"*:confirmEmailChange"}];let u=a,f;c();async function c(){await Lu(),t(2,u=[]);for(let A of l)A.system||(u.push({value:A.name+":list"}),u.push({value:A.name+":view"}),A.type!="view"&&(u.push({value:A.name+":create"}),u.push({value:A.name+":update"}),u.push({value:A.name+":delete"})),A.type=="auth"&&(u.push({value:A.name+":listAuthMethods"}),u.push({value:A.name+":authRefresh"}),u.push({value:A.name+":auth"}),u.push({value:A.name+":authWithPassword"}),u.push({value:A.name+":authWithOAuth2"}),u.push({value:A.name+":authWithOTP"}),u.push({value:A.name+":requestOTP"}),u.push({value:A.name+":requestPasswordReset"}),u.push({value:A.name+":confirmPasswordReset"}),u.push({value:A.name+":requestVerification"}),u.push({value:A.name+":confirmVerification"}),u.push({value:A.name+":requestEmailChange"}),u.push({value:A.name+":confirmEmailChange"})),A.fields.find(N=>N.type=="file")&&u.push({value:A.name+":file"}));t(2,u=u.concat(a))}function d(){Yt({}),Array.isArray(o.rateLimits.rules)||t(0,o.rateLimits.rules=[],o),o.rateLimits.rules.push({label:"",maxRequests:300,duration:10,audience:""}),t(0,o),o.rateLimits.rules.length==1&&t(0,o.rateLimits.enabled=!0,o)}function m(A){Yt({}),o.rateLimits.rules.splice(A,1),t(0,o),o.rateLimits.rules.length||t(0,o.rateLimits.enabled=!1,o)}function h(){o.rateLimits.enabled=this.checked,t(0,o)}function g(A,N){n.$$.not_equal(N.label,A)&&(N.label=A,t(0,o))}function _(A,N){A[N].maxRequests=gt(this.value),t(0,o)}function k(A,N){A[N].duration=gt(this.value),t(0,o)}function S(A,N){n.$$.not_equal(N.audience,A)&&(N.audience=A,t(0,o))}const C=A=>{Wn("rateLimits.rules."+A)},T=A=>m(A),O=()=>d(),E=()=>f==null?void 0:f.show(),L=()=>f==null?void 0:f.hide();function I(A){ie[A?"unsh
2025-02-21 22:54:51 +08:00
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
2025-03-20 19:46:40 +08:00
separately since they are not locally stored and will not be included in the final backup!</p></div>`,t=$(),i=b("form"),z(l.$$.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(l,i,null),s=!0,o||(r=Y(i,"submit",it(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),l.$set(f)},i(a){s||(M(l.$$.fragment,a),s=!0)},o(a){D(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(t),v(i)),H(l),o=!1,r()}}}function pR(n){let e;return{c(){e=b("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function mR(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=$(),l=b("button"),s=b("span"),s.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[4]),p(l,"class","btn btn-expanded"),l.disabled=n[3],x(l,"btn-loading",n[3])},m(a,u){w(a,e,u),y(e,t),w(a,i,u),w(a,l,u),y(l,s),o||(r=Y(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(l.disabled=a[3]),u&8&&x(l,"btn-loading",a[3])},d(a){a&&(v(e),v(i),v(l)),o=!1,r()}}}function hR(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[mR],header:[pR],default:[dR]},$$scope:{ctx:n}};return e=new tn({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){z(e.$$.fragment)},m(l,s){j(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeOpen=l[8]),s&8&&(o.beforeHide=l[9]),s&65548&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),H(e,l)}}}function _R(n,e,t){const i=yt(),l="backup_create_"+U.randomString(5);let s,o="",r=!1,a;function u(S){Yt({}),t(3,r=!1),t(2,o=S||""),s==null||s.show()}function f(){return s==null?void 0:s.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await he.backups.create(o,{$cancelKey:l}),t(3,r=!1),f(),i("submit"),en("Successfully generated new backup.")}catch(S){S.isAbort||he.error(S)}clearTimeout(a),t(3,r=!1)}}oo(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(Ks("A backup has already been started, please wait."),!1):!0,h=()=>(r&&Ks("The backup was started but may take a while to complete. You can come back later.",4500),!0);function g(S){ie[S?"unshift":"push"](()=>{s=S,t(1,s)})}function _(S){Ae.call(this,n,S)}function k(S){Ae.call(this,n,S)}return[f,s,o,r,l,c,u,d,m,h,g,_,k]}class gR extends Se{constructor(e){super(),we(this,e,_R,hR,ke,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function bR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Backup name"),l=$(),s=b("input"),p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),_e(s,n[2]),r||(a=Y(s,"input",n[9]),r=!0)},p(u,f){f&32768&&i!==(i=u[15])&&p(e,"for",i),f&32768&&o!==(o=u[15])&&p(s,"id",o),f&4&&s.value!==u[2]&&_e(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function kR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;return u=new $i({props:{value:n[1]}}),m=new pe({props:{class:"form-field required m-0",name:"name",$$slots:{default:[bR,({uniqueId:k})=>({15:k}),({uniqueId:k})=>k?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-alert-line"></i></div> <div class="content"><p class="txt-bold">Please proceed with caution and use it only with trusted backups!</p> <p>Backup restore is experimental and works only on UNIX based systems.</p> <p>The restore operation will attempt to replace your existing <code>pb_data</code> with the one from
2025-02-21 22:54:51 +08:00
the backup and will restart the application process.</p> <p>This means that on success all of your data (including app settings, users, superusers, etc.) will
be replaced with the ones from the backup.</p> <p>Nothing will happen if the backup is invalid or incompatible (ex. missing
2025-03-20 19:46:40 +08:00
<code>data.db</code> file).</p></div>`,t=$(),i=b("div"),l=W(`Type the backup name
`),s=b("div"),o=b("span"),r=W(n[1]),a=$(),z(u.$$.fragment),f=W(`
to confirm:`),c=$(),d=b("form"),z(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-xs"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(k,S){w(k,e,S),w(k,t,S),w(k,i,S),y(i,l),y(i,s),y(s,o),y(o,r),y(s,a),j(u,s,null),y(i,f),w(k,c,S),w(k,d,S),j(m,d,null),h=!0,g||(_=Y(d,"submit",it(n[7])),g=!0)},p(k,S){(!h||S&2)&&oe(r,k[1]);const C={};S&2&&(C.value=k[1]),u.$set(C);const T={};S&98308&&(T.$$scope={dirty:S,ctx:k}),m.$set(T)},i(k){h||(M(u.$$.fragment,k),M(m.$$.fragment,k),h=!0)},o(k){D(u.$$.fragment,k),D(m.$$.fragment,k),h=!1},d(k){k&&(v(e),v(t),v(i),v(c),v(d)),H(u),H(m),g=!1,_()}}}function yR(n){let e,t,i,l;return{c(){e=b("h4"),t=W("Restore "),i=b("strong"),l=W(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){w(s,e,o),y(e,t),y(e,i),y(i,l)},p(s,o){o&2&&oe(l,s[1])},d(s){s&&v(e)}}}function vR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=W("Cancel"),i=$(),l=b("button"),s=b("span"),s.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,l,f),y(l,s),r||(a=Y(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(l.disabled=o),f&16&&x(l,"btn-loading",u[4])},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function wR(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[vR],header:[yR],default:[kR]},$$scope:{ctx:n}};return e=new tn({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){z(e.$$.fragment)},m(l,s){j(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}function SR(n,e,t){let i;const l="backup_restore_"+U.randomString(5);let s,o="",r="",a=!1,u=null;function f(S){Yt({}),t(2,r=""),t(1,o=S),t(4,a=!1),s==null||s.show()}function c(){return s==null?void 0:s.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await he.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch(C){clearTimeout(u),C!=null&&C.isAbort||(t(4,a=!1),Oi(((S=C.response)==null?void 0:S.message)||C.message))}}}oo(()=>{clearTimeout(u)});function m(){r=this.value,t(2,r)}const h=()=>!a;function g(S){ie[S?"unshift":"push"](()=>{s=S,t(3,s)})}function _(S){Ae.call(this,n,S)}function k(S){Ae.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,s,a,i,l,d,f,m,h,g,_,k]}class TR extends Se{constructor(e){super(),we(this,e,SR,wR,ke,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function F1(n,e,t){const i=n.slice();return i[22]=e[t],i}function q1(n,e,t){const i=n.slice();return i[19]=e[t],i}function CR(n){let e=[],t=new Map,i,l,s=fe(n[3]);const o=a=>a[22].key;for(let a=0;a<s.length;a+=1){let u=F1(n,s,a),f=o(u);t.set(f,e[a]=H1(f,u))}let r=null;return s.length||(r=j1()),{c(){for(let a=0;a<e.length;a+=1)e[a].c();i=ge(),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),l=!0},p(a,u){u&876&&(s=fe(a[3]),re(),e=bt(e,u,o,1,a,s,t,i.parentNode,Wt,H1,i,F1),ae(),!s.length&&r?r.p(a,u):s.length?r&&(r.d(1),r=null):(r=j1(),r.c(),r.m(i.parentNode,i)))},i(a){if(!l){for(let u=0;u<s.length;u+=1)M(e[u]);l=!0}},o(a){for(let u=0;u<e.length;u+=1)D(e[u]);l=!1},d(a){a&&v(i);for(let u=0;u<e.length;u+=1)e[u].d(a);r&&r.d(a)}}}function $R(n){let e,t=fe(Array(n[3].length||1)),i=[];for(let l=0;l<t.length;l+=1)i[l]=z1(q1(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ge()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);w(l,e,s)},p(l,s){if(s&8){t=fe(Array(l[3].length||1));let o;for(o=0;o<t.length;o+=1){const r=q1(l,t,o);i[o]?i[o].p(r,s):(i[o]=z1(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:te,o:te,d(l){l&&v(e),ct(i,l)}}
2025-02-21 22:54:51 +08:00
2025-03-20 19:46:40 +08:00
Do you really want to upload "${m.name}"?`,()=>{u(m)},()=>{r()})}async function u(m){var g,_,k;if(o||!m)return;t(2,o=!0);const h=new FormData;h.set("file",m);try{await he.backups.upload(h,{requestKey:B1}),t(2,o=!1),i("success"),en("Successfully uploaded a new backup.")}catch(S){S.isAbort||(t(2,o=!1),(k=(_=(g=S.response)==null?void 0:g.data)==null?void 0:_.file)!=null&&k.message?Oi(S.response.data.file.message):he.error(S))}r()}oo(()=>{he.cancelRequest(B1)});const f=()=>s==null?void 0:s.click();function c(m){ie[m?"unshift":"push"](()=>{s=m,t(1,s)})}const d=m=>{var h,g;a((g=(h=m==null?void 0:m.target)==null?void 0:h.files)==null?void 0:g[0])};return n.$$set=m=>{"class"in m&&t(0,l=m.class)},[l,s,o,a,f,c,d]}class BR extends Se{constructor(e){super(),we(this,e,VR,UR,ke,{class:0})}}function WR(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function YR(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function W1(n){var B,J,V;let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,C,T,O,E,L;t=new pe({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[KR,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}});let I=n[2]&&Y1(n);function A(Z){n[24](Z)}function N(Z){n[25](Z)}function P(Z){n[26](Z)}let R={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(B=n[0].backups)==null?void 0:B.s3};n[1].backups.s3!==void 0&&(R.config=n[1].backups.s3),n[7]!==void 0&&(R.isTesting=n[7]),n[8]!==void 0&&(R.testError=n[8]),r=new Ly({props:R}),ie.push(()=>be(r,"config",A)),ie.push(()=>be(r,"isTesting",N)),ie.push(()=>be(r,"testError",P));let q=((V=(J=n[1].backups)==null?void 0:J.s3)==null?void 0:V.enabled)&&!n[9]&&!n[5]&&K1(n),F=n[9]&&J1(n);return{c(){e=b("form"),z(t.$$.fragment),i=$(),I&&I.c(),l=$(),s=b("div"),o=$(),z(r.$$.fragment),c=$(),d=b("div"),m=b("div"),h=$(),q&&q.c(),g=$(),F&&F.c(),_=$(),k=b("button"),S=b("span"),S.textContent="Save changes",p(s,"class","clearfix m-b-base"),p(m,"class","flex-fill"),p(S,"class","txt"),p(k,"type","submit"),p(k,"class","btn btn-expanded"),k.disabled=C=!n[9]||n[5],x(k,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(Z,G){w(Z,e,G),j(t,e,null),y(e,i),I&&I.m(e,null),y(e,l),y(e,s),y(e,o),j(r,e,null),y(e,c),y(e,d),y(d,m),y(d,h),q&&q.m(d,null),y(d,g),F&&F.m(d,null),y(d,_),y(d,k),y(k,S),O=!0,E||(L=[Y(k,"click",n[28]),Y(e,"submit",it(n[11]))],E=!0)},p(Z,G){var ue,Te,Ke;const ce={};G[0]&4|G[1]&3&&(ce.$$scope={dirty:G,ctx:Z}),t.$set(ce),Z[2]?I?(I.p(Z,G),G[0]&4&&M(I,1)):(I=Y1(Z),I.c(),M(I,1),I.m(e,l)):I&&(re(),D(I,1,1,()=>{I=null}),ae());const de={};G[0]&1&&(de.originalConfig=(ue=Z[0].backups)==null?void 0:ue.s3),!a&&G[0]&2&&(a=!0,de.config=Z[1].backups.s3,Ce(()=>a=!1)),!u&&G[0]&128&&(u=!0,de.isTesting=Z[7],Ce(()=>u=!1)),!f&&G[0]&256&&(f=!0,de.testError=Z[8],Ce(()=>f=!1)),r.$set(de),(Ke=(Te=Z[1].backups)==null?void 0:Te.s3)!=null&&Ke.enabled&&!Z[9]&&!Z[5]?q?q.p(Z,G):(q=K1(Z),q.c(),q.m(d,g)):q&&(q.d(1),q=null),Z[9]?F?F.p(Z,G):(F=J1(Z),F.c(),F.m(d,_)):F&&(F.d(1),F=null),(!O||G[0]&544&&C!==(C=!Z[9]||Z[5]))&&(k.disabled=C),(!O||G[0]&32)&&x(k,"btn-loading",Z[5])},i(Z){O||(M(t.$$.fragment,Z),M(I),M(r.$$.fragment,Z),Z&&tt(()=>{O&&(T||(T=je(e,pt,{duration:150},!0)),T.run(1))}),O=!0)},o(Z){D(t.$$.fragment,Z),D(I),D(r.$$.fragment,Z),Z&&(T||(T=je(e,pt,{duration:150},!1)),T.run(0)),O=!1},d(Z){Z&&v(e),H(t),I&&I.d(),H(r),q&&q.d(),F&&F.d(),Z&&T&&T.end(),E=!1,De(L)}}}function KR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(l,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,l,f),y(l,s),r||(a=Y(e,"change",n[17]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&4&&(e.checked=u[2]),f[1]&1&&o!==(o=u[31])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function Y1(n){let e,t,i,l,s,o,r,a,u;return l=new pe({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[ZR,({uniqueId:f})=>({31:f}),({uniqueId:f})
2025-02-21 22:54:51 +08:00
`),T=b("span"),T.textContent="macros",O=W(`.
`),E=b("br"),L=W(`
2025-03-20 19:46:40 +08:00
The timezone is in UTC.`),p(e,"for",i=n[31]),s.required=!0,p(s,"type","text"),p(s,"id",o=n[31]),p(s,"class","txt-lg txt-mono"),p(s,"placeholder","* * * * *"),s.autofocus=r=!((R=(P=n[0])==null?void 0:P.backups)!=null&&R.cron),p(c,"class","txt"),p(m,"class","ri-arrow-drop-down-fill"),p(f,"type","button"),p(f,"class","btn btn-sm btn-outline p-r-0"),p(u,"class","form-field-addon"),p(T,"class","link-primary"),p(k,"class","help-block")},m(P,R){var q,F;w(P,e,R),y(e,t),w(P,l,R),w(P,s,R),_e(s,n[1].backups.cron),w(P,a,R),w(P,u,R),y(u,f),y(f,c),y(f,d),y(f,m),y(f,h),j(g,f,null),w(P,_,R),w(P,k,R),y(k,S),y(S,C),y(S,T),y(S,O),y(S,E),y(S,L),I=!0,(F=(q=n[0])==null?void 0:q.backups)!=null&&F.cron||s.focus(),A||(N=[Y(s,"input",n[18]),$e(Fe.call(null,T,`@yearly
2025-02-21 22:54:51 +08:00
@annually
@monthly
@weekly
@daily
@midnight
2025-03-20 19:46:40 +08:00
@hourly`))],A=!0)},p(P,R){var F,B;(!I||R[1]&1&&i!==(i=P[31]))&&p(e,"for",i),(!I||R[1]&1&&o!==(o=P[31]))&&p(s,"id",o),(!I||R[0]&1&&r!==(r=!((B=(F=P[0])==null?void 0:F.backups)!=null&&B.cron)))&&(s.autofocus=r),R[0]&2&&s.value!==P[1].backups.cron&&_e(s,P[1].backups.cron);const q={};R[0]&2|R[1]&2&&(q.$$scope={dirty:R,ctx:P}),g.$set(q)},i(P){I||(M(g.$$.fragment,P),I=!0)},o(P){D(g.$$.fragment,P),I=!1},d(P){P&&(v(e),v(l),v(s),v(a),v(u),v(_),v(k)),H(g),A=!1,De(N)}}}function GR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Max @auto backups to keep"),l=$(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),_e(s,n[1].backups.cronMaxKeep),r||(a=Y(s,"input",n[23]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(s,"id",o),f[0]&2&&gt(s.value)!==u[1].backups.cronMaxKeep&&_e(s,u[1].backups.cronMaxKeep)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function K1(n){let e;function t(s,o){return s[7]?xR:s[8]?QR:XR}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function XR(n){let e;return{c(){e=b("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:te,d(t){t&&v(e)}}}function QR(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML='<i class="ri-error-warning-line txt-warning"></i> <span class="txt">Failed to establish S3 connection</span>',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=$e(t=Fe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&It(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function xR(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function J1(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),y(e,t),l||(s=Y(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&v(e),l=!1,s()}}}function eF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,C,T,O,E,L,I,A,N,P;m=new qr({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),g=new BR({props:{class:"btn-sm"}}),g.$on("success",n[13]);let R={};k=new IR({props:R}),n[15](k);function q(V,Z){return V[6]?YR:WR}let F=q(n),B=F(n),J=n[6]&&!n[4]&&W1(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=$(),s=b("div"),o=W(n[10]),r=$(),a=b("div"),u=b("div"),f=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=$(),z(m.$$.fragment),h=$(),z(g.$$.fragment),_=$(),z(k.$$.fragment),S=$(),C=b("hr"),T=$(),O=b("button"),E=b("span"),E.textContent="Backups options",L=$(),B.c(),I=$(),J&&J.c(),p(i,"class","breadcrumb-item"),p(s,"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-10"),p(E,"class","txt"),p(O,"type","button"),p(O,"class","btn btn-secondary"),O.disabled=n[4],x(O,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(V,Z){w(V,e,Z),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(V,r,Z),w(V,a,Z),y(a,u),y(u,f),y(f,c),y(f,d),j(m,f,null),y(f,h),j(g,f,null),y(u,_),j(k,u,null),y(u,S),y(u,C),y(u,T),y(u,O),y(O,E),y(O,L),B.m(O,null),y(u,I),J&&J.m(u,null),A=!0,N||(P=[Y(O,"click",n[16]),Y(u,"submit",it(n[11]))],N=!0)},p(V,Z){(!A||Z[0]&1024)&&oe(o,V[10]);const G={};k.$set(G),F!==(F=q(V))&&(B.d(1),B=F(V),B&&(B.c(),B.m(O,null))),(!A||Z[0]&16)&&(O.disabled=V[4]),(!A||Z[0]&16)&&x(O,"btn-loading",V[4]),V[6]&&!V[4]?J?(J.p(V,Z),Z[0]&80&&M(J,1)):(J=W1(V),J.c(),M(J,1),J.m(u,null)):J&&(re(),D(J,1,1,()=>{J=null}),ae())},i(V){A||(M(m.$$.fragment,V),M(g.$$.fragment,V),M(k.$$.fragment,V),M(J),A=!0)},o(V){D(m.$$.fragment,V),D(g.$$.fragment,V),
2025-02-21 22:54:51 +08:00
<a href="https://pocketbase.io/docs/go-jobs-scheduling/" target="_blank" rel="noopener noreferrer">Go</a>
or
<a href="https://pocketbase.io/docs/js-jobs-scheduling/" target="_blank" rel="noopener noreferrer">JavaScript
2025-03-20 19:46:40 +08:00
</a>.`,p(i,"class","breadcrumb-item"),p(s,"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-10"),p(_,"class","list-content"),p(g,"class","list list-compact"),p(S,"class","txt-hint m-t-xs"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(L,I){w(L,e,I),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(L,r,I),w(L,a,I),y(a,u),y(u,f),y(f,c),y(f,d),j(m,f,null),y(u,h),y(u,g),y(g,_),E.m(_,null),y(u,k),y(u,S),C=!0},p(L,I){(!C||I&8)&&oe(o,L[3]),O===(O=T(L))&&E?E.p(L,I):(E.d(1),E=O(L),E&&(E.c(),E.m(_,null)))},i(L){C||(M(m.$$.fragment,L),C=!0)},o(L){D(m.$$.fragment,L),C=!1},d(L){L&&(v(e),v(r),v(a)),H(m),E.d()}}}function rF(n){let e,t,i,l;return e=new Rl({}),i=new ii({props:{$$slots:{default:[oF]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=$(),z(i.$$.fragment)},m(s,o){j(e,s,o),w(s,t,o),j(i,s,o),l=!0},p(s,[o]){const r={};o&1039&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&v(t),H(e,s),H(i,s)}}}function aF(n,e,t){let i;Xe(n,rn,f=>t(3,i=f)),Mn(rn,i="Crons",i);let l=[],s=!1,o={};r();async function r(){t(1,s=!0);try{t(0,l=await he.crons.getFullList()),t(1,s=!1)}catch(f){f.isAbort||(he.error(f),t(1,s=!1))}}async function a(f){t(2,o[f]=!0,o);try{await he.crons.run(f),en(`Successfully triggered ${f}.`),t(2,o[f]=!1,o)}catch(c){c.isAbort||(he.error(c),t(2,o[f]=!1,o))}}return[l,s,o,i,r,a,f=>a(f.id)]}class uF extends Se{constructor(e){super(),we(this,e,aF,rF,ke,{})}}function Q1(n,e,t){const i=n.slice();return i[22]=e[t],i}function fF(n){let e,t,i,l,s,o,r,a=[],u=new Map,f,c,d,m,h,g,_,k,S,C,T,O,E,L,I,A,N,P,R,q;o=new pe({props:{class:"form-field",$$slots:{default:[dF,({uniqueId:J})=>({12:J}),({uniqueId:J})=>J?4096:0]},$$scope:{ctx:n}}});let F=fe(n[0]);const B=J=>J[22].id;for(let J=0;J<F.length;J+=1){let V=Q1(n,F,J),Z=B(V);u.set(Z,a[J]=x1(Z,V))}return{c(){e=b("div"),e.innerHTML=`<p>Below you&#39;ll find your current collections configuration that you could import in
another PocketBase environment.</p>`,t=$(),i=b("div"),l=b("div"),s=b("div"),z(o.$$.fragment),r=$();for(let J=0;J<a.length;J+=1)a[J].c();f=$(),c=b("div"),d=b("button"),m=b("span"),m.textContent="Copy",g=$(),_=b("pre"),k=W(n[6]),S=$(),C=b("div"),T=b("div"),O=$(),E=b("button"),L=b("i"),I=$(),A=b("span"),A.textContent="Download as JSON",p(e,"class","content txt-xl m-b-base"),p(s,"class","list-item list-item-section"),p(l,"class","export-list"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","btn btn-sm btn-transparent fade copy-schema"),d.disabled=h=!n[2],p(_,"class","code-wrapper"),p(c,"tabindex","0"),p(c,"class","export-preview"),p(i,"class","export-panel"),p(T,"class","flex-fill"),p(L,"class","ri-download-line"),p(A,"class","txt"),p(E,"type","button"),p(E,"class","btn btn-expanded"),E.disabled=N=!n[2],p(C,"class","flex m-t-base")},m(J,V){w(J,e,V),w(J,t,V),w(J,i,V),y(i,l),y(l,s),j(o,s,null),y(l,r);for(let Z=0;Z<a.length;Z+=1)a[Z]&&a[Z].m(l,null);y(i,f),y(i,c),y(c,d),y(d,m),y(c,g),y(c,_),y(_,k),n[16](c),w(J,S,V),w(J,C,V),y(C,T),y(C,O),y(C,E),y(E,L),y(E,I),y(E,A),P=!0,R||(q=[Y(d,"click",n[15]),Y(c,"keydown",n[17]),Y(E,"click",n[18])],R=!0)},p(J,V){const Z={};V&33558561&&(Z.$$scope={dirty:V,ctx:J}),o.$set(Z),V&6147&&(F=fe(J[0]),re(),a=bt(a,V,B,1,J,F,u,l,Wt,x1,null,Q1),ae()),(!P||V&4&&h!==(h=!J[2]))&&(d.disabled=h),(!P||V&64)&&oe(k,J[6]),(!P||V&4&&N!==(N=!J[2]))&&(E.disabled=N)},i(J){if(!P){M(o.$$.fragment,J);for(let V=0;V<F.length;V+=1)M(a[V]);P=!0}},o(J){D(o.$$.fragment,J);for(let V=0;V<a.length;V+=1)D(a[V]);P=!1},d(J){J&&(v(e),v(t),v(i),v(S),v(C)),H(o);for(let V=0;V<a.length;V+=1)a[V].d();n[16](null),R=!1,De(q)}}}function cF(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function dF(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=$(),s=b("label"),o=W("Select all"),p(e,"type","checkbox"),p(e,"id",t=n[12]),e.disabled=i=!n[0].length,e.checked=n[5],p(s,"for",r=n[12])},m(f,c){w(f,e,c),w(f,l,c),w(f,s,c),y(s,o),a||(u=Y(e,"change",n[13]),a=!0)},p(f,c){c&4096&&t!==(t=f[12])&&p(e,"id",t),c&1&&i!==(i=!f[0].length)&&(e.disabled=i),c&32&&(e.checked=f[5]),c&4096&&r!==(r=f[12])&&p(s,"for",r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function pF(n){let e,t,i,l,s,o=n[22].name+"",r,a,u,f,c;function d(){return n[14](n[22])}return{c(){e=b("input"),l=$(),s=b("label"),r=W(o),p(e,"type","checkbox"),p(e,"id",t=n[12]),e.checked=i=n[1][n[22].id],p(s,"for",a=n[12]),p(s,"title",u=n[22].name)},m(m,h){w(m,e,h),w(m,l,h),w(m,s,h),y(s,r),f||(c=Y(e,"change",d),f=!0)},p(m,h){n=m,h&4096&&t!==(t=n[12])&&p(e,"id",t),h&3&&i!==(i=n[1][n[22].id])&&(e.checked=i),h&1&&o!==(o=n[22].name+"")&&oe(r,o),h&4096&&a!==(a=n[12])&&p(s,"for",a),h&1&&u!==(u=n[22].name)&&p(s,"title",u)},d(m){m&&(v(e),v(l),v(s)),f=!1,c()}}}function x1(n,e){let t,i,l,s;return i=new pe({props:{class:"form-field",$$slots:{default:[pF,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=b("div"),z(i.$$.fragment),l=$(),p(t,"class","list-item list-item-collection"),this.first=t},m(o,r){w(o,t,r),j(i,t,null),y(t,l),s=!0},p(o,r){e=o;const a={};r&33558531&&(a.$$scope={dirty:r,ctx:e}),i.$set(a)},i(o){s||(M(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&v(t),H(i)}}}function mF(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[cF,fF],h=[];function g(_,k){return _[4]?0:1}return f=g(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=$(),s=b("div"),o=W(n[7]),r=$(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,k){w(_,e,k),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(_,r,k),w(_,a,k),y(a,u),h[f].m(u,null),d=!0},p(_,k){(!d||k&128)&&oe(o,_[7]);let S=f;f=g(_),f===S?h[f].p(_,k):(re(),D(h[S],1,1,()=>{h[S]=null}),ae(),c=h[f],c?c.p(_,k):(c=h[f]=m[f](_),c.c()),M(c,1),c.m(u,null))},i(_){d||(M(c),d=!0)},o(_){D(c),d=!1},d(_){_&&(v(e),v(r),v(a)),h[f].d()}}}function hF(n){let e,t,i,l;return e=new Rl({}),i=new ii({props:{$$slots:{de
2025-02-21 22:54:51 +08:00
- ${T.join(`
2025-03-20 19:46:40 +08:00
- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await he.collections.import(o,a),en("Successfully imported collections configuration."),i("submit")}catch(T){he.error(T)}t(4,u=!1),c()}}const g=()=>m(),_=()=>!u;function k(T){ie[T?"unshift":"push"](()=>{l=T,t(1,l)})}function S(T){Ae.call(this,n,T)}function C(T){Ae.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,u,m,f,s,o,g,_,k,S,C]}class EF extends Se{constructor(e){super(),we(this,e,MF,OF,ke,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function yb(n,e,t){const i=n.slice();return i[34]=e[t],i}function vb(n,e,t){const i=n.slice();return i[37]=e[t],i}function wb(n,e,t){const i=n.slice();return i[34]=e[t],i}function DF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,C,T,O,E,L,I;a=new pe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[LF,({uniqueId:B})=>({42:B}),({uniqueId:B})=>[0,B?2048:0]]},$$scope:{ctx:n}}});let A=n[1].length&&Tb(n),N=!1,P=n[6]&&n[1].length&&!n[7]&&Cb(),R=n[6]&&n[1].length&&n[7]&&$b(n),q=n[13].length&&Fb(n),F=!!n[0]&&qb(n);return{c(){e=b("input"),t=$(),i=b("div"),l=b("p"),s=W(`Paste below the collections configuration you want to import or
`),o=b("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=$(),z(a.$$.fragment),u=$(),A&&A.c(),f=$(),c=$(),P&&P.c(),d=$(),R&&R.c(),m=$(),q&&q.c(),h=$(),g=b("div"),F&&F.c(),_=$(),k=b("div"),S=$(),C=b("button"),T=b("span"),T.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"),x(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(k,"class","flex-fill"),p(T,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-expanded btn-warning m-l-auto"),C.disabled=O=!n[14],p(g,"class","flex m-t-base")},m(B,J){w(B,e,J),n[22](e),w(B,t,J),w(B,i,J),y(i,l),y(l,s),y(l,o),w(B,r,J),j(a,B,J),w(B,u,J),A&&A.m(B,J),w(B,f,J),w(B,c,J),P&&P.m(B,J),w(B,d,J),R&&R.m(B,J),w(B,m,J),q&&q.m(B,J),w(B,h,J),w(B,g,J),F&&F.m(g,null),y(g,_),y(g,k),y(g,S),y(g,C),y(C,T),E=!0,L||(I=[Y(e,"change",n[23]),Y(o,"click",n[24]),Y(C,"click",n[20])],L=!0)},p(B,J){(!E||J[0]&4096)&&x(o,"btn-loading",B[12]);const V={};J[0]&64&&(V.class="form-field "+(B[6]?"":"field-error")),J[0]&65|J[1]&6144&&(V.$$scope={dirty:J,ctx:B}),a.$set(V),B[1].length?A?(A.p(B,J),J[0]&2&&M(A,1)):(A=Tb(B),A.c(),M(A,1),A.m(f.parentNode,f)):A&&(re(),D(A,1,1,()=>{A=null}),ae()),B[6]&&B[1].length&&!B[7]?P||(P=Cb(),P.c(),P.m(d.parentNode,d)):P&&(P.d(1),P=null),B[6]&&B[1].length&&B[7]?R?R.p(B,J):(R=$b(B),R.c(),R.m(m.parentNode,m)):R&&(R.d(1),R=null),B[13].length?q?q.p(B,J):(q=Fb(B),q.c(),q.m(h.parentNode,h)):q&&(q.d(1),q=null),B[0]?F?F.p(B,J):(F=qb(B),F.c(),F.m(g,_)):F&&(F.d(1),F=null),(!E||J[0]&16384&&O!==(O=!B[14]))&&(C.disabled=O)},i(B){E||(M(a.$$.fragment,B),M(A),M(N),E=!0)},o(B){D(a.$$.fragment,B),D(A),D(N),E=!1},d(B){B&&(v(e),v(t),v(i),v(r),v(u),v(f),v(c),v(d),v(m),v(h),v(g)),n[22](null),H(a,B),A&&A.d(B),P&&P.d(B),R&&R.d(B),q&&q.d(B),F&&F.d(),L=!1,De(I)}}}function IF(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function Sb(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function LF(n){let e,t,i,l,s,o,r,a,u,f,c=!!n[0]&&!n[6]&&Sb();return{c(){e=b("label"),t=W("Collections"),l=$(),s=b("textarea"),r=$(),c&&c.c(),a=ge(),p(e,"for",i=n[42]),p(e,"class","p-b-10"),p(s,"id",o=n[42]),p(s,"class","code"),p(s,"spellcheck","false"),p(s,"rows","15"),s.required=!0},m(d,m){w(d,e,m),y(e,t),w(d,l,m),w(d,s,m),_e(s,n[0]),w(d,r,m),c&&c.m(d,m),w(d,a,m),u||(f=Y(s,"input",n[25]),u=!0)},p(d,m){m[1]&2048&&i!==(i=d[42])&&p(e,"for",i),m[1]&2048&&o!==(o=d[42])&&p(s,"id",o),m[0]&1&&_e(s,d[0]),d[0]&&!d[6]?c||(c=Sb(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(d),u=!1,f()}}}function Tb(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[AF,({uniqueId:i})=>({42:i}),({uniqueId:i})=>[0,i?2048:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,l){j(e,i,l),t=!0},p(i,l){const s={};l[0]&96|l[1]&6144&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function AF(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=$(),s=b("label"),o=W("Merge with the existing collections"),p(e,"type","checkbox"),p(e,"id",t=n[42]),e.disabled=i=!n[6],p(s,"for",r=n[42])},m(f,c){w(f,e,c),e.checked=n[5],w(f,l,c),w(f,s,c),y(s,o),a||(u=Y(e,"change",n[26]),a=!0)},p(f,c){c[1]&2048&&t!==(t=f[42])&&p(e,"id",t),c[0]&64&&i!==(i=!f[6])&&(e.disabled=i),c[0]&32&&(e.checked=f[5]),c[1]&2048&&r!==(r=f[42])&&p(s,"for",r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function Cb(n){let e;return{c(){e=b("div"),e.innerHTML='<div class="icon"><i class="ri-information-line"></i></div> <div class="content"><string>Your collections configuration is already up-to-date!</string></div>',p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function $b(n){let e,t,i,l,s,o=n[9].length&&Ob(n),r=n[3].length&&Db(n),a=n[8].length&&Nb(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=$(),i=b("div"),o&&o.c(),l=$(),r&&r.c(),s=$(),a&&a.c(),p(e,"class"
2025-02-21 22:54:51 +08:00
imported with different IDs. You can replace them in the import if you want
2025-03-20 19:46:40 +08:00
to.</string>`,s=$(),o=b("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',p(t,"class","icon"),p(l,"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),y(e,t),y(e,i),y(e,l),y(e,s),y(e,o),r||(a=Y(o,"click",n[28]),r=!0)},p:te,d(u){u&&v(e),r=!1,a()}}}function qb(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(l,s){w(l,e,s),t||(i=Y(e,"click",n[29]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function NF(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[IF,DF],h=[];function g(_,k){return _[4]?0:1}return f=g(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=$(),s=b("div"),o=W(n[15]),r=$(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,k){w(_,e,k),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(_,r,k),w(_,a,k),y(a,u),h[f].m(u,null),d=!0},p(_,k){(!d||k[0]&32768)&&oe(o,_[15]);let S=f;f=g(_),f===S?h[f].p(_,k):(re(),D(h[S],1,1,()=>{h[S]=null}),ae(),c=h[f],c?c.p(_,k):(c=h[f]=m[f](_),c.c()),M(c,1),c.m(u,null))},i(_){d||(M(c),d=!0)},o(_){D(c),d=!1},d(_){_&&(v(e),v(r),v(a)),h[f].d()}}}function PF(n){let e,t,i,l,s,o;e=new Rl({}),i=new ii({props:{$$slots:{default:[NF]},$$scope:{ctx:n}}});let r={};return s=new EF({props:r}),n[30](s),s.$on("submit",n[31]),{c(){z(e.$$.fragment),t=$(),z(i.$$.fragment),l=$(),z(s.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),w(a,l,u),j(s,a,u),o=!0},p(a,u){const f={};u[0]&63487|u[1]&4096&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),M(s.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),H(e,a),H(i,a),n[30](null),H(s,a)}}}function RF(n,e,t){let i,l,s,o,r,a,u;Xe(n,rn,de=>t(15,u=de)),Mn(rn,u="Import collections",u);let f,c,d="",m=!1,h=[],g=[],_=!0,k=[],S=!1,C=!1;T();async function T(){var de;t(4,S=!0);try{t(21,g=await he.collections.getFullList(200));for(let ue of g)delete ue.created,delete ue.updated,(de=ue.oauth2)==null||delete de.providers}catch(ue){he.error(ue)}t(4,S=!1)}function O(){if(t(3,k=[]),!!i)for(let de of h){const ue=U.findByKey(g,"id",de.id);!(ue!=null&&ue.id)||!U.hasCollectionChanges(ue,de,_)||k.push({new:de,old:ue})}}function E(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=U.filterDuplicatesByKey(h)):t(1,h=[]);for(let de of h)delete de.created,delete de.updated,de.fields=U.filterDuplicatesByKey(de.fields)}function L(){var de;for(let ue of h){const Te=U.findByKey(g,"name",ue.name)||U.findByKey(g,"id",ue.id);if(!Te)continue;const Ke=ue.id,Je=Te.id;ue.id=Je;const ft=Array.isArray(Te.fields)?Te.fields:[],et=Array.isArray(ue.fields)?ue.fields:[];for(const xe of et){const We=U.findByKey(ft,"name",xe.name);We&&We.id&&(xe.id=We.id)}for(let xe of h)if(Array.isArray(xe.fields))for(let We of xe.fields)We.collectionId&&We.collectionId===Ke&&(We.collectionId=Je);for(let xe=0;xe<((de=ue.indexes)==null?void 0:de.length);xe++)ue.indexes[xe]=ue.indexes[xe].replace(/create\s+(?:unique\s+)?\s*index\s*(?:if\s+not\s+exists\s+)?(\S*)\s+on/gim,We=>We.replace(Ke,Je))}t(0,d=JSON.stringify(h,null,4))}function I(de){t(12,m=!0);const ue=new FileReader;ue.onload=async Te=>{t(12,m=!1),t(10,f.value="",f),t(0,d=Te.target.result),await mn(),h.length||(Oi("Invalid collections configuration."),A())},ue.onerror=Te=>{console.warn(Te),Oi("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},ue.readAsText(de)}function A(){t(0,d=""),t(10,f.value="",f),Yt({})}function N(){const de=C?U.filterDuplicatesByKey(g.concat(h)):h;c==null||c.show(g,de,_)}function P(de){ie[de?"unshift":"push"](()=>{f=de,t(10,f)})}const R=()=>{f.files.length&&I(f.files[0])},q=()=>{f.click()};function F(){d=this.value,t(0,d)}function B(){C=this.checked,t(5,C)}function J(){_=this.checked,t(2,_)}const V=()=>L()
2025-02-21 22:54:51 +08:00
from the
`),r=b("strong"),u=W(a),f=W(`
to the
`),c=b("strong"),m=W(d),h=W(`.
`),g=b("br"),_=W(`
There are numerous command line tools that can help you, such as:
`),k=b("a"),k.textContent=`rclone
`,S=W(`,
2025-03-20 19:46:40 +08:00
`),C=b("a"),C.textContent=`s5cmd
`,T=W(", etc."),O=$(),E=b("div"),p(i,"class","icon"),p(k,"href","https://github.com/rclone/rclone"),p(k,"target","_blank"),p(k,"rel","noopener noreferrer"),p(k,"class","txt-bold"),p(C,"href","https://github.com/peak/s5cmd"),p(C,"target","_blank"),p(C,"rel","noopener noreferrer"),p(C,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(E,"class","clearfix m-t-base")},m(N,P){w(N,e,P),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),y(s,r),y(r,u),y(s,f),y(s,c),y(c,m),y(s,h),y(s,g),y(s,_),y(s,k),y(s,S),y(s,C),y(s,T),y(e,O),y(e,E),I=!0},p(N,P){var R;(!I||P&1)&&a!==(a=(R=N[0].s3)!=null&&R.enabled?"S3 storage":"local file system")&&oe(u,a),(!I||P&2)&&d!==(d=N[1].s3.enabled?"S3 storage":"local file system")&&oe(m,d)},i(N){I||(N&&tt(()=>{I&&(L||(L=je(e,pt,{duration:150},!0)),L.run(1))}),I=!0)},o(N){N&&(L||(L=je(e,pt,{duration:150},!1)),L.run(0)),I=!1},d(N){N&&v(e),N&&L&&L.end()}}}function oq(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&zb(n);return{c(){t&&t.c(),e=ge()},m(l,s){t&&t.m(l,s),w(l,e,s)},p(l,s){var o;((o=l[0].s3)==null?void 0:o.enabled)!=l[1].s3.enabled?t?(t.p(l,s),s&3&&M(t,1)):(t=zb(l),t.c(),M(t,1),t.m(e.parentNode,e)):t&&(re(),D(t,1,1,()=>{t=null}),ae())},d(l){l&&v(e),t&&t.d(l)}}}function Ub(n){let e;function t(s,o){return s[4]?uq:s[5]?aq:rq}let i=t(n),l=i(n);return{c(){l.c(),e=ge()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function rq(n){let e;return{c(){e=b("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:te,d(t){t&&v(e)}}}function aq(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML='<i class="ri-error-warning-line txt-warning"></i> <span class="txt">Failed to establish S3 connection</span>',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=$e(t=Fe.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&It(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function uq(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function Vb(n){let e,t,i,l;return{c(){e=b("button"),t=b("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(s,o){w(s,e,o),y(e,t),i||(l=Y(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&v(e),i=!1,l()}}}function fq(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;const k=[sq,lq],S=[];function C(T,O){return T[2]?0:1}return d=C(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=$(),s=b("div"),o=W(n[7]),r=$(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="<p>By default PocketBase uses the local file system to store uploaded files.</p> <p>If you have limited disk space, you could optionally connect to an S3 compatible storage.</p>",c=$(),m.c(),p(i,"class","breadcrumb-item"),p(s,"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,O){w(T,e,O),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(T,r,O),w(T,a,O),y(a,u),y(u,f),y(u,c),S[d].m(u,null),h=!0,g||(_=Y(u,"submit",it(n[16])),g=!0)},p(T,O){(!h||O&128)&&oe(o,T[7]);let E=d;d=C(T),d===E?S[d].p(T,O):(re(),D(S[E],1,1,()=>{S[E]=null}),ae(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(u,null))},i(T){h||(M(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(v(e),v(r),v(a)),S[d].d(),g=!1,_()}}}function cq(n){let e,t,i,l;return e=new Rl({}),i=new ii({props:{$$slots:{default:[fq]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=$(),z(i.$$.fragment)},m(s,o){j(e,s,o),w(s,t,o),j(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&v(t),
One-time password (OTP).`),p(e,"class","content txt-center m-b-sm")},m(r,a){w(r,e,a),y(e,t),y(t,i),y(t,l),y(l,s),y(t,o)},p(r,a){a&4096&&oe(s,r[12])},d(r){r&&v(e)}}}function Tq(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Id"),l=$(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","text"),p(s,"id",o=n[26]),s.value=n[4],p(s,"placeholder",n[11]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),r||(a=Y(s,"change",n[20]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&16&&s.value!==u[4]&&(s.value=u[4]),f&2048&&p(s,"placeholder",u[11])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function Cq(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("One-time password"),l=$(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","password"),p(s,"id",o=n[26]),s.required=!0,s.autofocus=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),_e(s,n[13]),s.focus(),r||(a=Y(s,"input",n[21]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&8192&&s.value!==u[13]&&_e(s,u[13])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function $q(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Email"),l=$(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","email"),p(s,"id",o=n[26]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),_e(s,n[12]),r||(a=Y(s,"input",n[19]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&4096&&s.value!==u[12]&&_e(s,u[12])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function Oq(n){let e,t=U.sentenize(n[0].password.identityFields.join(" or "),!1)+"",i,l,s,o,r,a,u,f;return{c(){e=b("label"),i=W(t),s=$(),o=b("input"),p(e,"for",l=n[26]),p(o,"id",r=n[26]),p(o,"type",a=n[0].password.identityFields.length==1&&n[0].password.identityFields[0]=="email"?"email":"text"),o.value=n[5],o.required=!0,o.autofocus=!0},m(c,d){w(c,e,d),y(e,i),w(c,s,d),w(c,o,d),o.focus(),u||(f=Y(o,"input",n[17]),u=!0)},p(c,d){d&1&&t!==(t=U.sentenize(c[0].password.identityFields.join(" or "),!1)+"")&&oe(i,t),d&67108864&&l!==(l=c[26])&&p(e,"for",l),d&67108864&&r!==(r=c[26])&&p(o,"id",r),d&1&&a!==(a=c[0].password.identityFields.length==1&&c[0].password.identityFields[0]=="email"?"email":"text")&&p(o,"type",a),d&32&&o.value!==c[5]&&(o.value=c[5])},d(c){c&&(v(e),v(s),v(o)),u=!1,f()}}}function Mq(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=W("Password"),l=$(),s=b("input"),r=$(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[26]),p(s,"type","password"),p(s,"id",o=n[26]),s.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),y(e,t),w(d,l,m),w(d,s,m),_e(s,n[6]),w(d,r,m),w(d,a,m),y(a,u),f||(c=[Y(s,"input",n[18]),$e(Fn.call(null,u))],f=!0)},p(d,m){m&67108864&&i!==(i=d[26])&&p(e,"for",i),m&67108864&&o!==(o=d[26])&&p(s,"id",o),m&64&&s.value!==d[6]&&_e(s,d[6])},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),f=!1,De(c)}}}function Eq(n){let e,t,i,l,s,o,r,a,u=n[2]>1&&Wb(n);const f=[vq,yq,kq],c=[];function d(m,h){return m[10]?0:m[0].password.enabled&&!m[3]?1:m[0].otp.enabled?2:-1}return~(s=d(n))&&(o=c[s]=f[s](n)),{c(){e=b("div"),t=b("h4"),i=W(`Superuser login
2025-03-29 03:07:16 +08:00
`),u&&u.c(),l=$(),o&&o.c(),r=ge(),p(e,"class","content txt-center m-b-base")},m(m,h){w(m,e,h),y(e,t),y(t,i),u&&u.m(t,null),w(m,l,h),~s&&c[s].m(m,h),w(m,r,h),a=!0},p(m,h){m[2]>1?u?u.p(m,h):(u=Wb(m),u.c(),u.m(t,null)):u&&(u.d(1),u=null);let g=s;s=d(m),s===g?~s&&c[s].p(m,h):(o&&(re(),D(c[g],1,1,()=>{c[g]=null}),ae()),~s?(o=c[s],o?o.p(m,h):(o=c[s]=f[s](m),o.c()),M(o,1),o.m(r.parentNode,r)):o=null)},i(m){a||(M(o),a=!0)},o(m){D(o),a=!1},d(m){m&&(v(e),v(l),v(r)),u&&u.d(),~s&&c[s].d(m)}}}function Dq(n){let e,t;return e=new bq({props:{$$slots:{default:[Eq]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,l){j(e,i,l),t=!0},p(i,[l]){const s={};l&134234111&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Iq(n,e,t){let i;Xe(n,Nu,q=>t(23,i=q));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r={},a=1,u=1,f=!1,c=!1,d=!1,m=!1,h="",g="",_="",k="",S="";C();async function C(){if(!m){t(10,m=!0);try{t(0,r=await he.collection("_superusers").listAuthMethods())}catch(q){he.error(q)}t(10,m=!1)}}async function T(){var q,F;if(!f){t(7,f=!0);try{await he.collection("_superusers").authWithPassword(s,o),Ls(),Yt({}),ls("/")}catch(B){B.status==401?(t(3,h=B.response.mfaId),((F=(q=r==null?void 0:r.password)==null?void 0:q.identityFields)==null?void 0:F.length)==1&&r.password.identityFields[0]=="email"?(t(12,k=s),await O()):/^[^@\s]+@[^@\s]+$/.test(s)&&t(12,k=s)):B.status!=400?he.error(B):Oi("Invalid login credentials.")}t(7,f=!1)}}async function O(){if(!c){t(8,c=!0);try{const q=await he.collection("_superusers").requestOTP(k);t(4,g=q.otpId),t(11,_=g),Ls(),Yt({})}catch(q){q.status==429&&t(4,g=_),he.error(q)}t(8,c=!1)}}async function E(){if(!d){t(9,d=!0);try{await he.collection("_superusers").authWithOTP(g||_,S,{mfaId:h}),Ls(),Yt({}),ls("/")}catch(q){he.error(q)}t(9,d=!1)}}const L=q=>{t(5,s=q.target.value)};function I(){o=this.value,t(6,o)}function A(){k=this.value,t(12,k)}const N=q=>{t(4,g=q.target.value||_),q.target.value=g};function P(){S=this.value,t(13,S)}const R=()=>{t(4,g="")};return n.$$.update=()=>{var q,F;n.$$.dirty&31&&(t(2,u=1),t(1,a=1),(q=r==null?void 0:r.mfa)!=null&&q.enabled&&t(2,u++,u),(F=r==null?void 0:r.otp)!=null&&F.enabled&&t(2,u++,u),h!=""&&t(1,a++,a),g!=""&&t(1,a++,a))},[r,a,u,h,g,s,o,f,c,d,m,_,k,S,T,O,E,L,I,A,N,P,R]}class Lq extends Se{constructor(e){super(),we(this,e,Iq,Dq,ke,{})}}function Gt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t<n.conditions.length;t++)if(!n.conditions[t]||typeof n.conditions[t]!="function")throw Error("Invalid parameter conditions["+t+"]")}return n.loadingComponent&&(n.asyncComponent.loading=n.loadingComponent,n.asyncComponent.loadingParams=n.loadingParams||void 0),{component:n.asyncComponent,userData:n.userData,conditions:n.conditions&&n.conditions.length?n.conditions:void 0,props:n.props&&Object.keys(n.props).length?n.props:{},_sveltesparouter:!0}}const Aq={"/pbinstal/:token":Gt({asyncComponent:()=>Tt(()=>import("./PageInstaller-CVV41nnK.js"),[],import.meta.url),conditions:[n=>n.params.token&&!Pr(n.params.token)],userData:{showAppSidebar:!1}}),"/login":Gt({component:Lq,conditions:[n=>!he.authStore.isValid],userData:{showAppSidebar:!1}}),"/request-password-reset":Gt({asyncComponent:()=>Tt(()=>import("./PageSuperuserRequestPasswordReset-D_nvyjTa.js"),[],import.meta.url),conditions:[n=>!he.authStore.isValid],userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Gt({asyncComponent:()=>Tt(()=>import("./PageSuperuserConfirmPasswordReset-DCCzCUTF.js"),[],import.meta.url),conditions:[n=>!he.authStore.isValid],userData:{showAppSidebar:!1}}),"/collections":Gt({component:cP,conditions:[n=>he.authStore.isValid],userDat