1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-04-28 09:53:27 +02:00
pocketbase/ui/dist/assets/index-b07f7f5b.js

161 lines
967 KiB
JavaScript
Raw Normal View History

var j1=Object.defineProperty;var H1=(n,e,t)=>e in n?j1(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var tr=(n,e,t)=>(H1(n,typeof e!="symbol"?e+"":e,t),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function x(){}const kl=n=>n;function He(n,e){for(const t in e)n[t]=e[t];return n}function V1(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function xg(n){return n()}function fu(){return Object.create(null)}function Te(n){n.forEach(xg)}function Dt(n){return typeof n=="function"}function he(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Pl;function _n(n,e){return n===e?!0:(Pl||(Pl=document.createElement("a")),Pl.href=e,n===Pl.href)}function z1(n){return Object.keys(n).length===0}function ha(n,...e){if(n==null){for(const i of e)i(void 0);return x}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function B1(n){let e;return ha(n,t=>e=t)(),e}function Ye(n,e,t){n.$$.on_destroy.push(ha(e,t))}function Ct(n,e,t,i){if(n){const s=e_(n,e,t,i);return n[0](s)}}function e_(n,e,t,i){return n[1]&&i?He(t.ctx.slice(),n[1](i(e))):t.ctx}function Mt(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r<o;r+=1)l[r]=e.dirty[r]|s[r];return l}return e.dirty|s}return e.dirty}function Ot(n,e,t,i,s,l){if(s){const o=e_(e,t,i,l);n.p(o,s)}}function Et(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 en(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function xe(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function wi(n){return n??""}function sn(n,e,t){return n.set(t),e}function $e(n){return n&&Dt(n.destroy)?n.destroy:x}function cu(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const t_=typeof window<"u";let Fo=t_?()=>window.performance.now():()=>Date.now(),ma=t_?n=>requestAnimationFrame(n):x;const vs=new Set;function n_(n){vs.forEach(e=>{e.c(n)||(vs.delete(e),e.f())}),vs.size!==0&&ma(n_)}function No(n){let e;return vs.size===0&&ma(n_),{promise:new Promise(t=>{vs.add(e={c:n,f:t})}),abort(){vs.delete(e)}}}function b(n,e){n.appendChild(e)}function i_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function U1(n){const e=v("style");return e.textContent="/* empty */",W1(i_(n),e),e.sheet}function W1(n,e){return b(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode&&n.parentNode.removeChild(n)}function _t(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function v(n){return document.createElement(n)}function U(n){return document.createTextNode(n)}function O(){return U(" ")}function ke(){return U("")}function Y(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Qe(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Fn(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 Y1=["width","height"];function ci(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
2023-09-01 09:22:49 +03:00
`;for(let _=0;_<=1;_+=a){const y=e+(t-e)*l(_);u+=_*100+`%{${o(y,1-y)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${G1(f)}_${r}`,d=i_(n),{stylesheet:h,rules:g}=po.get(d)||Z1(d,n);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const m=n.style.animation||"";return n.style.animation=`${m?`${m}, `:""}${c} ${i}ms linear ${s}ms 1 both`,ho+=1,c}function cl(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),ho-=s,ho||X1())}function X1(){ma(()=>{ho||(po.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&k(e)}),po.clear())})}function Q1(n,e,t,i){if(!e)return x;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return x;const{delay:l=0,duration:o=300,easing:r=kl,start:a=Fo()+l,end:u=a+o,tick:f=x,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,g;function m(){c&&(g=fl(n,0,1,o,l,r,c)),l||(h=!0)}function _(){c&&cl(n,g),d=!1}return No(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),_()),!d)return!1;if(h){const S=y-a,T=0+1*r(S/o);f(T,1-T)}return!0}),m(),f(0,1),_}function x1(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,l_(n,s)}}function l_(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let dl;function yi(n){dl=n}function wl(){if(!dl)throw new Error("Function called outside component initialization");return dl}function Zt(n){wl().$$.on_mount.push(n)}function e0(n){wl().$$.after_update.push(n)}function Is(n){wl().$$.on_destroy.push(n)}function wt(){const n=wl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=s_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Ne(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const bs=[],ne=[];let ys=[];const Hr=[],o_=Promise.resolve();let Vr=!1;function r_(){Vr||(Vr=!0,o_.then(ga))}function ln(){return r_(),o_}function Xe(n){ys.push(n)}function _e(n){Hr.push(n)}const nr=new Set;let ds=0;function ga(){if(ds!==0)return;const n=dl;do{try{for(;ds<bs.length;){const e=bs[ds];ds++,yi(e),t0(e.$$)}}catch(e){throw bs.length=0,ds=0,e}for(yi(null),bs.length=0,ds=0;ne.length;)ne.pop()();for(let e=0;e<ys.length;e+=1){const t=ys[e];nr.has(t)||(nr.add(t),t())}ys.length=0}while(bs.length);for(;Hr.length;)Hr.pop()();Vr=!1,nr.clear(),yi(n)}function t0(n){if(n.fragment!==null){n.update(),Te(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Xe)}}function n0(n){const e=[],t=[];ys.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),ys=e}let Hs;function _a(){return Hs||(Hs=Promise.resolve(),Hs.then(()=>{Hs=null})),Hs}function ts(n,e,t){n.dispatchEvent(s_(`${e?"intro":"outro"}${t}`))}const io=new Set;let ai;function re(){ai={r:0,c:[],p:ai}}function ae(){ai.r||Te(ai.c),ai=ai.p}function A(n,e){n&&n.i&&(io.delete(n),n.i(e))}function L(n,e,t,i){if(n&&n.o){if(io.has(n))return;io.add(n),ai.c.push(()=>{io.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ba={duration:0};function a_(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&cl(n,o)}function f(){const{delay:d=0,duration:h=300,easing:g=kl,tick:m=x,css:_}=s||ba;_&&(o=fl(n,0,1,h,d,g,_,a++)),m(0,1);const y=Fo()+d,S=y+h;r&&r.abort(),l=!0,Xe(()=>ts(n,!0,"start")),r=No(T=>{if(l){if(T>=S)return m(1,0),ts(n,!0,"end"),u(),l=!1;if(T>=y){const $=g((T-y)/h);m($,1-$)}}return l})}let c=!1;return{start(){c||(c=!0,cl(n),Dt(s)?(s=s(i),_a().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function va(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=ai;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=kl,tick:h=x,css:g}=s||ba;g&&(o=fl(n,1,0,c,f,d,g));const m=Fo()+f,_=m+c;Xe(()=>ts(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),No(y=>{if(l){if(y>=_)return h(0,1),ts(
2023-09-01 09:22:49 +03:00
`),t+=i.map(s=>{let l="";return s.name.includes("(")||s.name.includes(" ")?l+=s.name:l+="`"+s.name+"`",s.collate&&(l+=" COLLATE "+s.collate),s.sort&&(l+=" "+s.sort.toUpperCase()),l}).join(`,
`),i.length>1&&(t+=`
`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=z.parseIndex(e);return i.tableName=t,z.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=z.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?z.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const s of i)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}}const zo=Nn([]);function bo(n,e=4e3){return Bo(n,"info",e)}function jt(n,e=3e3){return Bo(n,"success",e)}function ls(n,e=4500){return Bo(n,"error",e)}function Iy(n,e=4500){return Bo(n,"warning",e)}function Bo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{hb(i)},t)};zo.update(s=>(Ia(s,i.message),z.pushOrReplaceByKey(s,i,"message"),s))}function hb(n){zo.update(e=>(Ia(e,n),e))}function Aa(){zo.update(n=>{for(let e of n)Ia(n,e);return[]})}function Ia(n,e){let t;typeof e=="string"?t=z.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),z.removeByKey(n,"message",t.message))}const Ci=Nn({});function tn(n){Ci.set(n||{})}function di(n){Ci.update(e=>(z.deleteByPath(e,n),e))}const La=Nn({});function Gr(n){La.set(n||{})}const ii=Nn([]),$i=Nn({}),vo=Nn(!1),mb=Nn({});function Ly(n){ii.update(e=>{const t=z.findByKey(e,"id",n);return t?$i.set(t):e.length&&$i.set(e[0]),e})}function Py(n){$i.update(e=>z.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),ii.update(e=>(z.pushOrReplaceByKey(e,n,"id"),Pa(),z.sortCollections(e)))}function Fy(n){ii.update(e=>(z.removeByKey(e,"id",n.id),$i.update(t=>t.id===n.id?e[0]:t),Pa(),e))}async function Ny(n=null){vo.set(!0);try{let e=await fe.collections.getFullList(200,{sort:"+name"});e=z.sortCollections(e),ii.set(e);const t=n&&z.findByKey(e,"id",n);t?$i.set(t):e.length&&$i.set(e[0]),Pa()}catch(e){fe.error(e)}vo.set(!1)}function Pa(){mb.update(n=>(ii.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(s=>{var l;return s.type=="file"&&((l=s.options)==null?void 0:l.protected)}));return e}),n))}const dr="pb_admin_file_token";qo.prototype.logout=function(n=!0){this.authStore.clear(),n&&Hi("/login")};qo.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{},l=s.message||n.message||t;if(e&&l&&ls(l),z.isEmpty(s.data)||tn(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Hi("/")};qo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=B1(mb);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(dr)||"";return(!t||ka(t,10))&&(t&&localStorage.removeItem(dr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(dr,t),this._adminFileTokenRequest=null),t};class Ry extends m_{save(e,t){super.save(e,t),t&&!t.collectionId&&Gr(t)}clear(){super.clear(),Gr(null)}}const fe=new qo("../",new Ry("pb_admin_auth"));fe.authStore.model&&!fe.authStore.model.collectionId&&Gr(fe.authStore.model);function qy(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=n[3].default,g=Ct(h,n,n[2],null);return{c(){e=v("div"),t=v("main"),g&&g.c(),i=O(),s=v("footer"),l=v("a"),l.innerHTML='<i class="ri-book-open-line txt-sm"></i> <span class="txt">Docs</span>',o=O(),r=v("span"),r.textContent="|",a=O(),u=v("a"),f=v("span"),f.textContent="PocketBase v0.18.7",p(t,"class","page-content"),p(l,"href","https://pocketbase.io/docs/"),p(l,"target","_blank"),p(l,"rel","noopener noreferrer"),p(r,"class","delimiter"),p(f,"class","txt"),p(u,"href","https:/
2023-09-01 09:22:49 +03:00
transform: ${u} translate(${(1-m)*c}${d}, ${(1-m)*h}${g});
2023-09-05 11:49:01 +03:00
opacity: ${a-f*_}`}}function nt(n,{delay:e=0,duration:t=400,easing:i=Uo,axis:s="y"}={}){const l=getComputedStyle(n),o=+l.opacity,r=s==="y"?"height":"width",a=parseFloat(l[r]),u=s==="y"?["top","bottom"]:["left","right"],f=u.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(l[`padding${f[0]}`]),d=parseFloat(l[`padding${f[1]}`]),h=parseFloat(l[`margin${f[0]}`]),g=parseFloat(l[`margin${f[1]}`]),m=parseFloat(l[`border${f[0]}Width`]),_=parseFloat(l[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${r}: ${y*a}px;padding-${u[0]}: ${y*c}px;padding-${u[1]}: ${y*d}px;margin-${u[0]}: ${y*h}px;margin-${u[1]}: ${y*g}px;border-${u[0]}-width: ${y*m}px;border-${u[1]}-width: ${y*_}px;`}}function Gt(n,{delay:e=0,duration:t=400,easing:i=Uo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>`
2023-09-01 09:22:49 +03:00
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
`}}let Xr,Yi;const Qr="app-tooltip";function Ku(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ni(){return Yi=Yi||document.querySelector("."+Qr),Yi||(Yi=document.createElement("div"),Yi.classList.add(Qr),document.body.appendChild(Yi)),Yi}function _b(n,e){let t=Ni();if(!t.classList.contains("active")||!(e!=null&&e.text)){xr();return}t.textContent=e.text,t.className=Qr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function xr(){clearTimeout(Xr),Ni().classList.remove("active"),Ni().activeNode=void 0}function By(n,e){Ni().activeNode=n,clearTimeout(Xr),Xr=setTimeout(()=>{Ni().classList.add("active"),_b(n,e)},isNaN(e.delay)?0:e.delay)}function je(n,e){let t=Ku(e);function i(){By(n,t)}function s(){xr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&z.isFocusable(n))&&n.addEventListener("click",s),Ni(),{update(l){var o,r;t=Ku(l),(r=(o=Ni())==null?void 0:o.activeNode)!=null&&r.contains(n)&&_b(n,t)},destroy(){var l,o;(o=(l=Ni())==null?void 0:l.activeNode)!=null&&o.contains(n)&&xr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Ju(n,e,t){const i=n.slice();return i[12]=e[t],i}const Uy=n=>({}),Gu=n=>({uniqueId:n[4]});function Wy(n){let e,t,i=pe(n[3]),s=[];for(let o=0;o<i.length;o+=1)s[o]=Zu(Ju(n,i,o));const l=o=>L(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=ke()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&8){i=pe(o[3]);let a;for(a=0;a<i.length;a+=1){const u=Ju(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Zu(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)L(s[r]);t=!1},d(o){o&&k(e),_t(s,o)}}}function Yy(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("i"),p(t,"class","ri-error-warning-fill txt-danger"),p(e,"class","form-field-addon")},m(a,u){w(a,e,u),b(e,t),l=!0,o||(r=$e(i=je.call(null,t,{position:"left",text:n[3].map(yo).join(`
`)})),o=!0)},p(a,u){i&&Dt(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(yo).join(`
2023-09-22 21:24:46 +03:00
`)})},i(a){l||(a&&Xe(()=>{l&&(s||(s=qe(t,Gt,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=qe(t,Gt,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&k(e),a&&s&&s.end(),o=!1,r()}}}function Zu(n){let e,t,i=yo(n[12])+"",s,l,o,r;return{c(){e=v("div"),t=v("pre"),s=U(i),l=O(),p(e,"class","help-block help-block-error")},m(a,u){w(a,e,u),b(e,t),b(t,s),b(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=yo(a[12])+"")&&se(s,i)},i(a){r||(a&&Xe(()=>{r&&(o||(o=qe(e,nt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=qe(e,nt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&k(e),a&&o&&o.end()}}}function Ky(n){let e,t,i,s,l,o,r;const a=n[9].default,u=Ct(a,n,n[8],Gu),f=[Yy,Wy],c=[];function d(h,g){return h[0]&&h[3].length?0:1}return i=d(n),s=c[i]=f[i](n),{c(){e=v("div"),u&&u.c(),t=O(),s.c(),p(e,"class",n[1]),Q(e,"error",n[3].length)},m(h,g){w(h,e,g),u&&u.m(e,null),b(e,t),c[i].m(e,null),n[11](e),l=!0,o||(r=Y(e,"click",n[10]),o=!0)},p(h,[g]){u&&u.p&&(!l||g&256)&&Ot(u,a,h,h[8],l?Mt(a,h[8],g,Uy):Et(h[8]),Gu);let m=i;i=d(h),i===m?c[i].p(h,g):(re(),L(c[m],1,1,()=>{c[m]=null}),ae(),s=c[i],s?s.p(h,g):(s=c[i]=f[i](h),s.c()),A(s,1),s.m(e,null)),(!l||g&2)&&p(e,"class",h[1]),(!l||g&10)&&Q(e,"error",h[3].length)},i(h){l||(A(u,h),A(s),l=!0)},o(h){L(u,h),L(s),l=!1},d(h){h&&k(e),u&&u.d(h),c[i].d(),n[11](null),o=!1,r()}}}const Xu="Invalid value";function yo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Xu:n||Xu}function Jy(n,e,t){let i;Ye(n,Ci,m=>t(7,i=m));let{$$slots:s={},$$scope:l}=e;const o="field_"+z.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){di(r)}Zt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function h(m){Ne.call(this,n,m)}function g(m){ne[m?"unshift":"push"](()=>{f=m,t(2,f)})}return n.$$set=m=>{"name"in m&&t(5,r=m.name),"inlineError"in m&&t(0,a=m.inlineError),"class"in m&&t(1,u=m.class),"$$scope"in m&&t(8,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=z.toArray(z.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,l,s,h,g]}class ce extends ve{constructor(e){super(),be(this,e,Jy,Ky,he,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function Gy(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=O(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),oe(l,n[0]),l.focus(),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&oe(l,u[0])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function Zy(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Password"),s=O(),l=v("input"),r=O(),a=v("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),oe(l,n[1]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(l,"id",o),d&2&&l.value!==c[1]&&oe(l,c[1])},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function Xy(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Password confirm"),s=O(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),oe(l,n[2]),r||(a=Y(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&4&&l.value!==u[2]&&oe(l,u[2])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function Qy(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return s=new ce({props:{class:"form-field required",name:"email",$$slots:{default:[Gy,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[Zy,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field required",name:"passwordConfirm",
2023-09-01 09:22:49 +03:00
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/function gi(){}const Lk=function(){let n=0;return function(){return n++}}();function pt(n){return n===null||typeof n>"u"}function Tt(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function tt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Bt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Hn(n,e){return Bt(n)?n:e}function st(n,e){return typeof n>"u"?e:n}const Pk=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,bb=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function qt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function gt(n,e,t,i){let s,l,o;if(Tt(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(tt(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function wo(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function So(n){if(Tt(n))return n.map(So);if(tt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=So(n[t[s]]);return e}return n}function vb(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Fk(n,e,t,i){if(!vb(n))return;const s=e[n],l=t[n];tt(s)&&tt(l)?pl(s,l,i):e[n]=So(l)}function pl(n,e,t){const i=Tt(e)?e:[e],s=i.length;if(!tt(n))return n;t=t||{};const l=t.merger||Fk;for(let o=0;o<s;++o){if(e=i[o],!tt(e))continue;const r=Object.keys(e);for(let a=0,u=r.length;a<u;++a)l(r[a],n,e,t)}return n}function sl(n,e){return pl(n,e,{merger:Nk})}function Nk(n,e,t){if(!vb(n))return;const i=e[n],s=t[n];tt(i)&&tt(s)?sl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=So(s))}const cf={"":n=>n,x:n=>n.x,y:n=>n.y};function qi(n,e){return(cf[e]||(cf[e]=Rk(e)))(n)}function Rk(n){const e=qk(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function qk(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Na(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Jn=n=>typeof n<"u",ji=n=>typeof n=="function",df=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function jk(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Vt=Math.PI,vt=2*Vt,Hk=vt+Vt,$o=Number.POSITIVE_INFINITY,Vk=Vt/180,Ht=Vt/2,Ws=Vt/4,pf=Vt*2/3,Wn=Math.log10,fi=Math.sign;function hf(n){const e=Math.round(n);n=ll(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Wn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function zk(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function Os(n){return!isNaN(parseFloat(n))&&isFinite(n)}function ll(n,e,t){return Math.abs(n-e)<t}function Bk(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function yb(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function ti(n){return n*(Vt/180)}function Ra(n){return n*(180/Vt)}function mf(n){if(!Bt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function kb(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*Vt&&(l+=vt),{angle:l,distance:s}}function ea(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Uk(n,e){return(n-e+Hk)%vt-Vt}function In(n){return(n%vt+vt)%vt}function hl(n,e,t,i){const s=In(n),l=In(e),o=In(t),r=In(l-s),a=In(o-s),u=In(s-l),f=In(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function dn(n,e,t){return Math.max(e,Math.min(t,n))}function Wk(n){return dn(n,-32768,32767)}function ml(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function qa(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,l;for(;i-s>1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const es=(n,e,t,i)=>qa(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),Yk=(n,e,t)=>qa(n,t,i=>n[i][e]>=t);function Kk(n,e,
2023-09-01 09:22:49 +03:00
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function Ml(n){return n+.5|0}const Li=(n,e,t)=>Math.max(Math.min(n,t),e);function el(n){return Li(Ml(n*2.55),0,255)}function Ri(n){return Li(Ml(n*255),0,255)}function vi(n){return Li(Ml(n/2.55)/100,0,1)}function yf(n){return Li(Ml(n*100),0,100)}const jn={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},ta=[..."0123456789ABCDEF"],Xk=n=>ta[n&15],Qk=n=>ta[(n&240)>>4]+ta[n&15],zl=n=>(n&240)>>4===(n&15),xk=n=>zl(n.r)&&zl(n.g)&&zl(n.b)&&zl(n.a);function e2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&jn[n[1]]*17,g:255&jn[n[2]]*17,b:255&jn[n[3]]*17,a:e===5?jn[n[4]]*17:255}:(e===7||e===9)&&(t={r:jn[n[1]]<<4|jn[n[2]],g:jn[n[3]]<<4|jn[n[4]],b:jn[n[5]]<<4|jn[n[6]],a:e===9?jn[n[7]]<<4|jn[n[8]]:255})),t}const t2=(n,e)=>n<255?e(n):"";function n2(n){var e=xk(n)?Xk:Qk;return n?"#"+e(n.r)+e(n.g)+e(n.b)+t2(n.a,e):void 0}const i2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ob(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function s2(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function l2(n,e,t){const i=Ob(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function o2(n,e,t,i,s){return n===s?(e-t)/i+(e<t?6:0):e===s?(t-n)/i+2:(n-e)/i+4}function ja(n){const t=n.r/255,i=n.g/255,s=n.b/255,l=Math.max(t,i,s),o=Math.min(t,i,s),r=(l+o)/2;let a,u,f;return l!==o&&(f=l-o,u=r>.5?f/(2-l-o):f/(l+o),a=o2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Ha(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ri)}function Va(n,e,t){return Ha(Ob,n,e,t)}function r2(n,e,t){return Ha(l2,n,e,t)}function a2(n,e,t){return Ha(s2,n,e,t)}function Eb(n){return(n%360+360)%360}function u2(n){const e=i2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?el(+e[5]):Ri(+e[5]));const s=Eb(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=r2(s,l,o):e[1]==="hsv"?i=a2(s,l,o):i=Va(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function f2(n,e){var t=ja(n);t[0]=Eb(t[0]+e),t=Va(t),n.r=t[0],n.g=t[1],n.b=t[2]}function c2(n){if(!n)return;const e=ja(n),t=e[0],i=yf(e[1]),s=yf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${vi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const kf={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"},wf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"
2023-09-01 09:22:49 +03:00
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class hw{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const l=t.listeners[s],o=t.duration;l.forEach(r=>r({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=$b.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var _i=new hw;const Pf="transparent",mw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=$f(n||Pf),s=i.valid&&$f(e||Pf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class gw{constructor(e,t,i,s){const l=t[i];s=Wl([e.to,s,l,e.from]);const o=Wl([e.from,l,s]);this._active=!0,this._fn=e.fn||mw[e.type||typeof o],this._easing=ol[e.easing]||ol.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Wl([e.to,t,s,e.from]),this._from=Wl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t<i),!this._active){this._target[s]=r,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][t]()}}const _w=["x","y","borderWidth","radius","tension"],bw=["color","borderColor","backgroundColor"];lt.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const vw=Object.keys(lt.animation);lt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});lt.set("animations",{colors:{type:"color",properties:bw},numbers:{type:"number",properties:_w}});lt.describe("animations",{_fallback:"animation"});lt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class Ub{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!tt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!tt(s))return;const l={};for(con
2023-09-01 09:22:49 +03:00
`)>-1?n.split(`
`):n}function FS(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function cc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Ln(e.bodyFont),u=Ln(e.titleFont),f=Ln(e.footerFont),c=l.length,d=s.length,h=i.length,g=Gn(e.padding);let m=g.height,_=0,y=i.reduce(($,C)=>$+C.before.length+C.lines.length+C.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(m+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;m+=h*$+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(m+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const T=function($){_=Math.max(_,t.measureText($).width+S)};return t.save(),t.font=u.string,gt(n.title,T),t.font=a.string,gt(n.beforeBody.concat(n.afterBody),T),S=e.displayColors?o+2+e.boxPadding:0,gt(i,$=>{gt($.before,T),gt($.lines,T),gt($.after,T)}),S=0,t.font=f.string,gt(n.footer,T),t.restore(),_+=g.width,{width:_,height:m}}function NS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function RS(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function qS(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),RS(u,n,e,t)&&(u="center"),u}function dc(n,e,t){const i=t.yAlign||e.yAlign||NS(n,t);return{xAlign:t.xAlign||e.xAlign||qS(n,e,t,i),yAlign:i}}function jS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function HS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function pc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:h}=ws(o);let g=jS(e,r);const m=HS(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+s:r==="right"&&(g+=Math.max(c,h)+s),{x:dn(g,0,i.width-e.width),y:dn(m,0,i.height-e.height)}}function Ql(n,e,t){const i=Gn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function hc(n){return ri([],bi(n))}function VS(n,e,t){return Vi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function mc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class fa extends Mi{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new Ub(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=VS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=ri(r,bi(s)),r=ri(r,bi(l)),r=ri(r,bi(o)),r}getBeforeBody(e,t){return hc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return gt(e,l=>{const o={before:[],lines:[],after:[]},r=mc(i,l);ri(o.before,bi(r.beforeLabel.call(this,l))
2023-09-01 09:22:49 +03:00
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const a4={datetime:Be.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Be.TIME_WITH_SECONDS,minute:Be.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Gb._date.override({_id:"luxon",_create:function(n){return Be.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return a4},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=Be.fromFormat(n,e,t):n=Be.fromISO(n,t):n instanceof Date?n=Be.fromJSDate(n,t):i==="object"&&!(n instanceof Be)&&(n=Be.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function Sc(n){let e,t,i;return{c(){e=v("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Xe(()=>{i&&(t||(t=qe(e,Gt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,Gt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function u4(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=U(n[1]),t=O(),s=U(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&se(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&se(s,i)},d(l){l&&(k(e),k(t),k(s))}}}function f4(n){let e;return{c(){e=U("Loading...")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function c4(n){let e,t,i,s,l,o=n[2]&&Sc();function r(f,c){return f[2]?f4:u4}let a=r(n),u=a(n);return{c(){e=v("div"),o&&o.c(),t=O(),i=v("canvas"),s=O(),l=v("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),jr(i,"height","250px"),jr(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){w(f,e,c),o&&o.m(e,null),b(e,t),b(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=Sc(),o.c(),A(o,1),o.m(e,t)):o&&(re(),L(o,1,1,()=>{o=null}),ae()),c&4&&Q(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){L(o)},d(f){f&&(k(e),k(s),k(l)),o&&o.d(),n[8](null),u.d()}}}function d4(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),fe.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let g of h)r.push({x:new Date(g.date),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),fe.error(h,(h==null?void 0:h.status)!=400))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Zt(()=>(Io.register(zi,Zo,Jo,iu,Al,PS,zS),t(6,o=new Io(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:h=>h.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>h.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(h){ne[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].d
2023-09-01 09:22:49 +03:00
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
2023-09-05 11:49:01 +03:00
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function S(T){return T instanceof a?new a(T.type,S(T.content),T.alias):Array.isArray(T)?T.map(S):T.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(S){return Object.prototype.toString.call(S).slice(8,-1)},objId:function(S){return S.__id||Object.defineProperty(S,"__id",{value:++l}),S.__id},clone:function S(T,$){$=$||{};var C,M;switch(r.util.type(T)){case"Object":if(M=r.util.objId(T),$[M])return $[M];C={},$[M]=C;for(var E in T)T.hasOwnProperty(E)&&(C[E]=S(T[E],$));return C;case"Array":return M=r.util.objId(T),$[M]?$[M]:(C=[],$[M]=C,T.forEach(function(D,I){C[I]=S(D,$)}),C);default:return T}},getLanguage:function(S){for(;S;){var T=s.exec(S.className);if(T)return T[1].toLowerCase();S=S.parentElement}return"none"},setLanguage:function(S,T){S.className=S.className.replace(RegExp(s,"gi"),""),S.classList.add("language-"+T)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(C){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(C.stack)||[])[1];if(S){var T=document.getElementsByTagName("script");for(var $ in T)if(T[$].src==S)return T[$]}return null}},isActive:function(S,T,$){for(var C="no-"+T;S;){var M=S.classList;if(M.contains(T))return!0;if(M.contains(C))return!1;S=S.parentElement}return!!$}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(S,T){var $=r.util.clone(r.languages[S]);for(var C in T)$[C]=T[C];return $},insertBefore:function(S,T,$,C){C=C||r.languages;var M=C[S],E={};for(var D in M)if(M.hasOwnProperty(D)){if(D==T)for(var I in $)$.hasOwnProperty(I)&&(E[I]=$[I]);$.hasOwnProperty(D)||(E[D]=M[D])}var P=C[S];return C[S]=E,r.languages.DFS(r.languages,function(F,N){N===P&&F!=S&&(this[F]=E)}),E},DFS:function S(T,$,C,M){M=M||{};var E=r.util.objId;for(var D in T)if(T.hasOwnProperty(D)){$.call(T,D,T[D],C||D);var I=T[D],P=r.util.type(I);P==="Object"&&!M[E(I)]?(M[E(I)]=!0,S(I,$,null,M)):P==="Array"&&!M[E(I)]&&(M[E(I)]=!0,S(I,$,D,M))}}},plugins:{},highlightAll:function(S,T){r.highlightAllUnder(document,S,T)},highlightAllUnder:function(S,T,$){var C={callback:$,container:S,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",C),C.elements=Array.prototype.slice.apply(C.container.querySelectorAll(C.selector)),r.hooks.run("before-all-elements-highlight",C);for(var M=0,E;E=C.elements[M++];)r.highlightElement(E,T===!0,C.callback)},highlightElement:function(S,T,$){var C=r.util.getLanguage(S),M=r.languages[C];r.util.setLanguage(S,C);var E=S.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(E,C);var D=S.textContent,I={element:S,language:C,grammar:M,code:D};function P(N){I.highlightedCode=N,r.hooks.run("before-insert",I),I.element.innerHTML=I.highlightedCode,r.hooks.run("after-highlight",I),r.hooks.run("complete",I),$&&$.call(I.element)}if(r.hooks.run("before-sanity-check",I),E=I.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!I.code){r.hooks.run("complete",I),$&&$.call(I.element);return}if(r.hooks.run("before-highlight",I),!I.grammar){P(r.util.encode(I.code));return}if(T&&i.Worker){var F=new Worker(r.filename);F.onmessage=function(N){P(N.data)},F.postMessage(JSON.stringify({language:I.language,code:I.code,immediateClose:!0}))}else P(r.highlight(I.code,I.grammar,I.language))},highlight:function(S,T,$){var C={code:S,grammar:T,language:$};if(r.hooks.run("before-tokenize",C),!C.grammar)throw new Error('The language "'+C.language+'" has no grammar.');return C.tokens=r.tokenize(C.code,C.grammar),r.hooks.run("after-tokenize",C),a.stringify(r.util.encode(C.tokens),C.language)},tokenize:function(S,T){var $=T.rest;if($){for(var C in $)T[C]=$[C];delete T.rest}var M=new c;return d(M,M.head,S),f(S,M,T,M.head,0),g(M)},hooks:{all:{},add:function
`),_.hasAttribute("data-start")||_.setAttribute("data-start",String(I+1))}y.textContent=M,t.highlightElement(y)},function(M){_.setAttribute(r,f),y.textContent=M})}}),t.plugins.fileHighlight={highlight:function(_){for(var y=(_||document).querySelectorAll(c),S=0,T;T=y[S++];)t.highlightElement(T)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(m1);var m4=m1.exports;const Xs=h4(m4);var g4={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var l={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};t.prototype={setDefaults:function(o){this.defaults=e(this.defaults,o)},normalize:function(o,r){r=e(this.defaults,r);for(var a in r){var u=i(a);a!=="normalize"&&u!=="setDefaults"&&r[a]&&this[u]&&(o=this[u].call(this,o,r[a]))}return o},leftTrim:function(o){return o.replace(/^\s+/,"")},rightTrim:function(o){return o.replace(/\s+$/,"")},tabsToSpaces:function(o,r){return r=r|0||4,o.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(o,r){return r=r|0||4,o.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(o){return o.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(o){return o.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(o){var r=o.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(a,u){return a.length-u.length}),!r[0].length)?o:o.replace(RegExp("^"+r[0],"gm"),"")},indent:function(o,r){return o.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(o,r){r=r===!0?80:r|0||80;for(var a=o.split(`
2023-09-01 09:22:49 +03:00
`),u=0;u<a.length;++u)if(!(s(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),c=0,d=0;d<f.length;++d){var h=s(f[d]);c+=h,c>r&&(f[d]=`
`+f[d],c=h)}a[u]=f.join("")}return a.join(`
2023-09-22 21:24:46 +03:00
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,h="",g="",m=!1,_=0;_<d.length;++_){var y=d[_];y==o.element?m=!0:y.nodeName==="#text"&&(m?g+=y.nodeValue:h+=y.nodeValue,a.removeChild(y),--_)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=h+o.code+g,o.code=r.normalize(o.code,o.settings);else{var S=h+o.element.innerHTML+g;o.element.innerHTML=r.normalize(S,o.settings),o.code=o.element.textContent}}}})})()})(g4);(function(n){var e=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],t=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,i={pattern:RegExp(t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};n.languages.dart=n.languages.extend("clike",{"class-name":[i,{pattern:RegExp(t+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:e,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function _4(n){let e,t,i;return{c(){e=v("div"),t=v("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){w(s,e,l),b(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&p(e,"class",i)},i:x,o:x,d(s){s&&k(e)}}}function b4(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Xs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Xs.highlight(a,Xs.languages[l]||Xs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Xs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class g1 extends ve{constructor(e){super(),be(this,e,b4,_4,he,{class:0,content:2,language:3})}}const v4=n=>({}),Tc=n=>({}),y4=n=>({}),Cc=n=>({});function Mc(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,T=n[4]&&!n[2]&&Oc(n);const $=n[19].header,C=Ct($,n,n[18],Cc);let M=n[4]&&n[2]&&Ec(n);const E=n[19].default,D=Ct(E,n,n[18],null),I=n[19].footer,P=Ct(I,n,n[18],Tc);return{c(){e=v("div"),t=v("div"),s=O(),l=v("div"),o=v("div"),T&&T.c(),r=O(),C&&C.c(),a=O(),M&&M.c(),u=O(),f=v("div"),D&&D.c(),c=O(),d=v("div"),P&&P.c(),p(t,
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&256&&l!==(l=_[8]))&&p(e,"for",l);const S={};y&256&&(S.id=_[8]),y&1&&(S.disabled=!z.isEmpty(_[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.exceptDomains,_e(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),H(r,_),d=!1,h()}}}function N$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[4](_)}let m={id:n[8]+".options.onlyDomains",disabled:!z.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(m.value=n[0].options.onlyDomains),r=new Rs({props:m}),ne.push(()=>de(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=O(),s=v("i"),o=O(),V(r.$$.fragment),u=O(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]+".options.onlyDomains"),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),j(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=$e(je.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&256&&l!==(l=_[8]+".options.onlyDomains"))&&p(e,"for",l);const S={};y&256&&(S.id=_[8]+".options.onlyDomains"),y&1&&(S.disabled=!z.isEmpty(_[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.onlyDomains,_e(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),H(r,_),d=!1,h()}}}function R$(n){let e,t,i,s,l,o,r;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[F$,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[N$,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=O(),l=v("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),j(i,t,null),b(e,s),b(e,l),j(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&769&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&769&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(i),H(o)}}}function q$(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[R$]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=He(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new hi({props:o}),ne.push(()=>de(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){V(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?kt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],_e(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function j$(n,e,t){const i=["field","key"];let s=xe(e,i),{field:l}=e,{key:o=""}=e;function r(d){n.$$.not_equal(l.options.exceptDomains,d)&&(l.options.exceptDomains=d,t(0,l))}function a(d){n.$$.not_equal(l.options.onlyDomains,d)&&(l.options.onlyDomains=d,t(0,l))}function u(d){l=d,t(0,l)}function f(d){Ne.call(this,n,d)}function c(d){Ne.call(this,n,d)}return n.$$set=d=>{e=He(He({},e),en(d)),t(2,s=xe(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,s,r,a,u,f,c]}class v1 extends ve{constructor(e){super(),be(this,e,j$,q$,he,{field:0,key:1})}}function H$(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r<s.length;r+=1)o=He(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new v1({props:o}),ne.push(()=>de(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){V(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?kt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],_e(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function V$(n,e,t){const i=["field","key"];let s=xe(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Ne.call(this,n,f)}function u(f){Ne.call(this,n,f)}return n.$$set=f=>{e=He(He({},e),en(f)),t(2,s=xe(e,i)),"field"in f&&t(0,l=f.field),"key"in f&&t(1,o=f.key)},[l,o,s,r,a,u]}class z$ extends ve{constructor(e){super(),be(this,e,V$,H$,he,{field:0,key:1})}}function B$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=O(),s=v("label"),l=v("span"),l.textContent="Strip urls domain",o=O(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[8])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[3]),$e(je.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],u=!0)},p(c,d){d&256&&t!==(t=c[8])&&p(e,"id",t),d&1&&(e.checked=c[0].options.convertUrls),d&256&&a!==(a=c[8])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,Te(f)}}}function U$
2023-09-01 09:22:49 +03:00
<span class='flatpickr-weekday'>
`+G.join("</span><span class='flatpickr-weekday'>")+`
2023-09-01 09:22:49 +03:00
</span>
`}}function ue(){t.calendarContainer.classList.add("hasWeeks");var W=ct("div","flatpickr-weekwrapper");W.appendChild(ct("span","flatpickr-weekday",t.l10n.weekAbbreviation));var G=ct("div","flatpickr-weeks");return W.appendChild(G),{weekWrapper:W,weekNumbers:G}}function ee(W,G){G===void 0&&(G=!0);var ie=G?W:W-t.currentMonth;ie<0&&t._hidePrevMonthArrow===!0||ie>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ie,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,we("onYearChange"),R()),N(),we("onMonthChange"),an())}function te(W,G){if(W===void 0&&(W=!0),G===void 0&&(G=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,G===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ie=Lr(t.config),le=ie.hours,Ce=ie.minutes,Le=ie.seconds;h(le,Ce,Le)}t.redraw(),W&&we("onChange")}function Ee(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),we("onClose")}function Fe(){t.config!==void 0&&we("onDestroy");for(var W=t._handlers.length;W--;)t._handlers[W].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var G=t.calendarContainer.parentNode;if(G.lastChild&&G.removeChild(G.lastChild),G.parentNode){for(;G.firstChild;)G.parentNode.insertBefore(G.firstChild,G);G.parentNode.removeChild(G)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ie){try{delete t[ie]}catch{}})}function Ve(W){return t.calendarContainer.contains(W)}function ze(W){if(t.isOpen&&!t.config.inline){var G=En(W),ie=Ve(G),le=G===t.input||G===t.altInput||t.element.contains(G)||W.path&&W.path.indexOf&&(~W.path.indexOf(t.input)||~W.path.indexOf(t.altInput)),Ce=!le&&!ie&&!Ve(W.relatedTarget),Le=!t.config.ignoredFocusElements.some(function(Pe){return Pe.contains(G)});Ce&&Le&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function Se(W){if(!(!W||t.config.minDate&&W<t.config.minDate.getFullYear()||t.config.maxDate&&W>t.config.maxDate.getFullYear())){var G=W,ie=t.currentYear!==G;t.currentYear=G||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ie&&(t.redraw(),we("onYearChange"),R())}}function Me(W,G){var ie;G===void 0&&(G=!0);var le=t.parseDate(W,void 0,G);if(t.config.minDate&&le&&Dn(le,t.config.minDate,G!==void 0?G:!t.minDateHasTime)<0||t.config.maxDate&&le&&Dn(le,t.config.maxDate,G!==void 0?G:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)ret
2023-09-01 09:22:49 +03:00
`),r=v("code"),r.textContent="multipart/form-data",a=U(`
requests, the following normalization rules are applied if the `),u=v("code"),u.textContent="json",f=U(` field
is a
`),c=v("strong"),c.textContent="plain string",d=U(`:
`),h=v("ul"),g=v("li"),g.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",m=O(),_=v("li"),_.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",y=O(),S=v("li"),S.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",T=O(),$=v("li"),$.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",C=O(),M=v("li"),D=U(E),I=U(" is converted to the json "),P=v("code"),P.textContent='{"a":1,"b":2}',F=O(),N=v("li"),N.textContent="numeric strings are converted to json number",R=O(),q=v("li"),q.textContent="double quoted strings are left as they are (aka. without normalizations)",B=O(),K=v("li"),K.textContent="any other string (empty string too) is double quoted",J=U(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your
data inside an object, eg.`),X=v("code"),X.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(ee,te){w(ee,e,te),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o),b(i,r),b(i,a),b(i,u),b(i,f),b(i,c),b(i,d),b(i,h),b(h,g),b(h,m),b(h,_),b(h,y),b(h,S),b(h,T),b(h,$),b(h,C),b(h,M),b(M,D),b(M,I),b(M,P),b(h,F),b(h,N),b(h,R),b(h,q),b(h,B),b(h,K),b(i,J),b(i,X),ue=!0},i(ee){ue||(ee&&Xe(()=>{ue&&(Z||(Z=qe(e,nt,{duration:150},!0)),Z.run(1))}),ue=!0)},o(ee){ee&&(Z||(Z=qe(e,nt,{duration:150},!1)),Z.run(0)),ue=!1},d(ee){ee&&k(e),ee&&Z&&Z.end()}}}function NT(n){let e,t,i,s,l,o,r;function a(d,h){return d[2]?FT:PT}let u=a(n),f=u(n),c=n[2]&&vd();return{c(){e=v("button"),t=v("strong"),t.textContent="String value normalizations",i=O(),f.c(),s=O(),c&&c.c(),l=ke(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,h){w(d,e,h),b(e,t),b(e,i),f.m(e,null),w(d,s,h),c&&c.m(d,h),w(d,l,h),o||(r=Y(e,"click",n[4]),o=!0)},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[2]?c?h&4&&A(c,1):(c=vd(),c.c(),A(c,1),c.m(l.parentNode,l)):c&&(re(),L(c,1,1,()=>{c=null}),ae())},d(d){d&&(k(e),k(s),k(l)),f.d(),c&&c.d(d),o=!1,r()}}}function RT(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[NT]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=He(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new hi({props:o}),ne.push(()=>de(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){V(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&10?kt(s,[a&2&&{key:r[1]},a&8&&Pt(r[3])]):{};a&260&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],_e(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function qT(n,e,t){const i=["field","key"];let s=xe(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(d){l=d,t(0,l)}function f(d){Ne.call(this,n,d)}function c(d){Ne.call(this,n,d)}return n.$$set=d=>{e=He(He({},e),en(d)),t(3,s=xe(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,r,s,a,u,f,c]}class jT extends ve{constructor(e){super(),be(this,e,qT,RT,he,{field:0,key:1})}}function HT(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=v("span"),i=U(t),s=O(),l=v("small"),r=U(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){w(a,e,u),b(e,i),w(a,s,u),w(a,l,u),b(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&se(i,t),u&1&&o!==(o=a[0].mimeType+"")&&se(r,o)},i:x,o:x,d(a){a&&(k(e),k(s),k(l))}}}function VT(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class yd extends ve{constructor(e){super(),be(this,e,VT,HT,he,{item:0})}}const zT=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:
Leave empty for no restriction.`,position:"top"})),S=!0)},p(M,E){(!y||E&4194304&&l!==(l=M[22]))&&p(e,"for",l);const D={};E&4194304&&(D.id=M[22]),E&8&&(D.items=M[3]),!a&&E&1&&(a=!0,D.keyOfSelected=M[0].options.mimeTypes,_e(()=>a=!1)),r.$set(D);const I={};E&16777217&&(I.$$scope={dirty:E,ctx:M}),_.$set(I)},i(M){y||(A(r.$$.fragment,M),A(_.$$.fragment,M),y=!0)},o(M){L(r.$$.fragment,M),L(_.$$.fragment,M),y=!1},d(M){M&&(k(e),k(o),k(u),k(f)),H(r,M),H(_),S=!1,T()}}}function KT(n){let e;return{c(){e=v("ul"),e.innerHTML=`<li><strong>WxH</strong>
2023-09-01 09:22:49 +03:00
(eg. 100x50) - crop to WxH viewbox (from center)</li> <li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li> <li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li> <li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li> <li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li> <li><strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function JT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,T,$,C;function M(D){n[13](D)}let E={id:n[22],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(E.value=n[0].options.thumbs),r=new Rs({props:E}),ne.push(()=>de(r,"value",M)),S=new Rn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[KT]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Thumb sizes",i=O(),s=v("i"),o=O(),V(r.$$.fragment),u=O(),f=v("div"),c=v("span"),c.textContent="Use comma as separator.",d=O(),h=v("button"),g=v("span"),g.textContent="Supported formats",m=O(),_=v("i"),y=O(),V(S.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[22]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(_,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(D,I){w(D,e,I),b(e,t),b(e,i),b(e,s),w(D,o,I),j(r,D,I),w(D,u,I),w(D,f,I),b(f,c),b(f,d),b(f,h),b(h,g),b(h,m),b(h,_),b(h,y),j(S,h,null),T=!0,$||(C=$e(je.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),$=!0)},p(D,I){(!T||I&4194304&&l!==(l=D[22]))&&p(e,"for",l);const P={};I&4194304&&(P.id=D[22]),!a&&I&1&&(a=!0,P.value=D[0].options.thumbs,_e(()=>a=!1)),r.$set(P);const F={};I&16777216&&(F.$$scope={dirty:I,ctx:D}),S.$set(F)},i(D){T||(A(r.$$.fragment,D),A(S.$$.fragment,D),T=!0)},o(D){L(r.$$.fragment,D),L(S.$$.fragment,D),T=!1},d(D){D&&(k(e),k(o),k(u),k(f)),H(r,D),H(S),$=!1,C()}}}function GT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Max file size"),s=O(),l=v("input"),r=O(),a=v("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[22]),p(l,"type","number"),p(l,"id",o=n[22]),p(l,"step","1"),p(l,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),oe(l,n[0].options.maxSize),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[14]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(l,"id",o),d&1&&ht(l.value)!==c[0].options.maxSize&&oe(l,c[0].options.maxSize)},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function kd(n){let e,t,i;return t=new ce({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[ZT,({uniqueId:s})=>({22:s}),({uniqueId:s})=>s?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),V(t.$$.fragment),p(e,"class","col-sm-3")},m(s,l){w(s,e,l),j(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&20971521&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function ZT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max select"),s=O(),l=v("input"),p(e,"for",i=n[22]),p(l,"id",o=n[22]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),oe(l,n[0].options.maxSelect),r||(a=Y(l,"input",n[15]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&o!==(o=u[22])&&p(l,"id",o),f&1&&ht(l.value)!==u[0].options.maxSelect&&oe(l,u[0].options.maxSelect)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function XT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[YT,({uniqueId:m})=>({22:m}),({uniqueId:m})=>m?4194304:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[JT,({uniqueId:m})=>({22:m}),({uniqueId:m})=>m?4194304:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[GT,({uniqueId:m})=>({22:m}),({uniqueId:m})=>m?4194304:0]},$$scope:{ctx:n}}});let g=!n[2]&&kd(n);return{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=O(),l=v("div"),V(o.$$.fragment),a=O(),u=v("div"),V(f.$$.fragment),d=O(),g&&g.c(),p(t,"clas
2023-09-01 09:22:49 +03:00
`),position:"top"})),c=!0)},p(m,_){var S,T;l&&Dt(l.update)&&_&20&&l.update.call(null,{text:[`Whether on ${((S=m[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,m[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((T=m[4])==null?void 0:T.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(`
2023-09-01 09:22:49 +03:00
`),position:"top"}),(!f||_&8388608&&o!==(o=m[23]))&&p(e,"for",o);const y={};_&8388608&&(y.id=m[23]),!u&&_&1&&(u=!0,y.keyOfSelected=m[0].options.cascadeDelete,_e(()=>u=!1)),a.$set(y)},i(m){f||(A(a.$$.fragment,m),f=!0)},o(m){L(a.$$.fragment,m),f=!1},d(m){m&&(k(e),k(r)),H(a,m),c=!1,d()}}}function fC(n){let e,t,i,s,l,o=!n[2]&&wd(n);return s=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[uC,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),o&&o.c(),t=O(),i=v("div"),V(s.$$.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),b(e,t),b(e,i),j(s,i,null),l=!0},p(r,a){r[2]?o&&(re(),L(o,1,1,()=>{o=null}),ae()):o?(o.p(r,a),a&4&&A(o,1)):(o=wd(r),o.c(),A(o,1),o.m(e,t));const u={};a&2&&(u.name="schema."+r[1]+".options.cascadeDelete"),a&41943061&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){l||(A(o),A(s.$$.fragment,r),l=!0)},o(r){L(o),L(s.$$.fragment,r),l=!1},d(r){r&&k(e),o&&o.d(),H(s)}}}function cC(n){let e,t,i,s,l;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[fC],default:[oC,({interactive:f})=>({24:f}),({interactive:f})=>f?16777216: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 hi({props:a}),ne.push(()=>de(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]);let u={};return s=new ou({props:u}),n[20](s),s.$on("save",n[21]),{c(){V(e.$$.fragment),i=O(),V(s.$$.fragment)},m(f,c){j(e,f,c),w(f,i,c),j(s,f,c),l=!0},p(f,[c]){const d=c&258?kt(o,[c&2&&{key:f[1]},c&256&&Pt(f[8])]):{};c&50331711&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],_e(()=>t=!1)),e.$set(d);const h={};s.$set(h)},i(f){l||(A(e.$$.fragment,f),A(s.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),L(s.$$.fragment,f),l=!1},d(f){f&&k(i),H(e,f),n[20](null),H(s,f)}}}function dC(n,e,t){var F;let i,s;const l=["field","key"];let o=xe(e,l),r;Ye(n,ii,N=>t(10,r=N));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,h=((F=a.options)==null?void 0:F.maxSelect)==1,g=h;function m(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1},a),t(2,h=!0),t(9,g=h)}function _(){a.options.minSelect=ht(this.value),t(0,a),t(9,g),t(2,h)}function y(){a.options.maxSelect=ht(this.value),t(0,a),t(9,g),t(2,h)}function S(N){n.$$.not_equal(a.options.cascadeDelete,N)&&(a.options.cascadeDelete=N,t(0,a),t(9,g),t(2,h))}const T=()=>d==null?void 0:d.show();function $(N){n.$$.not_equal(a.options.collectionId,N)&&(a.options.collectionId=N,t(0,a),t(9,g),t(2,h))}function C(N){h=N,t(2,h)}function M(N){a=N,t(0,a),t(9,g),t(2,h)}function E(N){Ne.call(this,n,N)}function D(N){Ne.call(this,n,N)}function I(N){ne[N?"unshift":"push"](()=>{d=N,t(3,d)})}const P=N=>{var R,q;(q=(R=N==null?void 0:N.detail)==null?void 0:R.collection)!=null&&q.id&&N.detail.collection.type!="view"&&t(0,a.options.collectionId=N.detail.collection.id,a)};return n.$$set=N=>{e=He(He({},e),en(N)),t(8,o=xe(e,l)),"field"in N&&t(0,a=N.field),"key"in N&&t(1,u=N.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(N=>N.type!="view")),n.$$.dirty&516&&g!=h&&(t(9,g=h),h?(t(0,a.options.minSelect=null,a),t(0,a.options.maxSelect=1,a)):t(0,a.options.maxSelect=null,a)),n.$$.dirty&1&&z.isEmpty(a.options)&&m(),n.$$.dirty&1025&&t(4,s=r.find(N=>N.id==a.options.collectionId)||null)},[a,u,h,d,s,i,f,c,o,g,r,_,y,S,T,$,C,M,E,D,I,P]}class pC extends ve{constructor(e){super(),be(this,e,dC,cC,he,{field:0,key:1})}}const hC=n=>({dragging:n&4,dragover:n&8}),Sd=n=>({dragging:n[2],dragover:n[3]});function mC(n){let e,t,i,s,l;const o=n[10].default,r=Ct(o,n,n[9],Sd);return{c(){e=v("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),Q(e,"dragging",n[2]),Q(e,"dragover",n[3])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[Y(e,"dragover",Qe(n[11])),Y(e,"dragleave",Qe(n[12])),Y(e,"dragend",n[13]),Y(e,"dragstart",n[14]),Y(e,"drop",n[15])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&Ot(r,o,a,a[9],i?Mt(o,a[9],u,hC):Et(a[9]),Sd),(!i||u&2&&t!==(t=!a[1]))&&
2023-09-01 09:22:49 +03:00
`),t=v("code"),t.textContent="username",i=U(` ,
`),s=v("code"),s.textContent="email",l=U(` ,
`),o=v("code"),o.textContent="emailVisibility",r=U(` ,
`),a=v("code"),a.textContent="verified",p(t,"class","txt-sm"),p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),w(u,s,f),w(u,l,f),w(u,o,f),w(u,r,f),w(u,a,f)},d(u){u&&(k(e),k(t),k(i),k(s),k(l),k(o),k(r),k(a))}}}function _C(n){let e,t,i,s;function l(u){n[6](u,n[17],n[18],n[19])}function o(){return n[7](n[19])}var r=n[1][n[17].type];function a(u,f){let c={key:u[4](u[17])};return u[17]!==void 0&&(c.field=u[17]),{props:c}}return r&&(e=At(r,a(n)),ne.push(()=>de(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8])),{c(){e&&V(e.$$.fragment),i=O()},m(u,f){e&&j(e,u,f),w(u,i,f),s=!0},p(u,f){if(n=u,f&1&&r!==(r=n[1][n[17].type])){if(e){re();const c=e;L(c.$$.fragment,1,0,()=>{H(c,1)}),ae()}r?(e=At(r,a(n)),ne.push(()=>de(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8]),V(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else if(r){const c={};f&1&&(c.key=n[4](n[17])),!t&&f&1&&(t=!0,c.field=n[17],_e(()=>t=!1)),e.$set(c)}},i(u){s||(e&&A(e.$$.fragment,u),s=!0)},o(u){e&&L(e.$$.fragment,u),s=!1},d(u){u&&k(i),e&&H(e,u)}}}function Cd(n,e){let t,i,s,l;function o(a){e[9](a)}let r={index:e[19],disabled:e[17].toDelete||e[17].id&&e[17].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[_C]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Il({props:r}),ne.push(()=>de(i,"list",o)),i.$on("drag",e[10]),i.$on("sort",e[11]),{key:n,first:null,c(){t=ke(),V(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),j(i,a,u),l=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[19]),u&1&&(f.disabled=e[17].toDelete||e[17].id&&e[17].system),u&1048577&&(f.$$scope={dirty:u,ctx:e}),!s&&u&1&&(s=!0,f.list=e[0].schema,_e(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),H(i,a)}}}function bC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=[],g=new Map,m,_,y,S,T,$,C,M,E=n[0].type==="auth"&&Td(),D=pe(n[0].schema);const I=N=>N[17];for(let N=0;N<D.length;N+=1){let R=$d(n,D,N),q=I(R);g.set(q,h[N]=Cd(q,R))}_=new n$({props:{class:"btn btn-block btn-outline"}}),_.$on("select",n[12]);function P(N){n[13](N)}let F={};return n[0]!==void 0&&(F.collection=n[0]),$=new Q4({props:F}),ne.push(()=>de($,"collection",P)),{c(){e=v("div"),t=v("p"),i=U(`System fields:
2023-09-01 09:22:49 +03:00
`),s=v("code"),s.textContent="id",l=U(` ,
`),o=v("code"),o.textContent="created",r=U(` ,
`),a=v("code"),a.textContent="updated",u=O(),E&&E.c(),f=U(`
2023-09-22 21:24:46 +03:00
.`),c=O(),d=v("div");for(let N=0;N<h.length;N+=1)h[N].c();m=O(),V(_.$$.fragment),y=O(),S=v("hr"),T=O(),V($.$$.fragment),p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm"),p(t,"class","txt-sm"),p(e,"class","block m-b-25"),p(d,"class","schema-fields")},m(N,R){w(N,e,R),b(e,t),b(t,i),b(t,s),b(t,l),b(t,o),b(t,r),b(t,a),b(t,u),E&&E.m(t,null),b(t,f),w(N,c,R),w(N,d,R);for(let q=0;q<h.length;q+=1)h[q]&&h[q].m(d,null);w(N,m,R),j(_,N,R),w(N,y,R),w(N,S,R),w(N,T,R),j($,N,R),M=!0},p(N,[R]){N[0].type==="auth"?E||(E=Td(),E.c(),E.m(t,f)):E&&(E.d(1),E=null),R&55&&(D=pe(N[0].schema),re(),h=yt(h,R,I,1,N,D,g,d,Ut,Cd,null,$d),ae());const q={};!C&&R&1&&(C=!0,q.collection=N[0],_e(()=>C=!1)),$.$set(q)},i(N){if(!M){for(let R=0;R<D.length;R+=1)A(h[R]);A(_.$$.fragment,N),A($.$$.fragment,N),M=!0}},o(N){for(let R=0;R<h.length;R+=1)L(h[R]);L(_.$$.fragment,N),L($.$$.fragment,N),M=!1},d(N){N&&(k(e),k(c),k(d),k(m),k(y),k(S),k(T)),E&&E.d();for(let R=0;R<h.length;R+=1)h[R].d();H(_,N),H($,N)}}}function vC(n,e,t){let i,{collection:s}=e;const l={text:k$,number:E$,bool:I$,email:v1,url:z$,editor:K$,date:uT,select:LT,json:jT,file:nC,relation:pC};function o($){s.schema[$]&&(s.schema.splice($,1),t(0,s))}function r($="text"){const C=z.initSchemaField({name:a(),type:$});C.onMountSelect=!0,s.schema.push(C),t(0,s)}function a($="field"){let C="";for(;u($+C);)++C;return $+C}function u($){var C;return!!((C=s==null?void 0:s.schema)!=null&&C.find(M=>M.name===$))}function f($){return i.findIndex(C=>C===$)}function c($,C){var M;!((M=s==null?void 0:s.schema)!=null&&M.length)||$===C||!C||t(0,s.indexes=s.indexes.map(E=>z.replaceIndexColumn(E,$,C)),s)}function d($,C,M,E){M[E]=$,t(0,s)}const h=$=>o($),g=$=>c($.detail.oldName,$.detail.newName);function m($){n.$$.not_equal(s.schema,$)&&(s.schema=$,t(0,s))}const _=$=>{if(!$.detail)return;const C=$.detail.target;C.style.opacity=0,setTimeout(()=>{var M;(M=C==null?void 0:C.style)==null||M.removeProperty("opacity")},0),$.detail.dataTransfer.setDragImage(C,0,0)},y=()=>{tn({})},S=$=>r($.detail);function T($){s=$,t(0,s)}return n.$$set=$=>{"collection"in $&&t(0,s=$.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&t(0,s.schema=[],s),n.$$.dirty&1&&(i=s.schema.filter($=>!$.toDelete)||[])},[s,l,o,r,f,c,d,h,g,m,_,y,S,T]}class yC extends ve{constructor(e){super(),be(this,e,vC,bC,he,{collection:0})}}const kC=n=>({isAdminOnly:n&512}),Md=n=>({isAdminOnly:n[9]}),wC=n=>({isAdminOnly:n&512}),Od=n=>({isAdminOnly:n[9]}),SC=n=>({isAdminOnly:n&512}),Ed=n=>({isAdminOnly:n[9]});function $C(n){let e,t;return e=new ce({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[CC,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&528&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),s&8&&(l.name=i[3]),s&295655&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function TC(n){let e;return{c(){e=v("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Dd(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<i class="ri-lock-line"></i> <span class="txt">Set Admins only</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[11]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Ad(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<small class="txt svelte-1akuazq">Unlock and set custom rule</small> <div class="icon svelte-1akuazq"><i class="ri-lock-unlock-line svelte-1akuazq"></i></div>',p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",n[10]),s=!0)},p:x,i(o){i||(o&&Xe(()=>{i&&(t||(t=qe(e,Gt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Gt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end()
<br/> <code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(_,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(F,N){w(F,e,N),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o);for(let R=0;R<P.length;R+=1)P[R]&&P[R].m(o,null);b(i,r),b(i,a),b(i,u),b(i,f),b(i,c),b(i,d),b(i,h),b(i,g),b(i,m),b(i,_),b(i,y),b(i,S),b(i,T),b(i,$),b(i,C),b(i,M),D=!0},p(F,N){if(N&4){I=pe(F[2]);let R;for(R=0;R<I.length;R+=1){const q=Ld(F,I,R);P[R]?P[R].p(q,N):(P[R]=Fd(q),P[R].c(),P[R].m(o,null))}for(;R<P.length;R+=1)P[R].d(1);P.length=I.length}},i(F){D||(F&&Xe(()=>{D&&(E||(E=qe(e,nt,{duration:150},!0)),E.run(1))}),D=!0)},o(F){F&&(E||(E=qe(e,nt,{duration:150},!1)),E.run(0)),D=!1},d(F){F&&k(e),_t(P,F),F&&E&&E.end()}}}function Fd(n){let e,t=n[11]+"",i;return{c(){e=v("code"),i=U(t)},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&4&&t!==(t=s[11]+"")&&se(i,t)},d(s){s&&k(e)}}}function Nd(n){let e,t,i,s,l,o,r,a,u;function f(_){n[6](_)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[EC,({isAdminOnly:_})=>({10:_}),({isAdminOnly:_})=>_?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Ts({props:c}),ne.push(()=>de(e,"rule",f));function d(_){n[7](_)}let h={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(h.rule=n[0].updateRule),s=new Ts({props:h}),ne.push(()=>de(s,"rule",d));function g(_){n[8](_)}let m={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(m.rule=n[0].deleteRule),r=new Ts({props:m}),ne.push(()=>de(r,"rule",g)),{c(){V(e.$$.fragment),i=O(),V(s.$$.fragment),o=O(),V(r.$$.fragment)},m(_,y){j(e,_,y),w(_,i,y),j(s,_,y),w(_,o,y),j(r,_,y),u=!0},p(_,y){const S={};y&1&&(S.collection=_[0]),y&17408&&(S.$$scope={dirty:y,ctx:_}),!t&&y&1&&(t=!0,S.rule=_[0].createRule,_e(()=>t=!1)),e.$set(S);const T={};y&1&&(T.collection=_[0]),!l&&y&1&&(l=!0,T.rule=_[0].updateRule,_e(()=>l=!1)),s.$set(T);const $={};y&1&&($.collection=_[0]),!a&&y&1&&(a=!0,$.rule=_[0].deleteRule,_e(()=>a=!1)),r.$set($)},i(_){u||(A(e.$$.fragment,_),A(s.$$.fragment,_),A(r.$$.fragment,_),u=!0)},o(_){L(e.$$.fragment,_),L(s.$$.fragment,_),L(r.$$.fragment,_),u=!1},d(_){_&&(k(i),k(o)),H(e,_),H(s,_),H(r,_)}}}function Rd(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=$e(je.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(s){s&&k(e),t=!1,i()}}}function EC(n){let e,t=!n[10]&&Rd();return{c(){t&&t.c(),e=ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[10]?t&&(t.d(1),t=null):t||(t=Rd(),t.c(),t.m(e.parentNode,e))},d(i){i&&k(e),t&&t.d(i)}}}function qd(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[DC]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Ts({props:l}),ne.push(()=>de(e,"rule",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function DC(n){let e,t,i;return{c(){e=v("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg.
2023-09-01 09:22:49 +03:00
changing the password without requiring to enter the old one, directly updating the verified
state or email, etc.`,t=O(),i=v("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},p:x,d(s){s&&(k(e),k(t),k(i))}}}function AC(n){var N,R;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,h,g,m,_,y,S,T,$,C=n[1]&&Pd(n);function M(q){n[4](q)}let E={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(E.rule=n[0].listRule),f=new Ts({props:E}),ne.push(()=>de(f,"rule",M));function D(q){n[5](q)}let I={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(I.rule=n[0].viewRule),h=new Ts({props:I}),ne.push(()=>de(h,"rule",D));let P=((N=n[0])==null?void 0:N.type)!=="view"&&Nd(n),F=((R=n[0])==null?void 0:R.type)==="auth"&&qd(n);return{c(){e=v("div"),t=v("div"),i=v("p"),i.innerHTML=`All rules follow the
2023-09-01 09:22:49 +03:00
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
</a>.`,s=O(),l=v("button"),r=U(o),a=O(),C&&C.c(),u=O(),V(f.$$.fragment),d=O(),V(h.$$.fragment),m=O(),P&&P.c(),_=O(),F&&F.c(),y=ke(),p(l,"type","button"),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(q,B){w(q,e,B),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),C&&C.m(e,null),w(q,u,B),j(f,q,B),w(q,d,B),j(h,q,B),w(q,m,B),P&&P.m(q,B),w(q,_,B),F&&F.m(q,B),w(q,y,B),S=!0,T||($=Y(l,"click",n[3]),T=!0)},p(q,[B]){var X,Z;(!S||B&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&se(r,o),q[1]?C?(C.p(q,B),B&2&&A(C,1)):(C=Pd(q),C.c(),A(C,1),C.m(e,null)):C&&(re(),L(C,1,1,()=>{C=null}),ae());const K={};B&1&&(K.collection=q[0]),!c&&B&1&&(c=!0,K.rule=q[0].listRule,_e(()=>c=!1)),f.$set(K);const J={};B&1&&(J.collection=q[0]),!g&&B&1&&(g=!0,J.rule=q[0].viewRule,_e(()=>g=!1)),h.$set(J),((X=q[0])==null?void 0:X.type)!=="view"?P?(P.p(q,B),B&1&&A(P,1)):(P=Nd(q),P.c(),A(P,1),P.m(_.parentNode,_)):P&&(re(),L(P,1,1,()=>{P=null}),ae()),((Z=q[0])==null?void 0:Z.type)==="auth"?F?(F.p(q,B),B&1&&A(F,1)):(F=qd(q),F.c(),A(F,1),F.m(y.parentNode,y)):F&&(re(),L(F,1,1,()=>{F=null}),ae())},i(q){S||(A(C),A(f.$$.fragment,q),A(h.$$.fragment,q),A(P),A(F),S=!0)},o(q){L(C),L(f.$$.fragment,q),L(h.$$.fragment,q),L(P),L(F),S=!1},d(q){q&&(k(e),k(u),k(d),k(m),k(_),k(y)),C&&C.d(),H(f,q),H(h,q),P&&P.d(q),F&&F.d(q),T=!1,$()}}}function IC(n,e,t){let i,{collection:s}=e,l=!1;const o=()=>t(1,l=!l);function r(h){n.$$.not_equal(s.listRule,h)&&(s.listRule=h,t(0,s))}function a(h){n.$$.not_equal(s.viewRule,h)&&(s.viewRule=h,t(0,s))}function u(h){n.$$.not_equal(s.createRule,h)&&(s.createRule=h,t(0,s))}function f(h){n.$$.not_equal(s.updateRule,h)&&(s.updateRule=h,t(0,s))}function c(h){n.$$.not_equal(s.deleteRule,h)&&(s.deleteRule=h,t(0,s))}function d(h){n.$$.not_equal(s.options.manageRule,h)&&(s.options.manageRule=h,t(0,s))}return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=z.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class LC extends ve{constructor(e){super(),be(this,e,IC,AC,he,{collection:0})}}function jd(n,e,t){const i=n.slice();return i[9]=e[t],i}function PC(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a,u){let f={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(f.value=a[0].options.query),{props:f}}return o&&(e=At(o,r(n)),ne.push(()=>de(e,"value",l)),e.$on("change",n[6])),{c(){e&&V(e.$$.fragment),i=ke()},m(a,u){e&&j(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&2&&o!==(o=a[1])){if(e){re();const f=e;L(f.$$.fragment,1,0,()=>{H(f,1)}),ae()}o?(e=At(o,r(a)),ne.push(()=>de(e,"value",l)),e.$on("change",a[6]),V(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else if(o){const f={};u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,_e(()=>t=!1)),e.$set(f)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&H(e,a)}}}function FC(n){let e;return{c(){e=v("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Hd(n){let e,t,i=pe(n[3]),s=[];for(let l=0;l<i.length;l+=1)s[l]=Vd(jd(n,i,l));return{c(){e=v("div"),t=v("div");for(let l=0;l<s.length;l+=1)s[l].c();p(t,"class","content"),p(e,"class","help-block help-block-error")},m(l,o){w(l,e,o),b(e,t);for(let r=0;r<s.length;r+=1)s[r]&&s[r].m(t,null)},p(l,o){if(o&8){i=pe(l[3]);let r;for(r=0;r<i.length;r+=1){const a=jd(l,i,r);s[r]?s[r].p(a,o):(s[r]=Vd(a),s[r].c(),s[r].m(t,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=i.length}},d(l){l&&k(e),_t(s,l)}}}function Vd(n){let e,t=n[9]+"",i;return{c(){e=v("p"),i=U(t)},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&se(i,t)},d(s){s&&k(e)}}}function NC(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[FC,PC],h=[];function g(_,y){return _[2]?0:1}l=g(n),o=h[l]=d[l](n);let m=n[3].length&&Hd(n);return{c(){e=v("label"),t=v("span"),t.textContent="Select query",s=O(),o.c(),r=O(),a=v("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>
2023-09-01 09:22:49 +03: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 (eg.
2023-09-22 21:24:46 +03:00
<code>MAX(balance) as maxBalance</code>).</li></ul>`,u=O(),m&&m.c(),f=ke(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,y){w(_,e,y),b(e,t),w(_,s,y),h[l].m(_,y),w(_,r,y),w(_,a,y),w(_,u,y),m&&m.m(_,y),w(_,f,y),c=!0},p(_,y){(!c||y&256&&i!==(i=_[8]))&&p(e,"for",i);let S=l;l=g(_),l===S?h[l].p(_,y):(re(),L(h[S],1,1,()=>{h[S]=null}),ae(),o=h[l],o?o.p(_,y):(o=h[l]=d[l](_),o.c()),A(o,1),o.m(r.parentNode,r)),_[3].length?m?m.p(_,y):(m=Hd(_),m.c(),m.m(f.parentNode,f)):m&&(m.d(1),m=null)},i(_){c||(A(o),c=!0)},o(_){L(o),c=!1},d(_){_&&(k(e),k(s),k(r),k(a),k(u),k(f)),h[l].d(_),m&&m.d(_)}}}function RC(n){let e,t;return e=new ce({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[NC,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function qC(n,e,t){let i;Ye(n,Ci,c=>t(4,i=c));let{collection:s}=e,l,o=!1,r=[];function a(c){var g;t(3,r=[]);const d=z.getNestedVal(c,"schema",null);if(z.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const h=z.extractColumnsFromQuery((g=s==null?void 0:s.options)==null?void 0:g.query);z.removeByValue(h,"id"),z.removeByValue(h,"created"),z.removeByValue(h,"updated");for(let m in d)for(let _ in d[m]){const y=d[m][_].message,S=h[m]||m;r.push(z.sentenize(S+": "+y))}}Zt(async()=>{t(2,o=!0);try{t(1,l=(await ot(()=>import("./CodeEditor-f7d1c772.js"),["./CodeEditor-f7d1c772.js","./index-808c8630.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(s.options.query,c)&&(s.options.query=c,t(0,s))}const f=()=>{r.length&&di("schema")};return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class jC extends ve{constructor(e){super(),be(this,e,qC,RC,he,{collection:0})}}const HC=n=>({active:n&1}),zd=n=>({active:n[0]});function Bd(n){let e,t,i;const s=n[15].default,l=Ct(s,n,n[14],null);return{c(){e=v("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&Ot(l,s,o,o[14],i?Mt(s,o[14],r,null):Et(o[14]),null)},i(o){i||(A(l,o),o&&Xe(()=>{i&&(t||(t=qe(e,nt,{duration:150},!0)),t.run(1))}),i=!0)},o(o){L(l,o),o&&(t||(t=qe(e,nt,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),o&&t&&t.end()}}}function VC(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Ct(a,n,n[14],zd);let f=n[0]&&Bd(n);return{c(){e=v("div"),t=v("button"),u&&u.c(),i=O(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),Q(t,"interactive",n[3]),p(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),Q(e,"active",n[0])},m(c,d){w(c,e,d),b(e,t),u&&u.m(t,null),b(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[Y(t,"click",Qe(n[17])),Y(t,"drop",Qe(n[18])),Y(t,"dragstart",n[19]),Y(t,"dragenter",n[20]),Y(t,"dragleave",n[21]),Y(t,"dragover",Qe(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!l||d&16385)&&Ot(u,a,c,c[14],l?Mt(a,c[14],d,HC):Et(c[14]),zd),(!l||d&4)&&p(t,"draggable",c[2]),(!l||d&8)&&Q(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&A(f,1)):(f=Bd(c),f.c(),A(f,1),f.m(e,null)):f&&(re(),L(f,1,1,()=>{f=null}),ae()),(!l||d&130&&s!==(s="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",s),(!l||d&131)&&Q(e,"active",c[0])},i(c){l||(A(u,c),A(f),l=!0)},o(c){L(u,c),L(f),l=!1},d(c){c&&k(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Te(r)}}}function zC(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=wt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,h=!1;function g(){return!!f}function m(){S(),t(0,f=!0),l("expand")}function _(){t(0,f=!1),clearTimeout(r),l("collapse")}function y(){l("toggle"),f?_():m()}function S(){if(d&&o.closest(".accordions")){const P=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const F of P)F.click()}}Zt
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&p(e,"for",l);const S={};y&4096&&(S.id=_[12]),y&1&&(S.disabled=!z.isEmpty(_[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.exceptEmailDomains,_e(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),H(r,_),d=!1,h()}}}function ZC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[8](_)}let m={id:n[12],disabled:!z.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(m.value=n[0].options.onlyEmailDomains),r=new Rs({props:m}),ne.push(()=>de(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=O(),s=v("i"),o=O(),V(r.$$.fragment),u=O(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),j(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=$e(je.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&p(e,"for",l);const S={};y&4096&&(S.id=_[12]),y&1&&(S.disabled=!z.isEmpty(_[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.onlyEmailDomains,_e(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),H(r,_),d=!1,h()}}}function XC(n){let e,t,i,s;e=new ce({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[JC,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Wd(n);return{c(){V(e.$$.fragment),t=O(),l&&l.c(),i=ke()},m(o,r){j(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=Wd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),L(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){o&&(k(t),k(i)),H(e,o),l&&l.d(o)}}}function QC(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function xC(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Yd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=$e(je.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Xe(()=>{i&&(t||(t=qe(e,Gt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Gt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function eM(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowEmailAuth?xC:QC}let a=r(n),u=a(n),f=n[2]&&Yd();return{c(){e=v("div"),e.innerHTML='<i class="ri-mail-star-line"></i> <span class="txt">Email/Password</span>',t=O(),i=v("div"),s=O(),u.c(),l=O(),f&&f.c(),o=ke(),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,s,d),u.m(c,d),w(c,l,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(l.parentNode,l))),c[2]?f?d&4&&A(f,1):(f=Yd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),L(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(s),k(l),k(o)),u.d(c),f&&f.d(c)}}}function tM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowOAuth2Auth,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Kd(n){let e,t,i;return{c(){e=v("div"),e.innerHTML='<div class="flex p-t-base"><a href="#/settings/auth-providers" target="_blank" class="btn btn-sm btn-outline"><span class="txt">Manage OAuth2 providers</span></a></div>',p(e,"class","block")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Xe(()=>{i&&(t||(t=qe(e,nt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,nt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function nM(n){let e,t,i,s;e=new ce({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[tM,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Kd();return{c(){V(e.$$.fragment),t=O(),l&&l.c(),i=ke()},m(o,r){j(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=Kd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),L(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){o&&(k(t),k(i)),H(e,o),l&&l.d(o)}}}function iM(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function sM(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-s
Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(c,d){d&4096&&t!==(t=c[12])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,Te(f)}}}function aM(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y;return s=new uo({props:{single:!0,$$slots:{header:[KC],default:[UC]},$$scope:{ctx:n}}}),o=new uo({props:{single:!0,$$slots:{header:[eM],default:[XC]},$$scope:{ctx:n}}}),a=new uo({props:{single:!0,$$slots:{header:[lM],default:[nM]},$$scope:{ctx:n}}}),g=new ce({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[oM,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),_=new ce({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[rM,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("h4"),e.textContent="Auth methods",t=O(),i=v("div"),V(s.$$.fragment),l=O(),V(o.$$.fragment),r=O(),V(a.$$.fragment),u=O(),f=v("hr"),c=O(),d=v("h4"),d.textContent="General",h=O(),V(g.$$.fragment),m=O(),V(_.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(S,T){w(S,e,T),w(S,t,T),w(S,i,T),j(s,i,null),b(i,l),j(o,i,null),b(i,r),j(a,i,null),w(S,u,T),w(S,f,T),w(S,c,T),w(S,d,T),w(S,h,T),j(g,S,T),w(S,m,T),j(_,S,T),y=!0},p(S,[T]){const $={};T&8201&&($.$$scope={dirty:T,ctx:S}),s.$set($);const C={};T&8197&&(C.$$scope={dirty:T,ctx:S}),o.$set(C);const M={};T&8195&&(M.$$scope={dirty:T,ctx:S}),a.$set(M);const E={};T&12289&&(E.$$scope={dirty:T,ctx:S}),g.$set(E);const D={};T&12289&&(D.$$scope={dirty:T,ctx:S}),_.$set(D)},i(S){y||(A(s.$$.fragment,S),A(o.$$.fragment,S),A(a.$$.fragment,S),A(g.$$.fragment,S),A(_.$$.fragment,S),y=!0)},o(S){L(s.$$.fragment,S),L(o.$$.fragment,S),L(a.$$.fragment,S),L(g.$$.fragment,S),L(_.$$.fragment,S),y=!1},d(S){S&&(k(e),k(t),k(i),k(u),k(f),k(c),k(d),k(h),k(m)),H(s),H(o),H(a),H(g,S),H(_,S)}}}function uM(n,e,t){let i,s,l,o;Ye(n,Ci,m=>t(4,o=m));let{collection:r}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(m){n.$$.not_equal(r.options.exceptEmailDomains,m)&&(r.options.exceptEmailDomains=m,t(0,r))}function c(m){n.$$.not_equal(r.options.onlyEmailDomains,m)&&(r.options.onlyEmailDomains=m,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function h(){r.options.minPasswordLength=ht(this.value),t(0,r)}function g(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=m=>{"collection"in m&&t(0,r=m.collection)},n.$$.update=()=>{var m,_,y,S;n.$$.dirty&1&&r.type==="auth"&&z.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!z.isEmpty((m=o==null?void 0:o.options)==null?void 0:m.allowEmailAuth)||!z.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.onlyEmailDomains)||!z.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!z.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,h,g]}class fM extends ve{constructor(e){super(),be(this,e,uM,aM,he,{collection:0})}}function Gd(n,e,t){const i=n.slice();return i[18]=e[t],i}function Zd(n,e,t){const i=n.slice();return i[18]=e[t],i}function Xd(n,e,t){const i=n.slice();return i[18]=e[t],i}function Qd(n){let e;return{c(){e=v("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function xd(n){let e,t,i,s,l=n[3]&&ep(n),o=!n[4]&&tp(n);return{c(){e=v("h6"),e.textContent="Changes:",t=O(),i=v("ul"),l&&l.c(),s=O(),o&&o.c(),p(i,"class","changes-list svelte-xqpcsf")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),l&&l.m(i,null),b(i,s),o&&o.m(i,null)},p(r,a){r[3]?l?l.p(r,a):(l=ep(r),l.c(),l.m(i,s)):l&&(l.d(1),l=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=tp(r),o.c(),o.m(i,null))},d(r){r&&(k(e),k(t),k(i)),l&&l.d(),o&&o.d()}}}function ep(n)
2023-09-05 11:49:01 +03:00
`),s=v("strong"),o=U(l),r=O(),a=v("i"),u=O(),f=v("strong"),d=U(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(m,_){w(m,e,_),b(e,t),b(t,i),b(t,s),b(s,o),b(t,r),b(t,a),b(t,u),b(t,f),b(f,d)},p(m,_){var y,S;_&2&&l!==(l=((y=m[1])==null?void 0:y.name)+"")&&se(o,l),_&4&&c!==(c=((S=m[2])==null?void 0:S.name)+"")&&se(d,c)},d(m){m&&k(e)}}}function tp(n){let e,t,i,s=pe(n[6]),l=[];for(let f=0;f<s.length;f+=1)l[f]=np(Xd(n,s,f));let o=pe(n[8]),r=[];for(let f=0;f<o.length;f+=1)r[f]=ip(Zd(n,o,f));let a=pe(n[7]),u=[];for(let f=0;f<a.length;f+=1)u[f]=sp(Gd(n,a,f));return{c(){for(let f=0;f<l.length;f+=1)l[f].c();e=O();for(let f=0;f<r.length;f+=1)r[f].c();t=O();for(let f=0;f<u.length;f+=1)u[f].c();i=ke()},m(f,c){for(let d=0;d<l.length;d+=1)l[d]&&l[d].m(f,c);w(f,e,c);for(let d=0;d<r.length;d+=1)r[d]&&r[d].m(f,c);w(f,t,c);for(let d=0;d<u.length;d+=1)u[d]&&u[d].m(f,c);w(f,i,c)},p(f,c){if(c&64){s=pe(f[6]);let d;for(d=0;d<s.length;d+=1){const h=Xd(f,s,d);l[d]?l[d].p(h,c):(l[d]=np(h),l[d].c(),l[d].m(e.parentNode,e))}for(;d<l.length;d+=1)l[d].d(1);l.length=s.length}if(c&256){o=pe(f[8]);let d;for(d=0;d<o.length;d+=1){const h=Zd(f,o,d);r[d]?r[d].p(h,c):(r[d]=ip(h),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&128){a=pe(f[7]);let d;for(d=0;d<a.length;d+=1){const h=Gd(f,a,d);u[d]?u[d].p(h,c):(u[d]=sp(h),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&&(k(e),k(t),k(i)),_t(l,f),_t(r,f),_t(u,f)}}}function np(n){let e,t,i,s=n[18].name+"",l,o,r;return{c(){e=v("li"),t=U(`Multiple to single value conversion of field
`),i=v("strong"),l=U(s),o=O(),r=v("em"),r.textContent="(will keep only the last array item)",p(r,"class","txt-sm"),p(e,"class","svelte-xqpcsf")},m(a,u){w(a,e,u),b(e,t),b(e,i),b(i,l),b(e,o),b(e,r)},p(a,u){u&64&&s!==(s=a[18].name+"")&&se(l,s)},d(a){a&&k(e)}}}function ip(n){let e,t,i,s,l=n[18].originalName+"",o,r,a,u,f,c=n[18].name+"",d;return{c(){e=v("li"),t=v("div"),i=U(`Renamed field
`),s=v("strong"),o=U(l),r=O(),a=v("i"),u=O(),f=v("strong"),d=U(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(h,g){w(h,e,g),b(e,t),b(t,i),b(t,s),b(s,o),b(t,r),b(t,a),b(t,u),b(t,f),b(f,d)},p(h,g){g&256&&l!==(l=h[18].originalName+"")&&se(o,l),g&256&&c!==(c=h[18].name+"")&&se(d,c)},d(h){h&&k(e)}}}function sp(n){let e,t,i,s=n[18].name+"",l,o;return{c(){e=v("li"),t=U("Removed field "),i=v("span"),l=U(s),o=O(),p(i,"class","txt-bold"),p(e,"class","txt-danger svelte-xqpcsf")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(i,l),b(e,o)},p(r,a){a&128&&s!==(s=r[18].name+"")&&se(l,s)},d(r){r&&k(e)}}}function cM(n){let e,t,i,s,l,o,r,a,u=n[7].length&&Qd(),f=n[9]&&xd(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=O(),s=v("div"),l=v("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query,
2023-09-22 21:24:46 +03:00
you'll have to update it manually!`,o=O(),u&&u.c(),r=O(),f&&f.c(),a=ke(),p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),u&&u.m(s,null),w(c,r,d),f&&f.m(c,d),w(c,a,d)},p(c,d){c[7].length?u||(u=Qd(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[9]?f?f.p(c,d):(f=xd(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&(k(e),k(r),k(a)),u&&u.d(),f&&f.d(c)}}}function dM(n){let e;return{c(){e=v("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function pM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=O(),i=v("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[Y(e,"click",n[12]),Y(i,"click",n[13])],s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,Te(l)}}}function hM(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[pM],header:[dM],default:[cM]},$$scope:{ctx:n}};return e=new on({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&33555422&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[14](null),H(e,s)}}}function mM(n,e,t){let i,s,l,o,r,a;const u=wt();let f,c,d;async function h(C,M){t(1,c=C),t(2,d=M),await ln(),i||l.length||o.length||r.length?f==null||f.show():m()}function g(){f==null||f.hide()}function m(){g(),u("confirm")}const _=()=>g(),y=()=>m();function S(C){ne[C?"unshift":"push"](()=>{f=C,t(5,f)})}function T(C){Ne.call(this,n,C)}function $(C){Ne.call(this,n,C)}return n.$$.update=()=>{var C,M,E;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,s=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,l=((C=d==null?void 0:d.schema)==null?void 0:C.filter(D=>D.id&&!D.toDelete&&D.originalName!=D.name))||[]),n.$$.dirty&4&&t(7,o=((M=d==null?void 0:d.schema)==null?void 0:M.filter(D=>D.id&&D.toDelete))||[]),n.$$.dirty&6&&t(6,r=((E=d==null?void 0:d.schema)==null?void 0:E.filter(D=>{var P,F,N;const I=(P=c==null?void 0:c.schema)==null?void 0:P.find(R=>R.id==D.id);return I?((F=I.options)==null?void 0:F.maxSelect)!=1&&((N=D.options)==null?void 0:N.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!s||i)},[g,c,d,i,s,f,r,o,l,a,m,h,_,y,S,T,$]}class gM extends ve{constructor(e){super(),be(this,e,mM,hM,he,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function lp(n,e,t){const i=n.slice();return i[49]=e[t][0],i[50]=e[t][1],i}function _M(n){let e,t,i;function s(o){n[35](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new yC({props:l}),ne.push(()=>de(e,"collection",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function bM(n){let e,t,i;function s(o){n[34](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new jC({props:l}),ne.push(()=>de(e,"collection",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function op(n){let e,t,i,s;function l(r){n[36](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new LC({props:o}),ne.push(()=>de(t,"collection",l)),{c(){e=v("div"),V(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),j(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],_e(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&k(e),H(t)}}}function rp(n){let e,t,i,s;function l(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new fM({props:o}),ne.push(()=>de(t,"collection",l)),{c(){e=v("div"),V(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===As)},m(r
2023-09-01 09:22:49 +03:00
form-field form-field-list form-field-file
`+(n[4].required?"required":"")+`
`+(n[9]?"dragover":"")+`
`,name:n[4].name,$$slots:{default:[f6,({uniqueId:o})=>({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),V(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),j(t,e,null),i=!0,s||(l=[Y(e,"dragover",Qe(n[25])),Y(e,"dragleave",n[26]),Y(e,"drop",n[15])],s=!0)},p(o,r){const a={};r[0]&528&&(a.class=`
2023-09-01 09:22:49 +03:00
form-field form-field-list form-field-file
`+(o[4].required?"required":"")+`
`+(o[9]?"dragover":"")+`
`),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(A(t.$$.fragment,o),i=!0)},o(o){L(t.$$.fragment,o),i=!1},d(o){o&&k(e),H(t),s=!1,Te(l)}}}function d6(n,e,t){let i,s,l,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,h=!1,g="";function m(B){z.removeByValue(f,B),t(2,f)}function _(B){z.pushUnique(f,B),t(2,f)}function y(B){z.isEmpty(u[B])||u.splice(B,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function T(B){var J,X;B.preventDefault(),t(9,h=!1);const K=((J=B.dataTransfer)==null?void 0:J.files)||[];if(!(l||!K.length)){for(const Z of K){const ue=s.length+u.length-f.length;if(((X=r.options)==null?void 0:X.maxSelect)<=ue)break;u.push(Z)}t(1,u)}}Zt(async()=>{t(10,g=await fe.getAdminFileToken(o.collectionId))});const $=B=>m(B),C=B=>_(B);function M(B){a=B,t(0,a),t(6,i),t(4,r)}const E=B=>y(B);function D(B){u=B,t(1,u)}function I(B){ne[B?"unshift":"push"](()=>{c=B,t(7,c)})}const P=()=>{for(let B of c.files)u.push(B);t(1,u),t(7,c.value=null,c)},F=()=>c==null?void 0:c.click();function N(B){ne[B?"unshift":"push"](()=>{d=B,t(8,d)})}const R=()=>{t(9,h=!0)},q=()=>{t(9,h=!1)};return n.$$set=B=>{"record"in B&&t(3,o=B.record),"field"in B&&t(4,r=B.field),"value"in B&&t(0,a=B.value),"uploadedFiles"in B&&t(1,u=B.uploadedFiles),"deletedFileNames"in B&&t(2,f=B.deletedFileNames)},n.$$.update=()=>{var B,K;n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=z.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=z.toArray(f))),n.$$.dirty[0]&16&&t(6,i=((B=r.options)==null?void 0:B.maxSelect)>1),n.$$.dirty[0]&65&&z.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,s=z.toArray(a)),n.$$.dirty[0]&54&&t(11,l=(s.length||u.length)&&((K=r.options)==null?void 0:K.maxSelect)<=s.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&S()},[a,u,f,o,r,s,i,c,d,h,g,l,m,_,y,T,$,C,M,E,D,I,P,F,N,R,q]}class p6 extends ve{constructor(e){super(),be(this,e,d6,c6,he,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function Hp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function h6(n,e){e=Hp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=Hp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function Vp(n,e,t){const i=n.slice();i[5]=e[t];const s=z.toArray(i[0][i[5]]).slice(0,5);return i[6]=s,i}function zp(n,e,t){const i=n.slice();return i[9]=e[t],i}function Bp(n){let e,t;return e=new ru({props:{record:n[0],filename:n[9],size:"xs"}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&1&&(l.record=i[0]),s&5&&(l.filename=i[9]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Up(n){let e=!z.isEmpty(n[9]),t,i,s=e&&Bp(n);return{c(){s&&s.c(),t=ke()},m(l,o){s&&s.m(l,o),w(l,t,o),i=!0},p(l,o){o&5&&(e=!z.isEmpty(l[9])),e?s?(s.p(l,o),o&5&&A(s,1)):(s=Bp(l),s.c(),A(s,1),s.m(t.parentNode,t)):s&&(re(),L(s,1,1,()=>{s=null}),ae())},i(l){i||(A(s),i=!0)},o(l){L(s),i=!1},d(l){l&&k(t),s&&s.d(l)}}}function Wp(n){let e,t,i=pe(n[6]),s=[];for(let o=0;o<i.length;o+=1)s[o]=Up(zp(n,i,o));const l=o=>L(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=ke()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&5){i=pe(o[6]);let a;for(a=0;a<i.length;a+=1){const u=zp(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Up(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)L(s[r]);t=!1},d(o){o&&k(e),_t(s,o)}}}function m6(n){let e,t,i,s,l,o,r=z.truncate(z.displayValue(n[0],n[1]),70)+"",a,u,f,c,d=pe(n[2]),h=[];for(let m=0;m<d.length;m+=1)h[m]=Wp(Vp(n,d,m));const g=m=>L(h[m],1,1,()=>{h[m
`),I&&I.c(),h=O(),m.c(),_=ke(),p(e,"class","flex m-b-base flex-gap-10"),p(l,"class","list picker-list m-b-base svelte-1u8jhky"),p(c,"class","section-title")},m(R,q){w(R,e,q),j(t,e,null),b(e,i),$&&$.m(e,null),w(R,s,q),w(R,l,q);for(let B=0;B<o.length;B+=1)o[B]&&o[B].m(l,null);E&&E.m(l,null),b(l,a),D&&D.m(l,null),w(R,f,q),w(R,c,q),b(c,d),I&&I.m(c,null),w(R,h,q),F[g].m(R,q),w(R,_,q),y=!0,S||(T=$e(u=h6.call(null,l,n[36])),S=!0)},p(R,q){const B={};q[0]&4&&(B.value=R[2]),q[0]&32&&(B.autocompleteCollection=R[5]),t.$set(B),R[11]?$&&($.d(1),$=null):$?$.p(R,q):($=Jp(R),$.c(),$.m(e,null)),q[0]&143252&&(C=pe(R[8]),re(),o=yt(o,q,M,1,R,C,r,l,Ut,xp,a,Kp),ae(),!C.length&&E?E.p(R,q):C.length?E&&(E.d(1),E=null):(E=Gp(R),E.c(),E.m(l,a))),R[13]?D||(D=eh(),D.c(),D.m(l,null)):D&&(D.d(1),D=null),u&&Dt(u.update)&&q[0]&4104&&u.update.call(null,R[36]),R[4]>1?I?I.p(R,q):(I=th(R),I.c(),I.m(c,null)):I&&(I.d(1),I=null);let K=g;g=N(R),g===K?F[g].p(R,q):(re(),L(F[K],1,1,()=>{F[K]=null}),ae(),m=F[g],m?m.p(R,q):(m=F[g]=P[g](R),m.c()),A(m,1),m.m(_.parentNode,_))},i(R){if(!y){A(t.$$.fragment,R);for(let q=0;q<C.length;q+=1)A(o[q]);A(m),y=!0}},o(R){L(t.$$.fragment,R);for(let q=0;q<o.length;q+=1)L(o[q]);L(m),y=!1},d(R){R&&(k(e),k(s),k(l),k(f),k(c),k(h),k(_)),H(t),$&&$.d();for(let q=0;q<o.length;q+=1)o[q].d();E&&E.d(),D&&D.d(),I&&I.d(),F[g].d(R),S=!1,T()}}}function S6(n){var r;let e,t,i,s=(((r=n[5])==null?void 0:r.name)||"")+"",l,o;return{c(){e=v("h4"),t=U("Select "),i=v("strong"),l=U(s),o=U(" records")},m(a,u){w(a,e,u),b(e,t),b(e,i),b(i,l),b(e,o)},p(a,u){var f;u[0]&32&&s!==(s=(((f=a[5])==null?void 0:f.name)||"")+"")&&se(l,s)},d(a){a&&k(e)}}}function $6(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=O(),i=v("button"),i.innerHTML='<span class="txt">Set selection</span>',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[Y(e,"click",n[28]),Y(i,"click",n[29])],s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,Te(l)}}}function T6(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[$6],header:[S6],default:[w6]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=He(o,l[a]);e=new on({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[5]};return i=new T1({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),s=!0},p(a,u){const f=u[0]&524288?kt(l,[l[0],l[1],Pt(a[19])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&32&&(c.collection=a[5]),i.$set(c)},i(a){s||(A(e.$$.fragment,a),A(i.$$.fragment,a),s=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),s=!1},d(a){a&&k(t),n[39](null),H(e,a),n[42](null),H(i,a)}}}const no=50;function C6(n,e,t){let i,s,l,o,r,a,u,f;const c=["value","field","show","hide"];let d=xe(e,c),h;Ye(n,ii,Oe=>t(26,h=Oe));const g=wt(),m="picker_"+z.randomString(5);let{value:_}=e,{field:y}=e,S,T,$="",C=[],M=[],E=1,D=0,I=!1,P=!1;function F(){return t(2,$=""),t(8,C=[]),t(6,M=[]),R(),q(!0),S==null?void 0:S.show()}function N(){return S==null?void 0:S.hide()}async function R(){const Oe=z.toArray(_);if(!s||!Oe.length)return;t(24,P=!0);let mt=[];const Ft=Oe.slice(),rn=[];for(;Ft.length>0;){const Ae=[];for(const at of Ft.splice(0,no))Ae.push(`id="${at}"`);rn.push(fe.collection(s).getFullList(no,{filter:Ae.join("||"),$autoCancel:!1}))}try{await Promise.all(rn).then(Ae=>{mt=mt.concat(...Ae)}),t(6,M=[]);for(const Ae of Oe){const at=z.findByKey(mt,"id",Ae);at&&M.push(at)}$.trim()||t(8,C=z.filterDuplicatesByKey(M.concat(C))),t(24,P=!1)}catch(Ae){Ae.isAbort||(fe.error(Ae),t(24,P=!1))}}async function q(Oe=!1){if(s){t(3,I=!0),Oe&&($.trim()?t(8,C=[]):t(8,C=z.toArray(M).slice()));try{const mt=Oe?1:E+1,Ft=z.getAllCollectionIdentifiers(l),rn=await fe.collection(s).getList(mt,no,{filter:z.normalizeSearchFilter($,Ft),sort:o?"":"-created",skipTotal:1,$cancelKey:m+"loadList"});t(8,C=z.filterDuplicatesByKey(C.concat(rn.items))),E=rn.page,t(23,D=rn.items.length),t(3,I=!1)}cat
2023-09-01 09:22:49 +03:00
...
2023-09-22 21:24:46 +03:00
-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),oe(l,n[5]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&32&&oe(l,c[5])},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function cO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S;return s=new ce({props:{class:"form-field required",name:"clientId",$$slots:{default:[oO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"teamId",$$slots:{default:[rO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field required",name:"keyId",$$slots:{default:[aO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),h=new ce({props:{class:"form-field required",name:"duration",$$slots:{default:[uO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),m=new ce({props:{class:"form-field required",name:"privateKey",$$slots:{default:[fO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),i=v("div"),V(s.$$.fragment),l=O(),o=v("div"),V(r.$$.fragment),a=O(),u=v("div"),V(f.$$.fragment),c=O(),d=v("div"),V(h.$$.fragment),g=O(),V(m.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m(T,$){w(T,e,$),b(e,t),b(t,i),j(s,i,null),b(t,l),b(t,o),j(r,o,null),b(t,a),b(t,u),j(f,u,null),b(t,c),b(t,d),j(h,d,null),b(t,g),j(m,t,null),_=!0,y||(S=Y(e,"submit",Qe(n[17])),y=!0)},p(T,$){const C={};$&25165828&&(C.$$scope={dirty:$,ctx:T}),s.$set(C);const M={};$&25165832&&(M.$$scope={dirty:$,ctx:T}),r.$set(M);const E={};$&25165840&&(E.$$scope={dirty:$,ctx:T}),f.$set(E);const D={};$&25165888&&(D.$$scope={dirty:$,ctx:T}),h.$set(D);const I={};$&25165856&&(I.$$scope={dirty:$,ctx:T}),m.$set(I)},i(T){_||(A(s.$$.fragment,T),A(r.$$.fragment,T),A(f.$$.fragment,T),A(h.$$.fragment,T),A(m.$$.fragment,T),_=!0)},o(T){L(s.$$.fragment,T),L(r.$$.fragment,T),L(f.$$.fragment,T),L(h.$$.fragment,T),L(m.$$.fragment,T),_=!1},d(T){T&&k(e),H(s),H(r),H(f),H(h),H(m),y=!1,S()}}}function dO(n){let e;return{c(){e=v("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function pO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=U("Close"),i=O(),s=v("button"),l=v("i"),o=O(),r=v("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(l,"class","ri-key-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[9]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],Q(s,"btn-loading",n[7])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(s.disabled=a),d&128&&Q(s,"btn-loading",c[7])},d(c){c&&(k(e),k(i),k(s)),u=!1,f()}}}function hO(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[pO],header:[dO],default:[cO]},$$scope:{ctx:n}};return e=new on({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[19](null),H(e,s)}}}const fo=15777e3;function mO(n,e,t){let i;const s=wt(),l="apple_secret_"+z.randomString(5);let o,r,a,u,f,c,d=!1;function h(P={}){t(2,r=P.clientId||""),t(3,a=P.teamId||""),t(4,u=P.keyId||""),t(5,f=P.privateKey||""),t(6,c=P.duration||fo),tn({}),o==null||o.show()}function g(){return o==null?void 0:o.hide()}async function m(){t(7,d=!0);try{const P=await fe.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),jt("Successfully generated client secret."),s("submit",P),o==null||o.hide()}catch(P){fe.error(P)}t(7,d=!1)}function _(){r=t
`),r=v("button"),r.textContent="Restore draft",a=O(),u=v("button"),u.innerHTML='<i class="ri-close-line"></i>',f=O(),c=v("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(l,"class","flex flex-gap-xs"),p(u,"type","button"),p(u,"class","close"),p(u,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(t,a),b(t,u),b(e,f),b(e,c),h=!0,g||(m=[Y(r,"click",n[37]),$e(je.call(null,u,"Discard draft")),Y(u,"click",Qe(n[38]))],g=!0)},p:x,i(_){h||(d&&d.end(1),h=!0)},o(_){_&&(d=va(e,nt,{duration:150})),h=!1},d(_){_&&k(e),_&&d&&d.end(),g=!1,Te(m)}}}function gh(n){let e,t,i,s,l;return{c(){e=v("div"),t=v("i"),p(t,"class","ri-calendar-event-line txt-disabled"),p(e,"class","form-field-addon")},m(o,r){w(o,e,r),b(e,t),s||(l=$e(i=je.call(null,t,{text:`Created: ${n[3].created}
Updated: ${n[3].updated}`,position:"left"})),s=!0)},p(o,r){i&&Dt(i.update)&&r[0]&8&&i.update.call(null,{text:`Created: ${o[3].created}
Updated: ${o[3].updated}`,position:"left"})},d(o){o&&k(e),s=!1,l()}}}function CO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m=!n[6]&&gh(n);return{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="id",l=O(),o=v("span"),a=O(),m&&m.c(),u=O(),f=v("input"),p(t,"class",wi(z.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[70]),p(f,"type","text"),p(f,"id",c=n[70]),p(f,"placeholder","Leave empty to auto generate..."),p(f,"minlength","15"),f.readOnly=d=!n[6]},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),w(_,a,y),m&&m.m(_,y),w(_,u,y),w(_,f,y),oe(f,n[3].id),h||(g=Y(f,"input",n[39]),h=!0)},p(_,y){y[2]&256&&r!==(r=_[70])&&p(e,"for",r),_[6]?m&&(m.d(1),m=null):m?m.p(_,y):(m=gh(_),m.c(),m.m(u.parentNode,u)),y[2]&256&&c!==(c=_[70])&&p(f,"id",c),y[0]&64&&d!==(d=!_[6])&&(f.readOnly=d),y[0]&8&&f.value!==_[3].id&&oe(f,_[3].id)},d(_){_&&(k(e),k(a),k(u),k(f)),m&&m.d(_),h=!1,g()}}}function _h(n){var u,f;let e,t,i,s,l;function o(c){n[40](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new xM({props:r}),ne.push(()=>de(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&bh();return{c(){V(e.$$.fragment),i=O(),a&&a.c(),s=ke()},m(c,d){j(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,s,d),l=!0},p(c,d){var g,m;const h={};d[0]&64&&(h.isNew=c[6]),d[0]&1&&(h.collection=c[0]),!t&&d[0]&8&&(t=!0,h.record=c[3],_e(()=>t=!1)),e.$set(h),(m=(g=c[0])==null?void 0:g.schema)!=null&&m.length?a||(a=bh(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){L(e.$$.fragment,c),l=!1},d(c){c&&(k(i),k(s)),H(e,c),a&&a.d(c)}}}function bh(n){let e;return{c(){e=v("hr")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function MO(n){let e,t,i;function s(o){n[53](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new I6({props:l}),ne.push(()=>de(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function OO(n){let e,t,i,s,l;function o(f){n[50](f,n[67])}function r(f){n[51](f,n[67])}function a(f){n[52](f,n[67])}let u={field:n[67],record:n[3]};return n[3][n[67].name]!==void 0&&(u.value=n[3][n[67].name]),n[4][n[67].name]!==void 0&&(u.uploadedFiles=n[4][n[67].name]),n[5][n[67].name]!==void 0&&(u.deletedFileNames=n[5][n[67].name]),e=new p6({props:u}),ne.push(()=>de(e,"value",o)),ne.push(()=>de(e,"uploadedFiles",r)),ne.push(()=>de(e,"deletedFileNames",a)),{c(){V(e.$$.fragment)},m(f,c){j(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[67]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[67].name],_e(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[67].name],_e(()=>i=!1)),!s&&c[0]&33&&(s=!0,d.deletedFileNames=n[5][n[67].name],_e(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),l=!1},d(f){H(e,f)}}}function EO(n){let e,t,i;function s(o){n[49](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new j5({props:l}),ne.push(()=>de(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function DO(n){let e,t,i;function s(o){n[48](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new D5({props:l}),ne.push(()=>de(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function AO(n){let e,t,i;function s(o){n[47](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new C5({props:l}),ne.push(()=>de(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.fie
2023-09-01 09:22:49 +03:00
record-panel
`+(n[15]?"overlay-panel-xl":"overlay-panel-lg")+`
`+(n[13]&&!n[6]?"colored-header":"")+`
`,beforeHide:n[54],$$slots:{footer:[VO],header:[HO],default:[qO]},$$scope:{ctx:n}};return e=new on({props:i}),n[55](e),e.$on("hide",n[56]),e.$on("show",n[57]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&41024&&(o.class=`
2023-09-01 09:22:49 +03:00
record-panel
`+(s[15]?"overlay-panel-xl":"overlay-panel-lg")+`
`+(s[13]&&!s[6]?"colored-header":"")+`
`),l[0]&2176&&(o.beforeHide=s[54]),l[0]&30461|l[2]&512&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[55](null),H(e,s)}}}const ss="form",yl="providers";function BO(n,e,t){let i,s,l,o,r;const a=wt(),u="record_"+z.randomString(5);let{collection:f}=e,c,d=null,h=null,g=null,m=!1,_=!1,y={},S={},T=JSON.stringify(null),$=T,C=ss,M=!0,E=!1;function D(ge){return P(ge),t(11,_=!0),t(12,C=ss),c==null?void 0:c.show()}function I(){return c==null?void 0:c.hide()}async function P(ge){t(28,E=!1),tn({}),t(2,d=ge||{}),t(3,h=structuredClone(d)),t(4,y={}),t(5,S={}),await ln(),t(9,g=R()),!g||K(h,g)?t(9,g=null):(delete g.password,delete g.passwordConfirm),t(26,T=JSON.stringify(h)),t(28,E=!0)}async function F(ge){var ut,Wt;tn({}),t(2,d=ge||{}),t(4,y={}),t(5,S={});const we=((Wt=(ut=f==null?void 0:f.schema)==null?void 0:ut.filter(et=>et.type!="file"))==null?void 0:Wt.map(et=>et.name))||[];for(let et in ge)we.includes(et)||t(3,h[et]=ge[et],h);await ln(),t(26,T=JSON.stringify(h)),J()}function N(){return"record_draft_"+((f==null?void 0:f.id)||"")+"_"+((d==null?void 0:d.id)||"")}function R(ge){try{const we=window.localStorage.getItem(N());if(we)return JSON.parse(we)}catch{}return ge}function q(ge){try{window.localStorage.setItem(N(),ge)}catch(we){console.warn("updateDraft failure:",we)}}function B(){g&&(t(3,h=g),t(9,g=null))}function K(ge,we){var an;const ut=structuredClone(ge||{}),Wt=structuredClone(we||{}),et=(an=f==null?void 0:f.schema)==null?void 0:an.filter(Qt=>Qt.type==="file");for(let Qt of et)delete ut[Qt.name],delete Wt[Qt.name];return delete ut.password,delete ut.passwordConfirm,delete Wt.password,delete Wt.passwordConfirm,JSON.stringify(ut)==JSON.stringify(Wt)}function J(){t(9,g=null),window.localStorage.removeItem(N())}async function X(ge=!0){if(!(m||!r||!(f!=null&&f.id))){t(10,m=!0);try{const we=ue();let ut;M?ut=await fe.collection(f.id).create(we):ut=await fe.collection(f.id).update(h.id,we),jt(M?"Successfully created record.":"Successfully updated record."),J(),ge?(t(11,_=!1),I()):F(ut),a("save",ut)}catch(we){fe.error(we)}t(10,m=!1)}}function Z(){d!=null&&d.id&&mn("Do you really want to delete the selected record?",()=>fe.collection(d.collectionId).delete(d.id).then(()=>{I(),jt("Successfully deleted record."),a("delete",d)}).catch(ge=>{fe.error(ge)}))}function ue(){const ge=structuredClone(h||{}),we=new FormData,ut={id:ge.id},Wt={};for(const et of(f==null?void 0:f.schema)||[])ut[et.name]=!0,et.type=="json"&&(Wt[et.name]=!0);i&&(ut.username=!0,ut.email=!0,ut.emailVisibility=!0,ut.password=!0,ut.passwordConfirm=!0,ut.verified=!0);for(const et in ge)if(ut[et]){if(typeof ge[et]>"u"&&(ge[et]=null),Wt[et]&&ge[et]!=="")try{JSON.parse(ge[et])}catch(an){const Qt={};throw Qt[et]={code:"invalid_json",message:an.toString()},new Kn({status:400,response:{data:Qt}})}z.addValueToFormData(we,et,ge[et])}for(const et in y){const an=z.toArray(y[et]);for(const Qt of an)we.append(et,Qt)}for(const et in S){const an=z.toArray(S[et]);for(const Qt of an)we.append(et+"."+Qt,"")}return we}function ee(){!(f!=null&&f.id)||!(d!=null&&d.email)||mn(`Do you really want to sent verification email to ${d.email}?`,()=>fe.collection(f.id).requestVerification(d.email).then(()=>{jt(`Successfully sent verification email to ${d.email}.`)}).catch(ge=>{fe.error(ge)}))}function te(){!(f!=null&&f.id)||!(d!=null&&d.email)||mn(`Do you really want to sent password reset email to ${d.email}?`,()=>fe.collection(f.id).requestPasswordReset(d.email).then(()=>{jt(`Successfully sent password reset email to ${d.email}.`)}).catch(ge=>{fe.error(ge)}))}function Ee(){o?mn("You have unsaved changes. Do you really want to discard them?",()=>{Fe()}):Fe()}async function Fe(){let ge=d?structuredClone(d):null;if(ge){ge.id="",ge.created="",ge.updated="";const we=(f==null?void 0:f.schema)||[];for(const ut of we)ut.type==="file"&&delete ge[ut.name]}J(),D(ge),await ln(),t(26,T="")}function Ve(ge){(ge.ctrlKey||ge.metaKey)&&ge.code=="KeyS"&&(ge.preventDefault(),ge.stopPropagation(),X(!1))}const ze=()=>I(),Se=()=>ee(),Me=()=>te(),Ge=()=>Ee(
Updated: ${n[1].updated}`,position:"left"})),g=!0)},p(_,y){y[0]&1073741824&&l!==(l=_[30])&&p(e,"for",l),u&&Dt(u.update)&&y[0]&2&&u.update.call(null,{text:`Created: ${_[1].created}
Updated: ${_[1].updated}`,position:"left"}),y[0]&1073741824&&d!==(d=_[30])&&p(c,"id",d),y[0]&2&&h!==(h=_[1].id)&&c.value!==h&&(c.value=h)},d(_){_&&(k(e),k(o),k(r),k(f),k(c)),g=!1,m()}}}function vm(n){let e,t,i,s,l,o,r;function a(){return n[18](n[31])}return{c(){e=v("button"),t=v("img"),s=O(),_n(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"type","button"),p(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){w(u,e,f),b(e,t),b(e,s),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(u){u&&k(e),o=!1,r()}}}function sD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="Email",o=O(),r=v("input"),p(t,"class",z.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),oe(r,n[3]),u||(f=Y(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&oe(r,c[3])},d(c){c&&(k(e),k(o),k(r)),u=!1,f()}}}function ym(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[lD,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function lD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=U("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(s,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[20]),r=!0)},p(u,f){f[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&o!==(o=u[30])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function km(n){let e,t,i,s,l,o,r,a,u;return s=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[oD,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[rD,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),V(s.$$.fragment),l=O(),o=v("div"),V(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){w(f,e,c),b(e,t),b(t,i),j(s,i,null),b(t,l),b(t,o),j(r,o,null),u=!0},p(f,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&1073742848|c[1]&8&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Xe(()=>{u&&(a||(a=qe(t,nt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){L(s.$$.fragment,f),L(r.$$.fragment,f),f&&(a||(a=qe(t,nt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),H(s),H(r),f&&a&&a.end()}}}function oD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;return c=new S1({}),{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="Password",o=O(),r=v("input"),u=O(),f=v("div"),V(c.$$.fragment),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0,p(f,"class","form-field-addon")},m(m,_){w(m,e,_),b(e,t),b(e,i),b(e,s),w(m,o,_),w(m,r,_),oe(r,n[9]),w(m,u,_),w(m,f,_),j(c,f,null),d=!0,h||(g=Y(r,"input",n[21]),h=!0)},p(m,_){(!d||_[0]&1073741824&&l!==(l=m[30]))&&p(e,"for",l),(!d||_[0]&1073741824&&a!==(a=m[30]))&&p(r,"id",a),_[0]&512&&r.value!==m[9]&&oe(r,m[9])},i(m){d||(A(c.$$.fragment,m),d=!0)},o(m){L(c.$$.fragment,m),d=!1},d(m){m&&(k(e),k(o),k(r),k(u),k(f)),H(c),h=!1,g()}}}function rD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="Password confirm",o=O(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","password"),p(r,"autocom
2023-09-01 09:22:49 +03:00
`),f=v("button"),f.textContent="{APP_NAME} ",c=U(`,
`),d=v("button"),d.textContent="{APP_URL} ",h=U("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(_,y){w(_,e,y),b(e,t),w(_,s,y),w(_,l,y),oe(l,n[0].subject),w(_,r,y),w(_,a,y),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),g||(m=[Y(l,"input",n[13]),Y(f,"click",n[14]),Y(d,"click",n[15])],g=!0)},p(_,y){y[1]&1&&i!==(i=_[31])&&p(e,"for",i),y[1]&1&&o!==(o=_[31])&&p(l,"id",o),y[0]&1&&l.value!==_[0].subject&&oe(l,_[0].subject)},d(_){_&&(k(e),k(s),k(l),k(r),k(a)),g=!1,Te(m)}}}function KD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y;return{c(){e=v("label"),t=U("Action URL"),s=O(),l=v("input"),r=O(),a=v("div"),u=U(`Available placeholder parameters:
2023-09-01 09:22:49 +03:00
`),f=v("button"),f.textContent="{APP_NAME} ",c=U(`,
`),d=v("button"),d.textContent="{APP_URL} ",h=U(`,
`),g=v("button"),g.textContent="{TOKEN} ",m=U("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(S,T){w(S,e,T),b(e,t),w(S,s,T),w(S,l,T),oe(l,n[0].actionUrl),w(S,r,T),w(S,a,T),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),b(a,g),b(a,m),_||(y=[Y(l,"input",n[16]),Y(f,"click",n[17]),Y(d,"click",n[18]),Y(g,"click",n[19])],_=!0)},p(S,T){T[1]&1&&i!==(i=S[31])&&p(e,"for",i),T[1]&1&&o!==(o=S[31])&&p(l,"id",o),T[0]&1&&l.value!==S[0].actionUrl&&oe(l,S[0].actionUrl)},d(S){S&&(k(e),k(s),k(l),k(r),k(a)),_=!1,Te(y)}}}function JD(n){let e,t,i,s;return{c(){e=v("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){w(l,e,o),oe(e,n[0].body),i||(s=Y(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&oe(e,l[0].body)},i:x,o:x,d(l){l&&k(e),i=!1,s()}}}function GD(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a,u){let f={id:a[31],language:"html"};return a[0].body!==void 0&&(f.value=a[0].body),{props:f}}return o&&(e=At(o,r(n)),ne.push(()=>de(e,"value",l))),{c(){e&&V(e.$$.fragment),i=ke()},m(a,u){e&&j(e,a,u),w(a,i,u),s=!0},p(a,u){if(u[0]&16&&o!==(o=a[4])){if(e){re();const f=e;L(f.$$.fragment,1,0,()=>{H(f,1)}),ae()}o?(e=At(o,r(a)),ne.push(()=>de(e,"value",l)),V(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else if(o){const f={};u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,_e(()=>t=!1)),e.$set(f)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&H(e,a)}}}function ZD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,T,$;const C=[GD,JD],M=[];function E(D,I){return D[4]&&!D[5]?0:1}return l=E(n),o=M[l]=C[l](n),{c(){e=v("label"),t=U("Body (HTML)"),s=O(),o.c(),r=O(),a=v("div"),u=U(`Available placeholder parameters:
2023-09-01 09:22:49 +03:00
`),f=v("button"),f.textContent="{APP_NAME} ",c=U(`,
`),d=v("button"),d.textContent="{APP_URL} ",h=U(`,
`),g=v("button"),g.textContent="{TOKEN} ",m=U(`,
2023-09-22 21:24:46 +03:00
`),_=v("button"),_.textContent="{ACTION_URL} ",y=U("."),p(e,"for",i=n[31]),p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(_,"type","button"),p(_,"class","label label-sm link-primary txt-mono"),p(_,"title","Required parameter"),p(a,"class","help-block")},m(D,I){w(D,e,I),b(e,t),w(D,s,I),M[l].m(D,I),w(D,r,I),w(D,a,I),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),b(a,g),b(a,m),b(a,_),b(a,y),S=!0,T||($=[Y(f,"click",n[22]),Y(d,"click",n[23]),Y(g,"click",n[24]),Y(_,"click",n[25])],T=!0)},p(D,I){(!S||I[1]&1&&i!==(i=D[31]))&&p(e,"for",i);let P=l;l=E(D),l===P?M[l].p(D,I):(re(),L(M[P],1,1,()=>{M[P]=null}),ae(),o=M[l],o?o.p(D,I):(o=M[l]=C[l](D),o.c()),A(o,1),o.m(r.parentNode,r))},i(D){S||(A(o),S=!0)},o(D){L(o),S=!1},d(D){D&&(k(e),k(s),k(r),k(a)),M[l].d(D),T=!1,Te($)}}}function XD(n){let e,t,i,s,l,o;return e=new ce({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[YD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[KD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[ZD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),s=O(),V(l.$$.fragment)},m(r,a){j(e,r,a),w(r,t,a),j(i,r,a),w(r,s,a),j(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){r&&(k(t),k(s)),H(e,r),H(i,r),H(l,r)}}}function Dm(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=$e(je.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Xe(()=>{i&&(t||(t=qe(e,Gt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Gt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function QD(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Dm();return{c(){e=v("div"),t=v("i"),i=O(),s=v("span"),l=U(n[2]),o=O(),r=v("div"),a=O(),f&&f.c(),u=ke(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),w(c,o,d),w(c,r,d),w(c,a,d),f&&f.m(c,d),w(c,u,d)},p(c,d){d[0]&4&&se(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=Dm(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(re(),L(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(o),k(r),k(a),k(u)),f&&f.d(c)}}}function xD(n){let e,t;const i=[n[8]];let s={$$slots:{header:[QD],default:[XD]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=He(s,i[l]);return e=new uo({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){V(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,o){const r=o[0]&256?kt(i,[Pt(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[26](null),H(e,l)}}}let Am;function eA(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=xe(e,s),o;Ye(n,Ci,Z=>t(12,o=Z));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=Am,d=!1;function h(){f==null||f.expand()}function g(){f==null||f.collapse()}function m(){f==null||f.collapseSiblings()}async function _(){c||d||(t(5,d=!0),t(4,c=(await ot(()=>import("./CodeEditor-f7d1c772.js"),["./CodeEditor-f7d1c772.js","./index-808c8630.js"],import.meta.url)).default),Am=c,t(5,d=!1))}function y(Z){z.copyToClipboard(Z),bo(`Copied ${Z} to clipboard`,2e3)}_();function S(){u.subject=this.value,t(0,u)}const T=()=>y("{APP_NAME}"),$=()=>y("{APP_U
2023-09-01 09:22:49 +03:00
from the
`),r=v("strong"),u=U(a),f=U(`
to the
`),c=v("strong"),h=U(d),g=U(`.
`),m=v("br"),_=U(`
There are numerous command line tools that can help you, such as:
`),y=v("a"),y.textContent=`rclone
`,S=U(`,
`),T=v("a"),T.textContent=`s5cmd
`,$=U(", etc."),C=O(),M=v("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener noreferrer"),p(y,"class","txt-bold"),p(T,"href","https://github.com/peak/s5cmd"),p(T,"target","_blank"),p(T,"rel","noopener noreferrer"),p(T,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(M,"class","clearfix m-t-base")},m(P,F){w(P,e,F),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(r,u),b(l,f),b(l,c),b(c,h),b(l,g),b(l,m),b(l,_),b(l,y),b(l,S),b(l,T),b(l,$),b(e,C),b(e,M),D=!0},p(P,F){var N;(!D||F&1)&&a!==(a=(N=P[0].s3)!=null&&N.enabled?"S3 storage":"local file system")&&se(u,a),(!D||F&2)&&d!==(d=P[1].s3.enabled?"S3 storage":"local file system")&&se(h,d)},i(P){D||(P&&Xe(()=>{D&&(E||(E=qe(e,nt,{duration:150},!0)),E.run(1))}),D=!0)},o(P){P&&(E||(E=qe(e,nt,{duration:150},!1)),E.run(0)),D=!1},d(P){P&&k(e),P&&E&&E.end()}}}function VA(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&jm(n);return{c(){t&&t.c(),e=ke()},m(s,l){t&&t.m(s,l),w(s,e,l)},p(s,l){var o;((o=s[0].s3)==null?void 0:o.enabled)!=s[1].s3.enabled?t?(t.p(s,l),l&3&&A(t,1)):(t=jm(s),t.c(),A(t,1),t.m(e.parentNode,e)):t&&(re(),L(t,1,1,()=>{t=null}),ae())},d(s){s&&k(e),t&&t.d(s)}}}function Hm(n){let e;function t(l,o){return l[4]?UA:l[5]?BA:zA}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function zA(n){let e;return{c(){e=v("div"),e.innerHTML='<i class="ri-checkbox-circle-line txt-success"></i> <span class="txt">S3 connected successfully</span>',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function BA(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML='<i class="ri-error-warning-line txt-warning"></i> <span class="txt">Failed to establish S3 connection</span>',p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=$e(t=je.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Dt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function UA(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Vm(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){w(l,e,o),b(e,t),i||(s=Y(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&k(e),i=!1,s()}}}function WA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;const y=[HA,jA],S=[];function T($,C){return $[2]?0:1}return d=T(n),h=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=O(),l=v("div"),o=U(n[7]),r=O(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="<p>By default PocketBase uses the local file system to store uploaded files.</p> <p>If you have limited disk space, you could optionally connect to an S3 compatible storage.</p>",c=O(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m($,C){w($,e,C),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w($,r,C),w($,a,C),b(a,u),b(u,f),b(u,c),S[d].m(u,null),g=!0,m||(_=Y(u,"submit",Qe(n[16])),m=!0)},p($,C){(!g||C&128)&&se(o,$[7]);let M=d;d=T($),d===M?S[d].p($,C):(re(),L(S[M],1,1,()=>{S[M]=null}),ae(),h=S[d],h?h.p($,C):(h=S[d]=y[d]($),h.c()),A(h,1),h.m(u,null))},i($){g||(A(h),g=!0)},o($){L(h),g=!1},d($){$&&(k(e),k(r),k(a)),S[d].d(),m=!1,_()}}}function YA(n){let e,t,i,s;return e=new Oi({}),i=new Sn({props:{$$slots:{default:[WA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),H(
another PocketBase environment.</p>`,t=O(),i=v("div"),s=v("button"),s.innerHTML='<span class="txt">Copy</span>',l=O(),V(o.$$.fragment),r=O(),a=v("div"),u=v("div"),f=O(),c=v("button"),c.innerHTML='<i class="ri-download-line"></i> <span class="txt">Download as JSON</span>',p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(m,_){w(m,e,_),w(m,t,_),w(m,i,_),b(i,s),b(i,l),j(o,i,null),n[8](i),w(m,r,_),w(m,a,_),b(a,u),b(a,f),b(a,c),d=!0,h||(g=[Y(s,"click",n[7]),Y(i,"keydown",n[9]),Y(c,"click",n[10])],h=!0)},p(m,_){const y={};_&4&&(y.content=m[2]),o.$set(y)},i(m){d||(A(o.$$.fragment,m),d=!0)},o(m){L(o.$$.fragment,m),d=!1},d(m){m&&(k(e),k(t),k(i),k(r),k(a)),H(o),n[8](null),h=!1,Te(g)}}}function S8(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function $8(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[S8,w8],g=[];function m(_,y){return _[1]?0:1}return f=m(n),c=g[f]=h[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=O(),l=v("div"),o=U(n[3]),r=O(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(_,r,y),w(_,a,y),b(a,u),g[f].m(u,null),d=!0},p(_,y){(!d||y&8)&&se(o,_[3]);let S=f;f=m(_),f===S?g[f].p(_,y):(re(),L(g[S],1,1,()=>{g[S]=null}),ae(),c=g[f],c?c.p(_,y):(c=g[f]=h[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){L(c),d=!1},d(_){_&&(k(e),k(r),k(a)),g[f].d()}}}function T8(n){let e,t,i,s;return e=new Oi({}),i=new Sn({props:{$$slots:{default:[$8]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),H(e,l),H(i,l)}}}function C8(n,e,t){let i,s;Ye(n,It,_=>t(3,s=_)),sn(It,s="Export collections",s);const l="export_"+z.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await fe.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let _ of r)delete _.created,delete _.updated}catch(_){fe.error(_)}t(1,a=!1)}function f(){z.downloadJson(r,"pb_schema")}function c(){z.copyToClipboard(i),bo("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function h(_){ne[_?"unshift":"push"](()=>{o=_,t(0,o)})}const g=_=>{if(_.ctrlKey&&_.code==="KeyA"){_.preventDefault();const y=window.getSelection(),S=document.createRange();S.selectNodeContents(o),y.removeAllRanges(),y.addRange(S)}},m=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,h,g,m]}class M8 extends ve{constructor(e){super(),be(this,e,C8,T8,he,{})}}function tg(n,e,t){const i=n.slice();return i[14]=e[t],i}function ng(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function ig(n,e,t){const i=n.slice();return i[14]=e[t],i}function sg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function lg(n,e,t){const i=n.slice();return i[14]=e[t],i}function og(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function rg(n,e,t){const i=n.slice();return i[30]=e[t],i}function O8(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&ag(),a=n[0].name!==n[1].name&&ug(n);return{c(){e=v("div"),r&&r.c(),t=O(),a&&a.c(),i=O(),s=v("strong"),o=U(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),b(e,t),a&&a.m(e,null),b(e,i),b(e,s),b(s,o)},p(u,f){u[9]?r||(r=ag(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=ug(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&se(o,l)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function E8(n){var o;let e,t,i,s=((o=n[0])==null?voi
2023-09-01 09:22:49 +03:00
- ${$.join(`
- `)}`,()=>{g()}):g()}async function g(){if(!u){t(4,u=!0);try{await fe.collections.import(o,a),jt("Successfully imported collections configuration."),i("submit")}catch($){fe.error($)}t(4,u=!1),c()}}const m=()=>h(),_=()=>!u;function y($){ne[$?"unshift":"push"](()=>{s=$,t(1,s)})}function S($){Ne.call(this,n,$)}function T($){Ne.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,h,f,l,o,m,_,y,S,T]}class j8 extends ve{constructor(e){super(),be(this,e,q8,R8,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function kg(n,e,t){const i=n.slice();return i[32]=e[t],i}function wg(n,e,t){const i=n.slice();return i[35]=e[t],i}function Sg(n,e,t){const i=n.slice();return i[32]=e[t],i}function H8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,T,$,C,M,E;a=new ce({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[z8,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let D=!1,I=n[6]&&n[1].length&&!n[7]&&Tg(),P=n[6]&&n[1].length&&n[7]&&Cg(n),F=n[13].length&&Rg(n),N=!!n[0]&&qg(n);return{c(){e=v("input"),t=O(),i=v("div"),s=v("p"),l=U(`Paste below the collections configuration you want to import or
`),o=v("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=O(),V(a.$$.fragment),u=O(),f=O(),I&&I.c(),c=O(),P&&P.c(),d=O(),F&&F.c(),h=O(),g=v("div"),N&&N.c(),m=O(),_=v("div"),y=O(),S=v("button"),T=v("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"),Q(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(_,"class","flex-fill"),p(T,"class","txt"),p(S,"type","button"),p(S,"class","btn btn-expanded btn-warning m-l-auto"),S.disabled=$=!n[14],p(g,"class","flex m-t-base")},m(R,q){w(R,e,q),n[19](e),w(R,t,q),w(R,i,q),b(i,s),b(s,l),b(s,o),w(R,r,q),j(a,R,q),w(R,u,q),w(R,f,q),I&&I.m(R,q),w(R,c,q),P&&P.m(R,q),w(R,d,q),F&&F.m(R,q),w(R,h,q),w(R,g,q),N&&N.m(g,null),b(g,m),b(g,_),b(g,y),b(g,S),b(S,T),C=!0,M||(E=[Y(e,"change",n[20]),Y(o,"click",n[21]),Y(S,"click",n[26])],M=!0)},p(R,q){(!C||q[0]&4096)&&Q(o,"btn-loading",R[12]);const B={};q[0]&64&&(B.class="form-field "+(R[6]?"":"field-error")),q[0]&65|q[1]&1536&&(B.$$scope={dirty:q,ctx:R}),a.$set(B),R[6]&&R[1].length&&!R[7]?I||(I=Tg(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),R[6]&&R[1].length&&R[7]?P?P.p(R,q):(P=Cg(R),P.c(),P.m(d.parentNode,d)):P&&(P.d(1),P=null),R[13].length?F?F.p(R,q):(F=Rg(R),F.c(),F.m(h.parentNode,h)):F&&(F.d(1),F=null),R[0]?N?N.p(R,q):(N=qg(R),N.c(),N.m(g,m)):N&&(N.d(1),N=null),(!C||q[0]&16384&&$!==($=!R[14]))&&(S.disabled=$)},i(R){C||(A(a.$$.fragment,R),A(D),C=!0)},o(R){L(a.$$.fragment,R),L(D),C=!1},d(R){R&&(k(e),k(t),k(i),k(r),k(u),k(f),k(c),k(d),k(h),k(g)),n[19](null),H(a,R),I&&I.d(R),P&&P.d(R),F&&F.d(R),N&&N.d(),M=!1,Te(E)}}}function V8(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function $g(n){let e;return{c(){e=v("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function z8(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&$g();return{c(){e=v("label"),t=U("Collections"),s=O(),l=v("textarea"),r=O(),c&&c.c(),a=ke(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),oe(l,n[0]),w(d,r,h),c&&c.m(d,h),w(d,a,h),u||(f=Y(l,"input",n[22]),u=!0)},p(d,h){h[1]&512&&i!==(i=d[40])&&p(e,"for",i),h[1]&512&&o!==(o=d[40])&&p(l,"id",o),h[0]&1&&oe(l,d[0]),d[0]&&!d[6]?c||(c=$g(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(k(e),k(s),k(l),k(r),k(a)),c&&c.d(d),u=!1,f()}}}function Tg(n){let e;return{c(){e=v("div"),e.innerHTML='<div class="icon"><i class="ri-information-line"></i></div> <div class="content"><string>Your collections configuration is already up-to-date!</string></div>',p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Cg(n){let e,t,i,s,l,o=n[9].length&&Mg(n),r=n[4].length&&Dg(n),a=n[8].length&&Pg(n);return{c(){e=v("h5"),e.textContent="Detected changes",t=O(),i=v("div"),o&&o.c(),s=O(),r&&r.c(),l=O(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),o&&o.m(i,null),b(i,s),r&&r.m(i,null),b(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=Mg(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Dg(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=Pg(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&(k(e),k(t),k(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function Mg(n){let e=[],t=new Map,i,s=pe(n[9]);const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=Sg(n,s,o),a=l(r);t.set(a,e[o]=Eg(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ke()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&512&&(s=pe(o[9]),e=yt(e,r,l,1,o,s,t,i.parentNode,rs,Eg,i,Sg))},d(o){o&&k(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function Og(n){let e,t,i=n[32].id+"",s,l;return{c(){e=v("small"),t=U("("),s=U(i),l=U(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&se(s,i)},d(o){o&&k(e)}}}function Eg(n,e){let t,i,s,l,o=e[32].name+
2023-09-01 09:22:49 +03:00
imported with different IDs. You can replace them in the import if you want
to.</string>`,l=O(),o=v("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){w(u,e,f),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),r||(a=Y(o,"click",n[24]),r=!0)},p:x,d(u){u&&k(e),r=!1,a()}}}function qg(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[25]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function B8(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[V8,H8],g=[];function m(_,y){return _[5]?0:1}return f=m(n),c=g[f]=h[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=O(),l=v("div"),o=U(n[15]),r=O(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(_,r,y),w(_,a,y),b(a,u),g[f].m(u,null),d=!0},p(_,y){(!d||y[0]&32768)&&se(o,_[15]);let S=f;f=m(_),f===S?g[f].p(_,y):(re(),L(g[S],1,1,()=>{g[S]=null}),ae(),c=g[f],c?c.p(_,y):(c=g[f]=h[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){L(c),d=!1},d(_){_&&(k(e),k(r),k(a)),g[f].d()}}}function U8(n){let e,t,i,s,l,o;e=new Oi({}),i=new Sn({props:{$$slots:{default:[B8]},$$scope:{ctx:n}}});let r={};return l=new j8({props:r}),n[27](l),l.$on("submit",n[28]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),s=O(),V(l.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),w(a,s,u),j(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s)),H(e,a),H(i,a),n[27](null),H(l,a)}}}function W8(n,e,t){let i,s,l,o,r,a,u;Ye(n,It,Z=>t(15,u=Z)),sn(It,u="Import collections",u);let f,c,d="",h=!1,g=[],m=[],_=!0,y=[],S=!1;T();async function T(){t(5,S=!0);try{t(2,m=await fe.collections.getFullList(200));for(let Z of m)delete Z.created,delete Z.updated}catch(Z){fe.error(Z)}t(5,S=!1)}function $(){if(t(4,y=[]),!!i)for(let Z of g){const ue=z.findByKey(m,"id",Z.id);!(ue!=null&&ue.id)||!z.hasCollectionChanges(ue,Z,_)||y.push({new:Z,old:ue})}}function C(){t(1,g=[]);try{t(1,g=JSON.parse(d))}catch{}Array.isArray(g)?t(1,g=z.filterDuplicatesByKey(g)):t(1,g=[]);for(let Z of g)delete Z.created,delete Z.updated,Z.schema=z.filterDuplicatesByKey(Z.schema)}function M(){var Z,ue;for(let ee of g){const te=z.findByKey(m,"name",ee.name)||z.findByKey(m,"id",ee.id);if(!te)continue;const Ee=ee.id,Fe=te.id;ee.id=Fe;const Ve=Array.isArray(te.schema)?te.schema:[],ze=Array.isArray(ee.schema)?ee.schema:[];for(const Se of ze){const Me=z.findByKey(Ve,"name",Se.name);Me&&Me.id&&(Se.id=Me.id)}for(let Se of g)if(Array.isArray(Se.schema))for(let Me of Se.schema)(Z=Me.options)!=null&&Z.collectionId&&((ue=Me.options)==null?void 0:ue.collectionId)===Ee&&(Me.options.collectionId=Fe)}t(0,d=JSON.stringify(g,null,4))}function E(Z){t(12,h=!0);const ue=new FileReader;ue.onload=async ee=>{t(12,h=!1),t(10,f.value="",f),t(0,d=ee.target.result),await ln(),g.length||(ls("Invalid collections configuration."),D())},ue.onerror=ee=>{console.warn(ee),ls("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},ue.readAsText(Z)}function D(){t(0,d=""),t(10,f.value="",f),tn({})}function I(Z){ne[Z?"unshift":"push"](()=>{f=Z,t(10,f)})}const P=()=>{f.files.length&&E(f.files[0])},F=()=>{f.click()};function N(){d=this.value,t(0,d)}function R(){_=this.checked,t(3,_)}const q=()=>M(),B=()=>D(),K=()=>c==null?void 0:c.show(m,g,_);function J(Z){ne[Z?"unshift":"push"](()=>{c=Z,t(11,c)})}const X=()=>D();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&C(),n.$$.dirty[0]&3&&t(6,i=!!d&&g.length&&g.length===g.filter(Z=>!!Z.id&&!!Z.name).length),n.$$.dirty[0]&78&&t(9,s=m.filter(Z=>i&&_&&!z.findByKey(g,"id",Z.id))),n.
2023-09-01 09:22:49 +03: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
separately since they are not locally stored and will not be included in the final backup!</p></div>`,t=O(),i=v("form"),V(s.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),j(s,i,null),l=!0,o||(r=Y(i,"submit",Qe(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),s.$set(f)},i(a){l||(A(s.$$.fragment,a),l=!0)},o(a){L(s.$$.fragment,a),l=!1},d(a){a&&(k(e),k(t),k(i)),H(s),o=!1,r()}}}function G8(n){let e;return{c(){e=v("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Z8(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=O(),s=v("button"),l=v("span"),l.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[4]),p(s,"class","btn btn-expanded"),s.disabled=n[3],Q(s,"btn-loading",n[3])},m(a,u){w(a,e,u),b(e,t),w(a,i,u),w(a,s,u),b(s,l),o||(r=Y(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(s.disabled=a[3]),u&8&&Q(s,"btn-loading",a[3])},d(a){a&&(k(e),k(i),k(s)),o=!1,r()}}}function X8(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[Z8],header:[G8],default:[J8]},$$scope:{ctx:n}};return e=new on({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&8&&(o.beforeOpen=s[8]),l&8&&(o.beforeHide=s[9]),l&65548&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[10](null),H(e,s)}}}function Q8(n,e,t){const i=wt(),s="backup_create_"+z.randomString(5);let l,o="",r=!1,a;function u(S){tn({}),t(3,r=!1),t(2,o=S||""),l==null||l.show()}function f(){return l==null?void 0:l.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await fe.backups.create(o,{$cancelKey:s}),t(3,r=!1),f(),i("submit"),jt("Successfully generated new backup.")}catch(S){S.isAbort||fe.error(S)}clearTimeout(a),t(3,r=!1)}}Is(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const h=()=>r?(bo("A backup has already been started, please wait."),!1):!0,g=()=>(r&&bo("The backup was started but may take a while to complete. You can come back later.",4500),!0);function m(S){ne[S?"unshift":"push"](()=>{l=S,t(1,l)})}function _(S){Ne.call(this,n,S)}function y(S){Ne.call(this,n,S)}return[f,l,o,r,s,c,u,d,h,g,m,_,y]}class x8 extends ve{constructor(e){super(),be(this,e,Q8,X8,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function eI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Backup name"),s=O(),l=v("input"),p(e,"for",i=n[15]),p(l,"type","text"),p(l,"id",o=n[15]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),oe(l,n[2]),r||(a=Y(l,"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(l,"id",o),f&4&&l.value!==u[2]&&oe(l,u[2])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function tI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;return u=new qs({props:{value:n[1]}}),h=new ce({props:{class:"form-field required m-0",name:"name",$$slots:{default:[eI,({uniqueId:y})=>({15:y}),({uniqueId:y})=>y?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.innerHTML=`<div class="icon"><i class="ri-alert-line"></i></div> <div class="content"><p class="txt-bold">Please proceed with caution.
2023-09-01 09:22:49 +03:00
<br/>
Backup restore is still experimental and currently 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
the backup and will restart the application process.</p> <p>Nothing will happen if the backup file is invalid or incompatible.</p></div>`,t=O(),i=v("div"),s=U(`Type the backup name
`),l=v("div"),o=v("span"),r=U(n[1]),a=O(),V(u.$$.fragment),f=U(`
to confirm:`),c=O(),d=v("form"),V(h.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(l,"class","label"),p(i,"class","content m-b-sm"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(y,S){w(y,e,S),w(y,t,S),w(y,i,S),b(i,s),b(i,l),b(l,o),b(o,r),b(l,a),j(u,l,null),b(i,f),w(y,c,S),w(y,d,S),j(h,d,null),g=!0,m||(_=Y(d,"submit",Qe(n[7])),m=!0)},p(y,S){(!g||S&2)&&se(r,y[1]);const T={};S&2&&(T.value=y[1]),u.$set(T);const $={};S&98308&&($.$$scope={dirty:S,ctx:y}),h.$set($)},i(y){g||(A(u.$$.fragment,y),A(h.$$.fragment,y),g=!0)},o(y){L(u.$$.fragment,y),L(h.$$.fragment,y),g=!1},d(y){y&&(k(e),k(t),k(i),k(c),k(d)),H(u),H(h),m=!1,_()}}}function nI(n){let e,t,i,s;return{c(){e=v("h4"),t=U("Restore "),i=v("strong"),s=U(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(i,s)},p(l,o){o&2&&se(s,l[1])},d(l){l&&k(e)}}}function iI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=U("Cancel"),i=O(),s=v("button"),l=v("span"),l.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),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])&&(s.disabled=o),f&16&&Q(s,"btn-loading",u[4])},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function sI(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[iI],header:[nI],default:[tI]},$$scope:{ctx:n}};return e=new on({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&65590&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[11](null),H(e,s)}}}function lI(n,e,t){let i;const s="backup_restore_"+z.randomString(5);let l,o="",r="",a=!1,u=null;function f(S){tn({}),t(2,r=""),t(1,o=S),t(4,a=!1),l==null||l.show()}function c(){return l==null?void 0:l.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await fe.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch(T){clearTimeout(u),T!=null&&T.isAbort||(t(4,a=!1),ls(((S=T.response)==null?void 0:S.message)||T.message))}}}Is(()=>{clearTimeout(u)});function h(){r=this.value,t(2,r)}const g=()=>!a;function m(S){ne[S?"unshift":"push"](()=>{l=S,t(3,l)})}function _(S){Ne.call(this,n,S)}function y(S){Ne.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,l,a,i,s,d,f,h,g,m,_,y]}class oI extends ve{constructor(e){super(),be(this,e,lI,sI,he,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function jg(n,e,t){const i=n.slice();return i[22]=e[t],i}function Hg(n,e,t){const i=n.slice();return i[19]=e[t],i}function rI(n){let e=[],t=new Map,i,s,l=pe(n[3]);const o=a=>a[22].key;for(let a=0;a<l.length;a+=1){let u=jg(n,l,a),f=o(u);t.set(f,e[a]=zg(f,u))}let r=null;return l.length||(r=Vg()),{c(){for(let a=0;a<e.length;a+=1)e[a].c();i=ke(),r&&r.c()},m(a,u){for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(a,u);w(a,i,u),r&&r.m(a,u),s=!0},p(a,u){u&876&&(l=pe(a[3]),re(),e=yt(e,u,o,1,a,l,t,i.parentNode,Ut,zg,i,jg),ae(),!l.length&&r?r.p(a,u):l.length?r&&(r.d(1),r=null):(r=Vg(),r.c(),r.m(i.parentNode,i)))},i(a){if(!s){for(let u=0;u<l.length;u+=1)A(e[u]);s=!0}},o(a){for(let u=0;u<e.length;u+=1)L(e[u]);s=!1},d(a){a&&k(i);for(let u=0;u<e.length;u+=1)e[u].d(a);r&&r.d(a)}}}function aI(n){let e,t=pe(Array(n[3].length||1)),i=[];for(let s=0;s<t.length;s+=1)i[s]=Bg(Hg(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=ke()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);w(s,e,l)},p(s,l){if(l&8){t=pe(Array(s[3].length||1));let o;for(o=0;o<t.length;o+=1){const r=Hg(s,t,o);i[o]?i[o].p(r,l):(i[o]=Bg(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:x,o:x,d(s){s&&k(e),_t(i,s)}}}f
`),$=v("span"),$.textContent="macros",C=U(`.
`),M=v("br"),E=U(`
The timezone is in UTC.`),p(e,"for",i=n[31]),l.required=!0,p(l,"type","text"),p(l,"id",o=n[31]),p(l,"class","txt-lg txt-mono"),p(l,"placeholder","* * * * *"),l.autofocus=r=!((N=(F=n[0])==null?void 0:F.backups)!=null&&N.cron),p(c,"class","txt"),p(h,"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($,"class","link-primary"),p(y,"class","help-block")},m(F,N){var R,q;w(F,e,N),b(e,t),w(F,s,N),w(F,l,N),oe(l,n[1].backups.cron),w(F,a,N),w(F,u,N),b(u,f),b(f,c),b(f,d),b(f,h),b(f,g),j(m,f,null),w(F,_,N),w(F,y,N),b(y,S),b(S,T),b(S,$),b(S,C),b(S,M),b(S,E),D=!0,(q=(R=n[0])==null?void 0:R.backups)!=null&&q.cron||l.focus(),I||(P=[Y(l,"input",n[18]),$e(je.call(null,$,`@yearly
@annually
@monthly
@weekly
@daily
@midnight
2023-09-22 21:24:46 +03:00
@hourly`))],I=!0)},p(F,N){var q,B;(!D||N[1]&1&&i!==(i=F[31]))&&p(e,"for",i),(!D||N[1]&1&&o!==(o=F[31]))&&p(l,"id",o),(!D||N[0]&1&&r!==(r=!((B=(q=F[0])==null?void 0:q.backups)!=null&&B.cron)))&&(l.autofocus=r),N[0]&2&&l.value!==F[1].backups.cron&&oe(l,F[1].backups.cron);const R={};N[0]&2|N[1]&2&&(R.$$scope={dirty:N,ctx:F}),m.$set(R)},i(F){D||(A(m.$$.fragment,F),D=!0)},o(F){L(m.$$.fragment,F),D=!1},d(F){F&&(k(e),k(s),k(l),k(a),k(u),k(_),k(y)),H(m),I=!1,Te(P)}}}function wI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max @auto backups to keep"),s=O(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","number"),p(l,"id",o=n[31]),p(l,"min","1")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),oe(l,n[1].backups.cronMaxKeep),r||(a=Y(l,"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(l,"id",o),f[0]&2&&ht(l.value)!==u[1].backups.cronMaxKeep&&oe(l,u[1].backups.cronMaxKeep)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function Kg(n){let e;function t(l,o){return l[7]?TI:l[8]?$I:SI}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function SI(n){let e;return{c(){e=v("div"),e.innerHTML='<i class="ri-checkbox-circle-line txt-success"></i> <span class="txt">S3 connected successfully</span>',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function $I(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML='<i class="ri-error-warning-line txt-warning"></i> <span class="txt">Failed to establish S3 connection</span>',p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=$e(t=je.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Dt(t.update)&&o[0]&256&&t.update.call(null,(r=l[8].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function TI(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Jg(n){let e,t,i,s,l;return{c(){e=v("button"),t=v("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),b(e,t),s||(l=Y(e,"click",n[27]),s=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&k(e),s=!1,l()}}}function CI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,T,$,C,M,E,D,I,P,F;h=new Yo({props:{class:"btn-sm",tooltip:"Refresh"}}),h.$on("refresh",n[13]),m=new gI({props:{class:"btn-sm"}}),m.$on("success",n[13]);let N={};y=new pI({props:N}),n[15](y);function R(J,X){return J[6]?bI:_I}let q=R(n),B=q(n),K=n[6]&&!n[4]&&Wg(n);return{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=O(),l=v("div"),o=U(n[10]),r=O(),a=v("div"),u=v("div"),f=v("div"),c=v("span"),c.textContent="Backup and restore your PocketBase data",d=O(),V(h.$$.fragment),g=O(),V(m.$$.fragment),_=O(),V(y.$$.fragment),S=O(),T=v("hr"),$=O(),C=v("button"),M=v("span"),M.textContent="Backups options",E=O(),B.c(),D=O(),K&&K.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(M,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-secondary"),C.disabled=n[4],Q(C,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(J,X){w(J,e,X),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(J,r,X),w(J,a,X),b(a,u),b(u,f),b(f,c),b(f,d),j(h,f,null),b(f,g),j(m,f,null),b(u,_),j(y,u,null),b(u,S),b(u,T),b(u,$),b(u,C),b(C,M),b(C,E),B.m(C,null),b(u,D),K&&K.m(u,null),I=!0,P||(F=[Y(C,"click",n[16]),Y(u,"submit",Qe(n[11]))],P=!0)},p(J,X){(!I||X[0]&1024)&&se(o,J[10]);const Z={};y.$set(Z),q!==(q=R(J))&&(B.d(1),B=q(J),B&&(B.c(),B.m(C,null))),(!I||X[0]&16)&&(C.disabled=J[4]),(!I||X[0]&16)&&Q(C,"btn-loading",J[4]),J[6]&&!J[4]?K?(K.p(J,X),X[0]&80&&A(K,1)):(K=Wg(J),K.c(),A(K,1),K.m(u,null)):K&&(re(),L(K,1,1,()=>{K=null}),ae())},i(J){I||(A(h.$$.fragment,J),A(m.$$.fragment,J),A(y.$$.fragment,J),A(K),I=!0)},o(J){L(h.$$.fragment,J),L(m.$$.fragment,J),L(