From 825eadfca10603c04bbb2b6d2c7b0217ee71d849 Mon Sep 17 00:00:00 2001 From: yoan <536464346@qq.com> Date: Sat, 7 Sep 2024 21:29:14 +0800 Subject: [PATCH] update tag --- ui/dist/assets/{index-BFHx9JvV.js => index-BGMLTQZA.js} | 4 ++-- ui/dist/index.html | 2 +- ui/src/pages/DashboardLayout.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename ui/dist/assets/{index-BFHx9JvV.js => index-BGMLTQZA.js} (99%) diff --git a/ui/dist/assets/index-BFHx9JvV.js b/ui/dist/assets/index-BGMLTQZA.js similarity index 99% rename from ui/dist/assets/index-BFHx9JvV.js rename to ui/dist/assets/index-BGMLTQZA.js index bdf3d1f0..ef665b74 100644 --- a/ui/dist/assets/index-BFHx9JvV.js +++ b/ui/dist/assets/index-BGMLTQZA.js @@ -255,7 +255,7 @@ Error generating stack: `+o.message+` If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},kM="DialogDescriptionWarning",CM=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${pS(kM).contentName}}.`;return y.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Kg=eS,Gg=rS,qg=sS,dc=oS,fc=iS,hc=lS,pc=uS,ff=fS;const Xg=Kg,Qg=Gg,EM=qg,mS=y.forwardRef(({className:e,...t},r)=>c.jsx(dc,{className:me("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));mS.displayName=dc.displayName;const TM=ic("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),hf=y.forwardRef(({side:e="right",className:t,children:r,...n},s)=>c.jsxs(EM,{children:[c.jsx(mS,{}),c.jsxs(fc,{ref:s,className:me(TM({side:e}),t),...n,children:[r,c.jsxs(ff,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[c.jsx(vg,{className:"h-4 w-4 dark:text-stone-200"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));hf.displayName=fc.displayName;const Jg=({className:e,...t})=>c.jsx("div",{className:me("flex flex-col space-y-2 text-center sm:text-left",e),...t});Jg.displayName="SheetHeader";const ev=y.forwardRef(({className:e,...t},r)=>c.jsx(hc,{ref:r,className:me("text-lg font-semibold text-foreground",e),...t}));ev.displayName=hc.displayName;const NM=y.forwardRef(({className:e,...t},r)=>c.jsx(pc,{ref:r,className:me("text-sm text-muted-foreground",e),...t}));NM.displayName=pc.displayName;class Ir extends Error{constructor(t){var r,n,s,o;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Ir.prototype),t!==null&&typeof t=="object"&&(this.url=typeof t.url=="string"?t.url:"",this.status=typeof t.status=="number"?t.status:0,this.isAbort=!!t.isAbort,this.originalError=t.originalError,t.response!==null&&typeof t.response=="object"?this.response=t.response:t.data!==null&&typeof t.data=="object"?this.response=t.data:this.response={}),this.originalError||t instanceof Ir||(this.originalError=t),typeof DOMException<"u"&&t instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(r=this.response)==null?void 0:r.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":(o=(s=(n=this.originalError)==null?void 0:n.cause)==null?void 0:s.message)!=null&&o.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const tu=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function jM(e,t){const r={};if(typeof e!="string")return r;const n=Object.assign({},{}).decode||RM;let s=0;for(;s0&&(!r.exp||r.exp-t>Date.now()/1e3))}gS=typeof atob!="function"||DM?e=>{let t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,s=0,o=0,i="";n=t.charAt(o++);~n&&(r=s%4?64*r+n:n,s++%4)?i+=String.fromCharCode(255&r>>(-2*s&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return i}:atob;const s0="pb_auth";class OM{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!vS(this.token)}get isAdmin(){return Vi(this.token).type==="admin"}get isAuthRecord(){return Vi(this.token).type==="authRecord"}save(t,r){this.baseToken=t||"",this.baseModel=r||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(t,r=s0){const n=jM(t||"")[r]||"";let s={};try{s=JSON.parse(n),(typeof s===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||null)}exportToCookie(t,r=s0){var l,u;const n={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},s=Vi(this.token);n.expires=s!=null&&s.exp?new Date(1e3*s.exp):new Date("1970-01-01"),t=Object.assign({},n,t);const o={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let i=n0(r,JSON.stringify(o),t);const a=typeof Blob<"u"?new Blob([i]).size:i.length;if(o.model&&a>4096){o.model={id:(l=o==null?void 0:o.model)==null?void 0:l.id,email:(u=o==null?void 0:o.model)==null?void 0:u.email};const d=["collectionId","username","verified"];for(const f in this.model)d.includes(f)&&(o.model[f]=this.model[f]);i=n0(r,JSON.stringify(o),t)}return i}onChange(t,r=!1){return this._onChangeCallbacks.push(t),r&&t(this.token,this.model),()=>{for(let n=this._onChangeCallbacks.length-1;n>=0;n--)if(this._onChangeCallbacks[n]==t)return delete this._onChangeCallbacks[n],void this._onChangeCallbacks.splice(n,1)}}triggerChange(){for(const t of this._onChangeCallbacks)t&&t(this.token,this.model)}}class AM extends OM{constructor(t="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=t,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(t,r){this._storageSet(this.storageKey,{token:t,model:r}),super.save(t,r)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(t){if(typeof window<"u"&&(window!=null&&window.localStorage)){const r=window.localStorage.getItem(t)||"";try{return JSON.parse(r)}catch{return r}}return this.storageFallback[t]}_storageSet(t,r){if(typeof window<"u"&&(window!=null&&window.localStorage)){let n=r;typeof r!="string"&&(n=JSON.stringify(r)),window.localStorage.setItem(t,n)}else this.storageFallback[t]=r}_storageRemove(t){var r;typeof window<"u"&&(window!=null&&window.localStorage)&&((r=window.localStorage)==null||r.removeItem(t)),delete this.storageFallback[t]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",t=>{if(t.key!=this.storageKey)return;const r=this._storageGet(this.storageKey)||{};super.save(r.token||"",r.model||null)})}}class ei{constructor(t){this.client=t}}class MM extends ei{async getAll(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/settings",t)}async update(t,r){return r=Object.assign({method:"PATCH",body:t},r),this.client.send("/api/settings",r)}async testS3(t="storage",r){return r=Object.assign({method:"POST",body:{filesystem:t}},r),this.client.send("/api/settings/test/s3",r).then(()=>!0)}async testEmail(t,r,n){return n=Object.assign({method:"POST",body:{email:t,template:r}},n),this.client.send("/api/settings/test/email",n).then(()=>!0)}async generateAppleClientSecret(t,r,n,s,o,i){return i=Object.assign({method:"POST",body:{clientId:t,teamId:r,keyId:n,privateKey:s,duration:o}},i),this.client.send("/api/settings/apple/generate-client-secret",i)}}class tv extends ei{decode(t){return t}async getFullList(t,r){if(typeof t=="number")return this._getFullList(t,r);let n=500;return(r=Object.assign({},t,r)).batch&&(n=r.batch,delete r.batch),this._getFullList(n,r)}async getList(t=1,r=30,n){return(n=Object.assign({method:"GET"},n)).query=Object.assign({page:t,perPage:r},n.query),this.client.send(this.baseCrudPath,n).then(s=>{var o;return s.items=((o=s.items)==null?void 0:o.map(i=>this.decode(i)))||[],s})}async getFirstListItem(t,r){return(r=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+t},r)).query=Object.assign({filter:t,skipTotal:1},r.query),this.getList(1,1,r).then(n=>{var s;if(!((s=n==null?void 0:n.items)!=null&&s.length))throw new Ir({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return n.items[0]})}async getOne(t,r){if(!t)throw new Ir({url:this.client.buildUrl(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return r=Object.assign({method:"GET"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then(n=>this.decode(n))}async create(t,r){return r=Object.assign({method:"POST",body:t},r),this.client.send(this.baseCrudPath,r).then(n=>this.decode(n))}async update(t,r,n){return n=Object.assign({method:"PATCH",body:r},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),n).then(s=>this.decode(s))}async delete(t,r){return r=Object.assign({method:"DELETE"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then(()=>!0)}_getFullList(t=500,r){(r=r||{}).query=Object.assign({skipTotal:1},r.query);let n=[],s=async o=>this.getList(o,t||500,r).then(i=>{const a=i.items;return n=n.concat(a),a.length==i.perPage?s(o+1):n});return s(1)}}function Nr(e,t,r,n){const s=n!==void 0;return s||r!==void 0?s?(console.warn(e),t.body=Object.assign({},t.body,r),t.query=Object.assign({},t.query,n),t):Object.assign(t,r):t}function Eh(e){var t;(t=e._resetAutoRefresh)==null||t.call(e)}class IM extends tv{get baseCrudPath(){return"/api/admins"}async update(t,r,n){return super.update(t,r,n).then(s=>{var o,i;return((o=this.client.authStore.model)==null?void 0:o.id)===s.id&&((i=this.client.authStore.model)==null?void 0:i.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,s),s})}async delete(t,r){return super.delete(t,r).then(n=>{var s,o;return n&&((s=this.client.authStore.model)==null?void 0:s.id)===t&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.clear(),n})}authResponse(t){const r=this.decode((t==null?void 0:t.admin)||{});return t!=null&&t.token&&(t!=null&&t.admin)&&this.client.authStore.save(t.token,r),Object.assign({},t,{token:(t==null?void 0:t.token)||"",admin:r})}async authWithPassword(t,r,n,s){let o={method:"POST",body:{identity:t,password:r}};o=Nr("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",o,n,s);const i=o.autoRefreshThreshold;delete o.autoRefreshThreshold,o.autoRefresh||Eh(this.client);let a=await this.client.send(this.baseCrudPath+"/auth-with-password",o);return a=this.authResponse(a),i&&function(u,d,f,p){Eh(u);const m=u.beforeSend,x=u.authStore.model,g=u.authStore.onChange((w,v)=>{(!w||(v==null?void 0:v.id)!=(x==null?void 0:x.id)||(v!=null&&v.collectionId||x!=null&&x.collectionId)&&(v==null?void 0:v.collectionId)!=(x==null?void 0:x.collectionId))&&Eh(u)});u._resetAutoRefresh=function(){g(),u.beforeSend=m,delete u._resetAutoRefresh},u.beforeSend=async(w,v)=>{var E;const h=u.authStore.token;if((E=v.query)!=null&&E.autoRefresh)return m?m(w,v):{url:w,sendOptions:v};let _=u.authStore.isValid;if(_&&vS(u.authStore.token,d))try{await f()}catch{_=!1}_||await p();const C=v.headers||{};for(let T in C)if(T.toLowerCase()=="authorization"&&h==C[T]&&u.authStore.token){C[T]=u.authStore.token;break}return v.headers=C,m?m(w,v):{url:w,sendOptions:v}}}(this.client,i,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(t,r,Object.assign({autoRefresh:!0},o))),a}async authRefresh(t,r){let n={method:"POST"};return n=Nr("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",n,t,r),this.client.send(this.baseCrudPath+"/auth-refresh",n).then(this.authResponse.bind(this))}async requestPasswordReset(t,r,n){let s={method:"POST",body:{email:t}};return s=Nr("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,r,n),this.client.send(this.baseCrudPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(t,r,n,s,o){let i={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return i=Nr("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",i,s,o),this.client.send(this.baseCrudPath+"/confirm-password-reset",i).then(()=>!0)}}const LM=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function yS(e){if(e){e.query=e.query||{};for(let t in e)LM.includes(t)||(e.query[t]=e[t],delete e[t])}}class xS extends ei{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(t,r,n){var i;if(!t)throw new Error("topic must be set.");let s=t;if(n){yS(n);const a="options="+encodeURIComponent(JSON.stringify({query:n.query,headers:n.headers}));s+=(s.includes("?")?"&":"?")+a}const o=function(a){const l=a;let u;try{u=JSON.parse(l==null?void 0:l.data)}catch{}r(u||{})};return this.subscriptions[s]||(this.subscriptions[s]=[]),this.subscriptions[s].push(o),this.isConnected?this.subscriptions[s].length===1?await this.submitSubscriptions():(i=this.eventSource)==null||i.addEventListener(s,o):await this.connect(),async()=>this.unsubscribeByTopicAndListener(t,o)}async unsubscribe(t){var n;let r=!1;if(t){const s=this.getSubscriptionsByTopic(t);for(let o in s)if(this.hasSubscriptionListeners(o)){for(let i of this.subscriptions[o])(n=this.eventSource)==null||n.removeEventListener(o,i);delete this.subscriptions[o],r||(r=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?r&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(t){var n;let r=!1;for(let s in this.subscriptions)if((s+"?").startsWith(t)){r=!0;for(let o of this.subscriptions[s])(n=this.eventSource)==null||n.removeEventListener(s,o);delete this.subscriptions[s]}r&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(t,r){var o;let n=!1;const s=this.getSubscriptionsByTopic(t);for(let i in s){if(!Array.isArray(this.subscriptions[i])||!this.subscriptions[i].length)continue;let a=!1;for(let l=this.subscriptions[i].length-1;l>=0;l--)this.subscriptions[i][l]===r&&(a=!0,delete this.subscriptions[i][l],this.subscriptions[i].splice(l,1),(o=this.eventSource)==null||o.removeEventListener(i,r));a&&(this.subscriptions[i].length||delete this.subscriptions[i],n||this.hasSubscriptionListeners(i)||(n=!0))}this.hasSubscriptionListeners()?n&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(t){var r,n;if(this.subscriptions=this.subscriptions||{},t)return!!((r=this.subscriptions[t])!=null&&r.length);for(let s in this.subscriptions)if((n=this.subscriptions[s])!=null&&n.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(t=>{if(!(t!=null&&t.isAbort))throw t})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(t){const r={};t=t.includes("?")?t:t+"?";for(let n in this.subscriptions)(n+"?").startsWith(t)&&(r[n]=this.subscriptions[n]);return r}getNonEmptySubscriptionKeys(){const t=[];for(let r in this.subscriptions)this.subscriptions[r].length&&t.push(r);return t}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let t in this.subscriptions)for(let r of this.subscriptions[t])this.eventSource.addEventListener(t,r)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let t in this.subscriptions)for(let r of this.subscriptions[t])this.eventSource.removeEventListener(t,r)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((t,r)=>{this.pendingConnects.push({resolve:t,reject:r}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=t=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",t=>{const r=t;this.clientId=r==null?void 0:r.lastEventId,this.submitSubscriptions().then(async()=>{let n=3;for(;this.hasUnsentSubscriptions()&&n>0;)n--,await this.submitSubscriptions()}).then(()=>{for(let s of this.pendingConnects)s.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const n=this.getSubscriptionsByTopic("PB_CONNECT");for(let s in n)for(let o of n[s])o(t)}).catch(n=>{this.clientId="",this.connectErrorHandler(n)})})}hasUnsentSubscriptions(){const t=this.getNonEmptySubscriptionKeys();if(t.length!=this.lastSentSubscriptions.length)return!0;for(const r of t)if(!this.lastSentSubscriptions.includes(r))return!0;return!1}connectErrorHandler(t){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let n of this.pendingConnects)n.reject(new Ir(t));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const r=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},r)}disconnect(t=!1){var r;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(r=this.eventSource)==null||r.close(),this.eventSource=null,this.clientId="",!t){this.reconnectAttempts=0;for(let n of this.pendingConnects)n.resolve();this.pendingConnects=[]}}}class FM extends tv{constructor(t,r){super(t),this.collectionIdOrName=r}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(t,r,n){if(!t)throw new Error("Missing topic.");if(!r)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+t,r,n)}async unsubscribe(t){return t?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+t):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(t,r){if(typeof t=="number")return super.getFullList(t,r);const n=Object.assign({},t,r);return super.getFullList(n)}async getList(t=1,r=30,n){return super.getList(t,r,n)}async getFirstListItem(t,r){return super.getFirstListItem(t,r)}async getOne(t,r){return super.getOne(t,r)}async create(t,r){return super.create(t,r)}async update(t,r,n){return super.update(t,r,n).then(s=>{var o,i,a;return((o=this.client.authStore.model)==null?void 0:o.id)!==(s==null?void 0:s.id)||((i=this.client.authStore.model)==null?void 0:i.collectionId)!==this.collectionIdOrName&&((a=this.client.authStore.model)==null?void 0:a.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,s),s})}async delete(t,r){return super.delete(t,r).then(n=>{var s,o,i;return!n||((s=this.client.authStore.model)==null?void 0:s.id)!==t||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((i=this.client.authStore.model)==null?void 0:i.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),n})}authResponse(t){const r=this.decode((t==null?void 0:t.record)||{});return this.client.authStore.save(t==null?void 0:t.token,r),Object.assign({},t,{token:(t==null?void 0:t.token)||"",record:r})}async listAuthMethods(t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCollectionPath+"/auth-methods",t).then(r=>Object.assign({},r,{usernamePassword:!!(r!=null&&r.usernamePassword),emailPassword:!!(r!=null&&r.emailPassword),authProviders:Array.isArray(r==null?void 0:r.authProviders)?r==null?void 0:r.authProviders:[]}))}async authWithPassword(t,r,n,s){let o={method:"POST",body:{identity:t,password:r}};return o=Nr("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",o,n,s),this.client.send(this.baseCollectionPath+"/auth-with-password",o).then(i=>this.authResponse(i))}async authWithOAuth2Code(t,r,n,s,o,i,a){let l={method:"POST",body:{provider:t,code:r,codeVerifier:n,redirectUrl:s,createData:o}};return l=Nr("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",l,i,a),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",l).then(u=>this.authResponse(u))}authWithOAuth2(...t){if(t.length>1||typeof(t==null?void 0:t[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((t==null?void 0:t[0])||"",(t==null?void 0:t[1])||"",(t==null?void 0:t[2])||"",(t==null?void 0:t[3])||"",(t==null?void 0:t[4])||{},(t==null?void 0:t[5])||{},(t==null?void 0:t[6])||{});const r=(t==null?void 0:t[0])||{};let n=null;r.urlCallback||(n=o0(void 0));const s=new xS(this.client);function o(){n==null||n.close(),s.unsubscribe()}const i={},a=r.requestKey;return a&&(i.requestKey=a),this.listAuthMethods(i).then(l=>{var p;const u=l.authProviders.find(m=>m.name===r.provider);if(!u)throw new Ir(new Error(`Missing or invalid provider "${r.provider}".`));const d=this.client.buildUrl("/api/oauth2-redirect"),f=a?(p=this.client.cancelControllers)==null?void 0:p[a]:void 0;return f&&(f.signal.onabort=()=>{o()}),new Promise(async(m,x)=>{var g;try{await s.subscribe("@oauth2",async _=>{var E;const C=s.clientId;try{if(!_.state||C!==_.state)throw new Error("State parameters don't match.");if(_.error||!_.code)throw new Error("OAuth2 redirect error or missing code: "+_.error);const T=Object.assign({},r);delete T.provider,delete T.scopes,delete T.createData,delete T.urlCallback,(E=f==null?void 0:f.signal)!=null&&E.onabort&&(f.signal.onabort=null);const R=await this.authWithOAuth2Code(u.name,_.code,u.codeVerifier,d,r.createData,T);m(R)}catch(T){x(new Ir(T))}o()});const w={state:s.clientId};(g=r.scopes)!=null&&g.length&&(w.scope=r.scopes.join(" "));const v=this._replaceQueryParams(u.authUrl+d,w);await(r.urlCallback||function(_){n?n.location.href=_:n=o0(_)})(v)}catch(w){o(),x(new Ir(w))}})}).catch(l=>{throw o(),l})}async authRefresh(t,r){let n={method:"POST"};return n=Nr("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",n,t,r),this.client.send(this.baseCollectionPath+"/auth-refresh",n).then(s=>this.authResponse(s))}async requestPasswordReset(t,r,n){let s={method:"POST",body:{email:t}};return s=Nr("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(t,r,n,s,o){let i={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return i=Nr("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",i,s,o),this.client.send(this.baseCollectionPath+"/confirm-password-reset",i).then(()=>!0)}async requestVerification(t,r,n){let s={method:"POST",body:{email:t}};return s=Nr("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-verification",s).then(()=>!0)}async confirmVerification(t,r,n){let s={method:"POST",body:{token:t}};return s=Nr("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then(()=>{const o=Vi(t),i=this.client.authStore.model;return i&&!i.verified&&i.id===o.id&&i.collectionId===o.collectionId&&(i.verified=!0,this.client.authStore.save(this.client.authStore.token,i)),!0})}async requestEmailChange(t,r,n){let s={method:"POST",body:{newEmail:t}};return s=Nr("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-email-change",s).then(()=>!0)}async confirmEmailChange(t,r,n,s){let o={method:"POST",body:{token:t,password:r}};return o=Nr("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",o,n,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",o).then(()=>{const i=Vi(t),a=this.client.authStore.model;return a&&a.id===i.id&&a.collectionId===i.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(t,r){return r=Object.assign({method:"GET"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths",r)}async unlinkExternalAuth(t,r,n){return n=Object.assign({method:"DELETE"},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths/"+encodeURIComponent(r),n).then(()=>!0)}_replaceQueryParams(t,r={}){let n=t,s="";t.indexOf("?")>=0&&(n=t.substring(0,t.indexOf("?")),s=t.substring(t.indexOf("?")+1));const o={},i=s.split("&");for(const a of i){if(a=="")continue;const l=a.split("=");o[decodeURIComponent(l[0].replace(/\+/g," "))]=decodeURIComponent((l[1]||"").replace(/\+/g," "))}for(let a in r)r.hasOwnProperty(a)&&(r[a]==null?delete o[a]:o[a]=r[a]);s="";for(let a in o)o.hasOwnProperty(a)&&(s!=""&&(s+="&"),s+=encodeURIComponent(a.replace(/%20/g,"+"))+"="+encodeURIComponent(o[a].replace(/%20/g,"+")));return s!=""?n+"?"+s:n}}function o0(e){if(typeof window>"u"||!(window!=null&&window.open))throw new Ir(new Error("Not in a browser context - please pass a custom urlCallback function."));let t=1024,r=768,n=window.innerWidth,s=window.innerHeight;t=t>n?n:t,r=r>s?s:r;let o=n/2-t/2,i=s/2-r/2;return window.open(e,"popup_window","width="+t+",height="+r+",top="+i+",left="+o+",resizable,menubar=no")}class zM extends tv{get baseCrudPath(){return"/api/collections"}async import(t,r=!1,n){return n=Object.assign({method:"PUT",body:{collections:t,deleteMissing:r}},n),this.client.send(this.baseCrudPath+"/import",n).then(()=>!0)}}class UM extends ei{async getList(t=1,r=30,n){return(n=Object.assign({method:"GET"},n)).query=Object.assign({page:t,perPage:r},n.query),this.client.send("/api/logs",n)}async getOne(t,r){if(!t)throw new Ir({url:this.client.buildUrl("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return r=Object.assign({method:"GET"},r),this.client.send("/api/logs/"+encodeURIComponent(t),r)}async getStats(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/stats",t)}}class VM extends ei{async check(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/health",t)}}class WM extends ei{getUrl(t,r,n={}){if(!r||!(t!=null&&t.id)||!(t!=null&&t.collectionId)&&!(t!=null&&t.collectionName))return"";const s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(t.collectionId||t.collectionName)),s.push(encodeURIComponent(t.id)),s.push(encodeURIComponent(r));let o=this.client.buildUrl(s.join("/"));if(Object.keys(n).length){n.download===!1&&delete n.download;const i=new URLSearchParams(n);o+=(o.includes("?")?"&":"?")+i}return o}async getToken(t){return t=Object.assign({method:"POST"},t),this.client.send("/api/files/token",t).then(r=>(r==null?void 0:r.token)||"")}}class $M extends ei{async getFullList(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/backups",t)}async create(t,r){return r=Object.assign({method:"POST",body:{name:t}},r),this.client.send("/api/backups",r).then(()=>!0)}async upload(t,r){return r=Object.assign({method:"POST",body:t},r),this.client.send("/api/backups/upload",r).then(()=>!0)}async delete(t,r){return r=Object.assign({method:"DELETE"},r),this.client.send(`/api/backups/${encodeURIComponent(t)}`,r).then(()=>!0)}async restore(t,r){return r=Object.assign({method:"POST"},r),this.client.send(`/api/backups/${encodeURIComponent(t)}/restore`,r).then(()=>!0)}getDownloadUrl(t,r){return this.client.buildUrl(`/api/backups/${encodeURIComponent(r)}?token=${encodeURIComponent(t)}`)}}class BM{constructor(t="/",r,n="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=t,this.lang=n,this.authStore=r||new AM,this.admins=new IM(this),this.collections=new zM(this),this.files=new WM(this),this.logs=new UM(this),this.settings=new MM(this),this.realtime=new xS(this),this.health=new VM(this),this.backups=new $M(this)}collection(t){return this.recordServices[t]||(this.recordServices[t]=new FM(this,t)),this.recordServices[t]}autoCancellation(t){return this.enableAutoCancellation=!!t,this}cancelRequest(t){return this.cancelControllers[t]&&(this.cancelControllers[t].abort(),delete this.cancelControllers[t]),this}cancelAllRequests(){for(let t in this.cancelControllers)this.cancelControllers[t].abort();return this.cancelControllers={},this}filter(t,r){if(!r)return t;for(let n in r){let s=r[n];switch(typeof s){case"boolean":case"number":s=""+s;break;case"string":s="'"+s.replace(/'/g,"\\'")+"'";break;default:s=s===null?"null":s instanceof Date?"'"+s.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(s).replace(/'/g,"\\'")+"'"}t=t.replaceAll("{:"+n+"}",s)}return t}getFileUrl(t,r,n={}){return this.files.getUrl(t,r,n)}buildUrl(t){var n;let r=this.baseUrl;return typeof window>"u"||!window.location||r.startsWith("https://")||r.startsWith("http://")||(r=(n=window.location.origin)!=null&&n.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(r+=window.location.pathname||"/",r+=r.endsWith("/")?"":"/"),r+=this.baseUrl),t&&(r+=r.endsWith("/")?"":"/",r+=t.startsWith("/")?t.substring(1):t),r}async send(t,r){r=this.initSendOptions(t,r);let n=this.buildUrl(t);if(this.beforeSend){const s=Object.assign({},await this.beforeSend(n,r));s.url!==void 0||s.options!==void 0?(n=s.url||n,r=s.options||r):Object.keys(s).length&&(r=s,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(r.query!==void 0){const s=this.serializeQueryParams(r.query);s&&(n+=(n.includes("?")?"&":"?")+s),delete r.query}return this.getHeader(r.headers,"Content-Type")=="application/json"&&r.body&&typeof r.body!="string"&&(r.body=JSON.stringify(r.body)),(r.fetch||fetch)(n,r).then(async s=>{let o={};try{o=await s.json()}catch{}if(this.afterSend&&(o=await this.afterSend(s,o)),s.status>=400)throw new Ir({url:s.url,status:s.status,data:o});return o}).catch(s=>{throw new Ir(s)})}initSendOptions(t,r){if((r=Object.assign({method:"GET"},r)).body=this.convertToFormDataIfNeeded(r.body),yS(r),r.query=Object.assign({},r.params,r.query),r.requestKey===void 0&&(r.$autoCancel===!1||r.query.$autoCancel===!1?r.requestKey=null:(r.$cancelKey||r.query.$cancelKey)&&(r.requestKey=r.$cancelKey||r.query.$cancelKey)),delete r.$autoCancel,delete r.query.$autoCancel,delete r.$cancelKey,delete r.query.$cancelKey,this.getHeader(r.headers,"Content-Type")!==null||this.isFormData(r.body)||(r.headers=Object.assign({},r.headers,{"Content-Type":"application/json"})),this.getHeader(r.headers,"Accept-Language")===null&&(r.headers=Object.assign({},r.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(r.headers,"Authorization")===null&&(r.headers=Object.assign({},r.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&r.requestKey!==null){const n=r.requestKey||(r.method||"GET")+t;delete r.requestKey,this.cancelRequest(n);const s=new AbortController;this.cancelControllers[n]=s,r.signal=s.signal}return r}convertToFormDataIfNeeded(t){if(typeof FormData>"u"||t===void 0||typeof t!="object"||t===null||this.isFormData(t)||!this.hasBlobField(t))return t;const r=new FormData;for(const n in t){const s=t[n];if(typeof s!="object"||this.hasBlobField({data:s})){const o=Array.isArray(s)?s:[s];for(let i of o)r.append(n,i)}else{let o={};o[n]=s,r.append("@jsonPayload",JSON.stringify(o))}}return r}hasBlobField(t){for(const r in t){const n=Array.isArray(t[r])?t[r]:[t[r]];for(const s of n)if(typeof Blob<"u"&&s instanceof Blob||typeof File<"u"&&s instanceof File)return!0}return!1}getHeader(t,r){t=t||{},r=r.toLowerCase();for(let n in t)if(n.toLowerCase()==r)return t[n];return null}isFormData(t){return t&&(t.constructor.name==="FormData"||typeof FormData<"u"&&t instanceof FormData)}serializeQueryParams(t){const r=[];for(const n in t){if(t[n]===null)continue;const s=t[n],o=encodeURIComponent(n);if(Array.isArray(s))for(const i of s)r.push(o+"="+encodeURIComponent(i));else s instanceof Date?r.push(o+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?r.push(o+"="+encodeURIComponent(JSON.stringify(s))):r.push(o+"="+encodeURIComponent(s))}return r.join("&")}}var HM={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const YM=HM.VITE_API_DOMAIN;console.log(YM);let ru;const jt=()=>ru||(ru=new BM("http://127.0.0.1:8090"),ru);//! moment.js +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},kM="DialogDescriptionWarning",CM=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${pS(kM).contentName}}.`;return y.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Kg=eS,Gg=rS,qg=sS,dc=oS,fc=iS,hc=lS,pc=uS,ff=fS;const Xg=Kg,Qg=Gg,EM=qg,mS=y.forwardRef(({className:e,...t},r)=>c.jsx(dc,{className:me("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));mS.displayName=dc.displayName;const TM=ic("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),hf=y.forwardRef(({side:e="right",className:t,children:r,...n},s)=>c.jsxs(EM,{children:[c.jsx(mS,{}),c.jsxs(fc,{ref:s,className:me(TM({side:e}),t),...n,children:[r,c.jsxs(ff,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[c.jsx(vg,{className:"h-4 w-4 dark:text-stone-200"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));hf.displayName=fc.displayName;const Jg=({className:e,...t})=>c.jsx("div",{className:me("flex flex-col space-y-2 text-center sm:text-left",e),...t});Jg.displayName="SheetHeader";const ev=y.forwardRef(({className:e,...t},r)=>c.jsx(hc,{ref:r,className:me("text-lg font-semibold text-foreground",e),...t}));ev.displayName=hc.displayName;const NM=y.forwardRef(({className:e,...t},r)=>c.jsx(pc,{ref:r,className:me("text-sm text-muted-foreground",e),...t}));NM.displayName=pc.displayName;class Ir extends Error{constructor(t){var r,n,s,o;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Ir.prototype),t!==null&&typeof t=="object"&&(this.url=typeof t.url=="string"?t.url:"",this.status=typeof t.status=="number"?t.status:0,this.isAbort=!!t.isAbort,this.originalError=t.originalError,t.response!==null&&typeof t.response=="object"?this.response=t.response:t.data!==null&&typeof t.data=="object"?this.response=t.data:this.response={}),this.originalError||t instanceof Ir||(this.originalError=t),typeof DOMException<"u"&&t instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(r=this.response)==null?void 0:r.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":(o=(s=(n=this.originalError)==null?void 0:n.cause)==null?void 0:s.message)!=null&&o.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const tu=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function jM(e,t){const r={};if(typeof e!="string")return r;const n=Object.assign({},{}).decode||RM;let s=0;for(;s0&&(!r.exp||r.exp-t>Date.now()/1e3))}gS=typeof atob!="function"||DM?e=>{let t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,s=0,o=0,i="";n=t.charAt(o++);~n&&(r=s%4?64*r+n:n,s++%4)?i+=String.fromCharCode(255&r>>(-2*s&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return i}:atob;const s0="pb_auth";class OM{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!vS(this.token)}get isAdmin(){return Vi(this.token).type==="admin"}get isAuthRecord(){return Vi(this.token).type==="authRecord"}save(t,r){this.baseToken=t||"",this.baseModel=r||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(t,r=s0){const n=jM(t||"")[r]||"";let s={};try{s=JSON.parse(n),(typeof s===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||null)}exportToCookie(t,r=s0){var l,u;const n={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},s=Vi(this.token);n.expires=s!=null&&s.exp?new Date(1e3*s.exp):new Date("1970-01-01"),t=Object.assign({},n,t);const o={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let i=n0(r,JSON.stringify(o),t);const a=typeof Blob<"u"?new Blob([i]).size:i.length;if(o.model&&a>4096){o.model={id:(l=o==null?void 0:o.model)==null?void 0:l.id,email:(u=o==null?void 0:o.model)==null?void 0:u.email};const d=["collectionId","username","verified"];for(const f in this.model)d.includes(f)&&(o.model[f]=this.model[f]);i=n0(r,JSON.stringify(o),t)}return i}onChange(t,r=!1){return this._onChangeCallbacks.push(t),r&&t(this.token,this.model),()=>{for(let n=this._onChangeCallbacks.length-1;n>=0;n--)if(this._onChangeCallbacks[n]==t)return delete this._onChangeCallbacks[n],void this._onChangeCallbacks.splice(n,1)}}triggerChange(){for(const t of this._onChangeCallbacks)t&&t(this.token,this.model)}}class AM extends OM{constructor(t="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=t,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(t,r){this._storageSet(this.storageKey,{token:t,model:r}),super.save(t,r)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(t){if(typeof window<"u"&&(window!=null&&window.localStorage)){const r=window.localStorage.getItem(t)||"";try{return JSON.parse(r)}catch{return r}}return this.storageFallback[t]}_storageSet(t,r){if(typeof window<"u"&&(window!=null&&window.localStorage)){let n=r;typeof r!="string"&&(n=JSON.stringify(r)),window.localStorage.setItem(t,n)}else this.storageFallback[t]=r}_storageRemove(t){var r;typeof window<"u"&&(window!=null&&window.localStorage)&&((r=window.localStorage)==null||r.removeItem(t)),delete this.storageFallback[t]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",t=>{if(t.key!=this.storageKey)return;const r=this._storageGet(this.storageKey)||{};super.save(r.token||"",r.model||null)})}}class ei{constructor(t){this.client=t}}class MM extends ei{async getAll(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/settings",t)}async update(t,r){return r=Object.assign({method:"PATCH",body:t},r),this.client.send("/api/settings",r)}async testS3(t="storage",r){return r=Object.assign({method:"POST",body:{filesystem:t}},r),this.client.send("/api/settings/test/s3",r).then(()=>!0)}async testEmail(t,r,n){return n=Object.assign({method:"POST",body:{email:t,template:r}},n),this.client.send("/api/settings/test/email",n).then(()=>!0)}async generateAppleClientSecret(t,r,n,s,o,i){return i=Object.assign({method:"POST",body:{clientId:t,teamId:r,keyId:n,privateKey:s,duration:o}},i),this.client.send("/api/settings/apple/generate-client-secret",i)}}class tv extends ei{decode(t){return t}async getFullList(t,r){if(typeof t=="number")return this._getFullList(t,r);let n=500;return(r=Object.assign({},t,r)).batch&&(n=r.batch,delete r.batch),this._getFullList(n,r)}async getList(t=1,r=30,n){return(n=Object.assign({method:"GET"},n)).query=Object.assign({page:t,perPage:r},n.query),this.client.send(this.baseCrudPath,n).then(s=>{var o;return s.items=((o=s.items)==null?void 0:o.map(i=>this.decode(i)))||[],s})}async getFirstListItem(t,r){return(r=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+t},r)).query=Object.assign({filter:t,skipTotal:1},r.query),this.getList(1,1,r).then(n=>{var s;if(!((s=n==null?void 0:n.items)!=null&&s.length))throw new Ir({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return n.items[0]})}async getOne(t,r){if(!t)throw new Ir({url:this.client.buildUrl(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return r=Object.assign({method:"GET"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then(n=>this.decode(n))}async create(t,r){return r=Object.assign({method:"POST",body:t},r),this.client.send(this.baseCrudPath,r).then(n=>this.decode(n))}async update(t,r,n){return n=Object.assign({method:"PATCH",body:r},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),n).then(s=>this.decode(s))}async delete(t,r){return r=Object.assign({method:"DELETE"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then(()=>!0)}_getFullList(t=500,r){(r=r||{}).query=Object.assign({skipTotal:1},r.query);let n=[],s=async o=>this.getList(o,t||500,r).then(i=>{const a=i.items;return n=n.concat(a),a.length==i.perPage?s(o+1):n});return s(1)}}function Nr(e,t,r,n){const s=n!==void 0;return s||r!==void 0?s?(console.warn(e),t.body=Object.assign({},t.body,r),t.query=Object.assign({},t.query,n),t):Object.assign(t,r):t}function Eh(e){var t;(t=e._resetAutoRefresh)==null||t.call(e)}class IM extends tv{get baseCrudPath(){return"/api/admins"}async update(t,r,n){return super.update(t,r,n).then(s=>{var o,i;return((o=this.client.authStore.model)==null?void 0:o.id)===s.id&&((i=this.client.authStore.model)==null?void 0:i.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,s),s})}async delete(t,r){return super.delete(t,r).then(n=>{var s,o;return n&&((s=this.client.authStore.model)==null?void 0:s.id)===t&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.clear(),n})}authResponse(t){const r=this.decode((t==null?void 0:t.admin)||{});return t!=null&&t.token&&(t!=null&&t.admin)&&this.client.authStore.save(t.token,r),Object.assign({},t,{token:(t==null?void 0:t.token)||"",admin:r})}async authWithPassword(t,r,n,s){let o={method:"POST",body:{identity:t,password:r}};o=Nr("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",o,n,s);const i=o.autoRefreshThreshold;delete o.autoRefreshThreshold,o.autoRefresh||Eh(this.client);let a=await this.client.send(this.baseCrudPath+"/auth-with-password",o);return a=this.authResponse(a),i&&function(u,d,f,p){Eh(u);const m=u.beforeSend,x=u.authStore.model,g=u.authStore.onChange((w,v)=>{(!w||(v==null?void 0:v.id)!=(x==null?void 0:x.id)||(v!=null&&v.collectionId||x!=null&&x.collectionId)&&(v==null?void 0:v.collectionId)!=(x==null?void 0:x.collectionId))&&Eh(u)});u._resetAutoRefresh=function(){g(),u.beforeSend=m,delete u._resetAutoRefresh},u.beforeSend=async(w,v)=>{var E;const h=u.authStore.token;if((E=v.query)!=null&&E.autoRefresh)return m?m(w,v):{url:w,sendOptions:v};let _=u.authStore.isValid;if(_&&vS(u.authStore.token,d))try{await f()}catch{_=!1}_||await p();const C=v.headers||{};for(let T in C)if(T.toLowerCase()=="authorization"&&h==C[T]&&u.authStore.token){C[T]=u.authStore.token;break}return v.headers=C,m?m(w,v):{url:w,sendOptions:v}}}(this.client,i,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(t,r,Object.assign({autoRefresh:!0},o))),a}async authRefresh(t,r){let n={method:"POST"};return n=Nr("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",n,t,r),this.client.send(this.baseCrudPath+"/auth-refresh",n).then(this.authResponse.bind(this))}async requestPasswordReset(t,r,n){let s={method:"POST",body:{email:t}};return s=Nr("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,r,n),this.client.send(this.baseCrudPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(t,r,n,s,o){let i={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return i=Nr("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",i,s,o),this.client.send(this.baseCrudPath+"/confirm-password-reset",i).then(()=>!0)}}const LM=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function yS(e){if(e){e.query=e.query||{};for(let t in e)LM.includes(t)||(e.query[t]=e[t],delete e[t])}}class xS extends ei{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(t,r,n){var i;if(!t)throw new Error("topic must be set.");let s=t;if(n){yS(n);const a="options="+encodeURIComponent(JSON.stringify({query:n.query,headers:n.headers}));s+=(s.includes("?")?"&":"?")+a}const o=function(a){const l=a;let u;try{u=JSON.parse(l==null?void 0:l.data)}catch{}r(u||{})};return this.subscriptions[s]||(this.subscriptions[s]=[]),this.subscriptions[s].push(o),this.isConnected?this.subscriptions[s].length===1?await this.submitSubscriptions():(i=this.eventSource)==null||i.addEventListener(s,o):await this.connect(),async()=>this.unsubscribeByTopicAndListener(t,o)}async unsubscribe(t){var n;let r=!1;if(t){const s=this.getSubscriptionsByTopic(t);for(let o in s)if(this.hasSubscriptionListeners(o)){for(let i of this.subscriptions[o])(n=this.eventSource)==null||n.removeEventListener(o,i);delete this.subscriptions[o],r||(r=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?r&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(t){var n;let r=!1;for(let s in this.subscriptions)if((s+"?").startsWith(t)){r=!0;for(let o of this.subscriptions[s])(n=this.eventSource)==null||n.removeEventListener(s,o);delete this.subscriptions[s]}r&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(t,r){var o;let n=!1;const s=this.getSubscriptionsByTopic(t);for(let i in s){if(!Array.isArray(this.subscriptions[i])||!this.subscriptions[i].length)continue;let a=!1;for(let l=this.subscriptions[i].length-1;l>=0;l--)this.subscriptions[i][l]===r&&(a=!0,delete this.subscriptions[i][l],this.subscriptions[i].splice(l,1),(o=this.eventSource)==null||o.removeEventListener(i,r));a&&(this.subscriptions[i].length||delete this.subscriptions[i],n||this.hasSubscriptionListeners(i)||(n=!0))}this.hasSubscriptionListeners()?n&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(t){var r,n;if(this.subscriptions=this.subscriptions||{},t)return!!((r=this.subscriptions[t])!=null&&r.length);for(let s in this.subscriptions)if((n=this.subscriptions[s])!=null&&n.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(t=>{if(!(t!=null&&t.isAbort))throw t})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(t){const r={};t=t.includes("?")?t:t+"?";for(let n in this.subscriptions)(n+"?").startsWith(t)&&(r[n]=this.subscriptions[n]);return r}getNonEmptySubscriptionKeys(){const t=[];for(let r in this.subscriptions)this.subscriptions[r].length&&t.push(r);return t}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let t in this.subscriptions)for(let r of this.subscriptions[t])this.eventSource.addEventListener(t,r)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let t in this.subscriptions)for(let r of this.subscriptions[t])this.eventSource.removeEventListener(t,r)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((t,r)=>{this.pendingConnects.push({resolve:t,reject:r}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=t=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",t=>{const r=t;this.clientId=r==null?void 0:r.lastEventId,this.submitSubscriptions().then(async()=>{let n=3;for(;this.hasUnsentSubscriptions()&&n>0;)n--,await this.submitSubscriptions()}).then(()=>{for(let s of this.pendingConnects)s.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const n=this.getSubscriptionsByTopic("PB_CONNECT");for(let s in n)for(let o of n[s])o(t)}).catch(n=>{this.clientId="",this.connectErrorHandler(n)})})}hasUnsentSubscriptions(){const t=this.getNonEmptySubscriptionKeys();if(t.length!=this.lastSentSubscriptions.length)return!0;for(const r of t)if(!this.lastSentSubscriptions.includes(r))return!0;return!1}connectErrorHandler(t){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let n of this.pendingConnects)n.reject(new Ir(t));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const r=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},r)}disconnect(t=!1){var r;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(r=this.eventSource)==null||r.close(),this.eventSource=null,this.clientId="",!t){this.reconnectAttempts=0;for(let n of this.pendingConnects)n.resolve();this.pendingConnects=[]}}}class FM extends tv{constructor(t,r){super(t),this.collectionIdOrName=r}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(t,r,n){if(!t)throw new Error("Missing topic.");if(!r)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+t,r,n)}async unsubscribe(t){return t?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+t):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(t,r){if(typeof t=="number")return super.getFullList(t,r);const n=Object.assign({},t,r);return super.getFullList(n)}async getList(t=1,r=30,n){return super.getList(t,r,n)}async getFirstListItem(t,r){return super.getFirstListItem(t,r)}async getOne(t,r){return super.getOne(t,r)}async create(t,r){return super.create(t,r)}async update(t,r,n){return super.update(t,r,n).then(s=>{var o,i,a;return((o=this.client.authStore.model)==null?void 0:o.id)!==(s==null?void 0:s.id)||((i=this.client.authStore.model)==null?void 0:i.collectionId)!==this.collectionIdOrName&&((a=this.client.authStore.model)==null?void 0:a.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,s),s})}async delete(t,r){return super.delete(t,r).then(n=>{var s,o,i;return!n||((s=this.client.authStore.model)==null?void 0:s.id)!==t||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((i=this.client.authStore.model)==null?void 0:i.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),n})}authResponse(t){const r=this.decode((t==null?void 0:t.record)||{});return this.client.authStore.save(t==null?void 0:t.token,r),Object.assign({},t,{token:(t==null?void 0:t.token)||"",record:r})}async listAuthMethods(t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCollectionPath+"/auth-methods",t).then(r=>Object.assign({},r,{usernamePassword:!!(r!=null&&r.usernamePassword),emailPassword:!!(r!=null&&r.emailPassword),authProviders:Array.isArray(r==null?void 0:r.authProviders)?r==null?void 0:r.authProviders:[]}))}async authWithPassword(t,r,n,s){let o={method:"POST",body:{identity:t,password:r}};return o=Nr("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",o,n,s),this.client.send(this.baseCollectionPath+"/auth-with-password",o).then(i=>this.authResponse(i))}async authWithOAuth2Code(t,r,n,s,o,i,a){let l={method:"POST",body:{provider:t,code:r,codeVerifier:n,redirectUrl:s,createData:o}};return l=Nr("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",l,i,a),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",l).then(u=>this.authResponse(u))}authWithOAuth2(...t){if(t.length>1||typeof(t==null?void 0:t[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((t==null?void 0:t[0])||"",(t==null?void 0:t[1])||"",(t==null?void 0:t[2])||"",(t==null?void 0:t[3])||"",(t==null?void 0:t[4])||{},(t==null?void 0:t[5])||{},(t==null?void 0:t[6])||{});const r=(t==null?void 0:t[0])||{};let n=null;r.urlCallback||(n=o0(void 0));const s=new xS(this.client);function o(){n==null||n.close(),s.unsubscribe()}const i={},a=r.requestKey;return a&&(i.requestKey=a),this.listAuthMethods(i).then(l=>{var p;const u=l.authProviders.find(m=>m.name===r.provider);if(!u)throw new Ir(new Error(`Missing or invalid provider "${r.provider}".`));const d=this.client.buildUrl("/api/oauth2-redirect"),f=a?(p=this.client.cancelControllers)==null?void 0:p[a]:void 0;return f&&(f.signal.onabort=()=>{o()}),new Promise(async(m,x)=>{var g;try{await s.subscribe("@oauth2",async _=>{var E;const C=s.clientId;try{if(!_.state||C!==_.state)throw new Error("State parameters don't match.");if(_.error||!_.code)throw new Error("OAuth2 redirect error or missing code: "+_.error);const T=Object.assign({},r);delete T.provider,delete T.scopes,delete T.createData,delete T.urlCallback,(E=f==null?void 0:f.signal)!=null&&E.onabort&&(f.signal.onabort=null);const R=await this.authWithOAuth2Code(u.name,_.code,u.codeVerifier,d,r.createData,T);m(R)}catch(T){x(new Ir(T))}o()});const w={state:s.clientId};(g=r.scopes)!=null&&g.length&&(w.scope=r.scopes.join(" "));const v=this._replaceQueryParams(u.authUrl+d,w);await(r.urlCallback||function(_){n?n.location.href=_:n=o0(_)})(v)}catch(w){o(),x(new Ir(w))}})}).catch(l=>{throw o(),l})}async authRefresh(t,r){let n={method:"POST"};return n=Nr("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",n,t,r),this.client.send(this.baseCollectionPath+"/auth-refresh",n).then(s=>this.authResponse(s))}async requestPasswordReset(t,r,n){let s={method:"POST",body:{email:t}};return s=Nr("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(t,r,n,s,o){let i={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return i=Nr("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",i,s,o),this.client.send(this.baseCollectionPath+"/confirm-password-reset",i).then(()=>!0)}async requestVerification(t,r,n){let s={method:"POST",body:{email:t}};return s=Nr("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-verification",s).then(()=>!0)}async confirmVerification(t,r,n){let s={method:"POST",body:{token:t}};return s=Nr("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then(()=>{const o=Vi(t),i=this.client.authStore.model;return i&&!i.verified&&i.id===o.id&&i.collectionId===o.collectionId&&(i.verified=!0,this.client.authStore.save(this.client.authStore.token,i)),!0})}async requestEmailChange(t,r,n){let s={method:"POST",body:{newEmail:t}};return s=Nr("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-email-change",s).then(()=>!0)}async confirmEmailChange(t,r,n,s){let o={method:"POST",body:{token:t,password:r}};return o=Nr("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",o,n,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",o).then(()=>{const i=Vi(t),a=this.client.authStore.model;return a&&a.id===i.id&&a.collectionId===i.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(t,r){return r=Object.assign({method:"GET"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths",r)}async unlinkExternalAuth(t,r,n){return n=Object.assign({method:"DELETE"},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths/"+encodeURIComponent(r),n).then(()=>!0)}_replaceQueryParams(t,r={}){let n=t,s="";t.indexOf("?")>=0&&(n=t.substring(0,t.indexOf("?")),s=t.substring(t.indexOf("?")+1));const o={},i=s.split("&");for(const a of i){if(a=="")continue;const l=a.split("=");o[decodeURIComponent(l[0].replace(/\+/g," "))]=decodeURIComponent((l[1]||"").replace(/\+/g," "))}for(let a in r)r.hasOwnProperty(a)&&(r[a]==null?delete o[a]:o[a]=r[a]);s="";for(let a in o)o.hasOwnProperty(a)&&(s!=""&&(s+="&"),s+=encodeURIComponent(a.replace(/%20/g,"+"))+"="+encodeURIComponent(o[a].replace(/%20/g,"+")));return s!=""?n+"?"+s:n}}function o0(e){if(typeof window>"u"||!(window!=null&&window.open))throw new Ir(new Error("Not in a browser context - please pass a custom urlCallback function."));let t=1024,r=768,n=window.innerWidth,s=window.innerHeight;t=t>n?n:t,r=r>s?s:r;let o=n/2-t/2,i=s/2-r/2;return window.open(e,"popup_window","width="+t+",height="+r+",top="+i+",left="+o+",resizable,menubar=no")}class zM extends tv{get baseCrudPath(){return"/api/collections"}async import(t,r=!1,n){return n=Object.assign({method:"PUT",body:{collections:t,deleteMissing:r}},n),this.client.send(this.baseCrudPath+"/import",n).then(()=>!0)}}class UM extends ei{async getList(t=1,r=30,n){return(n=Object.assign({method:"GET"},n)).query=Object.assign({page:t,perPage:r},n.query),this.client.send("/api/logs",n)}async getOne(t,r){if(!t)throw new Ir({url:this.client.buildUrl("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return r=Object.assign({method:"GET"},r),this.client.send("/api/logs/"+encodeURIComponent(t),r)}async getStats(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/stats",t)}}class VM extends ei{async check(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/health",t)}}class WM extends ei{getUrl(t,r,n={}){if(!r||!(t!=null&&t.id)||!(t!=null&&t.collectionId)&&!(t!=null&&t.collectionName))return"";const s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(t.collectionId||t.collectionName)),s.push(encodeURIComponent(t.id)),s.push(encodeURIComponent(r));let o=this.client.buildUrl(s.join("/"));if(Object.keys(n).length){n.download===!1&&delete n.download;const i=new URLSearchParams(n);o+=(o.includes("?")?"&":"?")+i}return o}async getToken(t){return t=Object.assign({method:"POST"},t),this.client.send("/api/files/token",t).then(r=>(r==null?void 0:r.token)||"")}}class $M extends ei{async getFullList(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/backups",t)}async create(t,r){return r=Object.assign({method:"POST",body:{name:t}},r),this.client.send("/api/backups",r).then(()=>!0)}async upload(t,r){return r=Object.assign({method:"POST",body:t},r),this.client.send("/api/backups/upload",r).then(()=>!0)}async delete(t,r){return r=Object.assign({method:"DELETE"},r),this.client.send(`/api/backups/${encodeURIComponent(t)}`,r).then(()=>!0)}async restore(t,r){return r=Object.assign({method:"POST"},r),this.client.send(`/api/backups/${encodeURIComponent(t)}/restore`,r).then(()=>!0)}getDownloadUrl(t,r){return this.client.buildUrl(`/api/backups/${encodeURIComponent(r)}?token=${encodeURIComponent(t)}`)}}class BM{constructor(t="/",r,n="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=t,this.lang=n,this.authStore=r||new AM,this.admins=new IM(this),this.collections=new zM(this),this.files=new WM(this),this.logs=new UM(this),this.settings=new MM(this),this.realtime=new xS(this),this.health=new VM(this),this.backups=new $M(this)}collection(t){return this.recordServices[t]||(this.recordServices[t]=new FM(this,t)),this.recordServices[t]}autoCancellation(t){return this.enableAutoCancellation=!!t,this}cancelRequest(t){return this.cancelControllers[t]&&(this.cancelControllers[t].abort(),delete this.cancelControllers[t]),this}cancelAllRequests(){for(let t in this.cancelControllers)this.cancelControllers[t].abort();return this.cancelControllers={},this}filter(t,r){if(!r)return t;for(let n in r){let s=r[n];switch(typeof s){case"boolean":case"number":s=""+s;break;case"string":s="'"+s.replace(/'/g,"\\'")+"'";break;default:s=s===null?"null":s instanceof Date?"'"+s.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(s).replace(/'/g,"\\'")+"'"}t=t.replaceAll("{:"+n+"}",s)}return t}getFileUrl(t,r,n={}){return this.files.getUrl(t,r,n)}buildUrl(t){var n;let r=this.baseUrl;return typeof window>"u"||!window.location||r.startsWith("https://")||r.startsWith("http://")||(r=(n=window.location.origin)!=null&&n.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(r+=window.location.pathname||"/",r+=r.endsWith("/")?"":"/"),r+=this.baseUrl),t&&(r+=r.endsWith("/")?"":"/",r+=t.startsWith("/")?t.substring(1):t),r}async send(t,r){r=this.initSendOptions(t,r);let n=this.buildUrl(t);if(this.beforeSend){const s=Object.assign({},await this.beforeSend(n,r));s.url!==void 0||s.options!==void 0?(n=s.url||n,r=s.options||r):Object.keys(s).length&&(r=s,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(r.query!==void 0){const s=this.serializeQueryParams(r.query);s&&(n+=(n.includes("?")?"&":"?")+s),delete r.query}return this.getHeader(r.headers,"Content-Type")=="application/json"&&r.body&&typeof r.body!="string"&&(r.body=JSON.stringify(r.body)),(r.fetch||fetch)(n,r).then(async s=>{let o={};try{o=await s.json()}catch{}if(this.afterSend&&(o=await this.afterSend(s,o)),s.status>=400)throw new Ir({url:s.url,status:s.status,data:o});return o}).catch(s=>{throw new Ir(s)})}initSendOptions(t,r){if((r=Object.assign({method:"GET"},r)).body=this.convertToFormDataIfNeeded(r.body),yS(r),r.query=Object.assign({},r.params,r.query),r.requestKey===void 0&&(r.$autoCancel===!1||r.query.$autoCancel===!1?r.requestKey=null:(r.$cancelKey||r.query.$cancelKey)&&(r.requestKey=r.$cancelKey||r.query.$cancelKey)),delete r.$autoCancel,delete r.query.$autoCancel,delete r.$cancelKey,delete r.query.$cancelKey,this.getHeader(r.headers,"Content-Type")!==null||this.isFormData(r.body)||(r.headers=Object.assign({},r.headers,{"Content-Type":"application/json"})),this.getHeader(r.headers,"Accept-Language")===null&&(r.headers=Object.assign({},r.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(r.headers,"Authorization")===null&&(r.headers=Object.assign({},r.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&r.requestKey!==null){const n=r.requestKey||(r.method||"GET")+t;delete r.requestKey,this.cancelRequest(n);const s=new AbortController;this.cancelControllers[n]=s,r.signal=s.signal}return r}convertToFormDataIfNeeded(t){if(typeof FormData>"u"||t===void 0||typeof t!="object"||t===null||this.isFormData(t)||!this.hasBlobField(t))return t;const r=new FormData;for(const n in t){const s=t[n];if(typeof s!="object"||this.hasBlobField({data:s})){const o=Array.isArray(s)?s:[s];for(let i of o)r.append(n,i)}else{let o={};o[n]=s,r.append("@jsonPayload",JSON.stringify(o))}}return r}hasBlobField(t){for(const r in t){const n=Array.isArray(t[r])?t[r]:[t[r]];for(const s of n)if(typeof Blob<"u"&&s instanceof Blob||typeof File<"u"&&s instanceof File)return!0}return!1}getHeader(t,r){t=t||{},r=r.toLowerCase();for(let n in t)if(n.toLowerCase()==r)return t[n];return null}isFormData(t){return t&&(t.constructor.name==="FormData"||typeof FormData<"u"&&t instanceof FormData)}serializeQueryParams(t){const r=[];for(const n in t){if(t[n]===null)continue;const s=t[n],o=encodeURIComponent(n);if(Array.isArray(s))for(const i of s)r.push(o+"="+encodeURIComponent(i));else s instanceof Date?r.push(o+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?r.push(o+"="+encodeURIComponent(JSON.stringify(s))):r.push(o+"="+encodeURIComponent(s))}return r.join("&")}}var HM={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const YM=HM.VITE_API_DOMAIN;console.log(YM);let ru;const jt=()=>ru||(ru=new BM("/"),ru);//! moment.js //! version : 2.30.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT @@ -264,7 +264,7 @@ var wS;function ge(){return wS.apply(null,arguments)}function ZM(e){wS=e}functio [`+o+"] ";for(i in arguments[0])at(arguments[0],i)&&(s+=i+": "+arguments[0][i]+", ");s=s.slice(0,-2)}else s=arguments[o];n.push(s)}bS(e+` Arguments: `+Array.prototype.slice.call(n).join("")+` `+new Error().stack),r=!1}return t.apply(this,arguments)},t)}var a0={};function SS(e,t){ge.deprecationHandler!=null&&ge.deprecationHandler(e,t),a0[e]||(bS(t),a0[e]=!0)}ge.suppressDeprecationWarnings=!1;ge.deprecationHandler=null;function $n(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function GM(e){var t,r;for(r in e)at(e,r)&&(t=e[r],$n(t)?this[r]=t:this["_"+r]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Bp(e,t){var r=Hs({},e),n;for(n in t)at(t,n)&&(Mo(e[n])&&Mo(t[n])?(r[n]={},Hs(r[n],e[n]),Hs(r[n],t[n])):t[n]!=null?r[n]=t[n]:delete r[n]);for(n in e)at(e,n)&&!at(t,n)&&Mo(e[n])&&(r[n]=Hs({},r[n]));return r}function ov(e){e!=null&&this.set(e)}var Hp;Object.keys?Hp=Object.keys:Hp=function(e){var t,r=[];for(t in e)at(e,t)&&r.push(t);return r};var qM={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function XM(e,t,r){var n=this._calendar[e]||this._calendar.sameElse;return $n(n)?n.call(t,r):n}function Fn(e,t,r){var n=""+Math.abs(e),s=t-n.length,o=e>=0;return(o?r?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+n}var iv=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,nu=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Nh={},Wi={};function je(e,t,r,n){var s=n;typeof n=="string"&&(s=function(){return this[n]()}),e&&(Wi[e]=s),t&&(Wi[t[0]]=function(){return Fn(s.apply(this,arguments),t[1],t[2])}),r&&(Wi[r]=function(){return this.localeData().ordinal(s.apply(this,arguments),e)})}function QM(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function JM(e){var t=e.match(iv),r,n;for(r=0,n=t.length;r=0&&nu.test(e);)e=e.replace(nu,n),nu.lastIndex=0,r-=1;return e}var eI={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function tI(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(iv).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[e])}var rI="Invalid date";function nI(){return this._invalidDate}var sI="%d",oI=/\d{1,2}/;function iI(e){return this._ordinal.replace("%d",e)}var aI={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function lI(e,t,r,n){var s=this._relativeTime[r];return $n(s)?s(e,t,r,n):s.replace(/%d/i,e)}function cI(e,t){var r=this._relativeTime[e>0?"future":"past"];return $n(r)?r(t):r.replace(/%s/i,t)}var l0={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function en(e){return typeof e=="string"?l0[e]||l0[e.toLowerCase()]:void 0}function av(e){var t={},r,n;for(n in e)at(e,n)&&(r=en(n),r&&(t[r]=e[n]));return t}var uI={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function dI(e){var t=[],r;for(r in e)at(e,r)&&t.push({unit:r,priority:uI[r]});return t.sort(function(n,s){return n.priority-s.priority}),t}var CS=/\d/,Vr=/\d\d/,ES=/\d{3}/,lv=/\d{4}/,mf=/[+-]?\d{6}/,kt=/\d\d?/,TS=/\d\d\d\d?/,NS=/\d\d\d\d\d\d?/,gf=/\d{1,3}/,cv=/\d{1,4}/,vf=/[+-]?\d{1,6}/,va=/\d+/,yf=/[+-]?\d+/,fI=/Z|[+-]\d\d:?\d\d/gi,xf=/Z|[+-]\d\d(?::?\d\d)?/gi,hI=/[+-]?\d+(\.\d{1,3})?/,vc=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ya=/^[1-9]\d?/,uv=/^([1-9]\d|\d)/,hd;hd={};function we(e,t,r){hd[e]=$n(t)?t:function(n,s){return n&&r?r:t}}function pI(e,t){return at(hd,e)?hd[e](t._strict,t._locale):new RegExp(mI(e))}function mI(e){return cs(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,r,n,s,o){return r||n||s||o}))}function cs(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Yr(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function tt(e){var t=+e,r=0;return t!==0&&isFinite(t)&&(r=Yr(t)),r}var Yp={};function mt(e,t){var r,n=t,s;for(typeof e=="string"&&(e=[e]),ys(t)&&(n=function(o,i){i[t]=tt(o)}),s=e.length,r=0;r68?1900:2e3)};var jS=xa("FullYear",!0);function xI(){return wf(this.year())}function xa(e,t){return function(r){return r!=null?(RS(this,e,r),ge.updateOffset(this,t),this):Ll(this,e)}}function Ll(e,t){if(!e.isValid())return NaN;var r=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function RS(e,t,r){var n,s,o,i,a;if(!(!e.isValid()||isNaN(r))){switch(n=e._d,s=e._isUTC,t){case"Milliseconds":return void(s?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(s?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(s?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(s?n.setUTCHours(r):n.setHours(r));case"Date":return void(s?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}o=r,i=e.month(),a=e.date(),a=a===29&&i===1&&!wf(o)?28:a,s?n.setUTCFullYear(o,i,a):n.setFullYear(o,i,a)}}function wI(e){return e=en(e),$n(this[e])?this[e]():this}function _I(e,t){if(typeof e=="object"){e=av(e);var r=dI(e),n,s=r.length;for(n=0;n=0?(a=new Date(e+400,t,r,n,s,o,i),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,r,n,s,o,i),a}function Fl(e){var t,r;return e<100&&e>=0?(r=Array.prototype.slice.call(arguments),r[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function pd(e,t,r){var n=7+t-r,s=(7+Fl(e,0,n).getUTCDay()-t)%7;return-s+n-1}function IS(e,t,r,n,s){var o=(7+r-n)%7,i=pd(e,n,s),a=1+7*(t-1)+o+i,l,u;return a<=0?(l=e-1,u=sl(l)+a):a>sl(e)?(l=e+1,u=a-sl(e)):(l=e,u=a),{year:l,dayOfYear:u}}function zl(e,t,r){var n=pd(e.year(),t,r),s=Math.floor((e.dayOfYear()-n-1)/7)+1,o,i;return s<1?(i=e.year()-1,o=s+us(i,t,r)):s>us(e.year(),t,r)?(o=s-us(e.year(),t,r),i=e.year()+1):(i=e.year(),o=s),{week:o,year:i}}function us(e,t,r){var n=pd(e,t,r),s=pd(e+1,t,r);return(sl(e)-n+s)/7}je("w",["ww",2],"wo","week");je("W",["WW",2],"Wo","isoWeek");we("w",kt,ya);we("ww",kt,Vr);we("W",kt,ya);we("WW",kt,Vr);yc(["w","ww","W","WW"],function(e,t,r,n){t[n.substr(0,1)]=tt(e)});function AI(e){return zl(e,this._week.dow,this._week.doy).week}var MI={dow:0,doy:6};function II(){return this._week.dow}function LI(){return this._week.doy}function FI(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function zI(e){var t=zl(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}je("d",0,"do","day");je("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});je("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});je("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});je("e",0,0,"weekday");je("E",0,0,"isoWeekday");we("d",kt);we("e",kt);we("E",kt);we("dd",function(e,t){return t.weekdaysMinRegex(e)});we("ddd",function(e,t){return t.weekdaysShortRegex(e)});we("dddd",function(e,t){return t.weekdaysRegex(e)});yc(["dd","ddd","dddd"],function(e,t,r,n){var s=r._locale.weekdaysParse(e,n,r._strict);s!=null?t.d=s:Ze(r).invalidWeekday=e});yc(["d","e","E"],function(e,t,r,n){t[n]=tt(e)});function UI(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function VI(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function fv(e,t){return e.slice(t,7).concat(e.slice(0,t))}var WI="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),LS="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),$I="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),BI=vc,HI=vc,YI=vc;function ZI(e,t){var r=vn(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?fv(r,this._week.dow):e?r[e.day()]:r}function KI(e){return e===!0?fv(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function GI(e){return e===!0?fv(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function qI(e,t,r){var n,s,o,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)o=Wn([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(o,"").toLocaleLowerCase();return r?t==="dddd"?(s=zt.call(this._weekdaysParse,i),s!==-1?s:null):t==="ddd"?(s=zt.call(this._shortWeekdaysParse,i),s!==-1?s:null):(s=zt.call(this._minWeekdaysParse,i),s!==-1?s:null):t==="dddd"?(s=zt.call(this._weekdaysParse,i),s!==-1||(s=zt.call(this._shortWeekdaysParse,i),s!==-1)?s:(s=zt.call(this._minWeekdaysParse,i),s!==-1?s:null)):t==="ddd"?(s=zt.call(this._shortWeekdaysParse,i),s!==-1||(s=zt.call(this._weekdaysParse,i),s!==-1)?s:(s=zt.call(this._minWeekdaysParse,i),s!==-1?s:null)):(s=zt.call(this._minWeekdaysParse,i),s!==-1||(s=zt.call(this._weekdaysParse,i),s!==-1)?s:(s=zt.call(this._shortWeekdaysParse,i),s!==-1?s:null))}function XI(e,t,r){var n,s,o;if(this._weekdaysParseExact)return qI.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(s=Wn([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(o="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[n]=new RegExp(o.replace(".",""),"i")),r&&t==="dddd"&&this._fullWeekdaysParse[n].test(e))return n;if(r&&t==="ddd"&&this._shortWeekdaysParse[n].test(e))return n;if(r&&t==="dd"&&this._minWeekdaysParse[n].test(e))return n;if(!r&&this._weekdaysParse[n].test(e))return n}}function QI(e){if(!this.isValid())return e!=null?this:NaN;var t=Ll(this,"Day");return e!=null?(e=UI(e,this.localeData()),this.add(e-t,"d")):t}function JI(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function eL(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=VI(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function tL(e){return this._weekdaysParseExact?(at(this,"_weekdaysRegex")||hv.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(at(this,"_weekdaysRegex")||(this._weekdaysRegex=BI),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function rL(e){return this._weekdaysParseExact?(at(this,"_weekdaysRegex")||hv.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(at(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=HI),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function nL(e){return this._weekdaysParseExact?(at(this,"_weekdaysRegex")||hv.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(at(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=YI),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function hv(){function e(d,f){return f.length-d.length}var t=[],r=[],n=[],s=[],o,i,a,l,u;for(o=0;o<7;o++)i=Wn([2e3,1]).day(o),a=cs(this.weekdaysMin(i,"")),l=cs(this.weekdaysShort(i,"")),u=cs(this.weekdays(i,"")),t.push(a),r.push(l),n.push(u),s.push(a),s.push(l),s.push(u);t.sort(e),r.sort(e),n.sort(e),s.sort(e),this._weekdaysRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function pv(){return this.hours()%12||12}function sL(){return this.hours()||24}je("H",["HH",2],0,"hour");je("h",["hh",2],0,pv);je("k",["kk",2],0,sL);je("hmm",0,0,function(){return""+pv.apply(this)+Fn(this.minutes(),2)});je("hmmss",0,0,function(){return""+pv.apply(this)+Fn(this.minutes(),2)+Fn(this.seconds(),2)});je("Hmm",0,0,function(){return""+this.hours()+Fn(this.minutes(),2)});je("Hmmss",0,0,function(){return""+this.hours()+Fn(this.minutes(),2)+Fn(this.seconds(),2)});function FS(e,t){je(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}FS("a",!0);FS("A",!1);function zS(e,t){return t._meridiemParse}we("a",zS);we("A",zS);we("H",kt,uv);we("h",kt,ya);we("k",kt,ya);we("HH",kt,Vr);we("hh",kt,Vr);we("kk",kt,Vr);we("hmm",TS);we("hmmss",NS);we("Hmm",TS);we("Hmmss",NS);mt(["H","HH"],Gt);mt(["k","kk"],function(e,t,r){var n=tt(e);t[Gt]=n===24?0:n});mt(["a","A"],function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e});mt(["h","hh"],function(e,t,r){t[Gt]=tt(e),Ze(r).bigHour=!0});mt("hmm",function(e,t,r){var n=e.length-2;t[Gt]=tt(e.substr(0,n)),t[cn]=tt(e.substr(n)),Ze(r).bigHour=!0});mt("hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Gt]=tt(e.substr(0,n)),t[cn]=tt(e.substr(n,2)),t[is]=tt(e.substr(s)),Ze(r).bigHour=!0});mt("Hmm",function(e,t,r){var n=e.length-2;t[Gt]=tt(e.substr(0,n)),t[cn]=tt(e.substr(n))});mt("Hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Gt]=tt(e.substr(0,n)),t[cn]=tt(e.substr(n,2)),t[is]=tt(e.substr(s))});function oL(e){return(e+"").toLowerCase().charAt(0)==="p"}var iL=/[ap]\.?m?\.?/i,aL=xa("Hours",!0);function lL(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"}var US={calendar:qM,longDateFormat:eI,invalidDate:rI,ordinal:sI,dayOfMonthOrdinalParse:oI,relativeTime:aI,months:SI,monthsShort:PS,week:MI,weekdays:WI,weekdaysMin:$I,weekdaysShort:LS,meridiemParse:iL},Tt={},La={},Ul;function cL(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r0;){if(s=_f(o.slice(0,r).join("-")),s)return s;if(n&&n.length>=r&&cL(o,n)>=r-1)break;r--}t++}return Ul}function dL(e){return!!(e&&e.match("^[^/\\\\]*$"))}function _f(e){var t=null,r;if(Tt[e]===void 0&&typeof Ou<"u"&&Ou&&Ou.exports&&dL(e))try{t=Ul._abbr,r=require,r("./locale/"+e),ro(t)}catch{Tt[e]=null}return Tt[e]}function ro(e,t){var r;return e&&(xr(t)?r=Cs(e):r=mv(e,t),r?Ul=r:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Ul._abbr}function mv(e,t){if(t!==null){var r,n=US;if(t.abbr=e,Tt[e]!=null)SS("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Tt[e]._config;else if(t.parentLocale!=null)if(Tt[t.parentLocale]!=null)n=Tt[t.parentLocale]._config;else if(r=_f(t.parentLocale),r!=null)n=r._config;else return La[t.parentLocale]||(La[t.parentLocale]=[]),La[t.parentLocale].push({name:e,config:t}),null;return Tt[e]=new ov(Bp(n,t)),La[e]&&La[e].forEach(function(s){mv(s.name,s.config)}),ro(e),Tt[e]}else return delete Tt[e],null}function fL(e,t){if(t!=null){var r,n,s=US;Tt[e]!=null&&Tt[e].parentLocale!=null?Tt[e].set(Bp(Tt[e]._config,t)):(n=_f(e),n!=null&&(s=n._config),t=Bp(s,t),n==null&&(t.abbr=e),r=new ov(t),r.parentLocale=Tt[e],Tt[e]=r),ro(e)}else Tt[e]!=null&&(Tt[e].parentLocale!=null?(Tt[e]=Tt[e].parentLocale,e===ro()&&ro(e)):Tt[e]!=null&&delete Tt[e]);return Tt[e]}function Cs(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Ul;if(!vn(e)){if(t=_f(e),t)return t;e=[e]}return uL(e)}function hL(){return Hp(Tt)}function gv(e){var t,r=e._a;return r&&Ze(e).overflow===-2&&(t=r[os]<0||r[os]>11?os:r[jn]<1||r[jn]>dv(r[ar],r[os])?jn:r[Gt]<0||r[Gt]>24||r[Gt]===24&&(r[cn]!==0||r[is]!==0||r[Po]!==0)?Gt:r[cn]<0||r[cn]>59?cn:r[is]<0||r[is]>59?is:r[Po]<0||r[Po]>999?Po:-1,Ze(e)._overflowDayOfYear&&(tjn)&&(t=jn),Ze(e)._overflowWeeks&&t===-1&&(t=vI),Ze(e)._overflowWeekday&&t===-1&&(t=yI),Ze(e).overflow=t),e}var pL=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,mL=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,gL=/Z|[+-]\d\d(?::?\d\d)?/,su=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],jh=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],vL=/^\/?Date\((-?\d+)/i,yL=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,xL={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function VS(e){var t,r,n=e._i,s=pL.exec(n)||mL.exec(n),o,i,a,l,u=su.length,d=jh.length;if(s){for(Ze(e).iso=!0,t=0,r=u;tsl(i)||e._dayOfYear===0)&&(Ze(e)._overflowDayOfYear=!0),r=Fl(i,0,e._dayOfYear),e._a[os]=r.getUTCMonth(),e._a[jn]=r.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=n[t]=s[t];for(;t<7;t++)e._a[t]=n[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Gt]===24&&e._a[cn]===0&&e._a[is]===0&&e._a[Po]===0&&(e._nextDay=!0,e._a[Gt]=0),e._d=(e._useUTC?Fl:OI).apply(null,n),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Gt]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==o&&(Ze(e).weekdayMismatch=!0)}}function TL(e){var t,r,n,s,o,i,a,l,u;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(o=1,i=4,r=pi(t.GG,e._a[ar],zl(bt(),1,4).year),n=pi(t.W,1),s=pi(t.E,1),(s<1||s>7)&&(l=!0)):(o=e._locale._week.dow,i=e._locale._week.doy,u=zl(bt(),o,i),r=pi(t.gg,e._a[ar],u.year),n=pi(t.w,u.week),t.d!=null?(s=t.d,(s<0||s>6)&&(l=!0)):t.e!=null?(s=t.e+o,(t.e<0||t.e>6)&&(l=!0)):s=o),n<1||n>us(r,o,i)?Ze(e)._overflowWeeks=!0:l!=null?Ze(e)._overflowWeekday=!0:(a=IS(r,n,s,o,i),e._a[ar]=a.year,e._dayOfYear=a.dayOfYear)}ge.ISO_8601=function(){};ge.RFC_2822=function(){};function yv(e){if(e._f===ge.ISO_8601){VS(e);return}if(e._f===ge.RFC_2822){WS(e);return}e._a=[],Ze(e).empty=!0;var t=""+e._i,r,n,s,o,i,a=t.length,l=0,u,d;for(s=kS(e._f,e._locale).match(iv)||[],d=s.length,r=0;r0&&Ze(e).unusedInput.push(i),t=t.slice(t.indexOf(n)+n.length),l+=n.length),Wi[o]?(n?Ze(e).empty=!1:Ze(e).unusedTokens.push(o),gI(o,n,e)):e._strict&&!n&&Ze(e).unusedTokens.push(o);Ze(e).charsLeftOver=a-l,t.length>0&&Ze(e).unusedInput.push(t),e._a[Gt]<=12&&Ze(e).bigHour===!0&&e._a[Gt]>0&&(Ze(e).bigHour=void 0),Ze(e).parsedDateParts=e._a.slice(0),Ze(e).meridiem=e._meridiem,e._a[Gt]=NL(e._locale,e._a[Gt],e._meridiem),u=Ze(e).era,u!==null&&(e._a[ar]=e._locale.erasConvertYear(u,e._a[ar])),vv(e),gv(e)}function NL(e,t,r){var n;return r==null?t:e.meridiemHour!=null?e.meridiemHour(t,r):(e.isPM!=null&&(n=e.isPM(r),n&&t<12&&(t+=12),!n&&t===12&&(t=0)),t)}function jL(e){var t,r,n,s,o,i,a=!1,l=e._f.length;if(l===0){Ze(e).invalidFormat=!0,e._d=new Date(NaN);return}for(s=0;sthis?this:e:pf()});function HS(e,t){var r,n;if(t.length===1&&vn(t[0])&&(t=t[0]),!t.length)return bt();for(r=t[0],n=1;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function qL(){if(!xr(this._isDSTShifted))return this._isDSTShifted;var e={},t;return sv(e,this),e=$S(e),e._a?(t=e._isUTC?Wn(e._a):bt(e._a),this._isDSTShifted=this.isValid()&&VL(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function XL(){return this.isValid()?!this._isUTC:!1}function QL(){return this.isValid()?this._isUTC:!1}function ZS(){return this.isValid()?this._isUTC&&this._offset===0:!1}var JL=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,e4=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function bn(e,t){var r=e,n=null,s,o,i;return Cu(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:ys(e)||!isNaN(+e)?(r={},t?r[t]=+e:r.milliseconds=+e):(n=JL.exec(e))?(s=n[1]==="-"?-1:1,r={y:0,d:tt(n[jn])*s,h:tt(n[Gt])*s,m:tt(n[cn])*s,s:tt(n[is])*s,ms:tt(Zp(n[Po]*1e3))*s}):(n=e4.exec(e))?(s=n[1]==="-"?-1:1,r={y:_o(n[2],s),M:_o(n[3],s),w:_o(n[4],s),d:_o(n[5],s),h:_o(n[6],s),m:_o(n[7],s),s:_o(n[8],s)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(i=t4(bt(r.from),bt(r.to)),r={},r.ms=i.milliseconds,r.M=i.months),o=new bf(r),Cu(e)&&at(e,"_locale")&&(o._locale=e._locale),Cu(e)&&at(e,"_isValid")&&(o._isValid=e._isValid),o}bn.fn=bf.prototype;bn.invalid=UL;function _o(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function u0(e,t){var r={};return r.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=+t-+e.clone().add(r.months,"M"),r}function t4(e,t){var r;return e.isValid()&&t.isValid()?(t=wv(t,e),e.isBefore(t)?r=u0(e,t):(r=u0(t,e),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function KS(e,t){return function(r,n){var s,o;return n!==null&&!isNaN(+n)&&(SS(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=r,r=n,n=o),s=bn(r,n),GS(this,s,e),this}}function GS(e,t,r,n){var s=t._milliseconds,o=Zp(t._days),i=Zp(t._months);e.isValid()&&(n=n??!0,i&&OS(e,Ll(e,"Month")+i*r),o&&RS(e,"Date",Ll(e,"Date")+o*r),s&&e._d.setTime(e._d.valueOf()+s*r),n&&ge.updateOffset(e,o||i))}var r4=KS(1,"add"),n4=KS(-1,"subtract");function qS(e){return typeof e=="string"||e instanceof String}function s4(e){return yn(e)||mc(e)||qS(e)||ys(e)||i4(e)||o4(e)||e===null||e===void 0}function o4(e){var t=Mo(e)&&!rv(e),r=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],s,o,i=n.length;for(s=0;sr.valueOf():r.valueOf()9999?ku(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):$n(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",ku(r,"Z")):ku(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function w4(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",r,n,s,o;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),r="["+e+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",s="-MM-DD[T]HH:mm:ss.SSS",o=t+'[")]',this.format(r+n+s+o)}function _4(e){e||(e=this.isUtc()?ge.defaultFormatUtc:ge.defaultFormat);var t=ku(this,e);return this.localeData().postformat(t)}function b4(e,t){return this.isValid()&&(yn(e)&&e.isValid()||bt(e).isValid())?bn({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function S4(e){return this.from(bt(),e)}function k4(e,t){return this.isValid()&&(yn(e)&&e.isValid()||bt(e).isValid())?bn({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function C4(e){return this.to(bt(),e)}function XS(e){var t;return e===void 0?this._locale._abbr:(t=Cs(e),t!=null&&(this._locale=t),this)}var QS=Jr("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function JS(){return this._locale}var md=1e3,$i=60*md,gd=60*$i,ek=(365*400+97)*24*gd;function Bi(e,t){return(e%t+t)%t}function tk(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-ek:new Date(e,t,r).valueOf()}function rk(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-ek:Date.UTC(e,t,r)}function E4(e){var t,r;if(e=en(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?rk:tk,e){case"year":t=r(this.year(),0,1);break;case"quarter":t=r(this.year(),this.month()-this.month()%3,1);break;case"month":t=r(this.year(),this.month(),1);break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=r(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=Bi(t+(this._isUTC?0:this.utcOffset()*$i),gd);break;case"minute":t=this._d.valueOf(),t-=Bi(t,$i);break;case"second":t=this._d.valueOf(),t-=Bi(t,md);break}return this._d.setTime(t),ge.updateOffset(this,!0),this}function T4(e){var t,r;if(e=en(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?rk:tk,e){case"year":t=r(this.year()+1,0,1)-1;break;case"quarter":t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=r(this.year(),this.month()+1,1)-1;break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=gd-Bi(t+(this._isUTC?0:this.utcOffset()*$i),gd)-1;break;case"minute":t=this._d.valueOf(),t+=$i-Bi(t,$i)-1;break;case"second":t=this._d.valueOf(),t+=md-Bi(t,md)-1;break}return this._d.setTime(t),ge.updateOffset(this,!0),this}function N4(){return this._d.valueOf()-(this._offset||0)*6e4}function j4(){return Math.floor(this.valueOf()/1e3)}function R4(){return new Date(this.valueOf())}function P4(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function D4(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function O4(){return this.isValid()?this.toISOString():null}function A4(){return nv(this)}function M4(){return Hs({},Ze(this))}function I4(){return Ze(this).overflow}function L4(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}je("N",0,0,"eraAbbr");je("NN",0,0,"eraAbbr");je("NNN",0,0,"eraAbbr");je("NNNN",0,0,"eraName");je("NNNNN",0,0,"eraNarrow");je("y",["y",1],"yo","eraYear");je("y",["yy",2],0,"eraYear");je("y",["yyy",3],0,"eraYear");je("y",["yyyy",4],0,"eraYear");we("N",_v);we("NN",_v);we("NNN",_v);we("NNNN",K4);we("NNNNN",G4);mt(["N","NN","NNN","NNNN","NNNNN"],function(e,t,r,n){var s=r._locale.erasParse(e,n,r._strict);s?Ze(r).era=s:Ze(r).invalidEra=e});we("y",va);we("yy",va);we("yyy",va);we("yyyy",va);we("yo",q4);mt(["y","yy","yyy","yyyy"],ar);mt(["yo"],function(e,t,r,n){var s;r._locale._eraYearOrdinalRegex&&(s=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[ar]=r._locale.eraYearOrdinalParse(e,s):t[ar]=parseInt(e,10)});function F4(e,t){var r,n,s,o=this._eras||Cs("en")._eras;for(r=0,n=o.length;r=0)return o[n]}function U4(e,t){var r=e.since<=e.until?1:-1;return t===void 0?ge(e.since).year():ge(e.since).year()+(t-e.offset)*r}function V4(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;eo&&(t=o),nF.call(this,e,t,r,n,s))}function nF(e,t,r,n,s){var o=IS(e,t,r,n,s),i=Fl(o.year,0,o.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}je("Q",0,"Qo","quarter");we("Q",CS);mt("Q",function(e,t){t[os]=(tt(e)-1)*3});function sF(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}je("D",["DD",2],"Do","date");we("D",kt,ya);we("DD",kt,Vr);we("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});mt(["D","DD"],jn);mt("Do",function(e,t){t[jn]=tt(e.match(kt)[0])});var sk=xa("Date",!0);je("DDD",["DDDD",3],"DDDo","dayOfYear");we("DDD",gf);we("DDDD",ES);mt(["DDD","DDDD"],function(e,t,r){r._dayOfYear=tt(e)});function oF(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}je("m",["mm",2],0,"minute");we("m",kt,uv);we("mm",kt,Vr);mt(["m","mm"],cn);var iF=xa("Minutes",!1);je("s",["ss",2],0,"second");we("s",kt,uv);we("ss",kt,Vr);mt(["s","ss"],is);var aF=xa("Seconds",!1);je("S",0,0,function(){return~~(this.millisecond()/100)});je(0,["SS",2],0,function(){return~~(this.millisecond()/10)});je(0,["SSS",3],0,"millisecond");je(0,["SSSS",4],0,function(){return this.millisecond()*10});je(0,["SSSSS",5],0,function(){return this.millisecond()*100});je(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});je(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});je(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});je(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});we("S",gf,CS);we("SS",gf,Vr);we("SSS",gf,ES);var Ys,ok;for(Ys="SSSS";Ys.length<=9;Ys+="S")we(Ys,va);function lF(e,t){t[Po]=tt(("0."+e)*1e3)}for(Ys="S";Ys.length<=9;Ys+="S")mt(Ys,lF);ok=xa("Milliseconds",!1);je("z",0,0,"zoneAbbr");je("zz",0,0,"zoneName");function cF(){return this._isUTC?"UTC":""}function uF(){return this._isUTC?"Coordinated Universal Time":""}var ae=gc.prototype;ae.add=r4;ae.calendar=c4;ae.clone=u4;ae.diff=v4;ae.endOf=T4;ae.format=_4;ae.from=b4;ae.fromNow=S4;ae.to=k4;ae.toNow=C4;ae.get=wI;ae.invalidAt=I4;ae.isAfter=d4;ae.isBefore=f4;ae.isBetween=h4;ae.isSame=p4;ae.isSameOrAfter=m4;ae.isSameOrBefore=g4;ae.isValid=A4;ae.lang=QS;ae.locale=XS;ae.localeData=JS;ae.max=AL;ae.min=OL;ae.parsingFlags=M4;ae.set=_I;ae.startOf=E4;ae.subtract=n4;ae.toArray=P4;ae.toObject=D4;ae.toDate=R4;ae.toISOString=x4;ae.inspect=w4;typeof Symbol<"u"&&Symbol.for!=null&&(ae[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});ae.toJSON=O4;ae.toString=y4;ae.unix=j4;ae.valueOf=N4;ae.creationData=L4;ae.eraName=V4;ae.eraNarrow=W4;ae.eraAbbr=$4;ae.eraYear=B4;ae.year=jS;ae.isLeapYear=xI;ae.weekYear=X4;ae.isoWeekYear=Q4;ae.quarter=ae.quarters=sF;ae.month=AS;ae.daysInMonth=RI;ae.week=ae.weeks=FI;ae.isoWeek=ae.isoWeeks=zI;ae.weeksInYear=tF;ae.weeksInWeekYear=rF;ae.isoWeeksInYear=J4;ae.isoWeeksInISOWeekYear=eF;ae.date=sk;ae.day=ae.days=QI;ae.weekday=JI;ae.isoWeekday=eL;ae.dayOfYear=oF;ae.hour=ae.hours=aL;ae.minute=ae.minutes=iF;ae.second=ae.seconds=aF;ae.millisecond=ae.milliseconds=ok;ae.utcOffset=$L;ae.utc=HL;ae.local=YL;ae.parseZone=ZL;ae.hasAlignedHourOffset=KL;ae.isDST=GL;ae.isLocal=XL;ae.isUtcOffset=QL;ae.isUtc=ZS;ae.isUTC=ZS;ae.zoneAbbr=cF;ae.zoneName=uF;ae.dates=Jr("dates accessor is deprecated. Use date instead.",sk);ae.months=Jr("months accessor is deprecated. Use month instead",AS);ae.years=Jr("years accessor is deprecated. Use year instead",jS);ae.zone=Jr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",BL);ae.isDSTShifted=Jr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",qL);function dF(e){return bt(e*1e3)}function fF(){return bt.apply(null,arguments).parseZone()}function ik(e){return e}var lt=ov.prototype;lt.calendar=XM;lt.longDateFormat=tI;lt.invalidDate=nI;lt.ordinal=iI;lt.preparse=ik;lt.postformat=ik;lt.relativeTime=lI;lt.pastFuture=cI;lt.set=GM;lt.eras=F4;lt.erasParse=z4;lt.erasConvertYear=U4;lt.erasAbbrRegex=Y4;lt.erasNameRegex=H4;lt.erasNarrowRegex=Z4;lt.months=EI;lt.monthsShort=TI;lt.monthsParse=jI;lt.monthsRegex=DI;lt.monthsShortRegex=PI;lt.week=AI;lt.firstDayOfYear=LI;lt.firstDayOfWeek=II;lt.weekdays=ZI;lt.weekdaysMin=GI;lt.weekdaysShort=KI;lt.weekdaysParse=XI;lt.weekdaysRegex=tL;lt.weekdaysShortRegex=rL;lt.weekdaysMinRegex=nL;lt.isPM=oL;lt.meridiem=lL;function vd(e,t,r,n){var s=Cs(),o=Wn().set(n,t);return s[r](o,e)}function ak(e,t,r){if(ys(e)&&(t=e,e=void 0),e=e||"",t!=null)return vd(e,t,r,"month");var n,s=[];for(n=0;n<12;n++)s[n]=vd(e,n,r,"month");return s}function Sv(e,t,r,n){typeof e=="boolean"?(ys(t)&&(r=t,t=void 0),t=t||""):(t=e,r=t,e=!1,ys(t)&&(r=t,t=void 0),t=t||"");var s=Cs(),o=e?s._week.dow:0,i,a=[];if(r!=null)return vd(t,(r+o)%7,n,"day");for(i=0;i<7;i++)a[i]=vd(t,(i+o)%7,n,"day");return a}function hF(e,t){return ak(e,t,"months")}function pF(e,t){return ak(e,t,"monthsShort")}function mF(e,t,r){return Sv(e,t,r,"weekdays")}function gF(e,t,r){return Sv(e,t,r,"weekdaysShort")}function vF(e,t,r){return Sv(e,t,r,"weekdaysMin")}ro("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,r=tt(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+r}});ge.lang=Jr("moment.lang is deprecated. Use moment.locale instead.",ro);ge.langData=Jr("moment.langData is deprecated. Use moment.localeData instead.",Cs);var qn=Math.abs;function yF(){var e=this._data;return this._milliseconds=qn(this._milliseconds),this._days=qn(this._days),this._months=qn(this._months),e.milliseconds=qn(e.milliseconds),e.seconds=qn(e.seconds),e.minutes=qn(e.minutes),e.hours=qn(e.hours),e.months=qn(e.months),e.years=qn(e.years),this}function lk(e,t,r,n){var s=bn(t,r);return e._milliseconds+=n*s._milliseconds,e._days+=n*s._days,e._months+=n*s._months,e._bubble()}function xF(e,t){return lk(this,e,t,1)}function wF(e,t){return lk(this,e,t,-1)}function d0(e){return e<0?Math.floor(e):Math.ceil(e)}function _F(){var e=this._milliseconds,t=this._days,r=this._months,n=this._data,s,o,i,a,l;return e>=0&&t>=0&&r>=0||e<=0&&t<=0&&r<=0||(e+=d0(Gp(r)+t)*864e5,t=0,r=0),n.milliseconds=e%1e3,s=Yr(e/1e3),n.seconds=s%60,o=Yr(s/60),n.minutes=o%60,i=Yr(o/60),n.hours=i%24,t+=Yr(i/24),l=Yr(ck(t)),r+=l,t-=d0(Gp(l)),a=Yr(r/12),r%=12,n.days=t,n.months=r,n.years=a,this}function ck(e){return e*4800/146097}function Gp(e){return e*146097/4800}function bF(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if(e=en(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+n/864e5,r=this._months+ck(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(Gp(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return t*24+n/36e5;case"minute":return t*1440+n/6e4;case"second":return t*86400+n/1e3;case"millisecond":return Math.floor(t*864e5)+n;default:throw new Error("Unknown unit "+e)}}function Es(e){return function(){return this.as(e)}}var uk=Es("ms"),SF=Es("s"),kF=Es("m"),CF=Es("h"),EF=Es("d"),TF=Es("w"),NF=Es("M"),jF=Es("Q"),RF=Es("y"),PF=uk;function DF(){return bn(this)}function OF(e){return e=en(e),this.isValid()?this[e+"s"]():NaN}function ti(e){return function(){return this.isValid()?this._data[e]:NaN}}var AF=ti("milliseconds"),MF=ti("seconds"),IF=ti("minutes"),LF=ti("hours"),FF=ti("days"),zF=ti("months"),UF=ti("years");function VF(){return Yr(this.days()/7)}var es=Math.round,ji={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function WF(e,t,r,n,s){return s.relativeTime(t||1,!!r,e,n)}function $F(e,t,r,n){var s=bn(e).abs(),o=es(s.as("s")),i=es(s.as("m")),a=es(s.as("h")),l=es(s.as("d")),u=es(s.as("M")),d=es(s.as("w")),f=es(s.as("y")),p=o<=r.ss&&["s",o]||o0,p[4]=n,WF.apply(null,p)}function BF(e){return e===void 0?es:typeof e=="function"?(es=e,!0):!1}function HF(e,t){return ji[e]===void 0?!1:t===void 0?ji[e]:(ji[e]=t,e==="s"&&(ji.ss=t-1),!0)}function YF(e,t){if(!this.isValid())return this.localeData().invalidDate();var r=!1,n=ji,s,o;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(r=e),typeof t=="object"&&(n=Object.assign({},ji,t),t.s!=null&&t.ss==null&&(n.ss=t.s-1)),s=this.localeData(),o=$F(this,!r,n,s),r&&(o=s.pastFuture(+this,o)),s.postformat(o)}var Rh=Math.abs;function fi(e){return(e>0)-(e<0)||+e}function kf(){if(!this.isValid())return this.localeData().invalidDate();var e=Rh(this._milliseconds)/1e3,t=Rh(this._days),r=Rh(this._months),n,s,o,i,a=this.asSeconds(),l,u,d,f;return a?(n=Yr(e/60),s=Yr(n/60),e%=60,n%=60,o=Yr(r/12),r%=12,i=e?e.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",u=fi(this._months)!==fi(a)?"-":"",d=fi(this._days)!==fi(a)?"-":"",f=fi(this._milliseconds)!==fi(a)?"-":"",l+"P"+(o?u+o+"Y":"")+(r?u+r+"M":"")+(t?d+t+"D":"")+(s||n||e?"T":"")+(s?f+s+"H":"")+(n?f+n+"M":"")+(e?f+i+"S":"")):"P0D"}var st=bf.prototype;st.isValid=zL;st.abs=yF;st.add=xF;st.subtract=wF;st.as=bF;st.asMilliseconds=uk;st.asSeconds=SF;st.asMinutes=kF;st.asHours=CF;st.asDays=EF;st.asWeeks=TF;st.asMonths=NF;st.asQuarters=jF;st.asYears=RF;st.valueOf=PF;st._bubble=_F;st.clone=DF;st.get=OF;st.milliseconds=AF;st.seconds=MF;st.minutes=IF;st.hours=LF;st.days=FF;st.weeks=VF;st.months=zF;st.years=UF;st.humanize=YF;st.toISOString=kf;st.toString=kf;st.toJSON=kf;st.locale=XS;st.localeData=JS;st.toIsoString=Jr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",kf);st.lang=QS;je("X",0,0,"unix");je("x",0,0,"valueOf");we("x",yf);we("X",hI);mt("X",function(e,t,r){r._d=new Date(parseFloat(e)*1e3)});mt("x",function(e,t,r){r._d=new Date(tt(e))});//! moment.js -ge.version="2.30.1";ZM(bt);ge.fn=ae;ge.min=ML;ge.max=IL;ge.now=LL;ge.utc=Wn;ge.unix=dF;ge.months=hF;ge.isDate=mc;ge.locale=ro;ge.invalid=pf;ge.duration=bn;ge.isMoment=yn;ge.weekdays=mF;ge.parseZone=fF;ge.localeData=Cs;ge.isDuration=Cu;ge.monthsShort=pF;ge.weekdaysMin=vF;ge.defineLocale=mv;ge.updateLocale=fL;ge.locales=hL;ge.weekdaysShort=gF;ge.normalizeUnits=en;ge.relativeTimeRounding=BF;ge.relativeTimeThreshold=HF;ge.calendarFormat=l4;ge.prototype=ae;ge.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const ZF=async()=>await jt().collection("access").getFullList({sort:"-created",filter:"deleted = null"}),wa=async e=>e.id?await jt().collection("access").update(e.id,e):await jt().collection("access").create(e),KF=async e=>(e.deleted=ge.utc().format("YYYY-MM-DD HH:mm:ss"),await jt().collection("access").update(e.id,e)),GF=(e,t)=>{switch(t.type){case"SET_ACCESSES":return{...e,accesses:t.payload};case"ADD_ACCESS":return{...e,accesses:[t.payload,...e.accesses]};case"DELETE_ACCESS":return{...e,accesses:e.accesses.filter(r=>r.id!==t.payload)};case"UPDATE_ACCESS":return{...e,accesses:e.accesses.map(r=>r.id===t.payload.id?t.payload:r)};default:return e}},dk=y.createContext({}),yo=()=>y.useContext(dk),qF=({children:e})=>{const[t,r]=y.useReducer(GF,{accesses:[]});y.useEffect(()=>{(async()=>{const a=await ZF();r({type:"SET_ACCESSES",payload:a})})()},[]);const n=y.useCallback(i=>{r({type:"DELETE_ACCESS",payload:i})},[]),s=y.useCallback(i=>{r({type:"ADD_ACCESS",payload:i})},[]),o=y.useCallback(i=>{r({type:"UPDATE_ACCESS",payload:i})},[]);return c.jsx(dk.Provider,{value:{config:{accesses:t.accesses},deleteAccess:n,addAccess:s,updateAccess:o},children:e&&e})},XF={theme:"system",setTheme:()=>null},fk=y.createContext(XF);function QF({children:e,defaultTheme:t="system",storageKey:r="vite-ui-theme",...n}){const[s,o]=y.useState(()=>localStorage.getItem(r)||t);y.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),s==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(s)},[s]);const i={theme:s,setTheme:a=>{localStorage.setItem(r,a),o(a)}};return c.jsx(fk.Provider,{...n,value:i,children:e})}const JF=()=>{const e=y.useContext(fk);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function e3(){const{setTheme:e}=JF();return c.jsxs(Kb,{children:[c.jsx(Gb,{asChild:!0,children:c.jsxs(pt,{variant:"outline",size:"icon",children:[c.jsx(HR,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),c.jsx($R,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100 dark:text-white"}),c.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),c.jsxs($g,{align:"end",children:[c.jsx(Ui,{onClick:()=>e("light"),children:"浅色"}),c.jsx(Ui,{onClick:()=>e("dark"),children:"暗黑"}),c.jsx(Ui,{onClick:()=>e("system"),children:"系统"})]})]})}var t3="Separator",f0="horizontal",r3=["horizontal","vertical"],hk=y.forwardRef((e,t)=>{const{decorative:r,orientation:n=f0,...s}=e,o=n3(n)?n:f0,a=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return c.jsx(Me.div,{"data-orientation":o,...a,...s,ref:t})});hk.displayName=t3;function n3(e){return r3.includes(e)}var pk=hk;const Yt=y.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>c.jsx(pk,{ref:s,decorative:r,orientation:t,className:me("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Yt.displayName=pk.displayName;function s3(){const e=wn(),t=Vn();if(!jt().authStore.isValid||!jt().authStore.isAdmin)return c.jsx(o1,{to:"/login"});const r=t.pathname,n=i=>(console.log(r),i==r?"bg-muted text-primary":"text-muted-foreground"),s=()=>{jt().authStore.clear(),e("/login")},o=()=>{e("/setting/password")};return c.jsx(c.Fragment,{children:c.jsx(qF,{children:c.jsxs("div",{className:"grid min-h-screen w-full md:grid-cols-[220px_1fr] lg:grid-cols-[280px_1fr]",children:[c.jsx("div",{className:"hidden border-r dark:border-stone-500 bg-muted/40 md:block",children:c.jsxs("div",{className:"flex h-full max-h-screen flex-col gap-2",children:[c.jsx("div",{className:"flex h-14 items-center border-b dark:border-stone-500 px-4 lg:h-[60px] lg:px-6",children:c.jsxs(dr,{to:"/",className:"flex items-center gap-2 font-semibold",children:[c.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),c.jsx("span",{className:"dark:text-white",children:"Certimate"})]})}),c.jsx("div",{className:"flex-1",children:c.jsxs("nav",{className:"grid items-start px-2 text-sm font-medium lg:px-4",children:[c.jsxs(dr,{to:"/",className:me("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/")),children:[c.jsx(Nx,{className:"h-4 w-4"}),"控制面板"]}),c.jsxs(dr,{to:"/domains",className:me("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/domains")),children:[c.jsx(Ap,{className:"h-4 w-4"}),"域名列表"]}),c.jsxs(dr,{to:"/access",className:me("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/access")),children:[c.jsx(Rx,{className:"h-4 w-4"}),"授权管理"]}),c.jsxs(dr,{to:"/history",className:me("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/history")),children:[c.jsx(Tx,{className:"h-4 w-4"}),"部署历史"]})]})})]})}),c.jsxs("div",{className:"flex flex-col",children:[c.jsxs("header",{className:"flex h-14 items-center gap-4 border-b dark:border-stone-500 bg-muted/40 px-4 lg:h-[60px] lg:px-6",children:[c.jsxs(Xg,{children:[c.jsx(Qg,{asChild:!0,children:c.jsxs(pt,{variant:"outline",size:"icon",className:"shrink-0 md:hidden",children:[c.jsx(WR,{className:"h-5 w-5 dark:text-white"}),c.jsx("span",{className:"sr-only",children:"Toggle navigation menu"})]})}),c.jsx(hf,{side:"left",className:"flex flex-col",children:c.jsxs("nav",{className:"grid gap-2 text-lg font-medium",children:[c.jsxs(dr,{to:"/",className:"flex items-center gap-2 text-lg font-semibold",children:[c.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),c.jsx("span",{className:"dark:text-white",children:"Certimate"}),c.jsx("span",{className:"sr-only",children:"Certimate"})]}),c.jsxs(dr,{to:"/",className:me("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/")),children:[c.jsx(Nx,{className:"h-5 w-5"}),"控制面板"]}),c.jsxs(dr,{to:"/domains",className:me("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/domains")),children:[c.jsx(Ap,{className:"h-5 w-5"}),"域名列表"]}),c.jsxs(dr,{to:"/access",className:me("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/dns_provider")),children:[c.jsx(Rx,{className:"h-5 w-5"}),"授权管理"]}),c.jsxs(dr,{to:"/history",className:me("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/history")),children:[c.jsx(Tx,{className:"h-5 w-5"}),"部署历史"]})]})})]}),c.jsx("div",{className:"w-full flex-1"}),c.jsx(e3,{}),c.jsxs(Kb,{children:[c.jsx(Gb,{asChild:!0,children:c.jsxs(pt,{variant:"secondary",size:"icon",className:"rounded-full",children:[c.jsx(LR,{className:"h-5 w-5"}),c.jsx("span",{className:"sr-only",children:"Toggle user menu"})]})}),c.jsxs($g,{align:"end",children:[c.jsx(qb,{children:"账户"}),c.jsx(Xb,{}),c.jsx(Ui,{onClick:o,children:"设置"}),c.jsx(Ui,{onClick:s,children:"退出"})]})]})]}),c.jsxs("main",{className:"flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6 relative",children:[c.jsx(pg,{}),c.jsxs("div",{className:"fixed right-0 bottom-0 w-full flex justify-between p-5",children:[c.jsx("div",{className:""}),c.jsxs("div",{className:"text-muted-foreground text-sm hover:text-stone-900 dark:hover:text-stone-200 flex",children:[c.jsxs("a",{href:"https://docs.certimate.me",target:"_blank",className:"flex items-center",children:[c.jsx(OR,{size:16}),c.jsx("div",{className:"ml-1",children:"文档"})]}),c.jsx(Yt,{orientation:"vertical",className:"mx-2"}),c.jsx("a",{href:"https://github.com/usual2970/certimate/releases",target:"_blank",children:"Certimate v0.0.16"})]})]})]})]})]})})})}const kv=({phase:e,phaseSuccess:t})=>{let r=c.jsx(c.Fragment,{children:" "});return e==="check"&&(t?r=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Yt,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),c.jsx(Yt,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"检查 "}),c.jsx(Yt,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),c.jsx(Yt,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="apply"&&(t?r=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Yt,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),c.jsx(Yt,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Yt,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"获取"}),c.jsx(Yt,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="deploy"&&(t?r=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Yt,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),c.jsx(Yt,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"部署"})]}):r=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Yt,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),c.jsx(Yt,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"部署"})]})),r},mk=({className:e,...t})=>c.jsx("nav",{role:"navigation","aria-label":"pagination",className:me("mx-auto flex w-full justify-center",e),...t});mk.displayName="Pagination";const gk=y.forwardRef(({className:e,...t},r)=>c.jsx("ul",{ref:r,className:me("flex flex-row items-center gap-1",e),...t}));gk.displayName="PaginationContent";const qp=y.forwardRef(({className:e,...t},r)=>c.jsx("li",{ref:r,className:me("",e),...t}));qp.displayName="PaginationItem";const vk=({className:e,isActive:t,size:r="icon",...n})=>c.jsx("a",{"aria-current":t?"page":void 0,className:me(ef({variant:t?"outline":"ghost",size:r}),e),...n});vk.displayName="PaginationLink";const yk=({className:e,...t})=>c.jsxs("span",{"aria-hidden":!0,className:me("flex h-9 w-9 items-center justify-center",e),...t,children:[c.jsx(zR,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"More pages"})]});yk.displayName="PaginationEllipsis";const xk=({totalPages:e,currentPage:t,onPageChange:r})=>{const s=()=>{if(e>7){let u=[];const d=Math.max(2,t-1),f=Math.min(e-1,t+1),p=e-1;return u=o(d,f),t>3&&u.unshift("..."),t{let d=a;const f=[];for(;d<=l;)f.push(d),d+=u;return f},i=s();return c.jsx(c.Fragment,{children:c.jsx(mk,{className:"dark:text-stone-200 justify-end mt-3",children:c.jsx(gk,{children:i.map((a,l)=>a==="..."?c.jsx(qp,{children:c.jsx(yk,{})},l):c.jsx(qp,{children:c.jsx(vk,{href:"#",isActive:t==a,onClick:u=>{u.preventDefault(),r(a)},children:a})},l))})})})},h0=({when:e,children:t,fallback:r})=>e?t:r;var wk="AlertDialog",[o3,p8]=Qr(wk,[Jb]),Ts=Jb(),_k=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ts(t);return c.jsx(Kg,{...n,...r,modal:!0})};_k.displayName=wk;var i3="AlertDialogTrigger",bk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return c.jsx(Gg,{...s,...n,ref:t})});bk.displayName=i3;var a3="AlertDialogPortal",Sk=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ts(t);return c.jsx(qg,{...n,...r})};Sk.displayName=a3;var l3="AlertDialogOverlay",kk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return c.jsx(dc,{...s,...n,ref:t})});kk.displayName=l3;var Hi="AlertDialogContent",[c3,u3]=o3(Hi),Ck=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,o=Ts(r),i=y.useRef(null),a=Xe(t,i),l=y.useRef(null);return c.jsx(bM,{contentName:Hi,titleName:Ek,docsSlug:"alert-dialog",children:c.jsx(c3,{scope:r,cancelRef:l,children:c.jsxs(fc,{role:"alertdialog",...o,...s,ref:a,onOpenAutoFocus:ue(s.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[c.jsx(yg,{children:n}),c.jsx(f3,{contentRef:i})]})})})});Ck.displayName=Hi;var Ek="AlertDialogTitle",Tk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return c.jsx(hc,{...s,...n,ref:t})});Tk.displayName=Ek;var Nk="AlertDialogDescription",jk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return c.jsx(pc,{...s,...n,ref:t})});jk.displayName=Nk;var d3="AlertDialogAction",Rk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return c.jsx(ff,{...s,...n,ref:t})});Rk.displayName=d3;var Pk="AlertDialogCancel",Dk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=u3(Pk,r),o=Ts(r),i=Xe(t,s);return c.jsx(ff,{...o,...n,ref:i})});Dk.displayName=Pk;var f3=({contentRef:e})=>{const t=`\`${Hi}\` requires a description for the component to be accessible for screen reader users. +ge.version="2.30.1";ZM(bt);ge.fn=ae;ge.min=ML;ge.max=IL;ge.now=LL;ge.utc=Wn;ge.unix=dF;ge.months=hF;ge.isDate=mc;ge.locale=ro;ge.invalid=pf;ge.duration=bn;ge.isMoment=yn;ge.weekdays=mF;ge.parseZone=fF;ge.localeData=Cs;ge.isDuration=Cu;ge.monthsShort=pF;ge.weekdaysMin=vF;ge.defineLocale=mv;ge.updateLocale=fL;ge.locales=hL;ge.weekdaysShort=gF;ge.normalizeUnits=en;ge.relativeTimeRounding=BF;ge.relativeTimeThreshold=HF;ge.calendarFormat=l4;ge.prototype=ae;ge.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const ZF=async()=>await jt().collection("access").getFullList({sort:"-created",filter:"deleted = null"}),wa=async e=>e.id?await jt().collection("access").update(e.id,e):await jt().collection("access").create(e),KF=async e=>(e.deleted=ge.utc().format("YYYY-MM-DD HH:mm:ss"),await jt().collection("access").update(e.id,e)),GF=(e,t)=>{switch(t.type){case"SET_ACCESSES":return{...e,accesses:t.payload};case"ADD_ACCESS":return{...e,accesses:[t.payload,...e.accesses]};case"DELETE_ACCESS":return{...e,accesses:e.accesses.filter(r=>r.id!==t.payload)};case"UPDATE_ACCESS":return{...e,accesses:e.accesses.map(r=>r.id===t.payload.id?t.payload:r)};default:return e}},dk=y.createContext({}),yo=()=>y.useContext(dk),qF=({children:e})=>{const[t,r]=y.useReducer(GF,{accesses:[]});y.useEffect(()=>{(async()=>{const a=await ZF();r({type:"SET_ACCESSES",payload:a})})()},[]);const n=y.useCallback(i=>{r({type:"DELETE_ACCESS",payload:i})},[]),s=y.useCallback(i=>{r({type:"ADD_ACCESS",payload:i})},[]),o=y.useCallback(i=>{r({type:"UPDATE_ACCESS",payload:i})},[]);return c.jsx(dk.Provider,{value:{config:{accesses:t.accesses},deleteAccess:n,addAccess:s,updateAccess:o},children:e&&e})},XF={theme:"system",setTheme:()=>null},fk=y.createContext(XF);function QF({children:e,defaultTheme:t="system",storageKey:r="vite-ui-theme",...n}){const[s,o]=y.useState(()=>localStorage.getItem(r)||t);y.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),s==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(s)},[s]);const i={theme:s,setTheme:a=>{localStorage.setItem(r,a),o(a)}};return c.jsx(fk.Provider,{...n,value:i,children:e})}const JF=()=>{const e=y.useContext(fk);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function e3(){const{setTheme:e}=JF();return c.jsxs(Kb,{children:[c.jsx(Gb,{asChild:!0,children:c.jsxs(pt,{variant:"outline",size:"icon",children:[c.jsx(HR,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),c.jsx($R,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100 dark:text-white"}),c.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),c.jsxs($g,{align:"end",children:[c.jsx(Ui,{onClick:()=>e("light"),children:"浅色"}),c.jsx(Ui,{onClick:()=>e("dark"),children:"暗黑"}),c.jsx(Ui,{onClick:()=>e("system"),children:"系统"})]})]})}var t3="Separator",f0="horizontal",r3=["horizontal","vertical"],hk=y.forwardRef((e,t)=>{const{decorative:r,orientation:n=f0,...s}=e,o=n3(n)?n:f0,a=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return c.jsx(Me.div,{"data-orientation":o,...a,...s,ref:t})});hk.displayName=t3;function n3(e){return r3.includes(e)}var pk=hk;const Yt=y.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>c.jsx(pk,{ref:s,decorative:r,orientation:t,className:me("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Yt.displayName=pk.displayName;function s3(){const e=wn(),t=Vn();if(!jt().authStore.isValid||!jt().authStore.isAdmin)return c.jsx(o1,{to:"/login"});const r=t.pathname,n=i=>(console.log(r),i==r?"bg-muted text-primary":"text-muted-foreground"),s=()=>{jt().authStore.clear(),e("/login")},o=()=>{e("/setting/password")};return c.jsx(c.Fragment,{children:c.jsx(qF,{children:c.jsxs("div",{className:"grid min-h-screen w-full md:grid-cols-[220px_1fr] lg:grid-cols-[280px_1fr]",children:[c.jsx("div",{className:"hidden border-r dark:border-stone-500 bg-muted/40 md:block",children:c.jsxs("div",{className:"flex h-full max-h-screen flex-col gap-2",children:[c.jsx("div",{className:"flex h-14 items-center border-b dark:border-stone-500 px-4 lg:h-[60px] lg:px-6",children:c.jsxs(dr,{to:"/",className:"flex items-center gap-2 font-semibold",children:[c.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),c.jsx("span",{className:"dark:text-white",children:"Certimate"})]})}),c.jsx("div",{className:"flex-1",children:c.jsxs("nav",{className:"grid items-start px-2 text-sm font-medium lg:px-4",children:[c.jsxs(dr,{to:"/",className:me("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/")),children:[c.jsx(Nx,{className:"h-4 w-4"}),"控制面板"]}),c.jsxs(dr,{to:"/domains",className:me("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/domains")),children:[c.jsx(Ap,{className:"h-4 w-4"}),"域名列表"]}),c.jsxs(dr,{to:"/access",className:me("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/access")),children:[c.jsx(Rx,{className:"h-4 w-4"}),"授权管理"]}),c.jsxs(dr,{to:"/history",className:me("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/history")),children:[c.jsx(Tx,{className:"h-4 w-4"}),"部署历史"]})]})})]})}),c.jsxs("div",{className:"flex flex-col",children:[c.jsxs("header",{className:"flex h-14 items-center gap-4 border-b dark:border-stone-500 bg-muted/40 px-4 lg:h-[60px] lg:px-6",children:[c.jsxs(Xg,{children:[c.jsx(Qg,{asChild:!0,children:c.jsxs(pt,{variant:"outline",size:"icon",className:"shrink-0 md:hidden",children:[c.jsx(WR,{className:"h-5 w-5 dark:text-white"}),c.jsx("span",{className:"sr-only",children:"Toggle navigation menu"})]})}),c.jsx(hf,{side:"left",className:"flex flex-col",children:c.jsxs("nav",{className:"grid gap-2 text-lg font-medium",children:[c.jsxs(dr,{to:"/",className:"flex items-center gap-2 text-lg font-semibold",children:[c.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),c.jsx("span",{className:"dark:text-white",children:"Certimate"}),c.jsx("span",{className:"sr-only",children:"Certimate"})]}),c.jsxs(dr,{to:"/",className:me("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/")),children:[c.jsx(Nx,{className:"h-5 w-5"}),"控制面板"]}),c.jsxs(dr,{to:"/domains",className:me("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/domains")),children:[c.jsx(Ap,{className:"h-5 w-5"}),"域名列表"]}),c.jsxs(dr,{to:"/access",className:me("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/dns_provider")),children:[c.jsx(Rx,{className:"h-5 w-5"}),"授权管理"]}),c.jsxs(dr,{to:"/history",className:me("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/history")),children:[c.jsx(Tx,{className:"h-5 w-5"}),"部署历史"]})]})})]}),c.jsx("div",{className:"w-full flex-1"}),c.jsx(e3,{}),c.jsxs(Kb,{children:[c.jsx(Gb,{asChild:!0,children:c.jsxs(pt,{variant:"secondary",size:"icon",className:"rounded-full",children:[c.jsx(LR,{className:"h-5 w-5"}),c.jsx("span",{className:"sr-only",children:"Toggle user menu"})]})}),c.jsxs($g,{align:"end",children:[c.jsx(qb,{children:"账户"}),c.jsx(Xb,{}),c.jsx(Ui,{onClick:o,children:"设置"}),c.jsx(Ui,{onClick:s,children:"退出"})]})]})]}),c.jsxs("main",{className:"flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6 relative",children:[c.jsx(pg,{}),c.jsxs("div",{className:"fixed right-0 bottom-0 w-full flex justify-between p-5",children:[c.jsx("div",{className:""}),c.jsxs("div",{className:"text-muted-foreground text-sm hover:text-stone-900 dark:hover:text-stone-200 flex",children:[c.jsxs("a",{href:"https://docs.certimate.me",target:"_blank",className:"flex items-center",children:[c.jsx(OR,{size:16}),c.jsx("div",{className:"ml-1",children:"文档"})]}),c.jsx(Yt,{orientation:"vertical",className:"mx-2"}),c.jsx("a",{href:"https://github.com/usual2970/certimate/releases",target:"_blank",children:"Certimate v0.1.0"})]})]})]})]})]})})})}const kv=({phase:e,phaseSuccess:t})=>{let r=c.jsx(c.Fragment,{children:" "});return e==="check"&&(t?r=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Yt,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),c.jsx(Yt,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"检查 "}),c.jsx(Yt,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),c.jsx(Yt,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="apply"&&(t?r=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Yt,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),c.jsx(Yt,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Yt,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"获取"}),c.jsx(Yt,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="deploy"&&(t?r=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Yt,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),c.jsx(Yt,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"部署"})]}):r=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Yt,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),c.jsx(Yt,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"部署"})]})),r},mk=({className:e,...t})=>c.jsx("nav",{role:"navigation","aria-label":"pagination",className:me("mx-auto flex w-full justify-center",e),...t});mk.displayName="Pagination";const gk=y.forwardRef(({className:e,...t},r)=>c.jsx("ul",{ref:r,className:me("flex flex-row items-center gap-1",e),...t}));gk.displayName="PaginationContent";const qp=y.forwardRef(({className:e,...t},r)=>c.jsx("li",{ref:r,className:me("",e),...t}));qp.displayName="PaginationItem";const vk=({className:e,isActive:t,size:r="icon",...n})=>c.jsx("a",{"aria-current":t?"page":void 0,className:me(ef({variant:t?"outline":"ghost",size:r}),e),...n});vk.displayName="PaginationLink";const yk=({className:e,...t})=>c.jsxs("span",{"aria-hidden":!0,className:me("flex h-9 w-9 items-center justify-center",e),...t,children:[c.jsx(zR,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"More pages"})]});yk.displayName="PaginationEllipsis";const xk=({totalPages:e,currentPage:t,onPageChange:r})=>{const s=()=>{if(e>7){let u=[];const d=Math.max(2,t-1),f=Math.min(e-1,t+1),p=e-1;return u=o(d,f),t>3&&u.unshift("..."),t{let d=a;const f=[];for(;d<=l;)f.push(d),d+=u;return f},i=s();return c.jsx(c.Fragment,{children:c.jsx(mk,{className:"dark:text-stone-200 justify-end mt-3",children:c.jsx(gk,{children:i.map((a,l)=>a==="..."?c.jsx(qp,{children:c.jsx(yk,{})},l):c.jsx(qp,{children:c.jsx(vk,{href:"#",isActive:t==a,onClick:u=>{u.preventDefault(),r(a)},children:a})},l))})})})},h0=({when:e,children:t,fallback:r})=>e?t:r;var wk="AlertDialog",[o3,p8]=Qr(wk,[Jb]),Ts=Jb(),_k=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ts(t);return c.jsx(Kg,{...n,...r,modal:!0})};_k.displayName=wk;var i3="AlertDialogTrigger",bk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return c.jsx(Gg,{...s,...n,ref:t})});bk.displayName=i3;var a3="AlertDialogPortal",Sk=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ts(t);return c.jsx(qg,{...n,...r})};Sk.displayName=a3;var l3="AlertDialogOverlay",kk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return c.jsx(dc,{...s,...n,ref:t})});kk.displayName=l3;var Hi="AlertDialogContent",[c3,u3]=o3(Hi),Ck=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,o=Ts(r),i=y.useRef(null),a=Xe(t,i),l=y.useRef(null);return c.jsx(bM,{contentName:Hi,titleName:Ek,docsSlug:"alert-dialog",children:c.jsx(c3,{scope:r,cancelRef:l,children:c.jsxs(fc,{role:"alertdialog",...o,...s,ref:a,onOpenAutoFocus:ue(s.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[c.jsx(yg,{children:n}),c.jsx(f3,{contentRef:i})]})})})});Ck.displayName=Hi;var Ek="AlertDialogTitle",Tk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return c.jsx(hc,{...s,...n,ref:t})});Tk.displayName=Ek;var Nk="AlertDialogDescription",jk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return c.jsx(pc,{...s,...n,ref:t})});jk.displayName=Nk;var d3="AlertDialogAction",Rk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return c.jsx(ff,{...s,...n,ref:t})});Rk.displayName=d3;var Pk="AlertDialogCancel",Dk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=u3(Pk,r),o=Ts(r),i=Xe(t,s);return c.jsx(ff,{...o,...n,ref:i})});Dk.displayName=Pk;var f3=({contentRef:e})=>{const t=`\`${Hi}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${Hi}\` by passing a \`${Nk}\` component as a child, which also benefits sighted users by adding visible context to the dialog. diff --git a/ui/dist/index.html b/ui/dist/index.html index eaf74d2e..8eda2a45 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -5,7 +5,7 @@ Certimate - Your Trusted SSL Automation Partner - + diff --git a/ui/src/pages/DashboardLayout.tsx b/ui/src/pages/DashboardLayout.tsx index eeefbf0a..523385f7 100644 --- a/ui/src/pages/DashboardLayout.tsx +++ b/ui/src/pages/DashboardLayout.tsx @@ -227,7 +227,7 @@ export default function Dashboard() { href="https://github.com/usual2970/certimate/releases" target="_blank" > - Certimate v0.0.16 + Certimate v0.1.0