const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-PMlzupR2.js","./index-BhTME3U5.js","./ListApiDocs-DmGUce7q.js","./FieldsQueryParam-BEElMuh3.js","./ListApiDocs-ByASLUZu.css","./ViewApiDocs-CRSanFHP.js","./CreateApiDocs-BXC2dhsj.js","./UpdateApiDocs-DhtOn0BD.js","./AuthMethodsDocs-BYCZv5mv.js","./AuthWithPasswordDocs-D289hdS-.js","./AuthWithOAuth2Docs-4TdTDUI5.js","./AuthWithOtpDocs-7J8Eornu.js","./AuthRefreshDocs-Bn-OssXX.js","./CodeEditor-CyHPNCgP.js","./Leaflet-x3Krp1p9.js","./Leaflet-DCQr6yJv.css"])))=>i.map(i=>d[i]);
var nv=Object.defineProperty;var iv=(n,e,t)=>e in n?nv(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var pt=(n,e,t)=>iv(n,typeof e!="symbol"?e+"":e,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 te(){}const so=n=>n;function je(n,e){for(const t in e)n[t]=e[t];return n}function lv(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function f0(n){return n()}function bf(){return Object.create(null)}function Ee(n){n.forEach(f0)}function Lt(n){return typeof n=="function"}function be(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let So;function wn(n,e){return n===e?!0:(So||(So=document.createElement("a")),So.href=e,n===So.href)}function sv(n){return Object.keys(n).length===0}function ku(n,...e){if(n==null){for(const i of e)i(void 0);return te}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function c0(n){let e;return ku(n,t=>e=t)(),e}function Ge(n,e,t){n.$$.on_destroy.push(ku(e,t))}function Nt(n,e,t,i){if(n){const s=d0(n,e,t,i);return n[0](s)}}function d0(n,e,t,i){return n[1]&&i?je(t.ctx.slice(),n[1](i(e))):t.ctx}function Rt(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 This feature is experimental and may change in the future. Multi-factor authentication (MFA) requires the user to authenticate with any 2 different auth
methods (otp, identity/password, oauth2) before issuing an auth token.
(Learn more) . When PocketBase is deployed on platforms like Fly or it is accessible through proxies such as
NGINX, requests from different users will originate from the same IP address (the IP of the proxy
connecting to your PocketBase app). In this case to retrieve the actual user IP (used for rate limiting, logging, etc.) you need to
properly configure your proxy and list below the trusted headers that PocketBase could use to
extract the user IP. When using such proxy, to avoid spoofing it is recommended to: You can clear the headers field if PocketBase is not deployed behind a proxy. Please note that during the backup other concurrent write requests may fail since the
database will be temporary "locked" (this usually happens only during the ZIP generation). If you are using S3 storage for the collections file upload, you'll have to backup them
separately since they are not locally stored and will not be included in the final backup! Please proceed with caution and use it only with trusted backups! Backup restore is experimental and works only on UNIX based systems. The restore operation will attempt to replace your existing This means that on success all of your data (including app settings, users, superusers, etc.)
will be replaced with the ones from the backup. Nothing will happen if the backup is invalid (ex. missing
Below is an oversimplified version of the restore flow: '},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function Lc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[26]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function Ac(n){let e,t=ce(n[34]),i=[];for(let s=0;s a&&ui&&n[s-1]>t;)s--;return i>0||si.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>ca(s.backgroundColor),this.hoverBorderColor=(i,s)=>ca(s.borderColor),this.hoverColor=(i,s)=>ca(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return da(this,e,t)}get(e){return Fs(this,e)}describe(e,t){return da(lu,e,t)}override(e,t){return da(Ll,e,t)}route(e,t,i,s){const l=Fs(this,e),o=Fs(this,i),r="_"+t;Object.defineProperties(l,{[r]:{value:l[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[s];return St(a)?Object.assign({},u,a):Et(a,u)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var rn=new g4({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[c4,d4,_4]);function b4(n){return!n||Vt(n.size)||Vt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ed(n,e,t,i,s){let l=e[s];return l||(l=e[s]=n.measureText(s).width,t.push(s)),l>i&&(i=l),i}function yl(n,e,t){const i=n.currentDevicePixelRatio,s=t!==0?Math.max(t/2,.5):0;return Math.round((e-s)*i)/i+s}function td(n,e){!e&&!n||(e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore())}function su(n,e,t,i){k4(n,e,t,i)}function k4(n,e,t,i,s){let l,o,r,a,u,f,c,d;const m=e.pointStyle,h=e.rotation,g=e.radius;let _=(h||0)*YS;if(m&&typeof m=="object"&&(l=m.toString(),l==="[object HTMLImageElement]"||l==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(_),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(g)||g<=0)){switch(n.beginPath(),m){default:n.arc(t,i,g,0,Ci),n.closePath();break;case"triangle":f=g,n.moveTo(t+Math.sin(_)*f,i-Math.cos(_)*g),_+=Wc,n.lineTo(t+Math.sin(_)*f,i-Math.cos(_)*g),_+=Wc,n.lineTo(t+Math.sin(_)*f,i-Math.cos(_)*g),n.closePath();break;case"rectRounded":u=g*.516,a=g-u,o=Math.cos(_+kl)*a,c=Math.cos(_+kl)*a,r=Math.sin(_+kl)*a,d=Math.sin(_+kl)*a,n.arc(t-c,i-r,u,_-vn,_-ci),n.arc(t+d,i-o,u,_-ci,_),n.arc(t+c,i+r,u,_,_+ci),n.arc(t-d,i+o,u,_+ci,_+vn),n.closePath();break;case"rect":if(!h){a=Math.SQRT1_2*g,f=a,n.rect(t-f,i-a,2*f,2*a);break}_+=kl;case"rectRot":c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+d,i-o),n.lineTo(t+c,i+r),n.lineTo(t-d,i+o),n.closePath();break;case"crossRot":_+=kl;case"cross":c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"star":c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o),_+=kl,c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"line":o=Math.cos(_)*g,r=Math.sin(_)*g,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(_)*g,i+Math.sin(_)*g);break;case!1:n.closePath();break}n.fill(),e.borderWidth>0&&n.stroke()}}function ss(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.x{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;ro+r)))return a}function r5(n,e){gt(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;li?i:t,i=s&&t>i?t:i,{min:gi(t,gi(i,t)),max:gi(i,gi(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ft(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:s,grace:l,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=D4(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const l=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u0 to disable logs persistence.",p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),v(e,t),w(c,s,d),w(c,l,d),me(l,n[1].logs.maxDays),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[11]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&2&&mt(l.value)!==c[1].logs.maxDays&&me(l,c[1].logs.maxDays)},d(c){c&&(y(e),y(s),y(l),y(r),y(a)),u=!1,f()}}}function B$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return f=new zy({}),{c(){e=b("label"),t=W("Min log level"),s=C(),l=b("input"),o=C(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",u=C(),H(f.$$.fragment),p(e,"for",i=n[23]),p(l,"type","number"),l.required=!0,p(l,"min","-100"),p(l,"max","100"),p(r,"class","help-block")},m(h,g){w(h,e,g),v(e,t),w(h,s,g),w(h,l,g),me(l,n[1].logs.minLevel),w(h,o,g),w(h,r,g),v(r,a),v(r,u),q(f,r,null),c=!0,d||(m=Y(l,"input",n[12]),d=!0)},p(h,g){(!c||g&8388608&&i!==(i=h[23]))&&p(e,"for",i),g&2&&mt(l.value)!==h[1].logs.minLevel&&me(l,h[1].logs.minLevel)},i(h){c||(M(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&(y(e),y(s),y(l),y(o),y(r)),j(f),d=!1,m()}}}function W$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[1].logs.logIP,w(u,i,f),w(u,s,f),v(s,l),r||(a=Y(e,"change",n[13]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logIP),f&8388608&&o!==(o=u[23])&&p(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function Y$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable Auth Id logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[1].logs.logAuthId,w(u,i,f),w(u,s,f),v(s,l),r||(a=Y(e,"change",n[14]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logAuthId),f&8388608&&o!==(o=u[23])&&p(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function K$(n){let e,t,i,s;const l=[U$,z$],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&y(i),o[e].d(a)}}}function J$(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function Z$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),s=b("button"),l=b("span"),l.textContent="Save changes",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[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[3],x(s,"btn-loading",n[3])},m(u,f){w(u,e,f),v(e,t),w(u,i,f),w(u,s,f),v(s,l),r||(a=Y(e,"click",n[0]),r=!0)},p(u,f){f&8&&(e.disabled=u[3]),f&40&&o!==(o=!u[5]||u[3])&&(s.disabled=o),f&8&&x(s,"btn-loading",u[3])},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function G$(n){let e,t,i={popup:!0,class:"superuser-panel",beforeHide:n[15],$$slots:{footer:[Z$],header:[J$],default:[K$]},$$scope:{ctx:n}};return e=new ln({props:i}),n[16](e),e.$on("hide",n[17]),e.$on("show",n[18]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&8&&(o.beforeHide=s[15]),l&16777274&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[16](null),j(e,s)}}}function X$(n,e,t){let i,s;const l=wt(),o="logs_settings_"+U.randomString(3);let r,a=!1,u=!1,f={},c={};function d(){return h(),g(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Jt(),t(9,f={}),t(1,c=JSON.parse(JSON.stringify(f||{})))}async function g(){t(4,u=!0);try{const P=await he.settings.getAll()||{};k(P)}catch(P){he.error(P)}t(4,u=!1)}async function _(){if(s){t(3,a=!0);try{const P=await he.settings.update(U.filterRedactedProps(c));k(P),t(3,a=!1),m(),nn("Successfully saved logs settings."),l("save",P)}catch(P){t(3,a=!1),he.error(P)}}}function k(P={}){t(1,c={logs:(P==null?void 0:P.logs)||{}}),t(9,f=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=mt(this.value),t(1,c)}function $(){c.logs.minLevel=mt(this.value),t(1,c)}function T(){c.logs.logIP=this.checked,t(1,c)}function O(){c.logs.logAuthId=this.checked,t(1,c)}const E=()=>!a;function L(P){ne[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Le.call(this,n,P)}function A(P){Le.call(this,n,P)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(f)),n.$$.dirty&1026&&t(5,s=i!=JSON.stringify(c))},[m,c,r,a,u,s,o,_,d,f,i,S,$,T,O,E,L,I,A]}class Q$ extends ve{constructor(e){super(),ye(this,e,X$,G$,be,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function x$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Include requests by superusers"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"for",o=n[25])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,s,f),v(s,l),r||(a=Y(e,"change",n[12]),r=!0)},p(u,f){f&33554432&&t!==(t=u[25])&&p(e,"id",t),f&4&&(e.checked=u[2]),f&33554432&&o!==(o=u[25])&&p(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function kp(n){let e,t,i;function s(o){n[14](o)}let l={filter:n[1],presets:n[6]};return n[5]!==void 0&&(l.zoom=n[5]),e=new g$({props:l}),ne.push(()=>ge(e,"zoom",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&2&&(a.filter=o[1]),r&64&&(a.presets=o[6]),!t&&r&32&&(t=!0,a.zoom=o[5],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function yp(n){let e,t,i,s;function l(a){n[15](a)}function o(a){n[16](a)}let r={presets:n[6]};return n[1]!==void 0&&(r.filter=n[1]),n[5]!==void 0&&(r.zoom=n[5]),e=new hS({props:r}),ne.push(()=>ge(e,"filter",l)),ne.push(()=>ge(e,"zoom",o)),e.$on("select",n[17]),{c(){H(e.$$.fragment)},m(a,u){q(e,a,u),s=!0},p(a,u){const f={};u&64&&(f.presets=a[6]),!t&&u&2&&(t=!0,f.filter=a[1],$e(()=>t=!1)),!i&&u&32&&(i=!0,f.zoom=a[5],$e(()=>i=!1)),e.$set(f)},i(a){s||(M(e.$$.fragment,a),s=!0)},o(a){D(e.$$.fragment,a),s=!1},d(a){j(e,a)}}}function eC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T=n[4],O,E=n[4],L,I,A,P;u=new Fr({}),u.$on("refresh",n[11]),h=new fe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[x$,({uniqueId:z})=>({25:z}),({uniqueId:z})=>z?33554432:0]},$$scope:{ctx:n}}}),_=new Rr({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),_.$on("submit",n[13]),S=new zy({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let N=kp(n),R=yp(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),s=b("div"),l=W(n[7]),o=C(),r=b("button"),r.innerHTML='',a=C(),H(u.$$.fragment),f=C(),c=b("div"),d=C(),m=b("div"),H(h.$$.fragment),g=C(),H(_.$$.fragment),k=C(),H(S.$$.fragment),$=C(),N.c(),O=C(),R.c(),L=ke(),p(s,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(z,F){w(z,e,F),v(e,t),v(t,i),v(i,s),v(s,l),v(t,o),v(t,r),v(t,a),q(u,t,null),v(t,f),v(t,c),v(t,d),v(t,m),q(h,m,null),v(e,g),q(_,e,null),v(e,k),q(S,e,null),v(e,$),N.m(e,null),w(z,O,F),R.m(z,F),w(z,L,F),I=!0,A||(P=[Oe(Re.call(null,r,{text:"Logs settings",position:"right"})),Y(r,"click",n[10])],A=!0)},p(z,F){(!I||F&128)&&se(l,z[7]);const B={};F&100663300&&(B.$$scope={dirty:F,ctx:z}),h.$set(B);const J={};F&2&&(J.value=z[1]),_.$set(J),F&16&&be(T,T=z[4])?(oe(),D(N,1,1,te),re(),N=kp(z),N.c(),M(N,1),N.m(e,null)):N.p(z,F),F&16&&be(E,E=z[4])?(oe(),D(R,1,1,te),re(),R=yp(z),R.c(),M(R,1),R.m(L.parentNode,L)):R.p(z,F)},i(z){I||(M(u.$$.fragment,z),M(h.$$.fragment,z),M(_.$$.fragment,z),M(S.$$.fragment,z),M(N),M(R),I=!0)},o(z){D(u.$$.fragment,z),D(h.$$.fragment,z),D(_.$$.fragment,z),D(S.$$.fragment,z),D(N),D(R),I=!1},d(z){z&&(y(e),y(O),y(L)),j(u),j(h),j(_),j(S),N.d(z),R.d(z),A=!1,Ee(P)}}}function tC(n){let e,t,i,s,l,o;e=new si({props:{$$slots:{default:[eC]},$$scope:{ctx:n}}});let r={};i=new R$({props:r}),n[18](i),i.$on("show",n[19]),i.$on("hide",n[20]);let a={};return l=new Q$({props:a}),n[21](l),l.$on("save",n[8]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),s=C(),H(l.$$.fragment)},m(u,f){q(e,u,f),w(u,t,f),q(i,u,f),w(u,s,f),q(l,u,f),o=!0},p(u,[f]){const c={};f&67109119&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};i.$set(d);const m={};l.$set(m)},i(u){o||(M(e.$$.fragment,u),M(i.$$.fragment,u),M(l.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),D(i.$$.fragment,u),D(l.$$.fragment,u),o=!1},d(u){u&&(y(t),y(s)),j(e,u),n[18](null),j(i,u),n[21](null),j(l,u)}}}const Wo="logId",vp="superuserRequests",wp="superuserLogRequests";function nC(n,e,t){var R;let i,s,l;Ge(n,zu,z=>t(22,s=z)),Ge(n,an,z=>t(7,l=z)),En(an,l="Logs",l);const o=new URLSearchParams(s);let r,a,u=1,f=o.get("filter")||"",c={},d=(o.get(vp)||((R=window.localStorage)==null?void 0:R.getItem(wp)))<<0,m=d;function h(){t(4,u++,u)}function g(z={}){let F={};F.filter=f||null,F[vp]=d<<0||null,U.replaceHashQueryParams(Object.assign(F,z))}const _=()=>a==null?void 0:a.show(),k=()=>h();function S(){d=this.checked,t(2,d)}const $=z=>t(1,f=z.detail);function T(z){c=z,t(5,c)}function O(z){f=z,t(1,f)}function E(z){c=z,t(5,c)}const L=z=>r==null?void 0:r.show(z==null?void 0:z.detail);function I(z){ne[z?"unshift":"push"](()=>{r=z,t(0,r)})}const A=z=>{var B;let F={};F[Wo]=((B=z.detail)==null?void 0:B.id)||null,U.replaceHashQueryParams(F)},P=()=>{let z={};z[Wo]=null,U.replaceHashQueryParams(z)};function N(z){ne[z?"unshift":"push"](()=>{a=z,t(3,a)})}return n.$$.update=()=>{var z;n.$$.dirty&1&&o.get(Wo)&&r&&r.show(o.get(Wo)),n.$$.dirty&4&&t(6,i=d?"":'data.auth!="_superusers"'),n.$$.dirty&516&&m!=d&&(t(9,m=d),(z=window.localStorage)==null||z.setItem(wp,d<<0),g()),n.$$.dirty&2&&typeof f<"u"&&g()},[r,f,d,a,u,c,i,l,h,m,_,k,S,$,T,O,E,L,I,A,P,N]}class iC extends ve{constructor(e){super(),ye(this,e,nC,tC,be,{})}}function Sp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Tp(n){n[18]=n[19].default}function $p(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Cp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function lC(n){let e,t=n[15].label+"",i,s,l,o;function r(){return n[9](n[14])}return{c(){e=b("button"),i=W(t),s=C(),p(e,"type","button"),p(e,"class","sidebar-item"),x(e,"active",n[5]===n[14])},m(a,u){w(a,e,u),v(e,i),v(e,s),l||(o=Y(e,"click",r),l=!0)},p(a,u){n=a,u&8&&t!==(t=n[15].label+"")&&se(i,t),u&40&&x(e,"active",n[5]===n[14])},d(a){a&&y(e),l=!1,o()}}}function sC(n){let e,t=n[15].label+"",i,s,l,o;return{c(){e=b("div"),i=W(t),s=C(),p(e,"class","sidebar-item disabled")},m(r,a){w(r,e,a),v(e,i),v(e,s),l||(o=Oe(Re.call(null,e,{position:"left",text:"Not enabled for the collection"})),l=!0)},p(r,a){a&8&&t!==(t=r[15].label+"")&&se(i,t)},d(r){r&&y(e),l=!1,o()}}}function Op(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=i&&Cp();function r(f,c){return f[15].disabled?sC:lC}let a=r(e),u=a(e);return{key:n,first:null,c(){t=ke(),o&&o.c(),s=C(),u.c(),l=ke(),this.first=t},m(f,c){w(f,t,c),o&&o.m(f,c),w(f,s,c),u.m(f,c),w(f,l,c)},p(f,c){e=f,c&8&&(i=e[21]===Object.keys(e[6]).length),i?o||(o=Cp(),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null),a===(a=r(e))&&u?u.p(e,c):(u.d(1),u=a(e),u&&(u.c(),u.m(l.parentNode,l)))},d(f){f&&(y(t),y(s),y(l)),o&&o.d(f),u.d(f)}}}function Mp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:aC,then:rC,catch:oC,value:19,blocks:[,,,]};return yf(t=n[15].component,s),{c(){e=ke(),s.block.c()},m(l,o){w(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.anchor=e,i=!0},p(l,o){n=l,s.ctx=n,o&8&&t!==(t=n[15].component)&&yf(t,s)||kv(s,n,o)},i(l){i||(M(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];D(r)}i=!1},d(l){l&&y(e),s.block.d(l),s.token=null,s=null}}}function oC(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function rC(n){Tp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){H(e.$$.fragment),t=C()},m(s,l){q(e,s,l),w(s,t,l),i=!0},p(s,l){Tp(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(M(e.$$.fragment,s),i=!0)},o(s){D(e.$$.fragment,s),i=!1},d(s){s&&y(t),j(e,s)}}}function aC(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function Ep(n,e){let t,i,s,l=e[5]===e[14]&&Mp(e);return{key:n,first:null,c(){t=ke(),l&&l.c(),i=ke(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&M(l,1)):(l=Mp(e),l.c(),M(l,1),l.m(i.parentNode,i)):l&&(oe(),D(l,1,1,()=>{l=null}),re())},i(o){s||(M(l),s=!0)},o(o){D(l),s=!1},d(o){o&&(y(t),y(i)),l&&l.d(o)}}}function uC(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,c=ce(Object.entries(n[3]));const d=g=>g[14];for(let g=0;gemail != ''.`,s=C(),l=b("p"),l.textContent="Leave the rule empty to require MFA for everyone."},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:te,d(o){o&&(y(e),y(t),y(i),y(s),y(l))}}}function WC(n){let e,t,i,s,l,o,r,a,u;s=new fe({props:{class:"form-field form-field-toggle",name:"mfa.enabled",$$slots:{default:[VC,({uniqueId:d})=>({5:d}),({uniqueId:d})=>d?32:0]},$$scope:{ctx:n}}});function f(d){n[4](d)}let c={label:"MFA rule",formKey:"mfa.rule",superuserToggle:!1,disabled:!n[0].mfa.enabled,placeholder:"Leave empty to require MFA for everyone",collection:n[0],$$slots:{default:[BC]},$$scope:{ctx:n}};return n[0].mfa.rule!==void 0&&(c.rule=n[0].mfa.rule),r=new sl({props:c}),ne.push(()=>ge(r,"rule",f)),{c(){e=b("div"),e.innerHTML=`id_token
is a direct result of the trusted server code->token exchange response.`,i=C(),H(s.$$.fragment),l=C(),H(o.$$.fragment),p(t,"class","txt-hint txt-sm m-b-xs"),p(e,"class","content")},m(u,f){w(u,e,f),v(e,t),v(e,i),q(s,e,null),v(e,l),q(o,e,null),a=!0},p(u,f){const c={};f&2&&(c.name=u[1]+".extra.jwksURL"),f&24577&&(c.$$scope={dirty:f,ctx:u}),s.$set(c);const d={};f&2&&(d.name=u[1]+".extra.issuers"),f&24577&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(M(s.$$.fragment,u),M(o.$$.fragment,u),u&&tt(()=>{a&&(r||(r=qe(e,ht,{delay:10,duration:150},!0)),r.run(1))}),a=!0)},o(u){D(s.$$.fragment,u),D(o.$$.fragment,u),u&&(r||(r=qe(e,ht,{delay:10,duration:150},!1)),r.run(0)),a=!1},d(u){u&&y(e),j(s),j(o),u&&r&&r.end()}}}function lO(n){let e,t,i,s;return t=new fe({props:{class:"form-field required",name:n[1]+".userInfoURL",$$slots:{default:[rO,({uniqueId:l})=>({13:l}),({uniqueId:l})=>l?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","content")},m(l,o){w(l,e,o),q(t,e,null),s=!0},p(l,o){const r={};o&2&&(r.name=l[1]+".userInfoURL"),o&24577&&(r.$$scope={dirty:o,ctx:l}),t.$set(r)},i(l){s||(M(t.$$.fragment,l),l&&tt(()=>{s&&(i||(i=qe(e,ht,{delay:10,duration:150},!0)),i.run(1))}),s=!0)},o(l){D(t.$$.fragment,l),l&&(i||(i=qe(e,ht,{delay:10,duration:150},!1)),i.run(0)),s=!1},d(l){l&&y(e),j(t),l&&i&&i.end()}}}function sO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="JWKS verification URL",i=C(),s=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[13]),p(r,"type","url"),p(r,"id",a=n[13])},m(c,d){w(c,e,d),v(e,t),v(e,i),v(e,s),w(c,o,d),w(c,r,d),me(r,n[0].extra.jwksURL),u||(f=[Oe(Re.call(null,s,{text:"URL to the public token verification keys.",position:"top"})),Y(r,"input",n[9])],u=!0)},p(c,d){d&8192&&l!==(l=c[13])&&p(e,"for",l),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].extra.jwksURL&&me(r,c[0].extra.jwksURL)},d(c){c&&(y(e),y(o),y(r)),u=!1,Ee(f)}}}function oO(n){let e,t,i,s,l,o,r,a,u,f,c;function d(h){n[10](h)}let m={id:n[13]};return n[0].extra.issuers!==void 0&&(m.value=n[0].extra.issuers),r=new _o({props:m}),ne.push(()=>ge(r,"value",d)),{c(){e=b("label"),t=b("span"),t.textContent="Issuers",i=C(),s=b("i"),o=C(),H(r.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[13])},m(h,g){w(h,e,g),v(e,t),v(e,i),v(e,s),w(h,o,g),q(r,h,g),u=!0,f||(c=Oe(Re.call(null,s,{text:"Comma separated list of accepted values for the iss token claim validation.",position:"top"})),f=!0)},p(h,g){(!u||g&8192&&l!==(l=h[13]))&&p(e,"for",l);const _={};g&8192&&(_.id=h[13]),!a&&g&1&&(a=!0,_.value=h[0].extra.issuers,$e(()=>a=!1)),r.$set(_)},i(h){u||(M(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(y(e),y(o)),j(r,h),f=!1,c()}}}function rO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("User info URL"),s=C(),l=b("input"),p(e,"for",i=n[13]),p(l,"type","url"),p(l,"id",o=n[13]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].userInfoURL),r||(a=Y(l,"input",n[8]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(l,"id",o),f&1&&l.value!==u[0].userInfoURL&&me(l,u[0].userInfoURL)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function aO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Support PKCE",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].pkce,w(c,i,d),w(c,s,d),v(s,l),v(s,o),v(s,r),u||(f=[Y(e,"change",n[11]),Oe(Re.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if they don't support PKCE.",position:"right"}))],u=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&8192&&a!==(a=c[13])&&p(s,"for",a)},d(c){c&&(y(e),y(i),y(s)),u=!1,Ee(f)}}}function uO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_;e=new fe({props:{class:"form-field required",name:n[1]+".displayName",$$slots:{default:[x8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[eO,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[tO,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field m-b-xs",$$slots:{default:[nO,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}});const k=[lO,iO],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),g=new fe({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[aO,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),i.textContent="Endpoints",s=C(),H(l.$$.fragment),o=C(),H(r.$$.fragment),a=C(),H(u.$$.fragment),f=C(),c=b("div"),m.c(),h=C(),H(g.$$.fragment),p(i,"class","section-title"),p(c,"class","sub-panel m-b-base")},m(T,O){q(e,T,O),w(T,t,O),w(T,i,O),w(T,s,O),q(l,T,O),w(T,o,O),q(r,T,O),w(T,a,O),q(u,T,O),w(T,f,O),w(T,c,O),S[d].m(c,null),w(T,h,O),q(g,T,O),_=!0},p(T,[O]){const E={};O&2&&(E.name=T[1]+".displayName"),O&24577&&(E.$$scope={dirty:O,ctx:T}),e.$set(E);const L={};O&2&&(L.name=T[1]+".authURL"),O&24577&&(L.$$scope={dirty:O,ctx:T}),l.$set(L);const I={};O&2&&(I.name=T[1]+".tokenURL"),O&24577&&(I.$$scope={dirty:O,ctx:T}),r.$set(I);const A={};O&24580&&(A.$$scope={dirty:O,ctx:T}),u.$set(A);let P=d;d=$(T),d===P?S[d].p(T,O):(oe(),D(S[P],1,1,()=>{S[P]=null}),re(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(c,null));const N={};O&2&&(N.name=T[1]+".pkce"),O&24577&&(N.$$scope={dirty:O,ctx:T}),g.$set(N)},i(T){_||(M(e.$$.fragment,T),M(l.$$.fragment,T),M(r.$$.fragment,T),M(u.$$.fragment,T),M(m),M(g.$$.fragment,T),_=!0)},o(T){D(e.$$.fragment,T),D(l.$$.fragment,T),D(r.$$.fragment,T),D(u.$$.fragment,T),D(m),D(g.$$.fragment,T),_=!1},d(T){T&&(y(t),y(i),y(s),y(o),y(a),y(f),y(c),y(h)),j(e,T),j(l,T),j(r,T),j(u,T),S[d].d(),j(g,T)}}}function fO(n,e,t){let{key:i=""}=e,{config:s={}}=e;const l=[{label:"User info URL",value:!0},{label:"ID Token",value:!1}];let o=!!s.userInfoURL;U.isEmpty(s.pkce)&&(s.pkce=!0),s.displayName||(s.displayName="OIDC"),s.extra||(s.extra={},o=!0);function r(){o?t(0,s.extra={},s):(t(0,s.userInfoURL="",s),t(0,s.extra=s.extra||{},s))}function a(){s.displayName=this.value,t(0,s)}function u(){s.authURL=this.value,t(0,s)}function f(){s.tokenURL=this.value,t(0,s)}function c(_){o=_,t(2,o)}function d(){s.userInfoURL=this.value,t(0,s)}function m(){s.extra.jwksURL=this.value,t(0,s)}function h(_){n.$$.not_equal(s.extra.issuers,_)&&(s.extra.issuers=_,t(0,s))}function g(){s.pkce=this.checked,t(0,s)}return n.$$set=_=>{"key"in _&&t(1,i=_.key),"config"in _&&t(0,s=_.config)},n.$$.update=()=>{n.$$.dirty&4&&typeof o!==void 0&&r()},[s,i,o,l,a,u,f,c,d,m,h,g]}class Ta extends ve{constructor(e){super(),ye(this,e,fO,uO,be,{key:1,config:0})}}function cO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Auth URL"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","url"),p(l,"id",o=n[8]),l.required=n[3]},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].authURL),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&8&&(l.required=u[3]),f&1&&l.value!==u[0].authURL&&me(l,u[0].authURL)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function dO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Token URL"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","url"),p(l,"id",o=n[8]),l.required=n[3]},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].tokenURL),r||(a=Y(l,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&8&&(l.required=u[3]),f&1&&l.value!==u[0].tokenURL&&me(l,u[0].tokenURL)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function pO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("User info URL"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","url"),p(l,"id",o=n[8]),l.required=n[3]},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].userInfoURL),r||(a=Y(l,"input",n[7]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&8&&(l.required=u[3]),f&1&&l.value!==u[0].userInfoURL&&me(l,u[0].userInfoURL)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function mO(n){let e,t,i,s,l,o,r,a,u;return s=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authURL",$$slots:{default:[cO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenURL",$$slots:{default:[dO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userInfoURL",$$slots:{default:[pO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=W(n[2]),i=C(),H(s.$$.fragment),l=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),p(e,"class","section-title")},m(f,c){w(f,e,c),v(e,t),w(f,i,c),q(s,f,c),w(f,l,c),q(o,f,c),w(f,r,c),q(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&se(t,f[2]);const d={};c&8&&(d.class="form-field "+(f[3]?"required":"")),c&2&&(d.name=f[1]+".authURL"),c&777&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c&8&&(m.class="form-field "+(f[3]?"required":"")),c&2&&(m.name=f[1]+".tokenURL"),c&777&&(m.$$scope={dirty:c,ctx:f}),o.$set(m);const h={};c&8&&(h.class="form-field "+(f[3]?"required":"")),c&2&&(h.name=f[1]+".userInfoURL"),c&777&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(M(s.$$.fragment,f),M(o.$$.fragment,f),M(a.$$.fragment,f),u=!0)},o(f){D(s.$$.fragment,f),D(o.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(y(e),y(i),y(l),y(r)),j(s,f),j(o,f),j(a,f)}}}function hO(n,e,t){let i,{key:s=""}=e,{config:l={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){l.authURL=this.value,t(0,l)}function u(){l.tokenURL=this.value,t(0,l)}function f(){l.userInfoURL=this.value,t(0,l)}return n.$$set=c=>{"key"in c&&t(1,s=c.key),"config"in c&&t(0,l=c.config),"required"in c&&t(4,o=c.required),"title"in c&&t(2,r=c.title)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=o&&(l==null?void 0:l.enabled))},[l,s,r,i,o,a,u,f]}class $a extends ve{constructor(e){super(),ye(this,e,hO,mO,be,{key:1,config:0,required:4,title:2})}}const af=[{key:"apple",title:"Apple",logo:"apple.svg",optionsComponent:N8},{key:"google",title:"Google",logo:"google.svg"},{key:"microsoft",title:"Microsoft",logo:"microsoft.svg",optionsComponent:G8},{key:"yandex",title:"Yandex",logo:"yandex.svg"},{key:"facebook",title:"Facebook",logo:"facebook.svg"},{key:"instagram2",title:"Instagram",logo:"instagram.svg"},{key:"github",title:"GitHub",logo:"github.svg"},{key:"gitlab",title:"GitLab",logo:"gitlab.svg",optionsComponent:$a,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"bitbucket",title:"Bitbucket",logo:"bitbucket.svg"},{key:"gitee",title:"Gitee",logo:"gitee.svg"},{key:"gitea",title:"Gitea",logo:"gitea.svg",optionsComponent:$a,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"discord",title:"Discord",logo:"discord.svg"},{key:"twitter",title:"X/Twitter",logo:"twitter.svg"},{key:"kakao",title:"Kakao",logo:"kakao.svg"},{key:"vk",title:"VK",logo:"vk.svg"},{key:"linear",title:"Linear",logo:"linear.svg"},{key:"notion",title:"Notion",logo:"notion.svg"},{key:"monday",title:"monday.com",logo:"monday.svg"},{key:"lark",title:"Lark",logo:"lark.svg",optionsComponent:W8},{key:"box",title:"Box",logo:"box.svg"},{key:"spotify",title:"Spotify",logo:"spotify.svg"},{key:"trakt",title:"Trakt",logo:"trakt.svg"},{key:"twitch",title:"Twitch",logo:"twitch.svg"},{key:"patreon",title:"Patreon (v2)",logo:"patreon.svg"},{key:"strava",title:"Strava",logo:"strava.svg"},{key:"wakatime",title:"WakaTime",logo:"wakatime.svg"},{key:"livechat",title:"LiveChat",logo:"livechat.svg"},{key:"mailcow",title:"mailcow",logo:"mailcow.svg",optionsComponent:$a,optionsComponentProps:{required:!0}},{key:"planningcenter",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidc",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:Ta},{key:"oidc2",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:Ta},{key:"oidc3",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:Ta}];function _m(n,e,t){const i=n.slice();return i[16]=e[t],i}function gm(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",n[9]),s=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Hn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Hn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function _O(n){let e,t,i,s,l,o,r,a,u,f,c=n[1]!=""&&gm(n);return{c(){e=b("label"),t=b("i"),s=C(),l=b("input"),r=C(),c&&c.c(),a=ke(),p(t,"class","ri-search-line"),p(e,"for",i=n[19]),p(e,"class","m-l-10 txt-xl"),p(l,"id",o=n[19]),p(l,"type","text"),p(l,"placeholder","Search provider")},m(d,m){w(d,e,m),v(e,t),w(d,s,m),w(d,l,m),me(l,n[1]),w(d,r,m),c&&c.m(d,m),w(d,a,m),u||(f=Y(l,"input",n[8]),u=!0)},p(d,m){m&524288&&i!==(i=d[19])&&p(e,"for",i),m&524288&&o!==(o=d[19])&&p(l,"id",o),m&2&&l.value!==d[1]&&me(l,d[1]),d[1]!=""?c?(c.p(d,m),m&2&&M(c,1)):(c=gm(d),c.c(),M(c,1),c.m(a.parentNode,a)):c&&(oe(),D(c,1,1,()=>{c=null}),re())},d(d){d&&(y(e),y(s),y(l),y(r),y(a)),c&&c.d(d),u=!1,f()}}}function bm(n){let e,t,i,s,l=n[1]!=""&&km(n);return{c(){e=b("div"),t=b("span"),t.textContent="No providers to select.",i=C(),l&&l.c(),s=C(),p(t,"class","txt-hint"),p(e,"class","flex inline-flex")},m(o,r){w(o,e,r),v(e,t),v(e,i),l&&l.m(e,null),v(e,s)},p(o,r){o[1]!=""?l?l.p(o,r):(l=km(o),l.c(),l.m(e,s)):l&&(l.d(1),l=null)},d(o){o&&y(e),l&&l.d()}}}function km(n){let e,t,i;return{c(){e=b("button"),e.textContent="Clear filter",p(e,"type","button"),p(e,"class","btn btn-sm btn-secondary")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[5]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function ym(n){let e,t,i;return{c(){e=b("img"),wn(e.src,t="./images/oauth2/"+n[16].logo)||p(e,"src",t),p(e,"alt",i=n[16].title+" logo")},m(s,l){w(s,e,l)},p(s,l){l&8&&!wn(e.src,t="./images/oauth2/"+s[16].logo)&&p(e,"src",t),l&8&&i!==(i=s[16].title+" logo")&&p(e,"alt",i)},d(s){s&&y(e)}}}function vm(n,e){let t,i,s,l,o,r,a=e[16].title+"",u,f,c,d=e[16].key+"",m,h,g,_,k=e[16].logo&&ym(e);function S(){return e[10](e[16])}return{key:n,first:null,c(){t=b("div"),i=b("button"),s=b("figure"),k&&k.c(),l=C(),o=b("div"),r=b("div"),u=W(a),f=C(),c=b("em"),m=W(d),h=C(),p(s,"class","provider-logo"),p(r,"class","title"),p(c,"class","txt-hint txt-sm m-r-auto"),p(o,"class","content"),p(i,"type","button"),p(i,"class","provider-card handle"),p(t,"class","col-6"),this.first=t},m($,T){w($,t,T),v(t,i),v(i,s),k&&k.m(s,null),v(i,l),v(i,o),v(o,r),v(r,u),v(o,f),v(o,c),v(c,m),v(t,h),g||(_=Y(i,"click",S),g=!0)},p($,T){e=$,e[16].logo?k?k.p(e,T):(k=ym(e),k.c(),k.m(s,null)):k&&(k.d(1),k=null),T&8&&a!==(a=e[16].title+"")&&se(u,a),T&8&&d!==(d=e[16].key+"")&&se(m,d)},d($){$&&y(t),k&&k.d(),g=!1,_()}}}function gO(n){let e,t,i,s=[],l=new Map,o;e=new fe({props:{class:"searchbar m-b-sm",$$slots:{default:[_O,({uniqueId:f})=>({19:f}),({uniqueId:f})=>f?524288:0]},$$scope:{ctx:n}}});let r=ce(n[3]);const a=f=>f[16].key;for(let f=0;ftrue",g=C(),_=b("li"),_.innerHTML=""false" is converted to the json false",k=C(),S=b("li"),S.innerHTML=""null" is converted to the json null",$=C(),T=b("li"),T.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",O=C(),E=b("li"),I=W(L),A=W(" is converted to the json "),P=b("code"),P.textContent='{"a":1,"b":2}',N=C(),R=b("li"),R.textContent="numeric strings are converted to json number",z=C(),F=b("li"),F.textContent="double quoted strings are left as they are (aka. without normalizations)",B=C(),J=b("li"),J.textContent="any other string (empty string too) is double quoted",V=W(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your
data inside an object, eg.`),Z=b("code"),Z.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(pe,ae){w(pe,e,ae),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(i,r),v(i,a),v(i,u),v(i,f),v(i,c),v(i,d),v(i,m),v(m,h),v(m,g),v(m,_),v(m,k),v(m,S),v(m,$),v(m,T),v(m,O),v(m,E),v(E,I),v(E,A),v(E,P),v(m,N),v(m,R),v(m,z),v(m,F),v(m,B),v(m,J),v(i,V),v(i,Z),de=!0},i(pe){de||(pe&&tt(()=>{de&&(G||(G=qe(e,ht,{duration:150},!0)),G.run(1))}),de=!0)},o(pe){pe&&(G||(G=qe(e,ht,{duration:150},!1)),G.run(0)),de=!1},d(pe){pe&&y(e),pe&&G&&G.end()}}}function xE(n){let e,t,i,s,l,o,r,a,u,f,c;e=new fe({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[GE,({uniqueId:_})=>({10:_}),({uniqueId:_})=>_?1024:0]},$$scope:{ctx:n}}});function d(_,k){return _[2]?QE:XE}let m=d(n),h=m(n),g=n[2]&&hh();return{c(){H(e.$$.fragment),t=C(),i=b("button"),s=b("strong"),s.textContent="String value normalizations",l=C(),h.c(),r=C(),g&&g.c(),a=ke(),p(s,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(_,k){q(e,_,k),w(_,t,k),w(_,i,k),v(i,s),v(i,l),h.m(i,null),w(_,r,k),g&&g.m(_,k),w(_,a,k),u=!0,f||(c=Y(i,"click",n[5]),f=!0)},p(_,k){const S={};k&2&&(S.name="fields."+_[1]+".maxSize"),k&3073&&(S.$$scope={dirty:k,ctx:_}),e.$set(S),m!==(m=d(_))&&(h.d(1),h=m(_),h&&(h.c(),h.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm "+(_[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),_[2]?g?k&4&&M(g,1):(g=hh(),g.c(),M(g,1),g.m(a.parentNode,a)):g&&(oe(),D(g,1,1,()=>{g=null}),re())},i(_){u||(M(e.$$.fragment,_),M(g),u=!0)},o(_){D(e.$$.fragment,_),D(g),u=!1},d(_){_&&(y(t),y(i),y(r),y(a)),j(e,_),h.d(),g&&g.d(_),f=!1,c()}}}function eD(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[6](r)}let o={$$slots:{options:[xE]},$$scope:{ctx:n}};for(let r=0;r*) are not supported.id column.
If your query doesn't have a suitable one, you can use the universal
(ROW_NUMBER() OVER()) as id.MAX(balance) as maxBalance.(MAX(balance) + 1) as maxBalance.@request.headers.* @request.query.* @request.body.* @request.auth.*",m=C(),h=b("hr"),g=C(),_=b("p"),_.innerHTML=`You could also add constraints and query other collections using the
@collection filter:`,k=C(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",$=C(),T=b("hr"),O=C(),E=b("p"),E.innerHTML=`Example rule:
@request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(_,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(T,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(N,R){w(N,e,R),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o);for(let z=0;zverified = true.`,s=C(),l=b("p"),l.textContent="Leave it empty to allow anyone with an account to authenticate.",o=C(),r=b("p"),r.textContent='To disable authentication entirely you can change it to "Set superusers only".'},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),w(a,o,u),w(a,r,u)},p:te,d(a){a&&(y(e),y(t),y(i),y(s),y(l),y(o),y(r))}}}function bI(n){let e,t,i;return{c(){e=b("p"),e.innerHTML=`This rule is executed in addition to the create and update API
rules.`,t=C(),i=b("p"),i.textContent=`It enables superuser-like permissions to allow fully managing the auth record(s), eg.
changing the password without requiring to enter the old one, directly updating the
verified state or email, etc.`},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},p:te,d(s){s&&(y(e),y(t),y(i))}}}function kI(n){var R,z;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,g,_,k,S,$,T,O=n[1]&&Mh(n);function E(F){n[6](F)}let L={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(L.rule=n[0].listRule),f=new sl({props:L}),ne.push(()=>ge(f,"rule",E));function I(F){n[7](F)}let A={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(A.rule=n[0].viewRule),m=new sl({props:A}),ne.push(()=>ge(m,"rule",I));let P=((R=n[0])==null?void 0:R.type)!=="view"&&Ih(n),N=((z=n[0])==null?void 0:z.type)==="auth"&&Ph(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the
PocketBase filter syntax and operators
.`,s=C(),l=b("button"),r=W(o),a=C(),O&&O.c(),u=C(),H(f.$$.fragment),d=C(),H(m.$$.fragment),g=C(),P&&P.c(),_=C(),N&&N.c(),k=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(F,B){w(F,e,B),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),O&&O.m(e,null),w(F,u,B),q(f,F,B),w(F,d,B),q(m,F,B),w(F,g,B),P&&P.m(F,B),w(F,_,B),N&&N.m(F,B),w(F,k,B),S=!0,$||(T=Y(l,"click",n[5]),$=!0)},p(F,[B]){var Z,G;(!S||B&2)&&o!==(o=F[1]?"Hide available fields":"Show available fields")&&se(r,o),F[1]?O?(O.p(F,B),B&2&&M(O,1)):(O=Mh(F),O.c(),M(O,1),O.m(e,null)):O&&(oe(),D(O,1,1,()=>{O=null}),re());const J={};B&1&&(J.collection=F[0]),!c&&B&1&&(c=!0,J.rule=F[0].listRule,$e(()=>c=!1)),f.$set(J);const V={};B&1&&(V.collection=F[0]),!h&&B&1&&(h=!0,V.rule=F[0].viewRule,$e(()=>h=!1)),m.$set(V),((Z=F[0])==null?void 0:Z.type)!=="view"?P?(P.p(F,B),B&1&&M(P,1)):(P=Ih(F),P.c(),M(P,1),P.m(_.parentNode,_)):P&&(oe(),D(P,1,1,()=>{P=null}),re()),((G=F[0])==null?void 0:G.type)==="auth"?N?(N.p(F,B),B&1&&M(N,1)):(N=Ph(F),N.c(),M(N,1),N.m(k.parentNode,k)):N&&(oe(),D(N,1,1,()=>{N=null}),re())},i(F){S||(M(O),M(f.$$.fragment,F),M(m.$$.fragment,F),M(P),M(N),S=!0)},o(F){D(O),D(f.$$.fragment,F),D(m.$$.fragment,F),D(P),D(N),S=!1},d(F){F&&(y(e),y(u),y(d),y(g),y(_),y(k)),O&&O.d(),j(f,F),j(m,F),P&&P.d(F),N&&N.d(F),$=!1,T()}}}function yI(n,e,t){let i,s,{collection:l}=e,o=!1,r=l.manageRule!==null||l.authRule!=="";const a=()=>t(1,o=!o);function u(k){n.$$.not_equal(l.listRule,k)&&(l.listRule=k,t(0,l))}function f(k){n.$$.not_equal(l.viewRule,k)&&(l.viewRule=k,t(0,l))}function c(k){n.$$.not_equal(l.createRule,k)&&(l.createRule=k,t(0,l))}function d(k){n.$$.not_equal(l.updateRule,k)&&(l.updateRule=k,t(0,l))}function m(k){n.$$.not_equal(l.deleteRule,k)&&(l.deleteRule=k,t(0,l))}const h=()=>{t(2,r=!r)};function g(k){n.$$.not_equal(l.authRule,k)&&(l.authRule=k,t(0,l))}function _(k){n.$$.not_equal(l.manageRule,k)&&(l.manageRule=k,t(0,l))}return n.$$set=k=>{"collection"in k&&t(0,l=k.collection)},n.$$.update=()=>{var k;n.$$.dirty&1&&t(4,i=U.getAllCollectionIdentifiers(l)),n.$$.dirty&1&&t(3,s=(k=l.fields)==null?void 0:k.filter(S=>S.hidden).map(S=>S.name))},[l,o,r,s,i,a,u,f,c,d,m,h,g,_]}class vI extends ve{constructor(e){super(),ye(this,e,yI,kI,be,{collection:0})}}function Rh(n,e,t){const i=n.slice();return i[27]=e[t],i}function Fh(n,e,t){const i=n.slice();return i[30]=e[t],i}function qh(n,e,t){const i=n.slice();return i[33]=e[t],i}function jh(n,e,t){const i=n.slice();return i[33]=e[t],i}function Hh(n,e,t){const i=n.slice();return i[33]=e[t],i}function zh(n){let e,t,i,s,l,o,r=n[9].length&&Uh();return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=C(),s=b("div"),l=b("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query,
you'll have to update it manually!`,o=C(),r&&r.c(),p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(a,u){w(a,e,u),v(e,t),v(e,i),v(e,s),v(s,l),v(s,o),r&&r.m(s,null)},p(a,u){a[9].length?r||(r=Uh(),r.c(),r.m(s,null)):r&&(r.d(1),r=null)},d(a){a&&y(e),r&&r.d()}}}function Uh(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Vh(n){let e,t,i,s,l,o,r=n[5]&&Bh(n),a=!n[4]&&Wh(n),u=ce(n[3]),f=[];for(let m=0;m{l=_,t(0,l)})}const g=_=>{_.button==0&&c(_)};return n.$$set=_=>{"tolerance"in _&&t(3,s=_.tolerance)},[l,f,c,s,h,g]}class UI extends ve{constructor(e){super(),ye(this,e,zI,HI,be,{tolerance:3})}}function VI(n){let e,t,i,s,l;const o=n[5].default,r=Nt(o,n,n[4],null);return s=new UI({}),s.$on("dragstart",n[7]),s.$on("dragging",n[8]),s.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=C(),H(s.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,u){w(a,e,u),r&&r.m(e,null),n[6](e),w(a,i,u),q(s,a,u),l=!0},p(a,[u]){r&&r.p&&(!l||u&16)&&Ft(r,o,a,a[4],l?Rt(o,a[4],u,null):qt(a[4]),null),(!l||u&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){l||(M(r,a),M(s.$$.fragment,a),l=!0)},o(a){D(r,a),D(s.$$.fragment,a),l=!1},d(a){a&&(y(e),y(i)),r&&r.d(a),n[6](null),j(s,a)}}}const h_="@superuserSidebarWidth";function BI(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,o,r,a=localStorage.getItem(h_)||null;function u(m){ne[m?"unshift":"push"](()=>{o=m,t(1,o),t(2,a)})}const f=()=>{t(3,r=o.offsetWidth)},c=m=>{t(2,a=r+m.detail.diffX+"px")},d=()=>{U.triggerResize()};return n.$$set=m=>{"class"in m&&t(0,l=m.class),"$$scope"in m&&t(4,s=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(h_,a))},[l,o,a,r,s,i,u,f,c,d]}class Yy extends ve{constructor(e){super(),ye(this,e,BI,VI,be,{class:0})}}function __(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm link-hint"),p(e,"aria-hidden","true")},m(s,l){w(s,e,l),t||(i=Oe(Re.call(null,e,"OAuth2 auth is enabled but the collection doesn't have any registered providers")),t=!0)},d(s){s&&y(e),t=!1,i()}}}function WI(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-5oh3nd")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function YI(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-5oh3nd")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function KI(n){var T,O;let e,t,i,s,l,o=n[0].name+"",r,a,u,f,c,d,m,h,g,_=n[0].type=="auth"&&((T=n[0].oauth2)==null?void 0:T.enabled)&&!((O=n[0].oauth2.providers)!=null&&O.length)&&__();function k(E,L){return E[1]?YI:WI}let S=k(n),$=S(n);return{c(){var E;e=b("a"),t=b("i"),s=C(),l=b("span"),r=W(o),a=C(),_&&_.c(),u=C(),f=b("span"),$.c(),p(t,"class",i=Us(U.getCollectionTypeIcon(n[0].type))+" svelte-5oh3nd"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(f,"class","btn btn-xs btn-circle btn-hint btn-transparent btn-pin-collection m-l-auto svelte-5oh3nd"),p(f,"aria-label","Pin collection"),p(f,"aria-hidden","true"),p(e,"href",d="/collections?collection="+n[0].id),p(e,"class","sidebar-list-item svelte-5oh3nd"),p(e,"title",m=n[0].name),x(e,"active",((E=n[2])==null?void 0:E.id)===n[0].id)},m(E,L){w(E,e,L),v(e,t),v(e,s),v(e,l),v(l,r),v(e,a),_&&_.m(e,null),v(e,u),v(e,f),$.m(f,null),h||(g=[Oe(c=Re.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),Y(f,"click",tn(it(n[5]))),Oe(Fn.call(null,e))],h=!0)},p(E,[L]){var I,A,P;L&1&&i!==(i=Us(U.getCollectionTypeIcon(E[0].type))+" svelte-5oh3nd")&&p(t,"class",i),L&1&&o!==(o=E[0].name+"")&&se(r,o),E[0].type=="auth"&&((I=E[0].oauth2)!=null&&I.enabled)&&!((A=E[0].oauth2.providers)!=null&&A.length)?_||(_=__(),_.c(),_.m(e,u)):_&&(_.d(1),_=null),S!==(S=k(E))&&($.d(1),$=S(E),$&&($.c(),$.m(f,null))),c&&Lt(c.update)&&L&2&&c.update.call(null,{position:"right",text:(E[1]?"Unpin":"Pin")+" collection"}),L&1&&d!==(d="/collections?collection="+E[0].id)&&p(e,"href",d),L&1&&m!==(m=E[0].name)&&p(e,"title",m),L&5&&x(e,"active",((P=E[2])==null?void 0:P.id)===E[0].id)},i:te,o:te,d(E){E&&y(e),_&&_.d(),$.d(),h=!1,Ee(g)}}}function JI(n,e,t){let i,s;Ge(n,ii,u=>t(2,s=u));let{collection:l}=e,{pinnedIds:o}=e;function r(u){o.includes(u.id)?U.removeByValue(o,u.id):o.push(u.id),t(4,o)}const a=()=>r(l);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection),"pinnedIds"in u&&t(4,o=u.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(l.id))},[l,i,s,r,o,a]}class cf extends ve{constructor(e){super(),ye(this,e,JI,KI,be,{collection:0,pinnedIds:4})}}function g_(n,e,t){const i=n.slice();return i[25]=e[t],i}function b_(n,e,t){const i=n.slice();return i[25]=e[t],i}function k_(n,e,t){const i=n.slice();return i[25]=e[t],i}function y_(n){let e,t,i=[],s=new Map,l,o,r=ce(n[2]);const a=u=>u[25].id;for(let u=0;u'},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function ON(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[38]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function MN(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[37]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function O1(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[34](n[58])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=C(),r=b("label"),p(i,"type","checkbox"),p(i,"id",s="checkbox_"+n[58].id),i.checked=l=n[4][n[58].id],p(r,"for",a="checkbox_"+n[58].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){w(d,e,m),v(e,t),v(t,i),v(t,o),v(t,r),u||(f=[Y(i,"change",c),Y(t,"click",tn(n[29]))],u=!0)},p(d,m){n=d,m[0]&8&&s!==(s="checkbox_"+n[58].id)&&p(i,"id",s),m[0]&24&&l!==(l=n[4][n[58].id])&&(i.checked=l),m[0]&8&&a!==(a="checkbox_"+n[58].id)&&p(r,"for",a)},d(d){d&&y(e),u=!1,Ee(f)}}}function M1(n,e){let t,i,s,l;return i=new Zy({props:{short:!0,record:e[58],field:e[61]}}),{key:n,first:null,c(){t=b("td"),H(i.$$.fragment),p(t,"class",s="col-type-"+e[61].type+" col-field-"+e[61].name),this.first=t},m(o,r){w(o,t,r),q(i,t,null),l=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[58]),r[0]&32768&&(a.field=e[61]),i.$set(a),(!l||r[0]&32768&&s!==(s="col-type-"+e[61].type+" col-field-"+e[61].name))&&p(t,"class",s)},i(o){l||(M(i.$$.fragment,o),l=!0)},o(o){D(i.$$.fragment,o),l=!1},d(o){o&&y(t),j(i)}}}function E1(n,e){let t,i,s=[],l=new Map,o,r,a,u,f,c=!e[16]&&O1(e),d=ce(e[15]);const m=_=>_[61].id;for(let _=0;_ Loading collections...
',p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function YN(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[jN,qN,FN],m=[];function h($,T){return $[3]&&!$[11].length?0:$[11].length?2:1}e=h(n),t=m[e]=d[e](n);let g={};s=new ff({props:g}),n[32](s),s.$on("truncate",n[33]);let _={};o=new pC({props:_}),n[34](o);let k={collection:n[2]};a=new pf({props:k}),n[35](a),a.$on("hide",n[36]),a.$on("save",n[37]),a.$on("delete",n[38]);let S={collection:n[2]};return f=new aA({props:S}),n[39](f),f.$on("hide",n[40]),{c(){t.c(),i=C(),H(s.$$.fragment),l=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),u=C(),H(f.$$.fragment)},m($,T){m[e].m($,T),w($,i,T),q(s,$,T),w($,l,T),q(o,$,T),w($,r,T),q(a,$,T),w($,u,T),q(f,$,T),c=!0},p($,T){let O=e;e=h($),e===O?m[e].p($,T):(oe(),D(m[O],1,1,()=>{m[O]=null}),re(),t=m[e],t?t.p($,T):(t=m[e]=d[e]($),t.c()),M(t,1),t.m(i.parentNode,i));const E={};s.$set(E);const L={};o.$set(L);const I={};T[0]&4&&(I.collection=$[2]),a.$set(I);const A={};T[0]&4&&(A.collection=$[2]),f.$set(A)},i($){c||(M(t),M(s.$$.fragment,$),M(o.$$.fragment,$),M(a.$$.fragment,$),M(f.$$.fragment,$),c=!0)},o($){D(t),D(s.$$.fragment,$),D(o.$$.fragment,$),D(a.$$.fragment,$),D(f.$$.fragment,$),c=!1},d($){$&&(y(i),y(l),y(r),y(u)),m[e].d($),n[32](null),j(s,$),n[34](null),j(o,$),n[35](null),j(a,$),n[39](null),j(f,$)}}}function KN(n,e,t){let i,s,l,o,r,a,u,f;Ge(n,ii,De=>t(2,l=De)),Ge(n,an,De=>t(41,o=De)),Ge(n,Zs,De=>t(3,r=De)),Ge(n,zu,De=>t(17,a=De)),Ge(n,In,De=>t(11,u=De)),Ge(n,Il,De=>t(12,f=De));const c=new URLSearchParams(a);let d,m,h,g,_,k,S=c.get("filter")||"",$=c.get("sort")||"-@rowid",T=c.get("collection")||(l==null?void 0:l.id),O=0;ju(T);async function E(De){await _n(),(l==null?void 0:l.type)==="view"?g.show(De):h==null||h.show(De)}function L(){t(14,T=l==null?void 0:l.id),t(0,S=""),t(1,$="-@rowid"),I(),A({recordId:null}),d==null||d.forceHide(),m==null||m.hide()}async function I(){if(!$)return;const De=U.getAllCollectionIdentifiers(l),ot=$.split(",").map(Ie=>Ie.startsWith("+")||Ie.startsWith("-")?Ie.substring(1):Ie);ot.filter(Ie=>De.includes(Ie)).length!=ot.length&&((l==null?void 0:l.type)!="view"?t(1,$="-@rowid"):De.includes("created")?t(1,$="-created"):t(1,$=""))}function A(De={}){const ot=Object.assign({collection:(l==null?void 0:l.id)||"",filter:S,sort:$},De);U.replaceHashQueryParams(ot)}const P=()=>d==null?void 0:d.show();function N(De){ne[De?"unshift":"push"](()=>{k=De,t(9,k)})}function R(De){O=De,t(10,O)}const z=()=>d==null?void 0:d.show(l),F=()=>{_==null||_.load(),k==null||k.reload()},B=()=>m==null?void 0:m.show(l),J=()=>h==null?void 0:h.show(),V=De=>t(0,S=De.detail);function Z(De){ne[De?"unshift":"push"](()=>{_=De,t(8,_)})}function G(De){S=De,t(0,S)}function de(De){$=De,t(1,$)}const pe=De=>{A({recordId:De.detail.id});let ot=De.detail._partial?De.detail.id:De.detail;l.type==="view"?g==null||g.show(ot):h==null||h.show(ot)},ae=()=>{k==null||k.reload()},Ce=()=>h==null?void 0:h.show();function Ye(De){ne[De?"unshift":"push"](()=>{d=De,t(4,d)})}const Ke=()=>{_==null||_.load(),k==null||k.reload()};function ct(De){ne[De?"unshift":"push"](()=>{m=De,t(5,m)})}function et(De){ne[De?"unshift":"push"](()=>{h=De,t(6,h)})}const xe=()=>{A({recordId:null})},Be=De=>{S?k==null||k.reload():De.detail.isNew&&t(10,O++,O),_==null||_.reloadLoadedPages()},ut=De=>{(!S||_!=null&&_.hasRecord(De.detail.id))&&t(10,O--,O),_==null||_.reloadLoadedPages()};function Bt(De){ne[De?"unshift":"push"](()=>{g=De,t(7,g)})}const Ue=()=>{A({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&131072&&t(16,i=new URLSearchParams(a)),n.$$.dirty[0]&65536&&t(15,s=i.get("collection")),n.$$.dirty[0]&49164&&!r&&s&&s!=T&&s!=(l==null?void 0:l.id)&&s!=(l==null?void 0:l.name)&&_3(s),n.$$.dirty[0]&16388&&l!=null&&l.id&&T!=l.id&&T!=l.name&&L(),n.$$.dirty[0]&4&&l!=null&&l.id&&I(),n.$$.dirty[0]&8&&!r&&c.get("recordId")&&E(c.get("recordId")),n.$$.dirty[0]&15&&!r&&($||S||l!=null&&l.id)&&A(),n.$$.dirty[0]&4&&En(an,o=(l==null?void 0:l.name)||"Collections",o)},[S,$,l,r,d,m,h,g,_,k,O,u,f,A,T,s,i,a,P,N,R,z,F,B,J,V,Z,G,de,pe,ae,Ce,Ye,Ke,ct,et,xe,Be,ut,Bt,Ue]}class JN extends ve{constructor(e){super(),ye(this,e,KN,YN,be,{},null,[-1,-1])}}function F1(n){let e,t,i,s,l,o,r;return{c(){e=b("div"),e.innerHTML='Sync',t=C(),i=b("a"),i.innerHTML=' Export collections',s=C(),l=b("a"),l.innerHTML=' Import collections',p(e,"class","sidebar-title"),p(i,"href","/settings/export-collections"),p(i,"class","sidebar-list-item"),p(l,"href","/settings/import-collections"),p(l,"class","sidebar-list-item")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[Oe(Si.call(null,i,{path:"/settings/export-collections/?.*"})),Oe(Fn.call(null,i)),Oe(Si.call(null,l,{path:"/settings/import-collections/?.*"})),Oe(Fn.call(null,l))],o=!0)},d(a){a&&(y(e),y(t),y(i),y(s),y(l)),o=!1,Ee(r)}}}function ZN(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_=!n[0]&&F1();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=C(),s=b("a"),s.innerHTML=' Application',l=C(),o=b("a"),o.innerHTML=' Mail settings',r=C(),a=b("a"),a.innerHTML=' Files storage',u=C(),f=b("a"),f.innerHTML=' Backups',c=C(),d=b("a"),d.innerHTML=' Crons',m=C(),_&&_.c(),p(t,"class","sidebar-title"),p(s,"href","/settings"),p(s,"class","sidebar-list-item"),p(o,"href","/settings/mail"),p(o,"class","sidebar-list-item"),p(a,"href","/settings/storage"),p(a,"class","sidebar-list-item"),p(f,"href","/settings/backups"),p(f,"class","sidebar-list-item"),p(d,"href","/settings/crons"),p(d,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(k,S){w(k,e,S),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),v(e,r),v(e,a),v(e,u),v(e,f),v(e,c),v(e,d),v(e,m),_&&_.m(e,null),h||(g=[Oe(Si.call(null,s,{path:"/settings"})),Oe(Fn.call(null,s)),Oe(Si.call(null,o,{path:"/settings/mail/?.*"})),Oe(Fn.call(null,o)),Oe(Si.call(null,a,{path:"/settings/storage/?.*"})),Oe(Fn.call(null,a)),Oe(Si.call(null,f,{path:"/settings/backups/?.*"})),Oe(Fn.call(null,f)),Oe(Si.call(null,d,{path:"/settings/crons/?.*"})),Oe(Fn.call(null,d))],h=!0)},p(k,S){k[0]?_&&(_.d(1),_=null):_||(_=F1(),_.c(),_.m(e,null))},d(k){k&&y(e),_&&_.d(),h=!1,Ee(g)}}}function GN(n){let e,t;return e=new Yy({props:{class:"settings-sidebar",$$slots:{default:[ZN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function XN(n,e,t){let i;return Ge(n,Il,s=>t(0,i=s)),[i]}class Fl extends ve{constructor(e){super(),ye(this,e,XN,GN,be,{})}}function QN(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable "),o=b("small"),o.textContent="(experimental)",p(e,"type","checkbox"),p(e,"id",t=n[8]),p(o,"class","txt-hint"),p(s,"for",r=n[8])},m(f,c){w(f,e,c),e.checked=n[0].batch.enabled,w(f,i,c),w(f,s,c),v(s,l),v(s,o),a||(u=Y(e,"change",n[4]),a=!0)},p(f,c){c&256&&t!==(t=f[8])&&p(e,"id",t),c&1&&(e.checked=f[0].batch.enabled),c&256&&r!==(r=f[8])&&p(s,"for",r)},d(f){f&&(y(e),y(i),y(s)),a=!1,u()}}}function xN(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="Max requests in a batch",i=C(),s=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]),p(r,"type","number"),p(r,"id",a=n[8]),p(r,"min","0"),p(r,"step","1"),r.required=n[1]},m(c,d){w(c,e,d),v(e,t),v(e,i),v(e,s),w(c,o,d),w(c,r,d),me(r,n[0].batch.maxRequests),u||(f=[Oe(Re.call(null,s,{text:"Rate limiting (if enabled) also applies for the batch create/update/upsert/delete requests.",position:"right"})),Y(r,"input",n[5])],u=!0)},p(c,d){d&256&&l!==(l=c[8])&&p(e,"for",l),d&256&&a!==(a=c[8])&&p(r,"id",a),d&2&&(r.required=c[1]),d&1&&mt(r.value)!==c[0].batch.maxRequests&&me(r,c[0].batch.maxRequests)},d(c){c&&(y(e),y(o),y(r)),u=!1,Ee(f)}}}function eR(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=b("span"),t.textContent="Max processing time (in seconds)",s=C(),l=b("input"),p(t,"class","txt"),p(e,"for",i=n[8]),p(l,"type","number"),p(l,"id",o=n[8]),p(l,"min","0"),p(l,"step","1"),l.required=n[1]},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].batch.timeout),r||(a=Y(l,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&2&&(l.required=u[1]),f&1&&mt(l.value)!==u[0].batch.timeout&&me(l,u[0].batch.timeout)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function tR(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Max body size (in bytes)"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","number"),p(l,"id",o=n[8]),p(l,"min","0"),p(l,"step","1"),p(l,"placeholder","Default to 128MB"),l.value=r=n[0].batch.maxBodySize||""},m(f,c){w(f,e,c),v(e,t),w(f,s,c),w(f,l,c),a||(u=Y(l,"input",n[7]),a=!0)},p(f,c){c&256&&i!==(i=f[8])&&p(e,"for",i),c&256&&o!==(o=f[8])&&p(l,"id",o),c&1&&r!==(r=f[0].batch.maxBodySize||"")&&l.value!==r&&(l.value=r)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function nR(n){let e,t,i,s,l,o,r,a,u,f,c,d;return e=new fe({props:{class:"form-field form-field-toggle m-b-sm",name:"batch.enabled",$$slots:{default:[QN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field "+(n[1]?"required":""),name:"batch.maxRequests",$$slots:{default:[xN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field "+(n[1]?"required":""),name:"batch.timeout",$$slots:{default:[eR,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),c=new fe({props:{class:"form-field",name:"batch.maxBodySize",$$slots:{default:[tR,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),s=b("div"),H(l.$$.fragment),o=C(),r=b("div"),H(a.$$.fragment),u=C(),f=b("div"),H(c.$$.fragment),p(s,"class","col-lg-4"),p(r,"class","col-lg-4"),p(f,"class","col-lg-4"),p(i,"class","grid")},m(m,h){q(e,m,h),w(m,t,h),w(m,i,h),v(i,s),q(l,s,null),v(i,o),v(i,r),q(a,r,null),v(i,u),v(i,f),q(c,f,null),d=!0},p(m,h){const g={};h&769&&(g.$$scope={dirty:h,ctx:m}),e.$set(g);const _={};h&2&&(_.class="form-field "+(m[1]?"required":"")),h&771&&(_.$$scope={dirty:h,ctx:m}),l.$set(_);const k={};h&2&&(k.class="form-field "+(m[1]?"required":"")),h&771&&(k.$$scope={dirty:h,ctx:m}),a.$set(k);const S={};h&769&&(S.$$scope={dirty:h,ctx:m}),c.$set(S)},i(m){d||(M(e.$$.fragment,m),M(l.$$.fragment,m),M(a.$$.fragment,m),M(c.$$.fragment,m),d=!0)},o(m){D(e.$$.fragment,m),D(l.$$.fragment,m),D(a.$$.fragment,m),D(c.$$.fragment,m),d=!1},d(m){m&&(y(t),y(i)),j(e,m),j(l),j(a),j(c)}}}function iR(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function lR(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function q1(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function sR(n){let e,t,i,s,l,o;function r(c,d){return c[1]?lR:iR}let a=r(n),u=a(n),f=n[2]&&q1();return{c(){e=b("div"),e.innerHTML=' Batch API',t=C(),i=b("div"),s=C(),u.c(),l=C(),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&&M(f,1):(f=q1(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(oe(),D(f,1,1,()=>{f=null}),re())},d(c){c&&(y(e),y(t),y(i),y(s),y(l),y(o)),u.d(c),f&&f.d(c)}}}function oR(n){let e,t;return e=new Ui({props:{single:!0,$$slots:{header:[sR],default:[nR]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function rR(n,e,t){let i,s,l;Ge(n,Tn,c=>t(3,l=c));let{formSettings:o}=e;function r(){o.batch.enabled=this.checked,t(0,o)}function a(){o.batch.maxRequests=mt(this.value),t(0,o)}function u(){o.batch.timeout=mt(this.value),t(0,o)}const f=c=>t(0,o.batch.maxBodySize=c.target.value<<0,o);return n.$$set=c=>{"formSettings"in c&&t(0,o=c.formSettings)},n.$$.update=()=>{var c;n.$$.dirty&8&&t(2,i=!U.isEmpty(l==null?void 0:l.batch)),n.$$.dirty&1&&t(1,s=!!((c=o.batch)!=null&&c.enabled))},[o,s,i,l,r,a,u,f]}class aR extends ve{constructor(e){super(),ye(this,e,rR,oR,be,{formSettings:0})}}function j1(n,e,t){const i=n.slice();return i[17]=e[t],i}function H1(n){let e,t=n[17]+"",i,s,l,o;function r(){return n[13](n[17])}return{c(){e=b("button"),i=W(t),s=W(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){w(a,e,u),v(e,i),w(a,s,u),l||(o=Y(e,"click",r),l=!0)},p(a,u){n=a,u&4&&t!==(t=n[17]+"")&&se(i,t)},d(a){a&&(y(e),y(s)),l=!1,o()}}}function uR(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_;function k(O){n[11](O)}let S={id:n[16],placeholder:"Leave empty to disable"};n[0].trustedProxy.headers!==void 0&&(S.value=n[0].trustedProxy.headers),l=new _o({props:S}),ne.push(()=>ge(l,"value",k));let $=ce(n[2]),T=[];for(let O=0;O<$.length;O+=1)T[O]=H1(j1(n,$,O));return{c(){e=b("label"),t=W("Trusted IP proxy headers"),s=C(),H(l.$$.fragment),r=C(),a=b("div"),u=b("button"),u.textContent="Clear",f=C(),c=b("div"),d=b("p"),m=W(`Comma separated list of headers such as:
`);for(let O=0;O ',i=C(),s=b("tbody");for(let u=0;uRate limit label Max requests
(per IP)Interval
(in seconds)Targeted users users:create) *:create)POST /a/b)POST /a/b/)/a/b)/a/b/)[METHOD ]/my/path - full exact route match (
must be without trailing slash ; "METHOD" is optional).
For example:
`,m=C(),h=b("li"),h.innerHTML=`/hello - matches GET /hello, POST /hello, etc.POST /hello - matches only POST /hello[METHOD ]/my/prefix/ - path prefix (
must end with trailing slash;
"METHOD" is optional). For example:
`,g=C(),_=b("li"),k=b("code"),k.textContent="collectionName:predefinedTag",S=W(` - targets a specific action of a single collection. To
apply the rule for all collections you can use the `),$=b("code"),$.textContent="*",T=W(` wildcard. For example:
`),O=b("code"),O.textContent="posts:create",E=W(", "),L=b("code"),L.textContent="users:listAuthMethods",I=W(", "),A=b("code"),A.textContent="*:auth",P=W(`.
`),N=b("br"),R=W(`
The predifined collection tags are (`),z=b("em"),z.textContent="there should be autocomplete once you start typing",F=W(`):
`),B=b("ul");for(let Z=0;Z/hello/ - matches GET /hello,
POST /hello/a/b/c, etc.POST /hello/ - matches POST /hello,
POST /hello/a/b/c, etc.pb_data with the one from
the backup and will restart the application process.data.db file).pb_data with the content from the backuppb_data
Configure common settings for sending emails.
",c=C(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,O){w(T,e,O),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),w(T,r,O),w(T,a,O),v(a,u),v(u,f),v(u,c),S[d].m(u,null),h=!0,g||(_=Y(u,"submit",it(n[29])),g=!0)},p(T,O){(!h||O[0]&128)&&se(o,T[7]);let E=d;d=$(T),d===E?S[d].p(T,O):(oe(),D(S[E],1,1,()=>{S[E]=null}),re(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(u,null))},i(T){h||(M(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(y(e),y(r),y(a)),S[d].d(),g=!1,_()}}}function qq(n){let e,t,i,s,l,o;e=new Fl({}),i=new si({props:{$$slots:{default:[Fq]},$$scope:{ctx:n}}});let r={};return l=new Uy({props:r}),n[30](l),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),s=C(),H(l.$$.fragment)},m(a,u){q(e,a,u),w(a,t,u),q(i,a,u),w(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&255|u[1]&8&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),M(l.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(l.$$.fragment,a),o=!1},d(a){a&&(y(t),y(s)),j(e,a),j(i,a),n[30](null),j(l,a)}}}function jq(n,e,t){let i,s,l;Ge(n,an,de=>t(7,l=de));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];En(an,l="Mail settings",l);let a,u={},f={},c=!1,d=!1,m=!1,h=!1;g();async function g(){t(2,c=!0);try{const de=await he.settings.getAll()||{};k(de)}catch(de){he.error(de)}t(2,c=!1)}async function _(){if(!(d||!s)){t(3,d=!0);try{const de=await he.settings.update(U.filterRedactedProps(f));k(de),Jt({}),nn("Successfully saved mail settings.")}catch(de){he.error(de)}t(3,d=!1)}}function k(de={}){t(0,f={meta:(de==null?void 0:de.meta)||{},smtp:(de==null?void 0:de.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(12,u=JSON.parse(JSON.stringify(f))),t(4,m=!!f.smtp.username)}function S(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function $(){f.meta.senderName=this.value,t(0,f)}function T(){f.meta.senderAddress=this.value,t(0,f)}function O(){f.smtp.enabled=this.checked,t(0,f)}function E(){f.smtp.host=this.value,t(0,f)}function L(){f.smtp.port=mt(this.value),t(0,f)}function I(){f.smtp.username=this.value,t(0,f)}function A(de){m=de,t(4,m)}function P(de){n.$$.not_equal(f.smtp.password,de)&&(f.smtp.password=de,t(0,f))}const N=()=>{t(5,h=!h)};function R(de){n.$$.not_equal(f.smtp.tls,de)&&(f.smtp.tls=de,t(0,f))}function z(de){n.$$.not_equal(f.smtp.authMethod,de)&&(f.smtp.authMethod=de,t(0,f))}function F(){f.smtp.localName=this.value,t(0,f)}const B=()=>S(),J=()=>_(),V=()=>a==null?void 0:a.show(),Z=()=>_();function G(de){ne[de?"unshift":"push"](()=>{a=de,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&4096&&t(13,i=JSON.stringify(u)),n.$$.dirty[0]&8193&&t(6,s=i!=JSON.stringify(f))},[f,a,c,d,m,h,s,l,o,r,_,S,u,i,$,T,O,E,L,I,A,P,N,R,z,F,B,J,V,Z,G]}class Hq extends ve{constructor(e){super(),ye(this,e,jq,qq,be,{},null,[-1,-1])}}function zq(n){var L;let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_;function k(I){n[11](I)}function S(I){n[12](I)}function $(I){n[13](I)}let T={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[Vq]},$$scope:{ctx:n}};n[1].s3!==void 0&&(T.config=n[1].s3),n[4]!==void 0&&(T.isTesting=n[4]),n[5]!==void 0&&(T.testError=n[5]),e=new Xy({props:T}),ne.push(()=>ge(e,"config",k)),ne.push(()=>ge(e,"isTesting",S)),ne.push(()=>ge(e,"testError",$));let O=((L=n[1].s3)==null?void 0:L.enabled)&&!n[6]&&!n[3]&&i0(n),E=n[6]&&l0(n);return{c(){H(e.$$.fragment),l=C(),o=b("div"),r=b("div"),a=C(),O&&O.c(),u=C(),E&&E.c(),f=C(),c=b("button"),d=b("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=m=!n[6]||n[3],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,A){q(e,I,A),w(I,l,A),w(I,o,A),v(o,r),v(o,a),O&&O.m(o,null),v(o,u),E&&E.m(o,null),v(o,f),v(o,c),v(c,d),h=!0,g||(_=Y(c,"click",n[15]),g=!0)},p(I,A){var N;const P={};A&1&&(P.originalConfig=I[0].s3),A&524291&&(P.$$scope={dirty:A,ctx:I}),!t&&A&2&&(t=!0,P.config=I[1].s3,$e(()=>t=!1)),!i&&A&16&&(i=!0,P.isTesting=I[4],$e(()=>i=!1)),!s&&A&32&&(s=!0,P.testError=I[5],$e(()=>s=!1)),e.$set(P),(N=I[1].s3)!=null&&N.enabled&&!I[6]&&!I[3]?O?O.p(I,A):(O=i0(I),O.c(),O.m(o,u)):O&&(O.d(1),O=null),I[6]?E?E.p(I,A):(E=l0(I),E.c(),E.m(o,f)):E&&(E.d(1),E=null),(!h||A&72&&m!==(m=!I[6]||I[3]))&&(c.disabled=m),(!h||A&8)&&x(c,"btn-loading",I[3])},i(I){h||(M(e.$$.fragment,I),h=!0)},o(I){D(e.$$.fragment,I),h=!1},d(I){I&&(y(l),y(o)),j(e,I),O&&O.d(),E&&E.d(),g=!1,_()}}}function Uq(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function n0(n){var A;let e,t,i,s,l,o,r,a=(A=n[0].s3)!=null&&A.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,g,_,k,S,$,T,O,E,L,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',s=C(),l=b("div"),o=W(`If you have existing uploaded files, you'll have to migrate them manually from the `),r=b("strong"),u=W(a),f=W(` to the `),c=b("strong"),m=W(d),h=W(`. `),g=b("br"),_=W(` There are numerous command line tools that can help you, such as: `),k=b("a"),k.textContent=`rclone `,S=W(`, `),$=b("a"),$.textContent=`s5cmd `,T=W(", etc."),O=C(),E=b("div"),p(i,"class","icon"),p(k,"href","https://github.com/rclone/rclone"),p(k,"target","_blank"),p(k,"rel","noopener noreferrer"),p(k,"class","txt-bold"),p($,"href","https://github.com/peak/s5cmd"),p($,"target","_blank"),p($,"rel","noopener noreferrer"),p($,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(E,"class","clearfix m-t-base")},m(P,N){w(P,e,N),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(l,r),v(r,u),v(l,f),v(l,c),v(c,m),v(l,h),v(l,g),v(l,_),v(l,k),v(l,S),v(l,$),v(l,T),v(e,O),v(e,E),I=!0},p(P,N){var R;(!I||N&1)&&a!==(a=(R=P[0].s3)!=null&&R.enabled?"S3 storage":"local file system")&&se(u,a),(!I||N&2)&&d!==(d=P[1].s3.enabled?"S3 storage":"local file system")&&se(m,d)},i(P){I||(P&&tt(()=>{I&&(L||(L=qe(e,ht,{duration:150},!0)),L.run(1))}),I=!0)},o(P){P&&(L||(L=qe(e,ht,{duration:150},!1)),L.run(0)),I=!1},d(P){P&&y(e),P&&L&&L.end()}}}function Vq(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&n0(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&&M(t,1)):(t=n0(s),t.c(),M(t,1),t.m(e.parentNode,e)):t&&(oe(),D(t,1,1,()=>{t=null}),re())},d(s){s&&y(e),t&&t.d(s)}}}function i0(n){let e;function t(l,o){return l[4]?Yq:l[5]?Wq:Bq}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&&y(e),s.d(l)}}}function Bq(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function Wq(n){let e,t,i,s;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Oe(t=Re.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Lt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&y(e),i=!1,s()}}}function Yq(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function l0(n){let e,t,i,s;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){w(l,e,o),v(e,t),i||(s=Y(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&y(e),i=!1,s()}}}function Kq(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_;const k=[Uq,zq],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=C(),l=b("div"),o=W(n[7]),r=C(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="By default PocketBase uses the local file system to store uploaded files.
If you have limited disk space, you could optionally connect to an S3 compatible storage.
",c=C(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,O){w(T,e,O),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),w(T,r,O),w(T,a,O),v(a,u),v(u,f),v(u,c),S[d].m(u,null),h=!0,g||(_=Y(u,"submit",it(n[16])),g=!0)},p(T,O){(!h||O&128)&&se(o,T[7]);let E=d;d=$(T),d===E?S[d].p(T,O):(oe(),D(S[E],1,1,()=>{S[E]=null}),re(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(u,null))},i(T){h||(M(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(y(e),y(r),y(a)),S[d].d(),g=!1,_()}}}function Jq(n){let e,t,i,s;return e=new Fl({}),i=new si({props:{$$slots:{default:[Kq]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(e,l),j(i,l)}}}const Zq="s3_test_request";function Gq(n,e,t){let i,s,l;Ge(n,an,E=>t(7,l=E)),En(an,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const E=await he.settings.getAll()||{};h(E)}catch(E){he.error(E)}t(2,a=!1)}async function m(){if(!(u||!s)){t(3,u=!0);try{he.cancelRequest(Zq);const E=await he.settings.update(U.filterRedactedProps(r));Jt({}),await h(E),As(),nn("Successfully saved storage settings.")}catch(E){he.error(E)}t(3,u=!1)}}async function h(E={}){t(1,r={s3:(E==null?void 0:E.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function g(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function _(E){n.$$.not_equal(r.s3,E)&&(r.s3=E,t(1,r))}function k(E){f=E,t(4,f)}function S(E){c=E,t(5,c)}const $=()=>g(),T=()=>m(),O=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,m,g,i,_,k,S,$,T,O]}class Xq extends ve{constructor(e){super(),ye(this,e,Gq,Jq,be,{})}}function s0(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='