@capgo/cli 7.76.2 → 7.76.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +31 -31
- package/dist/package.json +1 -1
- package/dist/src/sdk.js +1 -1
- package/package.json +1 -1
package/dist/package.json
CHANGED
package/dist/src/sdk.js
CHANGED
|
@@ -335,7 +335,7 @@ ${w}
|
|
|
335
335
|
`)}}var w4=z0(R2(),1);import{spawn as mAD}from"node:child_process";import{existsSync as Q0,readdirSync as hX,readFileSync as S0,statSync as dAD}from"node:fs";import{homedir as cAD,platform as lAD}from"node:os";import mX,{dirname as gX,join as uD,relative as Jr,resolve as hN,sep as Yr}from"node:path";import{cwd as O6,env as nAD}from"node:process";import{existsSync as I1}from"fs";var w7=(D=".",$="unknown")=>{let X=`${D}/bun.lockb`,Y=`${D}/bun.lock`,J=`${D}/pnpm-lock.yaml`,Q=`${D}/shrinkwrap.yaml`,F=`${D}/yarn.lock`,w=`${D}/package-lock.json`,Z=`${D}/npm-shrinkwrap.json`;if(I1(X)||I1(Y))return"bun";if(I1(J)||I1(Q))return"pnpm";if(I1(F))return"yarn";if(I1(w)||I1(Z))return"npm";return $},j2=(D=w7(),$=!1)=>{switch(D){case"bun":return $?"bun install":"install";case"pnpm":return $?"pnpm install":"install";case"yarn":return $?"yarn install":"install";case"npm":return $?"npm install":"install";case"unknown":return $?"unknown unknown":"unknown";default:return $?"npm install":"install"}},TL=(D=".",$="npx")=>{let X=`${D}/bun.lockb`,Y=`${D}/bun.lock`,J=`${D}/pnpm-lock.yaml`,Q=`${D}/shrinkwrap.yaml`,F=`${D}/yarn.lock`,w=`${D}/package-lock.json`,Z=`${D}/npm-shrinkwrap.json`;if(I1(X)||I1(Y))return"bunx";if(I1(J)||I1(Q))return"pnpm exec";if(I1(F))return"yarn dlx";if(I1(w)||I1(Z))return"npx";return $};function E2(D,$){if(isNaN(D)||isNaN($))throw Error("Cannot compare against non-numbers");return D===$?0:D<$?-1:1}function xL(D=[],$=[]){if(D.length&&!$.length)return-1;if(!D.length&&$.length)return 1;return 0}function iZ(D=[],$=[]){let X=Math.max(D.length,$.length);for(let Y=0;Y<X;Y++){let J=D[Y],Q=$[Y];if(J===void 0&&Q===void 0)return 0;if(Q===void 0)return 1;if(J===void 0)return-1;if(typeof J==="string"&&typeof Q==="number")return 1;if(typeof J==="number"&&typeof Q==="string")return-1;if(J<Q)return-1;if(J>Q)return 1}return 0}var g8="0|[1-9]\\d*",Re="\\d*[a-zA-Z-][a-zA-Z0-9-]*",je=`(?<major>${g8})\\.(?<minor>${g8})\\.(?<patch>${g8})`,CL=`(?:${g8}|${Re})`,SL=`(?:-(?<prerelease>${CL}(?:\\.${CL})*))`,PL="[0-9A-Za-z-]+",uL=`(?:\\+(?<buildmetadata>${PL}(?:\\.${PL})*))`,vL=`v?${je}${SL}?${uL}?`,_L=new RegExp(`^${vL}$`),fL="(?:<|>)?=?",Ee="x|X|\\*",nZ=`${g8}|${Ee}`,T2=`[v=\\s]*(?<major>${nZ})(?:\\.(?<minor>${nZ})(?:\\.(?<patch>${nZ})${SL}?${uL}?)?)?`,kL=new RegExp(`^(?<operator>~>?|\\^|${fL})\\s*${T2}$`),yL=new RegExp(`^(?<operator>${fL})\\s*(${vL})$|^$`);function pZ(D){return typeof D==="number"&&!Number.isNaN(D)&&(!Number.isFinite(D)||0<=D&&D<=Number.MAX_SAFE_INTEGER)}var rZ=256;var Te=new RegExp(`^${g8}$`);function Y1(D){return D.split(".").filter(Boolean).map(($)=>{if(Te.test($)){let X=Number($);if(pZ(X))return X}return $})}function X$(D){return D.split(".").filter(Boolean)}function R6(D,$){let X=Number(D);if(!pZ(X))throw TypeError($);return X}function d$(D){return Number.isNaN(D.major)&&Number.isNaN(D.minor)&&Number.isNaN(D.patch)&&(D.prerelease===void 0||D.prerelease.length===0)&&(D.build===void 0||D.build.length===0)}function Q1(D,$){if(D===$)return 0;return E2(D.major,$.major)||E2(D.minor,$.minor)||E2(D.patch,$.patch)||xL(D.prerelease,$.prerelease)||iZ(D.prerelease,$.prerelease)}function oZ(D){return D.toFixed(0)}function J$(D){let $=oZ(D.major),X=oZ(D.minor),Y=oZ(D.patch),J=D.prerelease?.join(".")??"",Q=D.build?.join(".")??"";return[[`${$}.${X}.${Y}`,J].filter((Z)=>Z).join("-"),Q].filter((Z)=>Z).join("+")}function Ce(D,$){if(d$($))return!0;let X=Q1(D,$);switch($.operator){case"=":case void 0:return X===0;case"!=":return X!==0;case">":return X>0;case"<":return X<0;case">=":return X>=0;case"<=":return X<=0}}function C2(D,$){for(let X of $)if(!Ce(D,X))return!1;if(D.prerelease&&D.prerelease.length>0){for(let X of $){if(d$(X))continue;let{major:Y,minor:J,patch:Q,prerelease:F}=X;if(F&&F.length>0){if(D.major===Y&&D.minor===J&&D.patch===Q)return!0}}return!1}return!0}function Z7(D,$){return $.some((X)=>C2(D,X))}function Pe(D=[]){let $=[...D],X=$.length;while(X>=0){let Y=$[X];if(typeof Y==="number"){$[X]=Y+1;break}X-=1}if(X===-1)$.push(0);return $}function G7(D=[],$){let X=Pe(D);if(!$)return X;let Y=Y1($);if(Y.every((J)=>typeof J==="string")){if(Y.every((J,Q)=>J===X[Q])&&typeof X[Y.length]==="number")return X;Y=[...Y,0]}return Y}function O7(D,$,X={}){let Y=X.build!==void 0?X$(X.build):D.build??[];switch($){case"premajor":return{major:D.major+1,minor:0,patch:0,prerelease:G7(D.prerelease,X.prerelease),build:Y};case"preminor":return{major:D.major,minor:D.minor+1,patch:0,prerelease:G7(D.prerelease,X.prerelease),build:Y};case"prepatch":return{major:D.major,minor:D.minor,patch:D.patch+1,prerelease:G7(D.prerelease,X.prerelease),build:Y};case"prerelease":{let Q=(D.prerelease??[]).length===0?D.patch+1:D.patch;return{major:D.major,minor:D.minor,patch:Q,prerelease:G7(D.prerelease,X.prerelease),build:Y}}case"major":return{major:(D.prerelease??[]).length===0||D.minor!==0||D.patch!==0?D.major+1:D.major,minor:0,patch:0,prerelease:[],build:Y};case"minor":{let Q=(D.prerelease??[]).length===0||D.patch!==0?D.minor+1:D.minor;return{major:D.major,minor:Q,patch:0,prerelease:[],build:Y}}case"patch":{let Q=(D.prerelease??[]).length===0?D.patch+1:D.patch;return{major:D.major,minor:D.minor,patch:Q,prerelease:[],build:Y}}case"pre":return{major:D.major,minor:D.minor,patch:D.patch,prerelease:G7(D.prerelease,X.prerelease),build:Y};default:throw TypeError(`Cannot increment version: invalid argument ${$}`)}}var P2={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},h8={operator:void 0,...P2};function aZ(D,$){return Q1(D,$)>0}function M4(D,$){return Q1(D,$)<0}function xe(D){let X=D.match(yL)?.groups;if(!X)return null;let{operator:Y,prerelease:J,buildmetadata:Q}=X,F=X.major?{major:R6(X.major,`Cannot parse comparator ${D}: invalid major version`),minor:R6(X.minor,`Cannot parse comparator ${D}: invalid minor version`),patch:R6(X.patch,`Cannot parse comparator ${D}: invalid patch version`),prerelease:J?Y1(J):[],build:Q?X$(Q):[]}:P2;return{operator:Y||void 0,...F}}function eD(D){return!D||D.toLowerCase()==="x"||D==="*"}function Se(D){if(eD(D.major))return;if(eD(D.minor))return{operator:">=",major:+D.major,minor:0,patch:0,prerelease:[],build:[]};if(eD(D.patch))return{operator:">=",major:+D.major,minor:+D.minor,patch:0,prerelease:[],build:[]};return{operator:">=",major:+D.major,minor:+D.minor,patch:+D.patch,prerelease:D.prerelease?Y1(D.prerelease):[],build:[]}}function ue(D){if(eD(D.major))return;if(eD(D.minor))return{operator:"<",major:+D.major+1,minor:0,patch:0,prerelease:[],build:[]};if(eD(D.patch))return{operator:"<",major:+D.major,minor:+D.minor+1,patch:0,prerelease:[],build:[]};if(D.prerelease)return{operator:"<=",major:+D.major,minor:+D.minor,patch:+D.patch,prerelease:Y1(D.prerelease),build:[]};return{operator:"<=",major:+D.major,minor:+D.minor,patch:+D.patch,prerelease:[],build:[]}}function ve(D){let $=D.match(new RegExp(`^${T2}`)),X=$?.groups;if(!X)return null;let Y=$[0].length,J=D.slice(Y).match(/^\s+-\s+/);if(!J)return null;let Q=J[0].length,w=D.slice(Y+Q).match(new RegExp(`^${T2}\\s*$`))?.groups;if(!w)return null;let Z=Se(X),G=ue(w);return[Z,G].filter(Boolean)}function _e(D){let $=eD(D.major),X=eD(D.minor),Y=eD(D.patch),J=+D.major,Q=+D.minor,F=+D.patch;if($)return[h8];if(X)return[{operator:">=",major:J,minor:0,patch:0},{operator:"<",major:J+1,minor:0,patch:0}];if(Y){if(J===0)return[{operator:">=",major:J,minor:Q,patch:0},{operator:"<",major:J,minor:Q+1,patch:0}];return[{operator:">=",major:J,minor:Q,patch:0},{operator:"<",major:J+1,minor:0,patch:0}]}let w=Y1(D.prerelease??"");if(J===0){if(Q===0)return[{operator:">=",major:J,minor:Q,patch:F,prerelease:w},{operator:"<",major:J,minor:Q,patch:F+1}];return[{operator:">=",major:J,minor:Q,patch:F,prerelease:w},{operator:"<",major:J,minor:Q+1,patch:0}]}return[{operator:">=",major:J,minor:Q,patch:F,prerelease:w},{operator:"<",major:J+1,minor:0,patch:0}]}function fe(D){let $=eD(D.major),X=eD(D.minor),Y=eD(D.patch),J=+D.major,Q=+D.minor,F=+D.patch;if($)return[h8];if(X)return[{operator:">=",major:J,minor:0,patch:0},{operator:"<",major:J+1,minor:0,patch:0}];if(Y)return[{operator:">=",major:J,minor:Q,patch:0},{operator:"<",major:J,minor:Q+1,patch:0}];let w=Y1(D.prerelease??"");return[{operator:">=",major:J,minor:Q,patch:F,prerelease:w},{operator:"<",major:J,minor:Q+1,patch:0}]}function ke(D){let $=eD(D.major),X=eD(D.minor),Y=eD(D.patch),J=+D.major,Q=+D.minor,F=+D.patch;if($)return[{operator:"<",major:0,minor:0,patch:0}];if(X){if(Y)return[{operator:"<",major:J,minor:0,patch:0}];return[{operator:"<",major:J,minor:0,patch:0}]}if(Y)return[{operator:"<",major:J,minor:Q,patch:0}];let w=Y1(D.prerelease??""),Z=X$(D.build??"");return[{operator:"<",major:J,minor:Q,patch:F,prerelease:w,build:Z}]}function ye(D){let $=eD(D.minor),X=eD(D.patch),Y=+D.major,J=+D.minor,Q=+D.patch;if($){if(X)return[{operator:"<",major:Y+1,minor:0,patch:0}];return[{operator:"<",major:Y,minor:J+1,patch:0}]}if(X)return[{operator:"<",major:Y,minor:J+1,patch:0}];let F=Y1(D.prerelease??""),w=X$(D.build??"");return[{operator:"<=",major:Y,minor:J,patch:Q,prerelease:F,build:w}]}function be(D){let $=eD(D.major),X=eD(D.minor),Y=eD(D.patch),J=+D.major,Q=+D.minor,F=+D.patch;if($)return[{operator:"<",major:0,minor:0,patch:0}];if(X)return[{operator:">=",major:J+1,minor:0,patch:0}];if(Y)return[{operator:">=",major:J,minor:Q+1,patch:0}];let w=Y1(D.prerelease??""),Z=X$(D.build??"");return[{operator:">",major:J,minor:Q,patch:F,prerelease:w,build:Z}]}function ge(D){let $=eD(D.major),X=eD(D.minor),Y=eD(D.patch),J=+D.major,Q=+D.minor,F=+D.patch;if($)return[h8];if(X){if(Y)return[{operator:">=",major:J,minor:0,patch:0}];return[{operator:">=",major:J,minor:0,patch:0}]}if(Y)return[{operator:">=",major:J,minor:Q,patch:0}];let w=Y1(D.prerelease??""),Z=X$(D.build??"");return[{operator:">=",major:J,minor:Q,patch:F,prerelease:w,build:Z}]}function he(D){let $=eD(D.major),X=eD(D.minor),Y=eD(D.patch),J=+D.major,Q=+D.minor,F=+D.patch;if($)return[h8];if(X)return[{operator:">=",major:J,minor:0,patch:0},{operator:"<",major:J+1,minor:0,patch:0}];if(Y)return[{operator:">=",major:J,minor:Q,patch:0},{operator:"<",major:J,minor:Q+1,patch:0}];let w=Y1(D.prerelease??""),Z=X$(D.build??"");return[{operator:void 0,major:J,minor:Q,patch:F,prerelease:w,build:Z}]}function me(D){let $=D.match(kL)?.groups;if(!$)return xe(D);switch($.operator){case"^":return _e($);case"~":case"~>":return fe($);case"<":return ke($);case"<=":return ye($);case">":return be($);case">=":return ge($);case"=":case"":return he($);default:throw Error(`Cannot parse version range: '${$.operator}' is not a valid operator`)}}function de(D){return D.split(/\s+/).flatMap(me)}function x2(D){let $=D.replaceAll(/(?<=<|>|=|~|\^)(\s+)/g,"").split(/\s*\|\|\s*/).map((X)=>ve(X)||de(X));if($.some((X)=>X.includes(null)))throw TypeError(`Cannot parse version range: range "${D}" is invalid`);return $}function oD(D){if(typeof D!=="string")throw TypeError(`Cannot parse version as version must be a string: received ${typeof D}`);if(D.length>rZ)throw TypeError(`Cannot parse version as version length is too long: length is ${D.length}, max length is ${rZ}`);D=D.trim();let $=D.match(_L)?.groups;if(!$)throw TypeError(`Cannot parse version: ${D}`);let X=R6($.major,`Cannot parse version ${D}: invalid major version`),Y=R6($.minor,`Cannot parse version ${D}: invalid minor version`),J=R6($.patch,`Cannot parse version ${D}: invalid patch version`),Q=$.prerelease?Y1($.prerelease):[],F=$.buildmetadata?X$($.buildmetadata):[];return{major:X,minor:Y,patch:J,prerelease:Q,build:F}}function bL(D,$){let X=D.operator,Y=$.operator;if(X===void 0){if(d$(D))return!0;return Z7(D,[[$]])}if(Y===void 0){if(d$($))return!0;return Z7($,[[D]])}let J=Q1(D,$);return(X===">="||X===">")&&(Y===">="||Y===">")||(X==="<="||X==="<")&&(Y==="<="||Y==="<")||J===0&&((X===">="||X==="<=")&&(Y===">="||Y==="<="))||J===-1&&(X===">="||X===">")&&(Y==="<="||Y==="<")||J===1&&(X==="<="||X==="<")&&(Y===">="||Y===">")}function ce(D){return D.every(($)=>{return $.some((X)=>le(X))})}function le(D){for(let $=0;$<D.length-1;$++){let X=D[$];for(let Y of D.slice($+1))if(!bL(X,Y))return!1}return!0}function gL(D,$){return ce([D,$])&&D.some((X)=>{return $.some((Y)=>{return X.every((J)=>{return Y.every((Q)=>bL(J,Q))})})})}function hL(D){try{return oD(D),!0}catch{return!1}}function mL(D,$){return Q1(D,$)>=0}var OD={};S1(OD,{createClient:()=>uG,SupabaseClient:()=>Xj,PostgrestError:()=>B7,FunctionsRelayError:()=>a0.FunctionsRelayError,FunctionsHttpError:()=>a0.FunctionsHttpError,FunctionsFetchError:()=>a0.FunctionsFetchError,FunctionsError:()=>a0.FunctionsError,FunctionRegion:()=>a0.FunctionRegion});var a0=z0(PI(),1);var uI={};S1(uI,{default:()=>JDD,PostgrestTransformBuilder:()=>DG,PostgrestQueryBuilder:()=>$G,PostgrestFilterBuilder:()=>E6,PostgrestError:()=>B7,PostgrestClient:()=>f2,PostgrestBuilder:()=>eZ});var B7=class extends Error{constructor(D){super(D.message);this.name="PostgrestError",this.details=D.details,this.hint=D.hint,this.code=D.code}},eZ=class{constructor(D){var $,X,Y;if(this.shouldThrowOnError=!1,this.method=D.method,this.url=D.url,this.headers=new Headers(D.headers),this.schema=D.schema,this.body=D.body,this.shouldThrowOnError=($=D.shouldThrowOnError)!==null&&$!==void 0?$:!1,this.signal=D.signal,this.isMaybeSingle=(X=D.isMaybeSingle)!==null&&X!==void 0?X:!1,this.urlLengthLimit=(Y=D.urlLengthLimit)!==null&&Y!==void 0?Y:8000,D.fetch)this.fetch=D.fetch;else this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(D,$){return this.headers=new Headers(this.headers),this.headers.set(D,$),this}then(D,$){var X=this;if(this.schema===void 0);else if(["GET","HEAD"].includes(this.method))this.headers.set("Accept-Profile",this.schema);else this.headers.set("Content-Profile",this.schema);if(this.method!=="GET"&&this.method!=="HEAD")this.headers.set("Content-Type","application/json");let Y=this.fetch,J=Y(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async(Q)=>{let F=null,w=null,Z=null,G=Q.status,O=Q.statusText;if(Q.ok){var U,z;if(X.method!=="HEAD"){var q;let L=await Q.text();if(L==="");else if(X.headers.get("Accept")==="text/csv")w=L;else if(X.headers.get("Accept")&&((q=X.headers.get("Accept"))===null||q===void 0?void 0:q.includes("application/vnd.pgrst.plan+text")))w=L;else w=JSON.parse(L)}let K=(U=X.headers.get("Prefer"))===null||U===void 0?void 0:U.match(/count=(exact|planned|estimated)/),M=(z=Q.headers.get("content-range"))===null||z===void 0?void 0:z.split("/");if(K&&M&&M.length>1)Z=parseInt(M[1]);if(X.isMaybeSingle&&X.method==="GET"&&Array.isArray(w))if(w.length>1)F={code:"PGRST116",details:`Results contain ${w.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},w=null,Z=null,G=406,O="Not Acceptable";else if(w.length===1)w=w[0];else w=null}else{var B;let K=await Q.text();try{if(F=JSON.parse(K),Array.isArray(F)&&Q.status===404)w=[],F=null,G=200,O="OK"}catch(M){if(Q.status===404&&K==="")G=204,O="No Content";else F={message:K}}if(F&&X.isMaybeSingle&&(F===null||F===void 0||(B=F.details)===null||B===void 0?void 0:B.includes("0 rows")))F=null,G=200,O="OK";if(F&&X.shouldThrowOnError)throw new B7(F)}return{error:F,data:w,count:Z,status:G,statusText:O}});if(!this.shouldThrowOnError)J=J.catch((Q)=>{var F;let w="",Z="",G="",O=Q===null||Q===void 0?void 0:Q.cause;if(O){var U,z,q,B;let L=(U=O===null||O===void 0?void 0:O.message)!==null&&U!==void 0?U:"",I=(z=O===null||O===void 0?void 0:O.code)!==null&&z!==void 0?z:"";if(w=`${(q=Q===null||Q===void 0?void 0:Q.name)!==null&&q!==void 0?q:"FetchError"}: ${Q===null||Q===void 0?void 0:Q.message}`,w+=`
|
|
336
336
|
|
|
337
337
|
Caused by: ${(B=O===null||O===void 0?void 0:O.name)!==null&&B!==void 0?B:"Error"}: ${L}`,I)w+=` (${I})`;if(O===null||O===void 0?void 0:O.stack)w+=`
|
|
338
|
-
${O.stack}`}else{var K;w=(K=Q===null||Q===void 0?void 0:Q.stack)!==null&&K!==void 0?K:""}let M=this.url.toString().length;if((Q===null||Q===void 0?void 0:Q.name)==="AbortError"||(Q===null||Q===void 0?void 0:Q.code)==="ABORT_ERR"){if(G="",Z="Request was aborted (timeout or manual cancellation)",M>this.urlLengthLimit)Z+=`. Note: Your request URL is ${M} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`}else if((O===null||O===void 0?void 0:O.name)==="HeadersOverflowError"||(O===null||O===void 0?void 0:O.code)==="UND_ERR_HEADERS_OVERFLOW"){if(G="",Z="HTTP headers exceeded server limits (typically 16KB)",M>this.urlLengthLimit)Z+=`. Your request URL is ${M} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`}return{error:{message:`${(F=Q===null||Q===void 0?void 0:Q.name)!==null&&F!==void 0?F:"FetchError"}: ${Q===null||Q===void 0?void 0:Q.message}`,details:w,hint:Z,code:G},data:null,count:null,status:0,statusText:""}});return J.then(D,$)}returns(){return this}overrideTypes(){return this}},DG=class extends eZ{select(D){let $=!1,X=(D!==null&&D!==void 0?D:"*").split("").map((Y)=>{if(/\s/.test(Y)&&!$)return"";if(Y==='"')$=!$;return Y}).join("");return this.url.searchParams.set("select",X),this.headers.append("Prefer","return=representation"),this}order(D,{ascending:$=!0,nullsFirst:X,foreignTable:Y,referencedTable:J=Y}={}){let Q=J?`${J}.order`:"order",F=this.url.searchParams.get(Q);return this.url.searchParams.set(Q,`${F?`${F},`:""}${D}.${$?"asc":"desc"}${X===void 0?"":X?".nullsfirst":".nullslast"}`),this}limit(D,{foreignTable:$,referencedTable:X=$}={}){let Y=typeof X>"u"?"limit":`${X}.limit`;return this.url.searchParams.set(Y,`${D}`),this}range(D,$,{foreignTable:X,referencedTable:Y=X}={}){let J=typeof Y>"u"?"offset":`${Y}.offset`,Q=typeof Y>"u"?"limit":`${Y}.limit`;return this.url.searchParams.set(J,`${D}`),this.url.searchParams.set(Q,`${$-D+1}`),this}abortSignal(D){return this.signal=D,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){if(this.method==="GET")this.headers.set("Accept","application/json");else this.headers.set("Accept","application/vnd.pgrst.object+json");return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:D=!1,verbose:$=!1,settings:X=!1,buffers:Y=!1,wal:J=!1,format:Q="text"}={}){var F;let w=[D?"analyze":null,$?"verbose":null,X?"settings":null,Y?"buffers":null,J?"wal":null].filter(Boolean).join("|"),Z=(F=this.headers.get("Accept"))!==null&&F!==void 0?F:"application/json";if(this.headers.set("Accept",`application/vnd.pgrst.plan+${Q}; for="${Z}"; options=${w};`),Q==="json")return this;else return this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(D){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${D}`),this}},xI=new RegExp("[,()]"),E6=class extends DG{eq(D,$){return this.url.searchParams.append(D,`eq.${$}`),this}neq(D,$){return this.url.searchParams.append(D,`neq.${$}`),this}gt(D,$){return this.url.searchParams.append(D,`gt.${$}`),this}gte(D,$){return this.url.searchParams.append(D,`gte.${$}`),this}lt(D,$){return this.url.searchParams.append(D,`lt.${$}`),this}lte(D,$){return this.url.searchParams.append(D,`lte.${$}`),this}like(D,$){return this.url.searchParams.append(D,`like.${$}`),this}likeAllOf(D,$){return this.url.searchParams.append(D,`like(all).{${$.join(",")}}`),this}likeAnyOf(D,$){return this.url.searchParams.append(D,`like(any).{${$.join(",")}}`),this}ilike(D,$){return this.url.searchParams.append(D,`ilike.${$}`),this}ilikeAllOf(D,$){return this.url.searchParams.append(D,`ilike(all).{${$.join(",")}}`),this}ilikeAnyOf(D,$){return this.url.searchParams.append(D,`ilike(any).{${$.join(",")}}`),this}regexMatch(D,$){return this.url.searchParams.append(D,`match.${$}`),this}regexIMatch(D,$){return this.url.searchParams.append(D,`imatch.${$}`),this}is(D,$){return this.url.searchParams.append(D,`is.${$}`),this}isDistinct(D,$){return this.url.searchParams.append(D,`isdistinct.${$}`),this}in(D,$){let X=Array.from(new Set($)).map((Y)=>{if(typeof Y==="string"&&xI.test(Y))return`"${Y}"`;else return`${Y}`}).join(",");return this.url.searchParams.append(D,`in.(${X})`),this}notIn(D,$){let X=Array.from(new Set($)).map((Y)=>{if(typeof Y==="string"&&xI.test(Y))return`"${Y}"`;else return`${Y}`}).join(",");return this.url.searchParams.append(D,`not.in.(${X})`),this}contains(D,$){if(typeof $==="string")this.url.searchParams.append(D,`cs.${$}`);else if(Array.isArray($))this.url.searchParams.append(D,`cs.{${$.join(",")}}`);else this.url.searchParams.append(D,`cs.${JSON.stringify($)}`);return this}containedBy(D,$){if(typeof $==="string")this.url.searchParams.append(D,`cd.${$}`);else if(Array.isArray($))this.url.searchParams.append(D,`cd.{${$.join(",")}}`);else this.url.searchParams.append(D,`cd.${JSON.stringify($)}`);return this}rangeGt(D,$){return this.url.searchParams.append(D,`sr.${$}`),this}rangeGte(D,$){return this.url.searchParams.append(D,`nxl.${$}`),this}rangeLt(D,$){return this.url.searchParams.append(D,`sl.${$}`),this}rangeLte(D,$){return this.url.searchParams.append(D,`nxr.${$}`),this}rangeAdjacent(D,$){return this.url.searchParams.append(D,`adj.${$}`),this}overlaps(D,$){if(typeof $==="string")this.url.searchParams.append(D,`ov.${$}`);else this.url.searchParams.append(D,`ov.{${$.join(",")}}`);return this}textSearch(D,$,{config:X,type:Y}={}){let J="";if(Y==="plain")J="pl";else if(Y==="phrase")J="ph";else if(Y==="websearch")J="w";let Q=X===void 0?"":`(${X})`;return this.url.searchParams.append(D,`${J}fts${Q}.${$}`),this}match(D){return Object.entries(D).forEach(([$,X])=>{this.url.searchParams.append($,`eq.${X}`)}),this}not(D,$,X){return this.url.searchParams.append(D,`not.${$}.${X}`),this}or(D,{foreignTable:$,referencedTable:X=$}={}){let Y=X?`${X}.or`:"or";return this.url.searchParams.append(Y,`(${D})`),this}filter(D,$,X){return this.url.searchParams.append(D,`${$}.${X}`),this}},$G=class{constructor(D,{headers:$={},schema:X,fetch:Y,urlLengthLimit:J=8000}){this.url=D,this.headers=new Headers($),this.schema=X,this.fetch=Y,this.urlLengthLimit=J}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(D,$){let{head:X=!1,count:Y}=$!==null&&$!==void 0?$:{},J=X?"HEAD":"GET",Q=!1,F=(D!==null&&D!==void 0?D:"*").split("").map((G)=>{if(/\s/.test(G)&&!Q)return"";if(G==='"')Q=!Q;return G}).join(""),{url:w,headers:Z}=this.cloneRequestState();if(w.searchParams.set("select",F),Y)Z.append("Prefer",`count=${Y}`);return new E6({method:J,url:w,headers:Z,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}insert(D,{count:$,defaultToNull:X=!0}={}){var Y;let J="POST",{url:Q,headers:F}=this.cloneRequestState();if($)F.append("Prefer",`count=${$}`);if(!X)F.append("Prefer","missing=default");if(Array.isArray(D)){let w=D.reduce((Z,G)=>Z.concat(Object.keys(G)),[]);if(w.length>0){let Z=[...new Set(w)].map((G)=>`"${G}"`);Q.searchParams.set("columns",Z.join(","))}}return new E6({method:"POST",url:Q,headers:F,schema:this.schema,body:D,fetch:(Y=this.fetch)!==null&&Y!==void 0?Y:fetch,urlLengthLimit:this.urlLengthLimit})}upsert(D,{onConflict:$,ignoreDuplicates:X=!1,count:Y,defaultToNull:J=!0}={}){var Q;let F="POST",{url:w,headers:Z}=this.cloneRequestState();if(Z.append("Prefer",`resolution=${X?"ignore":"merge"}-duplicates`),$!==void 0)w.searchParams.set("on_conflict",$);if(Y)Z.append("Prefer",`count=${Y}`);if(!J)Z.append("Prefer","missing=default");if(Array.isArray(D)){let G=D.reduce((O,U)=>O.concat(Object.keys(U)),[]);if(G.length>0){let O=[...new Set(G)].map((U)=>`"${U}"`);w.searchParams.set("columns",O.join(","))}}return new E6({method:"POST",url:w,headers:Z,schema:this.schema,body:D,fetch:(Q=this.fetch)!==null&&Q!==void 0?Q:fetch,urlLengthLimit:this.urlLengthLimit})}update(D,{count:$}={}){var X;let Y="PATCH",{url:J,headers:Q}=this.cloneRequestState();if($)Q.append("Prefer",`count=${$}`);return new E6({method:"PATCH",url:J,headers:Q,schema:this.schema,body:D,fetch:(X=this.fetch)!==null&&X!==void 0?X:fetch,urlLengthLimit:this.urlLengthLimit})}delete({count:D}={}){var $;let X="DELETE",{url:Y,headers:J}=this.cloneRequestState();if(D)J.append("Prefer",`count=${D}`);return new E6({method:"DELETE",url:Y,headers:J,schema:this.schema,fetch:($=this.fetch)!==null&&$!==void 0?$:fetch,urlLengthLimit:this.urlLengthLimit})}};function z7(D){return z7=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},z7(D)}function DDD(D,$){if(z7(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(z7(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}function $DD(D){var $=DDD(D,"string");return z7($)=="symbol"?$:$+""}function XDD(D,$,X){return($=$DD($))in D?Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0}):D[$]=X,D}function SI(D,$){var X=Object.keys(D);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(D);$&&(Y=Y.filter(function(J){return Object.getOwnPropertyDescriptor(D,J).enumerable})),X.push.apply(X,Y)}return X}function _2(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?SI(Object(X),!0).forEach(function(Y){XDD(D,Y,X[Y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):SI(Object(X)).forEach(function(Y){Object.defineProperty(D,Y,Object.getOwnPropertyDescriptor(X,Y))})}return D}var f2=class D{constructor($,{headers:X={},schema:Y,fetch:J,timeout:Q,urlLengthLimit:F=8000}={}){this.url=$,this.headers=new Headers(X),this.schemaName=Y,this.urlLengthLimit=F;let w=J!==null&&J!==void 0?J:globalThis.fetch;if(Q!==void 0&&Q>0)this.fetch=(Z,G)=>{let O=new AbortController,U=setTimeout(()=>O.abort(),Q),z=G===null||G===void 0?void 0:G.signal;if(z){if(z.aborted)return clearTimeout(U),w(Z,G);let q=()=>{clearTimeout(U),O.abort()};return z.addEventListener("abort",q,{once:!0}),w(Z,_2(_2({},G),{},{signal:O.signal})).finally(()=>{clearTimeout(U),z.removeEventListener("abort",q)})}return w(Z,_2(_2({},G),{},{signal:O.signal})).finally(()=>clearTimeout(U))};else this.fetch=w}from($){if(!$||typeof $!=="string"||$.trim()==="")throw Error("Invalid relation name: relation must be a non-empty string.");return new $G(new URL(`${this.url}/${$}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema($){return new D(this.url,{headers:this.headers,schema:$,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}rpc($,X={},{head:Y=!1,get:J=!1,count:Q}={}){var F;let w,Z=new URL(`${this.url}/rpc/${$}`),G,O=(q)=>q!==null&&typeof q==="object"&&(!Array.isArray(q)||q.some(O)),U=Y&&Object.values(X).some(O);if(U)w="POST",G=X;else if(Y||J)w=Y?"HEAD":"GET",Object.entries(X).filter(([q,B])=>B!==void 0).map(([q,B])=>[q,Array.isArray(B)?`{${B.join(",")}}`:`${B}`]).forEach(([q,B])=>{Z.searchParams.append(q,B)});else w="POST",G=X;let z=new Headers(this.headers);if(U)z.set("Prefer",Q?`count=${Q},return=minimal`:"return=minimal");else if(Q)z.set("Prefer",`count=${Q}`);return new E6({method:w,url:Z,headers:z,schema:this.schemaName,body:G,fetch:(F=this.fetch)!==null&&F!==void 0?F:fetch,urlLengthLimit:this.urlLengthLimit})}},JDD={PostgrestClient:f2,PostgrestQueryBuilder:$G,PostgrestFilterBuilder:E6,PostgrestTransformBuilder:DG,PostgrestBuilder:eZ,PostgrestError:B7};var Dj=z0(UG(),1);var _A={};S1(_A,{isStorageVectorsError:()=>Q0D,isStorageError:()=>p8,VectorIndexScope:()=>vA,VectorIndexApi:()=>CA,VectorDataApi:()=>PA,VectorBucketScope:()=>uA,VectorBucketApi:()=>xA,StorageVectorsUnknownError:()=>w0D,StorageVectorsErrorCode:()=>Z0D,StorageVectorsError:()=>Y0D,StorageVectorsClient:()=>SA,StorageVectorsApiError:()=>F0D,StorageUnknownError:()=>c2,StorageError:()=>i8,StorageClient:()=>KG,StorageApiError:()=>n8,StorageAnalyticsClient:()=>TA});var V7=class extends Error{constructor(D,$){super(D);this.name="IcebergError",this.status=$.status,this.icebergType=$.icebergType,this.icebergCode=$.icebergCode,this.details=$.details,this.isCommitStateUnknown=$.icebergType==="CommitStateUnknownException"||[500,502,504].includes($.status)&&$.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function eDD(D,$,X){let Y=new URL($,D);if(X){for(let[J,Q]of Object.entries(X))if(Q!==void 0)Y.searchParams.set(J,Q)}return Y.toString()}async function D0D(D){if(!D||D.type==="none")return{};if(D.type==="bearer")return{Authorization:`Bearer ${D.token}`};if(D.type==="header")return{[D.name]:D.value};if(D.type==="custom")return await D.getHeaders();return{}}function $0D(D){let $=D.fetchImpl??globalThis.fetch;return{async request({method:X,path:Y,query:J,body:Q,headers:F}){let w=eDD(D.baseUrl,Y,J),Z=await D0D(D.auth),G=await $(w,{method:X,headers:{...Q?{"Content-Type":"application/json"}:{},...Z,...F},body:Q?JSON.stringify(Q):void 0}),O=await G.text(),U=(G.headers.get("content-type")||"").includes("application/json"),z=U&&O?JSON.parse(O):O;if(!G.ok){let q=U?z:void 0,B=q?.error;throw new V7(B?.message??`Request failed with status ${G.status}`,{status:G.status,icebergType:B?.type,icebergCode:B?.code,details:q})}return{status:G.status,headers:G.headers,data:z}}}}function d2(D){return D.join("\x1F")}var X0D=class{constructor(D,$=""){this.client=D,this.prefix=$}async listNamespaces(D){let $=D?{parent:d2(D.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:$})).data.namespaces.map((Y)=>({namespace:Y}))}async createNamespace(D,$){let X={namespace:D.namespace,properties:$?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:X})).data}async dropNamespace(D){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${d2(D.namespace)}`})}async loadNamespaceMetadata(D){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${d2(D.namespace)}`})).data.properties}}async namespaceExists(D){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${d2(D.namespace)}`}),!0}catch($){if($ instanceof V7&&$.status===404)return!1;throw $}}async createNamespaceIfNotExists(D,$){try{return await this.createNamespace(D,$)}catch(X){if(X instanceof V7&&X.status===409)return;throw X}}};function l8(D){return D.join("\x1F")}var J0D=class{constructor(D,$="",X){this.client=D,this.prefix=$,this.accessDelegation=X}async listTables(D){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${l8(D.namespace)}/tables`})).data.identifiers}async createTable(D,$){let X={};if(this.accessDelegation)X["X-Iceberg-Access-Delegation"]=this.accessDelegation;return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${l8(D.namespace)}/tables`,body:$,headers:X})).data.metadata}async updateTable(D,$){let X=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${l8(D.namespace)}/tables/${D.name}`,body:$});return{"metadata-location":X.data["metadata-location"],metadata:X.data.metadata}}async dropTable(D,$){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${l8(D.namespace)}/tables/${D.name}`,query:{purgeRequested:String($?.purge??!1)}})}async loadTable(D){let $={};if(this.accessDelegation)$["X-Iceberg-Access-Delegation"]=this.accessDelegation;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${l8(D.namespace)}/tables/${D.name}`,headers:$})).data.metadata}async tableExists(D){let $={};if(this.accessDelegation)$["X-Iceberg-Access-Delegation"]=this.accessDelegation;try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${l8(D.namespace)}/tables/${D.name}`,headers:$}),!0}catch(X){if(X instanceof V7&&X.status===404)return!1;throw X}}async createTableIfNotExists(D,$){try{return await this.createTable(D,$)}catch(X){if(X instanceof V7&&X.status===409)return await this.loadTable({namespace:D.namespace,name:$.name});throw X}}},LA=class{constructor(D){let $="v1";if(D.catalogName)$+=`/${D.catalogName}`;let X=D.baseUrl.endsWith("/")?D.baseUrl:`${D.baseUrl}/`;this.client=$0D({baseUrl:X,auth:D.auth,fetchImpl:D.fetch}),this.accessDelegation=D.accessDelegation?.join(","),this.namespaceOps=new X0D(this.client,$),this.tableOps=new J0D(this.client,$,this.accessDelegation)}async listNamespaces(D){return this.namespaceOps.listNamespaces(D)}async createNamespace(D,$){return this.namespaceOps.createNamespace(D,$)}async dropNamespace(D){await this.namespaceOps.dropNamespace(D)}async loadNamespaceMetadata(D){return this.namespaceOps.loadNamespaceMetadata(D)}async listTables(D){return this.tableOps.listTables(D)}async createTable(D,$){return this.tableOps.createTable(D,$)}async updateTable(D,$){return this.tableOps.updateTable(D,$)}async dropTable(D,$){await this.tableOps.dropTable(D,$)}async loadTable(D){return this.tableOps.loadTable(D)}async namespaceExists(D){return this.namespaceOps.namespaceExists(D)}async tableExists(D){return this.tableOps.tableExists(D)}async createNamespaceIfNotExists(D,$){return this.namespaceOps.createNamespaceIfNotExists(D,$)}async createTableIfNotExists(D,$){return this.tableOps.createTableIfNotExists(D,$)}};var i8=class extends Error{constructor(D,$="storage",X,Y){super(D);this.__isStorageError=!0,this.namespace=$,this.name=$==="vectors"?"StorageVectorsError":"StorageError",this.status=X,this.statusCode=Y}};function p8(D){return typeof D==="object"&&D!==null&&"__isStorageError"in D}var n8=class extends i8{constructor(D,$,X,Y="storage"){super(D,Y,$,X);this.name=Y==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=$,this.statusCode=X}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},c2=class extends i8{constructor(D,$,X="storage"){super(D,X);this.name=X==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=$}},Y0D=class extends i8{constructor(D){super(D,"vectors")}};function Q0D(D){return p8(D)&&D.namespace==="vectors"}var F0D=class extends n8{constructor(D,$,X){super(D,$,X,"vectors")}},w0D=class extends c2{constructor(D,$){super(D,$,"vectors")}},Z0D=function(D){return D.InternalError="InternalError",D.S3VectorConflictException="S3VectorConflictException",D.S3VectorNotFoundException="S3VectorNotFoundException",D.S3VectorBucketNotEmpty="S3VectorBucketNotEmpty",D.S3VectorMaxBucketsExceeded="S3VectorMaxBucketsExceeded",D.S3VectorMaxIndexesExceeded="S3VectorMaxIndexesExceeded",D}({}),G0D=(D)=>{if(D)return(...$)=>D(...$);return(...$)=>fetch(...$)},O0D=(D)=>{if(typeof D!=="object"||D===null)return!1;let $=Object.getPrototypeOf(D);return($===null||$===Object.prototype||Object.getPrototypeOf($)===null)&&!(Symbol.toStringTag in D)&&!(Symbol.iterator in D)},qG=(D)=>{if(Array.isArray(D))return D.map((X)=>qG(X));else if(typeof D==="function"||D!==Object(D))return D;let $={};return Object.entries(D).forEach(([X,Y])=>{let J=X.replace(/([-_][a-z])/gi,(Q)=>Q.toUpperCase().replace(/[-_]/g,""));$[J]=qG(Y)}),$},U0D=(D)=>{if(!D||typeof D!=="string")return!1;if(D.length===0||D.length>100)return!1;if(D.trim()!==D)return!1;if(D.includes("/")||D.includes("\\"))return!1;return/^[\w!.\*'() &$@=;:+,?-]+$/.test(D)};function M7(D){return M7=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},M7(D)}function q0D(D,$){if(M7(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(M7(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}function z0D(D){var $=q0D(D,"string");return M7($)=="symbol"?$:$+""}function B0D(D,$,X){return($=z0D($))in D?Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0}):D[$]=X,D}function IA(D,$){var X=Object.keys(D);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(D);$&&(Y=Y.filter(function(J){return Object.getOwnPropertyDescriptor(D,J).enumerable})),X.push.apply(X,Y)}return X}function ND(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?IA(Object(X),!0).forEach(function(Y){B0D(D,Y,X[Y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):IA(Object(X)).forEach(function(Y){Object.defineProperty(D,Y,Object.getOwnPropertyDescriptor(X,Y))})}return D}var AA=(D)=>{var $;return D.msg||D.message||D.error_description||(typeof D.error==="string"?D.error:($=D.error)===null||$===void 0?void 0:$.message)||JSON.stringify(D)},K0D=async(D,$,X,Y)=>{if(D&&typeof D==="object"&&"status"in D&&"ok"in D&&typeof D.status==="number"&&!(X===null||X===void 0?void 0:X.noResolveJson)){let J=D,Q=J.status||500;if(typeof J.json==="function")J.json().then((F)=>{let w=(F===null||F===void 0?void 0:F.statusCode)||(F===null||F===void 0?void 0:F.code)||Q+"";$(new n8(AA(F),Q,w,Y))}).catch(()=>{if(Y==="vectors"){let F=Q+"";$(new n8(J.statusText||`HTTP ${Q} error`,Q,F,Y))}else{let F=Q+"";$(new n8(J.statusText||`HTTP ${Q} error`,Q,F,Y))}});else{let F=Q+"";$(new n8(J.statusText||`HTTP ${Q} error`,Q,F,Y))}}else $(new c2(AA(D),D,Y))},W0D=(D,$,X,Y)=>{let J={method:D,headers:($===null||$===void 0?void 0:$.headers)||{}};if(D==="GET"||D==="HEAD"||!Y)return ND(ND({},J),X);if(O0D(Y))J.headers=ND({"Content-Type":"application/json"},$===null||$===void 0?void 0:$.headers),J.body=JSON.stringify(Y);else J.body=Y;if($===null||$===void 0?void 0:$.duplex)J.duplex=$.duplex;return ND(ND({},J),X)};async function N7(D,$,X,Y,J,Q,F){return new Promise((w,Z)=>{D(X,W0D($,Y,J,Q)).then((G)=>{if(!G.ok)throw G;if(Y===null||Y===void 0?void 0:Y.noResolveJson)return G;if(F==="vectors"){let O=G.headers.get("content-type");if(G.headers.get("content-length")==="0"||G.status===204)return{};if(!O||!O.includes("application/json"))return{}}return G.json()}).then((G)=>w(G)).catch((G)=>K0D(G,Z,Y,F))})}function jA(D="storage"){return{get:async($,X,Y,J)=>{return N7($,"GET",X,Y,J,void 0,D)},post:async($,X,Y,J,Q)=>{return N7($,"POST",X,J,Q,Y,D)},put:async($,X,Y,J,Q)=>{return N7($,"PUT",X,J,Q,Y,D)},head:async($,X,Y,J)=>{return N7($,"HEAD",X,ND(ND({},Y),{},{noResolveJson:!0}),J,void 0,D)},remove:async($,X,Y,J,Q)=>{return N7($,"DELETE",X,J,Q,Y,D)}}}var H0D=jA("storage"),{get:L7,post:Y$,put:zG,head:V0D,remove:BG}=H0D,u1=jA("vectors"),r8=class{constructor(D,$={},X,Y="storage"){this.shouldThrowOnError=!1,this.url=D,this.headers=$,this.fetch=G0D(X),this.namespace=Y}throwOnError(){return this.shouldThrowOnError=!0,this}async handleOperation(D){var $=this;try{return{data:await D(),error:null}}catch(X){if($.shouldThrowOnError)throw X;if(p8(X))return{data:null,error:X};throw X}}},N0D=class{constructor(D,$){this.downloadFn=D,this.shouldThrowOnError=$}then(D,$){return this.execute().then(D,$)}async execute(){var D=this;try{return{data:(await D.downloadFn()).body,error:null}}catch($){if(D.shouldThrowOnError)throw $;if(p8($))return{data:null,error:$};throw $}}},EA;EA=Symbol.toStringTag;var M0D=class{constructor(D,$){this.downloadFn=D,this.shouldThrowOnError=$,this[EA]="BlobDownloadBuilder",this.promise=null}asStream(){return new N0D(this.downloadFn,this.shouldThrowOnError)}then(D,$){return this.getPromise().then(D,$)}catch(D){return this.getPromise().catch(D)}finally(D){return this.getPromise().finally(D)}getPromise(){if(!this.promise)this.promise=this.execute();return this.promise}async execute(){var D=this;try{return{data:await(await D.downloadFn()).blob(),error:null}}catch($){if(D.shouldThrowOnError)throw $;if(p8($))return{data:null,error:$};throw $}}},L0D={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},RA={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},I0D=class extends r8{constructor(D,$={},X,Y){super(D,$,Y,"storage");this.bucketId=X}async uploadOrUpdate(D,$,X,Y){var J=this;return J.handleOperation(async()=>{let Q,F=ND(ND({},RA),Y),w=ND(ND({},J.headers),D==="POST"&&{"x-upsert":String(F.upsert)}),Z=F.metadata;if(typeof Blob<"u"&&X instanceof Blob){if(Q=new FormData,Q.append("cacheControl",F.cacheControl),Z)Q.append("metadata",J.encodeMetadata(Z));Q.append("",X)}else if(typeof FormData<"u"&&X instanceof FormData){if(Q=X,!Q.has("cacheControl"))Q.append("cacheControl",F.cacheControl);if(Z&&!Q.has("metadata"))Q.append("metadata",J.encodeMetadata(Z))}else{if(Q=X,w["cache-control"]=`max-age=${F.cacheControl}`,w["content-type"]=F.contentType,Z)w["x-metadata"]=J.toBase64(J.encodeMetadata(Z));if((typeof ReadableStream<"u"&&Q instanceof ReadableStream||Q&&typeof Q==="object"&&("pipe"in Q)&&typeof Q.pipe==="function")&&!F.duplex)F.duplex="half"}if(Y===null||Y===void 0?void 0:Y.headers)w=ND(ND({},w),Y.headers);let G=J._removeEmptyFolders($),O=J._getFinalPath(G),U=await(D=="PUT"?zG:Y$)(J.fetch,`${J.url}/object/${O}`,Q,ND({headers:w},(F===null||F===void 0?void 0:F.duplex)?{duplex:F.duplex}:{}));return{path:G,id:U.Id,fullPath:U.Key}})}async upload(D,$,X){return this.uploadOrUpdate("POST",D,$,X)}async uploadToSignedUrl(D,$,X,Y){var J=this;let Q=J._removeEmptyFolders(D),F=J._getFinalPath(Q),w=new URL(J.url+`/object/upload/sign/${F}`);return w.searchParams.set("token",$),J.handleOperation(async()=>{let Z,G=ND({upsert:RA.upsert},Y),O=ND(ND({},J.headers),{"x-upsert":String(G.upsert)});if(typeof Blob<"u"&&X instanceof Blob)Z=new FormData,Z.append("cacheControl",G.cacheControl),Z.append("",X);else if(typeof FormData<"u"&&X instanceof FormData)Z=X,Z.append("cacheControl",G.cacheControl);else Z=X,O["cache-control"]=`max-age=${G.cacheControl}`,O["content-type"]=G.contentType;return{path:Q,fullPath:(await zG(J.fetch,w.toString(),Z,{headers:O})).Key}})}async createSignedUploadUrl(D,$){var X=this;return X.handleOperation(async()=>{let Y=X._getFinalPath(D),J=ND({},X.headers);if($===null||$===void 0?void 0:$.upsert)J["x-upsert"]="true";let Q=await Y$(X.fetch,`${X.url}/object/upload/sign/${Y}`,{},{headers:J}),F=new URL(X.url+Q.url),w=F.searchParams.get("token");if(!w)throw new i8("No token returned by API");return{signedUrl:F.toString(),path:D,token:w}})}async update(D,$,X){return this.uploadOrUpdate("PUT",D,$,X)}async move(D,$,X){var Y=this;return Y.handleOperation(async()=>{return await Y$(Y.fetch,`${Y.url}/object/move`,{bucketId:Y.bucketId,sourceKey:D,destinationKey:$,destinationBucket:X===null||X===void 0?void 0:X.destinationBucket},{headers:Y.headers})})}async copy(D,$,X){var Y=this;return Y.handleOperation(async()=>{return{path:(await Y$(Y.fetch,`${Y.url}/object/copy`,{bucketId:Y.bucketId,sourceKey:D,destinationKey:$,destinationBucket:X===null||X===void 0?void 0:X.destinationBucket},{headers:Y.headers})).Key}})}async createSignedUrl(D,$,X){var Y=this;return Y.handleOperation(async()=>{let J=Y._getFinalPath(D),Q=await Y$(Y.fetch,`${Y.url}/object/sign/${J}`,ND({expiresIn:$},(X===null||X===void 0?void 0:X.transform)?{transform:X.transform}:{}),{headers:Y.headers}),F=(X===null||X===void 0?void 0:X.download)?`&download=${X.download===!0?"":X.download}`:"";return{signedUrl:encodeURI(`${Y.url}${Q.signedURL}${F}`)}})}async createSignedUrls(D,$,X){var Y=this;return Y.handleOperation(async()=>{let J=await Y$(Y.fetch,`${Y.url}/object/sign/${Y.bucketId}`,{expiresIn:$,paths:D},{headers:Y.headers}),Q=(X===null||X===void 0?void 0:X.download)?`&download=${X.download===!0?"":X.download}`:"";return J.map((F)=>ND(ND({},F),{},{signedUrl:F.signedURL?encodeURI(`${Y.url}${F.signedURL}${Q}`):null}))})}download(D,$,X){let Y=typeof($===null||$===void 0?void 0:$.transform)<"u"?"render/image/authenticated":"object",J=this.transformOptsToQueryString(($===null||$===void 0?void 0:$.transform)||{}),Q=J?`?${J}`:"",F=this._getFinalPath(D);return new M0D(()=>L7(this.fetch,`${this.url}/${Y}/${F}${Q}`,{headers:this.headers,noResolveJson:!0},X),this.shouldThrowOnError)}async info(D){var $=this;let X=$._getFinalPath(D);return $.handleOperation(async()=>{return qG(await L7($.fetch,`${$.url}/object/info/${X}`,{headers:$.headers}))})}async exists(D){var $=this;let X=$._getFinalPath(D);try{return await V0D($.fetch,`${$.url}/object/${X}`,{headers:$.headers}),{data:!0,error:null}}catch(Y){if($.shouldThrowOnError)throw Y;if(p8(Y)&&Y instanceof c2){let J=Y.originalError;if([400,404].includes(J===null||J===void 0?void 0:J.status))return{data:!1,error:Y}}throw Y}}getPublicUrl(D,$){let X=this._getFinalPath(D),Y=[],J=($===null||$===void 0?void 0:$.download)?`download=${$.download===!0?"":$.download}`:"";if(J!=="")Y.push(J);let Q=typeof($===null||$===void 0?void 0:$.transform)<"u"?"render/image":"object",F=this.transformOptsToQueryString(($===null||$===void 0?void 0:$.transform)||{});if(F!=="")Y.push(F);let w=Y.join("&");if(w!=="")w=`?${w}`;return{data:{publicUrl:encodeURI(`${this.url}/${Q}/public/${X}${w}`)}}}async remove(D){var $=this;return $.handleOperation(async()=>{return await BG($.fetch,`${$.url}/object/${$.bucketId}`,{prefixes:D},{headers:$.headers})})}async list(D,$,X){var Y=this;return Y.handleOperation(async()=>{let J=ND(ND(ND({},L0D),$),{},{prefix:D||""});return await Y$(Y.fetch,`${Y.url}/object/list/${Y.bucketId}`,J,{headers:Y.headers},X)})}async listV2(D,$){var X=this;return X.handleOperation(async()=>{let Y=ND({},D);return await Y$(X.fetch,`${X.url}/object/list-v2/${X.bucketId}`,Y,{headers:X.headers},$)})}encodeMetadata(D){return JSON.stringify(D)}toBase64(D){if(typeof Buffer<"u")return Buffer.from(D).toString("base64");return btoa(D)}_getFinalPath(D){return`${this.bucketId}/${D.replace(/^\/+/,"")}`}_removeEmptyFolders(D){return D.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(D){let $=[];if(D.width)$.push(`width=${D.width}`);if(D.height)$.push(`height=${D.height}`);if(D.resize)$.push(`resize=${D.resize}`);if(D.format)$.push(`format=${D.format}`);if(D.quality)$.push(`quality=${D.quality}`);return $.join("&")}},A0D="2.95.3",I7={"X-Client-Info":`storage-js/${A0D}`},R0D=class extends r8{constructor(D,$={},X,Y){let J=new URL(D);if(Y===null||Y===void 0?void 0:Y.useNewHostname){if(/supabase\.(co|in|red)$/.test(J.hostname)&&!J.hostname.includes("storage.supabase."))J.hostname=J.hostname.replace("supabase.","storage.supabase.")}let Q=J.href.replace(/\/$/,""),F=ND(ND({},I7),$);super(Q,F,X,"storage")}async listBuckets(D){var $=this;return $.handleOperation(async()=>{let X=$.listBucketOptionsToQueryString(D);return await L7($.fetch,`${$.url}/bucket${X}`,{headers:$.headers})})}async getBucket(D){var $=this;return $.handleOperation(async()=>{return await L7($.fetch,`${$.url}/bucket/${D}`,{headers:$.headers})})}async createBucket(D,$={public:!1}){var X=this;return X.handleOperation(async()=>{return await Y$(X.fetch,`${X.url}/bucket`,{id:D,name:D,type:$.type,public:$.public,file_size_limit:$.fileSizeLimit,allowed_mime_types:$.allowedMimeTypes},{headers:X.headers})})}async updateBucket(D,$){var X=this;return X.handleOperation(async()=>{return await zG(X.fetch,`${X.url}/bucket/${D}`,{id:D,name:D,public:$.public,file_size_limit:$.fileSizeLimit,allowed_mime_types:$.allowedMimeTypes},{headers:X.headers})})}async emptyBucket(D){var $=this;return $.handleOperation(async()=>{return await Y$($.fetch,`${$.url}/bucket/${D}/empty`,{},{headers:$.headers})})}async deleteBucket(D){var $=this;return $.handleOperation(async()=>{return await BG($.fetch,`${$.url}/bucket/${D}`,{},{headers:$.headers})})}listBucketOptionsToQueryString(D){let $={};if(D){if("limit"in D)$.limit=String(D.limit);if("offset"in D)$.offset=String(D.offset);if(D.search)$.search=D.search;if(D.sortColumn)$.sortColumn=D.sortColumn;if(D.sortOrder)$.sortOrder=D.sortOrder}return Object.keys($).length>0?"?"+new URLSearchParams($).toString():""}},TA=class extends r8{constructor(D,$={},X){let Y=D.replace(/\/$/,""),J=ND(ND({},I7),$);super(Y,J,X,"storage")}async createBucket(D){var $=this;return $.handleOperation(async()=>{return await Y$($.fetch,`${$.url}/bucket`,{name:D},{headers:$.headers})})}async listBuckets(D){var $=this;return $.handleOperation(async()=>{let X=new URLSearchParams;if((D===null||D===void 0?void 0:D.limit)!==void 0)X.set("limit",D.limit.toString());if((D===null||D===void 0?void 0:D.offset)!==void 0)X.set("offset",D.offset.toString());if(D===null||D===void 0?void 0:D.sortColumn)X.set("sortColumn",D.sortColumn);if(D===null||D===void 0?void 0:D.sortOrder)X.set("sortOrder",D.sortOrder);if(D===null||D===void 0?void 0:D.search)X.set("search",D.search);let Y=X.toString(),J=Y?`${$.url}/bucket?${Y}`:`${$.url}/bucket`;return await L7($.fetch,J,{headers:$.headers})})}async deleteBucket(D){var $=this;return $.handleOperation(async()=>{return await BG($.fetch,`${$.url}/bucket/${D}`,{},{headers:$.headers})})}from(D){var $=this;if(!U0D(D))throw new i8("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");let X=new LA({baseUrl:this.url,catalogName:D,auth:{type:"custom",getHeaders:async()=>$.headers},fetch:this.fetch}),Y=this.shouldThrowOnError;return new Proxy(X,{get(J,Q){let F=J[Q];if(typeof F!=="function")return F;return async(...w)=>{try{return{data:await F.apply(J,w),error:null}}catch(Z){if(Y)throw Z;return{data:null,error:Z}}}}})}},CA=class extends r8{constructor(D,$={},X){let Y=D.replace(/\/$/,""),J=ND(ND({},I7),{},{"Content-Type":"application/json"},$);super(Y,J,X,"vectors")}async createIndex(D){var $=this;return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/CreateIndex`,D,{headers:$.headers})||{}})}async getIndex(D,$){var X=this;return X.handleOperation(async()=>{return await u1.post(X.fetch,`${X.url}/GetIndex`,{vectorBucketName:D,indexName:$},{headers:X.headers})})}async listIndexes(D){var $=this;return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/ListIndexes`,D,{headers:$.headers})})}async deleteIndex(D,$){var X=this;return X.handleOperation(async()=>{return await u1.post(X.fetch,`${X.url}/DeleteIndex`,{vectorBucketName:D,indexName:$},{headers:X.headers})||{}})}},PA=class extends r8{constructor(D,$={},X){let Y=D.replace(/\/$/,""),J=ND(ND({},I7),{},{"Content-Type":"application/json"},$);super(Y,J,X,"vectors")}async putVectors(D){var $=this;if(D.vectors.length<1||D.vectors.length>500)throw Error("Vector batch size must be between 1 and 500 items");return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/PutVectors`,D,{headers:$.headers})||{}})}async getVectors(D){var $=this;return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/GetVectors`,D,{headers:$.headers})})}async listVectors(D){var $=this;if(D.segmentCount!==void 0){if(D.segmentCount<1||D.segmentCount>16)throw Error("segmentCount must be between 1 and 16");if(D.segmentIndex!==void 0){if(D.segmentIndex<0||D.segmentIndex>=D.segmentCount)throw Error(`segmentIndex must be between 0 and ${D.segmentCount-1}`)}}return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/ListVectors`,D,{headers:$.headers})})}async queryVectors(D){var $=this;return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/QueryVectors`,D,{headers:$.headers})})}async deleteVectors(D){var $=this;if(D.keys.length<1||D.keys.length>500)throw Error("Keys batch size must be between 1 and 500 items");return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/DeleteVectors`,D,{headers:$.headers})||{}})}},xA=class extends r8{constructor(D,$={},X){let Y=D.replace(/\/$/,""),J=ND(ND({},I7),{},{"Content-Type":"application/json"},$);super(Y,J,X,"vectors")}async createBucket(D){var $=this;return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/CreateVectorBucket`,{vectorBucketName:D},{headers:$.headers})||{}})}async getBucket(D){var $=this;return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/GetVectorBucket`,{vectorBucketName:D},{headers:$.headers})})}async listBuckets(D={}){var $=this;return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/ListVectorBuckets`,D,{headers:$.headers})})}async deleteBucket(D){var $=this;return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/DeleteVectorBucket`,{vectorBucketName:D},{headers:$.headers})||{}})}},SA=class extends xA{constructor(D,$={}){super(D,$.headers||{},$.fetch)}from(D){return new uA(this.url,this.headers,D,this.fetch)}async createBucket(D){var $=()=>super.createBucket,X=this;return $().call(X,D)}async getBucket(D){var $=()=>super.getBucket,X=this;return $().call(X,D)}async listBuckets(D={}){var $=()=>super.listBuckets,X=this;return $().call(X,D)}async deleteBucket(D){var $=()=>super.deleteBucket,X=this;return $().call(X,D)}},uA=class extends CA{constructor(D,$,X,Y){super(D,$,Y);this.vectorBucketName=X}async createIndex(D){var $=()=>super.createIndex,X=this;return $().call(X,ND(ND({},D),{},{vectorBucketName:X.vectorBucketName}))}async listIndexes(D={}){var $=()=>super.listIndexes,X=this;return $().call(X,ND(ND({},D),{},{vectorBucketName:X.vectorBucketName}))}async getIndex(D){var $=()=>super.getIndex,X=this;return $().call(X,X.vectorBucketName,D)}async deleteIndex(D){var $=()=>super.deleteIndex,X=this;return $().call(X,X.vectorBucketName,D)}index(D){return new vA(this.url,this.headers,this.vectorBucketName,D,this.fetch)}},vA=class extends PA{constructor(D,$,X,Y,J){super(D,$,J);this.vectorBucketName=X,this.indexName=Y}async putVectors(D){var $=()=>super.putVectors,X=this;return $().call(X,ND(ND({},D),{},{vectorBucketName:X.vectorBucketName,indexName:X.indexName}))}async getVectors(D){var $=()=>super.getVectors,X=this;return $().call(X,ND(ND({},D),{},{vectorBucketName:X.vectorBucketName,indexName:X.indexName}))}async listVectors(D={}){var $=()=>super.listVectors,X=this;return $().call(X,ND(ND({},D),{},{vectorBucketName:X.vectorBucketName,indexName:X.indexName}))}async queryVectors(D){var $=()=>super.queryVectors,X=this;return $().call(X,ND(ND({},D),{},{vectorBucketName:X.vectorBucketName,indexName:X.indexName}))}async deleteVectors(D){var $=()=>super.deleteVectors,X=this;return $().call(X,ND(ND({},D),{},{vectorBucketName:X.vectorBucketName,indexName:X.indexName}))}},KG=class extends R0D{constructor(D,$={},X,Y){super(D,$,X,Y)}from(D){return new I0D(this.url,this.headers,D,this.fetch)}get vectors(){return new SA(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new TA(this.url+"/iceberg",this.headers,this.fetch)}};var $j=z0(SG(),1);UD(OD,z0(UG(),1));UD(OD,z0(SG(),1));var n6D="2.95.3",T7="";if(typeof Deno<"u")T7="deno";else if(typeof document<"u")T7="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")T7="react-native";else T7="node";var i6D={"X-Client-Info":`supabase-js-${T7}/${n6D}`},p6D={headers:i6D},r6D={schema:"public"},o6D={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},a6D={};function C7(D){return C7=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},C7(D)}function t6D(D,$){if(C7(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(C7(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}function s6D(D){var $=t6D(D,"string");return C7($)=="symbol"?$:$+""}function e6D(D,$,X){return($=s6D($))in D?Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0}):D[$]=X,D}function eR(D,$){var X=Object.keys(D);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(D);$&&(Y=Y.filter(function(J){return Object.getOwnPropertyDescriptor(D,J).enumerable})),X.push.apply(X,Y)}return X}function I0(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?eR(Object(X),!0).forEach(function(Y){e6D(D,Y,X[Y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):eR(Object(X)).forEach(function(Y){Object.defineProperty(D,Y,Object.getOwnPropertyDescriptor(X,Y))})}return D}var D4D=(D)=>{if(D)return(...$)=>D(...$);return(...$)=>fetch(...$)},$4D=()=>{return Headers},X4D=(D,$,X)=>{let Y=D4D(X),J=$4D();return async(Q,F)=>{var w;let Z=(w=await $())!==null&&w!==void 0?w:D,G=new J(F===null||F===void 0?void 0:F.headers);if(!G.has("apikey"))G.set("apikey",D);if(!G.has("Authorization"))G.set("Authorization",`Bearer ${Z}`);return Y(Q,I0(I0({},F),{},{headers:G}))}};function J4D(D){return D.endsWith("/")?D:D+"/"}function Y4D(D,$){var X,Y;let{db:J,auth:Q,realtime:F,global:w}=D,{db:Z,auth:G,realtime:O,global:U}=$,z={db:I0(I0({},Z),J),auth:I0(I0({},G),Q),realtime:I0(I0({},O),F),storage:{},global:I0(I0(I0({},U),w),{},{headers:I0(I0({},(X=U===null||U===void 0?void 0:U.headers)!==null&&X!==void 0?X:{}),(Y=w===null||w===void 0?void 0:w.headers)!==null&&Y!==void 0?Y:{})}),accessToken:async()=>""};if(D.accessToken)z.accessToken=D.accessToken;else delete z.accessToken;return z}function Q4D(D){let $=D===null||D===void 0?void 0:D.trim();if(!$)throw Error("supabaseUrl is required.");if(!$.match(/^https?:\/\//i))throw Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(J4D($))}catch(X){throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var F4D=class extends $j.AuthClient{constructor(D){super(D)}},Xj=class{constructor(D,$,X){var Y,J;this.supabaseUrl=D,this.supabaseKey=$;let Q=Q4D(D);if(!$)throw Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",Q),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",Q),this.storageUrl=new URL("storage/v1",Q),this.functionsUrl=new URL("functions/v1",Q);let F=`sb-${Q.hostname.split(".")[0]}-auth-token`,w={db:r6D,realtime:a6D,auth:I0(I0({},o6D),{},{storageKey:F}),global:p6D},Z=Y4D(X!==null&&X!==void 0?X:{},w);if(this.storageKey=(Y=Z.auth.storageKey)!==null&&Y!==void 0?Y:"",this.headers=(J=Z.global.headers)!==null&&J!==void 0?J:{},!Z.accessToken){var G;this.auth=this._initSupabaseAuthClient((G=Z.auth)!==null&&G!==void 0?G:{},this.headers,Z.global.fetch)}else this.accessToken=Z.accessToken,this.auth=new Proxy({},{get:(O,U)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(U)} is not possible`)}});if(this.fetch=X4D($,this._getAccessToken.bind(this),Z.global.fetch),this.realtime=this._initRealtimeClient(I0({headers:this.headers,accessToken:this._getAccessToken.bind(this)},Z.realtime)),this.accessToken)Promise.resolve(this.accessToken()).then((O)=>this.realtime.setAuth(O)).catch((O)=>console.warn("Failed to set initial Realtime auth token:",O));if(this.rest=new f2(new URL("rest/v1",Q).href,{headers:this.headers,schema:Z.db.schema,fetch:this.fetch,timeout:Z.db.timeout,urlLengthLimit:Z.db.urlLengthLimit}),this.storage=new KG(this.storageUrl.href,this.headers,this.fetch,X===null||X===void 0?void 0:X.storage),!Z.accessToken)this._listenForAuthEvents()}get functions(){return new a0.FunctionsClient(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(D){return this.rest.from(D)}schema(D){return this.rest.schema(D)}rpc(D,$={},X={head:!1,get:!1,count:void 0}){return this.rest.rpc(D,$,X)}channel(D,$={config:{}}){return this.realtime.channel(D,$)}getChannels(){return this.realtime.getChannels()}removeChannel(D){return this.realtime.removeChannel(D)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var D=this,$,X;if(D.accessToken)return await D.accessToken();let{data:Y}=await D.auth.getSession();return($=(X=Y.session)===null||X===void 0?void 0:X.access_token)!==null&&$!==void 0?$:D.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:D,persistSession:$,detectSessionInUrl:X,storage:Y,userStorage:J,storageKey:Q,flowType:F,lock:w,debug:Z,throwOnError:G},O,U){let z={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new F4D({url:this.authUrl.href,headers:I0(I0({},z),O),storageKey:Q,autoRefreshToken:D,persistSession:$,detectSessionInUrl:X,storage:Y,userStorage:J,flowType:F,lock:w,debug:Z,throwOnError:G,fetch:U,hasCustomAuthorizationHeader:Object.keys(this.headers).some((q)=>q.toLowerCase()==="authorization")})}_initRealtimeClient(D){return new Dj.RealtimeClient(this.realtimeUrl.href,I0(I0({},D),{},{params:I0(I0({},{apikey:this.supabaseKey}),D===null||D===void 0?void 0:D.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((D,$)=>{this._handleTokenChanged(D,"CLIENT",$===null||$===void 0?void 0:$.access_token)})}_handleTokenChanged(D,$,X){if((D==="TOKEN_REFRESHED"||D==="SIGNED_IN")&&this.changedAccessToken!==X)this.changedAccessToken=X,this.realtime.setAuth(X);else if(D==="SIGNED_OUT"){if(this.realtime.setAuth(),$=="STORAGE")this.auth.signOut();this.changedAccessToken=void 0}}},uG=(D,$,X)=>{return new Xj(D,$,X)};function w4D(){if(typeof window<"u")return!1;let D=globalThis.process;if(!D)return!1;let $=D.version;if($===void 0||$===null)return!1;let X=$.match(/^v(\d+)\./);if(!X)return!1;return parseInt(X[1],10)<=18}if(w4D())console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");var mN=z0(yG(),1),Qr=z0(UE(),1),jw=z0(aJ(),1);var r$={name:"@capgo/cli",type:"module",version:"7.76.2",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLI#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsc --noEmit",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:mcp":"node test/test-mcp.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs",test:"bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:credentials && bun run test:credentials-validation && bun run test:checksum && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths"},devDependencies:{"@antfu/eslint-config":"^7.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.4","@capacitor/cli":"^8.0.0","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.0.0","@modelcontextprotocol/sdk":"^1.25.3","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.6","@supabase/supabase-js":"^2.79.0","@types/adm-zip":"^0.5.7","@types/node":"^25.0.0","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.4","adm-zip":"^0.5.16","ci-info":"^4.3.1",commander:"^14.0.2",eslint:"^9.38.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.0",micromatch:"^4.0.8",open:"^11.0.0",prettyjson:"^1.2.5",tmp:"^0.2.5","tus-js-client":"^4.3.1",typescript:"^5.9.3",partysocket:"^1.1.11",ws:"^8.18.3",zod:"^4.3.6"}};async function tJ(D){try{let X=`https://registry.npmjs.org/${encodeURIComponent(D.toLowerCase())}`,Y=await fetch(X,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});if(!Y.ok)return null;return(await Y.json())["dist-tags"]?.latest||null}catch{return null}}async function X0(){let D=await tJ("@capgo/cli")??"",$=D?.split(".")[0];if(D!==r$.version)H.warning(`\uD83D\uDEA8 You are using @capgo/cli@${r$.version} it's not the latest version.
|
|
338
|
+
${O.stack}`}else{var K;w=(K=Q===null||Q===void 0?void 0:Q.stack)!==null&&K!==void 0?K:""}let M=this.url.toString().length;if((Q===null||Q===void 0?void 0:Q.name)==="AbortError"||(Q===null||Q===void 0?void 0:Q.code)==="ABORT_ERR"){if(G="",Z="Request was aborted (timeout or manual cancellation)",M>this.urlLengthLimit)Z+=`. Note: Your request URL is ${M} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`}else if((O===null||O===void 0?void 0:O.name)==="HeadersOverflowError"||(O===null||O===void 0?void 0:O.code)==="UND_ERR_HEADERS_OVERFLOW"){if(G="",Z="HTTP headers exceeded server limits (typically 16KB)",M>this.urlLengthLimit)Z+=`. Your request URL is ${M} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`}return{error:{message:`${(F=Q===null||Q===void 0?void 0:Q.name)!==null&&F!==void 0?F:"FetchError"}: ${Q===null||Q===void 0?void 0:Q.message}`,details:w,hint:Z,code:G},data:null,count:null,status:0,statusText:""}});return J.then(D,$)}returns(){return this}overrideTypes(){return this}},DG=class extends eZ{select(D){let $=!1,X=(D!==null&&D!==void 0?D:"*").split("").map((Y)=>{if(/\s/.test(Y)&&!$)return"";if(Y==='"')$=!$;return Y}).join("");return this.url.searchParams.set("select",X),this.headers.append("Prefer","return=representation"),this}order(D,{ascending:$=!0,nullsFirst:X,foreignTable:Y,referencedTable:J=Y}={}){let Q=J?`${J}.order`:"order",F=this.url.searchParams.get(Q);return this.url.searchParams.set(Q,`${F?`${F},`:""}${D}.${$?"asc":"desc"}${X===void 0?"":X?".nullsfirst":".nullslast"}`),this}limit(D,{foreignTable:$,referencedTable:X=$}={}){let Y=typeof X>"u"?"limit":`${X}.limit`;return this.url.searchParams.set(Y,`${D}`),this}range(D,$,{foreignTable:X,referencedTable:Y=X}={}){let J=typeof Y>"u"?"offset":`${Y}.offset`,Q=typeof Y>"u"?"limit":`${Y}.limit`;return this.url.searchParams.set(J,`${D}`),this.url.searchParams.set(Q,`${$-D+1}`),this}abortSignal(D){return this.signal=D,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){if(this.method==="GET")this.headers.set("Accept","application/json");else this.headers.set("Accept","application/vnd.pgrst.object+json");return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:D=!1,verbose:$=!1,settings:X=!1,buffers:Y=!1,wal:J=!1,format:Q="text"}={}){var F;let w=[D?"analyze":null,$?"verbose":null,X?"settings":null,Y?"buffers":null,J?"wal":null].filter(Boolean).join("|"),Z=(F=this.headers.get("Accept"))!==null&&F!==void 0?F:"application/json";if(this.headers.set("Accept",`application/vnd.pgrst.plan+${Q}; for="${Z}"; options=${w};`),Q==="json")return this;else return this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(D){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${D}`),this}},xI=new RegExp("[,()]"),E6=class extends DG{eq(D,$){return this.url.searchParams.append(D,`eq.${$}`),this}neq(D,$){return this.url.searchParams.append(D,`neq.${$}`),this}gt(D,$){return this.url.searchParams.append(D,`gt.${$}`),this}gte(D,$){return this.url.searchParams.append(D,`gte.${$}`),this}lt(D,$){return this.url.searchParams.append(D,`lt.${$}`),this}lte(D,$){return this.url.searchParams.append(D,`lte.${$}`),this}like(D,$){return this.url.searchParams.append(D,`like.${$}`),this}likeAllOf(D,$){return this.url.searchParams.append(D,`like(all).{${$.join(",")}}`),this}likeAnyOf(D,$){return this.url.searchParams.append(D,`like(any).{${$.join(",")}}`),this}ilike(D,$){return this.url.searchParams.append(D,`ilike.${$}`),this}ilikeAllOf(D,$){return this.url.searchParams.append(D,`ilike(all).{${$.join(",")}}`),this}ilikeAnyOf(D,$){return this.url.searchParams.append(D,`ilike(any).{${$.join(",")}}`),this}regexMatch(D,$){return this.url.searchParams.append(D,`match.${$}`),this}regexIMatch(D,$){return this.url.searchParams.append(D,`imatch.${$}`),this}is(D,$){return this.url.searchParams.append(D,`is.${$}`),this}isDistinct(D,$){return this.url.searchParams.append(D,`isdistinct.${$}`),this}in(D,$){let X=Array.from(new Set($)).map((Y)=>{if(typeof Y==="string"&&xI.test(Y))return`"${Y}"`;else return`${Y}`}).join(",");return this.url.searchParams.append(D,`in.(${X})`),this}notIn(D,$){let X=Array.from(new Set($)).map((Y)=>{if(typeof Y==="string"&&xI.test(Y))return`"${Y}"`;else return`${Y}`}).join(",");return this.url.searchParams.append(D,`not.in.(${X})`),this}contains(D,$){if(typeof $==="string")this.url.searchParams.append(D,`cs.${$}`);else if(Array.isArray($))this.url.searchParams.append(D,`cs.{${$.join(",")}}`);else this.url.searchParams.append(D,`cs.${JSON.stringify($)}`);return this}containedBy(D,$){if(typeof $==="string")this.url.searchParams.append(D,`cd.${$}`);else if(Array.isArray($))this.url.searchParams.append(D,`cd.{${$.join(",")}}`);else this.url.searchParams.append(D,`cd.${JSON.stringify($)}`);return this}rangeGt(D,$){return this.url.searchParams.append(D,`sr.${$}`),this}rangeGte(D,$){return this.url.searchParams.append(D,`nxl.${$}`),this}rangeLt(D,$){return this.url.searchParams.append(D,`sl.${$}`),this}rangeLte(D,$){return this.url.searchParams.append(D,`nxr.${$}`),this}rangeAdjacent(D,$){return this.url.searchParams.append(D,`adj.${$}`),this}overlaps(D,$){if(typeof $==="string")this.url.searchParams.append(D,`ov.${$}`);else this.url.searchParams.append(D,`ov.{${$.join(",")}}`);return this}textSearch(D,$,{config:X,type:Y}={}){let J="";if(Y==="plain")J="pl";else if(Y==="phrase")J="ph";else if(Y==="websearch")J="w";let Q=X===void 0?"":`(${X})`;return this.url.searchParams.append(D,`${J}fts${Q}.${$}`),this}match(D){return Object.entries(D).forEach(([$,X])=>{this.url.searchParams.append($,`eq.${X}`)}),this}not(D,$,X){return this.url.searchParams.append(D,`not.${$}.${X}`),this}or(D,{foreignTable:$,referencedTable:X=$}={}){let Y=X?`${X}.or`:"or";return this.url.searchParams.append(Y,`(${D})`),this}filter(D,$,X){return this.url.searchParams.append(D,`${$}.${X}`),this}},$G=class{constructor(D,{headers:$={},schema:X,fetch:Y,urlLengthLimit:J=8000}){this.url=D,this.headers=new Headers($),this.schema=X,this.fetch=Y,this.urlLengthLimit=J}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(D,$){let{head:X=!1,count:Y}=$!==null&&$!==void 0?$:{},J=X?"HEAD":"GET",Q=!1,F=(D!==null&&D!==void 0?D:"*").split("").map((G)=>{if(/\s/.test(G)&&!Q)return"";if(G==='"')Q=!Q;return G}).join(""),{url:w,headers:Z}=this.cloneRequestState();if(w.searchParams.set("select",F),Y)Z.append("Prefer",`count=${Y}`);return new E6({method:J,url:w,headers:Z,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}insert(D,{count:$,defaultToNull:X=!0}={}){var Y;let J="POST",{url:Q,headers:F}=this.cloneRequestState();if($)F.append("Prefer",`count=${$}`);if(!X)F.append("Prefer","missing=default");if(Array.isArray(D)){let w=D.reduce((Z,G)=>Z.concat(Object.keys(G)),[]);if(w.length>0){let Z=[...new Set(w)].map((G)=>`"${G}"`);Q.searchParams.set("columns",Z.join(","))}}return new E6({method:"POST",url:Q,headers:F,schema:this.schema,body:D,fetch:(Y=this.fetch)!==null&&Y!==void 0?Y:fetch,urlLengthLimit:this.urlLengthLimit})}upsert(D,{onConflict:$,ignoreDuplicates:X=!1,count:Y,defaultToNull:J=!0}={}){var Q;let F="POST",{url:w,headers:Z}=this.cloneRequestState();if(Z.append("Prefer",`resolution=${X?"ignore":"merge"}-duplicates`),$!==void 0)w.searchParams.set("on_conflict",$);if(Y)Z.append("Prefer",`count=${Y}`);if(!J)Z.append("Prefer","missing=default");if(Array.isArray(D)){let G=D.reduce((O,U)=>O.concat(Object.keys(U)),[]);if(G.length>0){let O=[...new Set(G)].map((U)=>`"${U}"`);w.searchParams.set("columns",O.join(","))}}return new E6({method:"POST",url:w,headers:Z,schema:this.schema,body:D,fetch:(Q=this.fetch)!==null&&Q!==void 0?Q:fetch,urlLengthLimit:this.urlLengthLimit})}update(D,{count:$}={}){var X;let Y="PATCH",{url:J,headers:Q}=this.cloneRequestState();if($)Q.append("Prefer",`count=${$}`);return new E6({method:"PATCH",url:J,headers:Q,schema:this.schema,body:D,fetch:(X=this.fetch)!==null&&X!==void 0?X:fetch,urlLengthLimit:this.urlLengthLimit})}delete({count:D}={}){var $;let X="DELETE",{url:Y,headers:J}=this.cloneRequestState();if(D)J.append("Prefer",`count=${D}`);return new E6({method:"DELETE",url:Y,headers:J,schema:this.schema,fetch:($=this.fetch)!==null&&$!==void 0?$:fetch,urlLengthLimit:this.urlLengthLimit})}};function z7(D){return z7=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},z7(D)}function DDD(D,$){if(z7(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(z7(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}function $DD(D){var $=DDD(D,"string");return z7($)=="symbol"?$:$+""}function XDD(D,$,X){return($=$DD($))in D?Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0}):D[$]=X,D}function SI(D,$){var X=Object.keys(D);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(D);$&&(Y=Y.filter(function(J){return Object.getOwnPropertyDescriptor(D,J).enumerable})),X.push.apply(X,Y)}return X}function _2(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?SI(Object(X),!0).forEach(function(Y){XDD(D,Y,X[Y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):SI(Object(X)).forEach(function(Y){Object.defineProperty(D,Y,Object.getOwnPropertyDescriptor(X,Y))})}return D}var f2=class D{constructor($,{headers:X={},schema:Y,fetch:J,timeout:Q,urlLengthLimit:F=8000}={}){this.url=$,this.headers=new Headers(X),this.schemaName=Y,this.urlLengthLimit=F;let w=J!==null&&J!==void 0?J:globalThis.fetch;if(Q!==void 0&&Q>0)this.fetch=(Z,G)=>{let O=new AbortController,U=setTimeout(()=>O.abort(),Q),z=G===null||G===void 0?void 0:G.signal;if(z){if(z.aborted)return clearTimeout(U),w(Z,G);let q=()=>{clearTimeout(U),O.abort()};return z.addEventListener("abort",q,{once:!0}),w(Z,_2(_2({},G),{},{signal:O.signal})).finally(()=>{clearTimeout(U),z.removeEventListener("abort",q)})}return w(Z,_2(_2({},G),{},{signal:O.signal})).finally(()=>clearTimeout(U))};else this.fetch=w}from($){if(!$||typeof $!=="string"||$.trim()==="")throw Error("Invalid relation name: relation must be a non-empty string.");return new $G(new URL(`${this.url}/${$}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema($){return new D(this.url,{headers:this.headers,schema:$,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}rpc($,X={},{head:Y=!1,get:J=!1,count:Q}={}){var F;let w,Z=new URL(`${this.url}/rpc/${$}`),G,O=(q)=>q!==null&&typeof q==="object"&&(!Array.isArray(q)||q.some(O)),U=Y&&Object.values(X).some(O);if(U)w="POST",G=X;else if(Y||J)w=Y?"HEAD":"GET",Object.entries(X).filter(([q,B])=>B!==void 0).map(([q,B])=>[q,Array.isArray(B)?`{${B.join(",")}}`:`${B}`]).forEach(([q,B])=>{Z.searchParams.append(q,B)});else w="POST",G=X;let z=new Headers(this.headers);if(U)z.set("Prefer",Q?`count=${Q},return=minimal`:"return=minimal");else if(Q)z.set("Prefer",`count=${Q}`);return new E6({method:w,url:Z,headers:z,schema:this.schemaName,body:G,fetch:(F=this.fetch)!==null&&F!==void 0?F:fetch,urlLengthLimit:this.urlLengthLimit})}},JDD={PostgrestClient:f2,PostgrestQueryBuilder:$G,PostgrestFilterBuilder:E6,PostgrestTransformBuilder:DG,PostgrestBuilder:eZ,PostgrestError:B7};var Dj=z0(UG(),1);var _A={};S1(_A,{isStorageVectorsError:()=>Q0D,isStorageError:()=>p8,VectorIndexScope:()=>vA,VectorIndexApi:()=>CA,VectorDataApi:()=>PA,VectorBucketScope:()=>uA,VectorBucketApi:()=>xA,StorageVectorsUnknownError:()=>w0D,StorageVectorsErrorCode:()=>Z0D,StorageVectorsError:()=>Y0D,StorageVectorsClient:()=>SA,StorageVectorsApiError:()=>F0D,StorageUnknownError:()=>c2,StorageError:()=>i8,StorageClient:()=>KG,StorageApiError:()=>n8,StorageAnalyticsClient:()=>TA});var V7=class extends Error{constructor(D,$){super(D);this.name="IcebergError",this.status=$.status,this.icebergType=$.icebergType,this.icebergCode=$.icebergCode,this.details=$.details,this.isCommitStateUnknown=$.icebergType==="CommitStateUnknownException"||[500,502,504].includes($.status)&&$.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function eDD(D,$,X){let Y=new URL($,D);if(X){for(let[J,Q]of Object.entries(X))if(Q!==void 0)Y.searchParams.set(J,Q)}return Y.toString()}async function D0D(D){if(!D||D.type==="none")return{};if(D.type==="bearer")return{Authorization:`Bearer ${D.token}`};if(D.type==="header")return{[D.name]:D.value};if(D.type==="custom")return await D.getHeaders();return{}}function $0D(D){let $=D.fetchImpl??globalThis.fetch;return{async request({method:X,path:Y,query:J,body:Q,headers:F}){let w=eDD(D.baseUrl,Y,J),Z=await D0D(D.auth),G=await $(w,{method:X,headers:{...Q?{"Content-Type":"application/json"}:{},...Z,...F},body:Q?JSON.stringify(Q):void 0}),O=await G.text(),U=(G.headers.get("content-type")||"").includes("application/json"),z=U&&O?JSON.parse(O):O;if(!G.ok){let q=U?z:void 0,B=q?.error;throw new V7(B?.message??`Request failed with status ${G.status}`,{status:G.status,icebergType:B?.type,icebergCode:B?.code,details:q})}return{status:G.status,headers:G.headers,data:z}}}}function d2(D){return D.join("\x1F")}var X0D=class{constructor(D,$=""){this.client=D,this.prefix=$}async listNamespaces(D){let $=D?{parent:d2(D.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:$})).data.namespaces.map((Y)=>({namespace:Y}))}async createNamespace(D,$){let X={namespace:D.namespace,properties:$?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:X})).data}async dropNamespace(D){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${d2(D.namespace)}`})}async loadNamespaceMetadata(D){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${d2(D.namespace)}`})).data.properties}}async namespaceExists(D){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${d2(D.namespace)}`}),!0}catch($){if($ instanceof V7&&$.status===404)return!1;throw $}}async createNamespaceIfNotExists(D,$){try{return await this.createNamespace(D,$)}catch(X){if(X instanceof V7&&X.status===409)return;throw X}}};function l8(D){return D.join("\x1F")}var J0D=class{constructor(D,$="",X){this.client=D,this.prefix=$,this.accessDelegation=X}async listTables(D){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${l8(D.namespace)}/tables`})).data.identifiers}async createTable(D,$){let X={};if(this.accessDelegation)X["X-Iceberg-Access-Delegation"]=this.accessDelegation;return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${l8(D.namespace)}/tables`,body:$,headers:X})).data.metadata}async updateTable(D,$){let X=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${l8(D.namespace)}/tables/${D.name}`,body:$});return{"metadata-location":X.data["metadata-location"],metadata:X.data.metadata}}async dropTable(D,$){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${l8(D.namespace)}/tables/${D.name}`,query:{purgeRequested:String($?.purge??!1)}})}async loadTable(D){let $={};if(this.accessDelegation)$["X-Iceberg-Access-Delegation"]=this.accessDelegation;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${l8(D.namespace)}/tables/${D.name}`,headers:$})).data.metadata}async tableExists(D){let $={};if(this.accessDelegation)$["X-Iceberg-Access-Delegation"]=this.accessDelegation;try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${l8(D.namespace)}/tables/${D.name}`,headers:$}),!0}catch(X){if(X instanceof V7&&X.status===404)return!1;throw X}}async createTableIfNotExists(D,$){try{return await this.createTable(D,$)}catch(X){if(X instanceof V7&&X.status===409)return await this.loadTable({namespace:D.namespace,name:$.name});throw X}}},LA=class{constructor(D){let $="v1";if(D.catalogName)$+=`/${D.catalogName}`;let X=D.baseUrl.endsWith("/")?D.baseUrl:`${D.baseUrl}/`;this.client=$0D({baseUrl:X,auth:D.auth,fetchImpl:D.fetch}),this.accessDelegation=D.accessDelegation?.join(","),this.namespaceOps=new X0D(this.client,$),this.tableOps=new J0D(this.client,$,this.accessDelegation)}async listNamespaces(D){return this.namespaceOps.listNamespaces(D)}async createNamespace(D,$){return this.namespaceOps.createNamespace(D,$)}async dropNamespace(D){await this.namespaceOps.dropNamespace(D)}async loadNamespaceMetadata(D){return this.namespaceOps.loadNamespaceMetadata(D)}async listTables(D){return this.tableOps.listTables(D)}async createTable(D,$){return this.tableOps.createTable(D,$)}async updateTable(D,$){return this.tableOps.updateTable(D,$)}async dropTable(D,$){await this.tableOps.dropTable(D,$)}async loadTable(D){return this.tableOps.loadTable(D)}async namespaceExists(D){return this.namespaceOps.namespaceExists(D)}async tableExists(D){return this.tableOps.tableExists(D)}async createNamespaceIfNotExists(D,$){return this.namespaceOps.createNamespaceIfNotExists(D,$)}async createTableIfNotExists(D,$){return this.tableOps.createTableIfNotExists(D,$)}};var i8=class extends Error{constructor(D,$="storage",X,Y){super(D);this.__isStorageError=!0,this.namespace=$,this.name=$==="vectors"?"StorageVectorsError":"StorageError",this.status=X,this.statusCode=Y}};function p8(D){return typeof D==="object"&&D!==null&&"__isStorageError"in D}var n8=class extends i8{constructor(D,$,X,Y="storage"){super(D,Y,$,X);this.name=Y==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=$,this.statusCode=X}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},c2=class extends i8{constructor(D,$,X="storage"){super(D,X);this.name=X==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=$}},Y0D=class extends i8{constructor(D){super(D,"vectors")}};function Q0D(D){return p8(D)&&D.namespace==="vectors"}var F0D=class extends n8{constructor(D,$,X){super(D,$,X,"vectors")}},w0D=class extends c2{constructor(D,$){super(D,$,"vectors")}},Z0D=function(D){return D.InternalError="InternalError",D.S3VectorConflictException="S3VectorConflictException",D.S3VectorNotFoundException="S3VectorNotFoundException",D.S3VectorBucketNotEmpty="S3VectorBucketNotEmpty",D.S3VectorMaxBucketsExceeded="S3VectorMaxBucketsExceeded",D.S3VectorMaxIndexesExceeded="S3VectorMaxIndexesExceeded",D}({}),G0D=(D)=>{if(D)return(...$)=>D(...$);return(...$)=>fetch(...$)},O0D=(D)=>{if(typeof D!=="object"||D===null)return!1;let $=Object.getPrototypeOf(D);return($===null||$===Object.prototype||Object.getPrototypeOf($)===null)&&!(Symbol.toStringTag in D)&&!(Symbol.iterator in D)},qG=(D)=>{if(Array.isArray(D))return D.map((X)=>qG(X));else if(typeof D==="function"||D!==Object(D))return D;let $={};return Object.entries(D).forEach(([X,Y])=>{let J=X.replace(/([-_][a-z])/gi,(Q)=>Q.toUpperCase().replace(/[-_]/g,""));$[J]=qG(Y)}),$},U0D=(D)=>{if(!D||typeof D!=="string")return!1;if(D.length===0||D.length>100)return!1;if(D.trim()!==D)return!1;if(D.includes("/")||D.includes("\\"))return!1;return/^[\w!.\*'() &$@=;:+,?-]+$/.test(D)};function M7(D){return M7=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},M7(D)}function q0D(D,$){if(M7(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(M7(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}function z0D(D){var $=q0D(D,"string");return M7($)=="symbol"?$:$+""}function B0D(D,$,X){return($=z0D($))in D?Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0}):D[$]=X,D}function IA(D,$){var X=Object.keys(D);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(D);$&&(Y=Y.filter(function(J){return Object.getOwnPropertyDescriptor(D,J).enumerable})),X.push.apply(X,Y)}return X}function ND(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?IA(Object(X),!0).forEach(function(Y){B0D(D,Y,X[Y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):IA(Object(X)).forEach(function(Y){Object.defineProperty(D,Y,Object.getOwnPropertyDescriptor(X,Y))})}return D}var AA=(D)=>{var $;return D.msg||D.message||D.error_description||(typeof D.error==="string"?D.error:($=D.error)===null||$===void 0?void 0:$.message)||JSON.stringify(D)},K0D=async(D,$,X,Y)=>{if(D&&typeof D==="object"&&"status"in D&&"ok"in D&&typeof D.status==="number"&&!(X===null||X===void 0?void 0:X.noResolveJson)){let J=D,Q=J.status||500;if(typeof J.json==="function")J.json().then((F)=>{let w=(F===null||F===void 0?void 0:F.statusCode)||(F===null||F===void 0?void 0:F.code)||Q+"";$(new n8(AA(F),Q,w,Y))}).catch(()=>{if(Y==="vectors"){let F=Q+"";$(new n8(J.statusText||`HTTP ${Q} error`,Q,F,Y))}else{let F=Q+"";$(new n8(J.statusText||`HTTP ${Q} error`,Q,F,Y))}});else{let F=Q+"";$(new n8(J.statusText||`HTTP ${Q} error`,Q,F,Y))}}else $(new c2(AA(D),D,Y))},W0D=(D,$,X,Y)=>{let J={method:D,headers:($===null||$===void 0?void 0:$.headers)||{}};if(D==="GET"||D==="HEAD"||!Y)return ND(ND({},J),X);if(O0D(Y))J.headers=ND({"Content-Type":"application/json"},$===null||$===void 0?void 0:$.headers),J.body=JSON.stringify(Y);else J.body=Y;if($===null||$===void 0?void 0:$.duplex)J.duplex=$.duplex;return ND(ND({},J),X)};async function N7(D,$,X,Y,J,Q,F){return new Promise((w,Z)=>{D(X,W0D($,Y,J,Q)).then((G)=>{if(!G.ok)throw G;if(Y===null||Y===void 0?void 0:Y.noResolveJson)return G;if(F==="vectors"){let O=G.headers.get("content-type");if(G.headers.get("content-length")==="0"||G.status===204)return{};if(!O||!O.includes("application/json"))return{}}return G.json()}).then((G)=>w(G)).catch((G)=>K0D(G,Z,Y,F))})}function jA(D="storage"){return{get:async($,X,Y,J)=>{return N7($,"GET",X,Y,J,void 0,D)},post:async($,X,Y,J,Q)=>{return N7($,"POST",X,J,Q,Y,D)},put:async($,X,Y,J,Q)=>{return N7($,"PUT",X,J,Q,Y,D)},head:async($,X,Y,J)=>{return N7($,"HEAD",X,ND(ND({},Y),{},{noResolveJson:!0}),J,void 0,D)},remove:async($,X,Y,J,Q)=>{return N7($,"DELETE",X,J,Q,Y,D)}}}var H0D=jA("storage"),{get:L7,post:Y$,put:zG,head:V0D,remove:BG}=H0D,u1=jA("vectors"),r8=class{constructor(D,$={},X,Y="storage"){this.shouldThrowOnError=!1,this.url=D,this.headers=$,this.fetch=G0D(X),this.namespace=Y}throwOnError(){return this.shouldThrowOnError=!0,this}async handleOperation(D){var $=this;try{return{data:await D(),error:null}}catch(X){if($.shouldThrowOnError)throw X;if(p8(X))return{data:null,error:X};throw X}}},N0D=class{constructor(D,$){this.downloadFn=D,this.shouldThrowOnError=$}then(D,$){return this.execute().then(D,$)}async execute(){var D=this;try{return{data:(await D.downloadFn()).body,error:null}}catch($){if(D.shouldThrowOnError)throw $;if(p8($))return{data:null,error:$};throw $}}},EA;EA=Symbol.toStringTag;var M0D=class{constructor(D,$){this.downloadFn=D,this.shouldThrowOnError=$,this[EA]="BlobDownloadBuilder",this.promise=null}asStream(){return new N0D(this.downloadFn,this.shouldThrowOnError)}then(D,$){return this.getPromise().then(D,$)}catch(D){return this.getPromise().catch(D)}finally(D){return this.getPromise().finally(D)}getPromise(){if(!this.promise)this.promise=this.execute();return this.promise}async execute(){var D=this;try{return{data:await(await D.downloadFn()).blob(),error:null}}catch($){if(D.shouldThrowOnError)throw $;if(p8($))return{data:null,error:$};throw $}}},L0D={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},RA={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},I0D=class extends r8{constructor(D,$={},X,Y){super(D,$,Y,"storage");this.bucketId=X}async uploadOrUpdate(D,$,X,Y){var J=this;return J.handleOperation(async()=>{let Q,F=ND(ND({},RA),Y),w=ND(ND({},J.headers),D==="POST"&&{"x-upsert":String(F.upsert)}),Z=F.metadata;if(typeof Blob<"u"&&X instanceof Blob){if(Q=new FormData,Q.append("cacheControl",F.cacheControl),Z)Q.append("metadata",J.encodeMetadata(Z));Q.append("",X)}else if(typeof FormData<"u"&&X instanceof FormData){if(Q=X,!Q.has("cacheControl"))Q.append("cacheControl",F.cacheControl);if(Z&&!Q.has("metadata"))Q.append("metadata",J.encodeMetadata(Z))}else{if(Q=X,w["cache-control"]=`max-age=${F.cacheControl}`,w["content-type"]=F.contentType,Z)w["x-metadata"]=J.toBase64(J.encodeMetadata(Z));if((typeof ReadableStream<"u"&&Q instanceof ReadableStream||Q&&typeof Q==="object"&&("pipe"in Q)&&typeof Q.pipe==="function")&&!F.duplex)F.duplex="half"}if(Y===null||Y===void 0?void 0:Y.headers)w=ND(ND({},w),Y.headers);let G=J._removeEmptyFolders($),O=J._getFinalPath(G),U=await(D=="PUT"?zG:Y$)(J.fetch,`${J.url}/object/${O}`,Q,ND({headers:w},(F===null||F===void 0?void 0:F.duplex)?{duplex:F.duplex}:{}));return{path:G,id:U.Id,fullPath:U.Key}})}async upload(D,$,X){return this.uploadOrUpdate("POST",D,$,X)}async uploadToSignedUrl(D,$,X,Y){var J=this;let Q=J._removeEmptyFolders(D),F=J._getFinalPath(Q),w=new URL(J.url+`/object/upload/sign/${F}`);return w.searchParams.set("token",$),J.handleOperation(async()=>{let Z,G=ND({upsert:RA.upsert},Y),O=ND(ND({},J.headers),{"x-upsert":String(G.upsert)});if(typeof Blob<"u"&&X instanceof Blob)Z=new FormData,Z.append("cacheControl",G.cacheControl),Z.append("",X);else if(typeof FormData<"u"&&X instanceof FormData)Z=X,Z.append("cacheControl",G.cacheControl);else Z=X,O["cache-control"]=`max-age=${G.cacheControl}`,O["content-type"]=G.contentType;return{path:Q,fullPath:(await zG(J.fetch,w.toString(),Z,{headers:O})).Key}})}async createSignedUploadUrl(D,$){var X=this;return X.handleOperation(async()=>{let Y=X._getFinalPath(D),J=ND({},X.headers);if($===null||$===void 0?void 0:$.upsert)J["x-upsert"]="true";let Q=await Y$(X.fetch,`${X.url}/object/upload/sign/${Y}`,{},{headers:J}),F=new URL(X.url+Q.url),w=F.searchParams.get("token");if(!w)throw new i8("No token returned by API");return{signedUrl:F.toString(),path:D,token:w}})}async update(D,$,X){return this.uploadOrUpdate("PUT",D,$,X)}async move(D,$,X){var Y=this;return Y.handleOperation(async()=>{return await Y$(Y.fetch,`${Y.url}/object/move`,{bucketId:Y.bucketId,sourceKey:D,destinationKey:$,destinationBucket:X===null||X===void 0?void 0:X.destinationBucket},{headers:Y.headers})})}async copy(D,$,X){var Y=this;return Y.handleOperation(async()=>{return{path:(await Y$(Y.fetch,`${Y.url}/object/copy`,{bucketId:Y.bucketId,sourceKey:D,destinationKey:$,destinationBucket:X===null||X===void 0?void 0:X.destinationBucket},{headers:Y.headers})).Key}})}async createSignedUrl(D,$,X){var Y=this;return Y.handleOperation(async()=>{let J=Y._getFinalPath(D),Q=await Y$(Y.fetch,`${Y.url}/object/sign/${J}`,ND({expiresIn:$},(X===null||X===void 0?void 0:X.transform)?{transform:X.transform}:{}),{headers:Y.headers}),F=(X===null||X===void 0?void 0:X.download)?`&download=${X.download===!0?"":X.download}`:"";return{signedUrl:encodeURI(`${Y.url}${Q.signedURL}${F}`)}})}async createSignedUrls(D,$,X){var Y=this;return Y.handleOperation(async()=>{let J=await Y$(Y.fetch,`${Y.url}/object/sign/${Y.bucketId}`,{expiresIn:$,paths:D},{headers:Y.headers}),Q=(X===null||X===void 0?void 0:X.download)?`&download=${X.download===!0?"":X.download}`:"";return J.map((F)=>ND(ND({},F),{},{signedUrl:F.signedURL?encodeURI(`${Y.url}${F.signedURL}${Q}`):null}))})}download(D,$,X){let Y=typeof($===null||$===void 0?void 0:$.transform)<"u"?"render/image/authenticated":"object",J=this.transformOptsToQueryString(($===null||$===void 0?void 0:$.transform)||{}),Q=J?`?${J}`:"",F=this._getFinalPath(D);return new M0D(()=>L7(this.fetch,`${this.url}/${Y}/${F}${Q}`,{headers:this.headers,noResolveJson:!0},X),this.shouldThrowOnError)}async info(D){var $=this;let X=$._getFinalPath(D);return $.handleOperation(async()=>{return qG(await L7($.fetch,`${$.url}/object/info/${X}`,{headers:$.headers}))})}async exists(D){var $=this;let X=$._getFinalPath(D);try{return await V0D($.fetch,`${$.url}/object/${X}`,{headers:$.headers}),{data:!0,error:null}}catch(Y){if($.shouldThrowOnError)throw Y;if(p8(Y)&&Y instanceof c2){let J=Y.originalError;if([400,404].includes(J===null||J===void 0?void 0:J.status))return{data:!1,error:Y}}throw Y}}getPublicUrl(D,$){let X=this._getFinalPath(D),Y=[],J=($===null||$===void 0?void 0:$.download)?`download=${$.download===!0?"":$.download}`:"";if(J!=="")Y.push(J);let Q=typeof($===null||$===void 0?void 0:$.transform)<"u"?"render/image":"object",F=this.transformOptsToQueryString(($===null||$===void 0?void 0:$.transform)||{});if(F!=="")Y.push(F);let w=Y.join("&");if(w!=="")w=`?${w}`;return{data:{publicUrl:encodeURI(`${this.url}/${Q}/public/${X}${w}`)}}}async remove(D){var $=this;return $.handleOperation(async()=>{return await BG($.fetch,`${$.url}/object/${$.bucketId}`,{prefixes:D},{headers:$.headers})})}async list(D,$,X){var Y=this;return Y.handleOperation(async()=>{let J=ND(ND(ND({},L0D),$),{},{prefix:D||""});return await Y$(Y.fetch,`${Y.url}/object/list/${Y.bucketId}`,J,{headers:Y.headers},X)})}async listV2(D,$){var X=this;return X.handleOperation(async()=>{let Y=ND({},D);return await Y$(X.fetch,`${X.url}/object/list-v2/${X.bucketId}`,Y,{headers:X.headers},$)})}encodeMetadata(D){return JSON.stringify(D)}toBase64(D){if(typeof Buffer<"u")return Buffer.from(D).toString("base64");return btoa(D)}_getFinalPath(D){return`${this.bucketId}/${D.replace(/^\/+/,"")}`}_removeEmptyFolders(D){return D.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(D){let $=[];if(D.width)$.push(`width=${D.width}`);if(D.height)$.push(`height=${D.height}`);if(D.resize)$.push(`resize=${D.resize}`);if(D.format)$.push(`format=${D.format}`);if(D.quality)$.push(`quality=${D.quality}`);return $.join("&")}},A0D="2.95.3",I7={"X-Client-Info":`storage-js/${A0D}`},R0D=class extends r8{constructor(D,$={},X,Y){let J=new URL(D);if(Y===null||Y===void 0?void 0:Y.useNewHostname){if(/supabase\.(co|in|red)$/.test(J.hostname)&&!J.hostname.includes("storage.supabase."))J.hostname=J.hostname.replace("supabase.","storage.supabase.")}let Q=J.href.replace(/\/$/,""),F=ND(ND({},I7),$);super(Q,F,X,"storage")}async listBuckets(D){var $=this;return $.handleOperation(async()=>{let X=$.listBucketOptionsToQueryString(D);return await L7($.fetch,`${$.url}/bucket${X}`,{headers:$.headers})})}async getBucket(D){var $=this;return $.handleOperation(async()=>{return await L7($.fetch,`${$.url}/bucket/${D}`,{headers:$.headers})})}async createBucket(D,$={public:!1}){var X=this;return X.handleOperation(async()=>{return await Y$(X.fetch,`${X.url}/bucket`,{id:D,name:D,type:$.type,public:$.public,file_size_limit:$.fileSizeLimit,allowed_mime_types:$.allowedMimeTypes},{headers:X.headers})})}async updateBucket(D,$){var X=this;return X.handleOperation(async()=>{return await zG(X.fetch,`${X.url}/bucket/${D}`,{id:D,name:D,public:$.public,file_size_limit:$.fileSizeLimit,allowed_mime_types:$.allowedMimeTypes},{headers:X.headers})})}async emptyBucket(D){var $=this;return $.handleOperation(async()=>{return await Y$($.fetch,`${$.url}/bucket/${D}/empty`,{},{headers:$.headers})})}async deleteBucket(D){var $=this;return $.handleOperation(async()=>{return await BG($.fetch,`${$.url}/bucket/${D}`,{},{headers:$.headers})})}listBucketOptionsToQueryString(D){let $={};if(D){if("limit"in D)$.limit=String(D.limit);if("offset"in D)$.offset=String(D.offset);if(D.search)$.search=D.search;if(D.sortColumn)$.sortColumn=D.sortColumn;if(D.sortOrder)$.sortOrder=D.sortOrder}return Object.keys($).length>0?"?"+new URLSearchParams($).toString():""}},TA=class extends r8{constructor(D,$={},X){let Y=D.replace(/\/$/,""),J=ND(ND({},I7),$);super(Y,J,X,"storage")}async createBucket(D){var $=this;return $.handleOperation(async()=>{return await Y$($.fetch,`${$.url}/bucket`,{name:D},{headers:$.headers})})}async listBuckets(D){var $=this;return $.handleOperation(async()=>{let X=new URLSearchParams;if((D===null||D===void 0?void 0:D.limit)!==void 0)X.set("limit",D.limit.toString());if((D===null||D===void 0?void 0:D.offset)!==void 0)X.set("offset",D.offset.toString());if(D===null||D===void 0?void 0:D.sortColumn)X.set("sortColumn",D.sortColumn);if(D===null||D===void 0?void 0:D.sortOrder)X.set("sortOrder",D.sortOrder);if(D===null||D===void 0?void 0:D.search)X.set("search",D.search);let Y=X.toString(),J=Y?`${$.url}/bucket?${Y}`:`${$.url}/bucket`;return await L7($.fetch,J,{headers:$.headers})})}async deleteBucket(D){var $=this;return $.handleOperation(async()=>{return await BG($.fetch,`${$.url}/bucket/${D}`,{},{headers:$.headers})})}from(D){var $=this;if(!U0D(D))throw new i8("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");let X=new LA({baseUrl:this.url,catalogName:D,auth:{type:"custom",getHeaders:async()=>$.headers},fetch:this.fetch}),Y=this.shouldThrowOnError;return new Proxy(X,{get(J,Q){let F=J[Q];if(typeof F!=="function")return F;return async(...w)=>{try{return{data:await F.apply(J,w),error:null}}catch(Z){if(Y)throw Z;return{data:null,error:Z}}}}})}},CA=class extends r8{constructor(D,$={},X){let Y=D.replace(/\/$/,""),J=ND(ND({},I7),{},{"Content-Type":"application/json"},$);super(Y,J,X,"vectors")}async createIndex(D){var $=this;return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/CreateIndex`,D,{headers:$.headers})||{}})}async getIndex(D,$){var X=this;return X.handleOperation(async()=>{return await u1.post(X.fetch,`${X.url}/GetIndex`,{vectorBucketName:D,indexName:$},{headers:X.headers})})}async listIndexes(D){var $=this;return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/ListIndexes`,D,{headers:$.headers})})}async deleteIndex(D,$){var X=this;return X.handleOperation(async()=>{return await u1.post(X.fetch,`${X.url}/DeleteIndex`,{vectorBucketName:D,indexName:$},{headers:X.headers})||{}})}},PA=class extends r8{constructor(D,$={},X){let Y=D.replace(/\/$/,""),J=ND(ND({},I7),{},{"Content-Type":"application/json"},$);super(Y,J,X,"vectors")}async putVectors(D){var $=this;if(D.vectors.length<1||D.vectors.length>500)throw Error("Vector batch size must be between 1 and 500 items");return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/PutVectors`,D,{headers:$.headers})||{}})}async getVectors(D){var $=this;return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/GetVectors`,D,{headers:$.headers})})}async listVectors(D){var $=this;if(D.segmentCount!==void 0){if(D.segmentCount<1||D.segmentCount>16)throw Error("segmentCount must be between 1 and 16");if(D.segmentIndex!==void 0){if(D.segmentIndex<0||D.segmentIndex>=D.segmentCount)throw Error(`segmentIndex must be between 0 and ${D.segmentCount-1}`)}}return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/ListVectors`,D,{headers:$.headers})})}async queryVectors(D){var $=this;return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/QueryVectors`,D,{headers:$.headers})})}async deleteVectors(D){var $=this;if(D.keys.length<1||D.keys.length>500)throw Error("Keys batch size must be between 1 and 500 items");return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/DeleteVectors`,D,{headers:$.headers})||{}})}},xA=class extends r8{constructor(D,$={},X){let Y=D.replace(/\/$/,""),J=ND(ND({},I7),{},{"Content-Type":"application/json"},$);super(Y,J,X,"vectors")}async createBucket(D){var $=this;return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/CreateVectorBucket`,{vectorBucketName:D},{headers:$.headers})||{}})}async getBucket(D){var $=this;return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/GetVectorBucket`,{vectorBucketName:D},{headers:$.headers})})}async listBuckets(D={}){var $=this;return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/ListVectorBuckets`,D,{headers:$.headers})})}async deleteBucket(D){var $=this;return $.handleOperation(async()=>{return await u1.post($.fetch,`${$.url}/DeleteVectorBucket`,{vectorBucketName:D},{headers:$.headers})||{}})}},SA=class extends xA{constructor(D,$={}){super(D,$.headers||{},$.fetch)}from(D){return new uA(this.url,this.headers,D,this.fetch)}async createBucket(D){var $=()=>super.createBucket,X=this;return $().call(X,D)}async getBucket(D){var $=()=>super.getBucket,X=this;return $().call(X,D)}async listBuckets(D={}){var $=()=>super.listBuckets,X=this;return $().call(X,D)}async deleteBucket(D){var $=()=>super.deleteBucket,X=this;return $().call(X,D)}},uA=class extends CA{constructor(D,$,X,Y){super(D,$,Y);this.vectorBucketName=X}async createIndex(D){var $=()=>super.createIndex,X=this;return $().call(X,ND(ND({},D),{},{vectorBucketName:X.vectorBucketName}))}async listIndexes(D={}){var $=()=>super.listIndexes,X=this;return $().call(X,ND(ND({},D),{},{vectorBucketName:X.vectorBucketName}))}async getIndex(D){var $=()=>super.getIndex,X=this;return $().call(X,X.vectorBucketName,D)}async deleteIndex(D){var $=()=>super.deleteIndex,X=this;return $().call(X,X.vectorBucketName,D)}index(D){return new vA(this.url,this.headers,this.vectorBucketName,D,this.fetch)}},vA=class extends PA{constructor(D,$,X,Y,J){super(D,$,J);this.vectorBucketName=X,this.indexName=Y}async putVectors(D){var $=()=>super.putVectors,X=this;return $().call(X,ND(ND({},D),{},{vectorBucketName:X.vectorBucketName,indexName:X.indexName}))}async getVectors(D){var $=()=>super.getVectors,X=this;return $().call(X,ND(ND({},D),{},{vectorBucketName:X.vectorBucketName,indexName:X.indexName}))}async listVectors(D={}){var $=()=>super.listVectors,X=this;return $().call(X,ND(ND({},D),{},{vectorBucketName:X.vectorBucketName,indexName:X.indexName}))}async queryVectors(D){var $=()=>super.queryVectors,X=this;return $().call(X,ND(ND({},D),{},{vectorBucketName:X.vectorBucketName,indexName:X.indexName}))}async deleteVectors(D){var $=()=>super.deleteVectors,X=this;return $().call(X,ND(ND({},D),{},{vectorBucketName:X.vectorBucketName,indexName:X.indexName}))}},KG=class extends R0D{constructor(D,$={},X,Y){super(D,$,X,Y)}from(D){return new I0D(this.url,this.headers,D,this.fetch)}get vectors(){return new SA(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new TA(this.url+"/iceberg",this.headers,this.fetch)}};var $j=z0(SG(),1);UD(OD,z0(UG(),1));UD(OD,z0(SG(),1));var n6D="2.95.3",T7="";if(typeof Deno<"u")T7="deno";else if(typeof document<"u")T7="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")T7="react-native";else T7="node";var i6D={"X-Client-Info":`supabase-js-${T7}/${n6D}`},p6D={headers:i6D},r6D={schema:"public"},o6D={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},a6D={};function C7(D){return C7=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},C7(D)}function t6D(D,$){if(C7(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(C7(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}function s6D(D){var $=t6D(D,"string");return C7($)=="symbol"?$:$+""}function e6D(D,$,X){return($=s6D($))in D?Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0}):D[$]=X,D}function eR(D,$){var X=Object.keys(D);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(D);$&&(Y=Y.filter(function(J){return Object.getOwnPropertyDescriptor(D,J).enumerable})),X.push.apply(X,Y)}return X}function I0(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?eR(Object(X),!0).forEach(function(Y){e6D(D,Y,X[Y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):eR(Object(X)).forEach(function(Y){Object.defineProperty(D,Y,Object.getOwnPropertyDescriptor(X,Y))})}return D}var D4D=(D)=>{if(D)return(...$)=>D(...$);return(...$)=>fetch(...$)},$4D=()=>{return Headers},X4D=(D,$,X)=>{let Y=D4D(X),J=$4D();return async(Q,F)=>{var w;let Z=(w=await $())!==null&&w!==void 0?w:D,G=new J(F===null||F===void 0?void 0:F.headers);if(!G.has("apikey"))G.set("apikey",D);if(!G.has("Authorization"))G.set("Authorization",`Bearer ${Z}`);return Y(Q,I0(I0({},F),{},{headers:G}))}};function J4D(D){return D.endsWith("/")?D:D+"/"}function Y4D(D,$){var X,Y;let{db:J,auth:Q,realtime:F,global:w}=D,{db:Z,auth:G,realtime:O,global:U}=$,z={db:I0(I0({},Z),J),auth:I0(I0({},G),Q),realtime:I0(I0({},O),F),storage:{},global:I0(I0(I0({},U),w),{},{headers:I0(I0({},(X=U===null||U===void 0?void 0:U.headers)!==null&&X!==void 0?X:{}),(Y=w===null||w===void 0?void 0:w.headers)!==null&&Y!==void 0?Y:{})}),accessToken:async()=>""};if(D.accessToken)z.accessToken=D.accessToken;else delete z.accessToken;return z}function Q4D(D){let $=D===null||D===void 0?void 0:D.trim();if(!$)throw Error("supabaseUrl is required.");if(!$.match(/^https?:\/\//i))throw Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(J4D($))}catch(X){throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var F4D=class extends $j.AuthClient{constructor(D){super(D)}},Xj=class{constructor(D,$,X){var Y,J;this.supabaseUrl=D,this.supabaseKey=$;let Q=Q4D(D);if(!$)throw Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",Q),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",Q),this.storageUrl=new URL("storage/v1",Q),this.functionsUrl=new URL("functions/v1",Q);let F=`sb-${Q.hostname.split(".")[0]}-auth-token`,w={db:r6D,realtime:a6D,auth:I0(I0({},o6D),{},{storageKey:F}),global:p6D},Z=Y4D(X!==null&&X!==void 0?X:{},w);if(this.storageKey=(Y=Z.auth.storageKey)!==null&&Y!==void 0?Y:"",this.headers=(J=Z.global.headers)!==null&&J!==void 0?J:{},!Z.accessToken){var G;this.auth=this._initSupabaseAuthClient((G=Z.auth)!==null&&G!==void 0?G:{},this.headers,Z.global.fetch)}else this.accessToken=Z.accessToken,this.auth=new Proxy({},{get:(O,U)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(U)} is not possible`)}});if(this.fetch=X4D($,this._getAccessToken.bind(this),Z.global.fetch),this.realtime=this._initRealtimeClient(I0({headers:this.headers,accessToken:this._getAccessToken.bind(this)},Z.realtime)),this.accessToken)Promise.resolve(this.accessToken()).then((O)=>this.realtime.setAuth(O)).catch((O)=>console.warn("Failed to set initial Realtime auth token:",O));if(this.rest=new f2(new URL("rest/v1",Q).href,{headers:this.headers,schema:Z.db.schema,fetch:this.fetch,timeout:Z.db.timeout,urlLengthLimit:Z.db.urlLengthLimit}),this.storage=new KG(this.storageUrl.href,this.headers,this.fetch,X===null||X===void 0?void 0:X.storage),!Z.accessToken)this._listenForAuthEvents()}get functions(){return new a0.FunctionsClient(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(D){return this.rest.from(D)}schema(D){return this.rest.schema(D)}rpc(D,$={},X={head:!1,get:!1,count:void 0}){return this.rest.rpc(D,$,X)}channel(D,$={config:{}}){return this.realtime.channel(D,$)}getChannels(){return this.realtime.getChannels()}removeChannel(D){return this.realtime.removeChannel(D)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var D=this,$,X;if(D.accessToken)return await D.accessToken();let{data:Y}=await D.auth.getSession();return($=(X=Y.session)===null||X===void 0?void 0:X.access_token)!==null&&$!==void 0?$:D.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:D,persistSession:$,detectSessionInUrl:X,storage:Y,userStorage:J,storageKey:Q,flowType:F,lock:w,debug:Z,throwOnError:G},O,U){let z={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new F4D({url:this.authUrl.href,headers:I0(I0({},z),O),storageKey:Q,autoRefreshToken:D,persistSession:$,detectSessionInUrl:X,storage:Y,userStorage:J,flowType:F,lock:w,debug:Z,throwOnError:G,fetch:U,hasCustomAuthorizationHeader:Object.keys(this.headers).some((q)=>q.toLowerCase()==="authorization")})}_initRealtimeClient(D){return new Dj.RealtimeClient(this.realtimeUrl.href,I0(I0({},D),{},{params:I0(I0({},{apikey:this.supabaseKey}),D===null||D===void 0?void 0:D.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((D,$)=>{this._handleTokenChanged(D,"CLIENT",$===null||$===void 0?void 0:$.access_token)})}_handleTokenChanged(D,$,X){if((D==="TOKEN_REFRESHED"||D==="SIGNED_IN")&&this.changedAccessToken!==X)this.changedAccessToken=X,this.realtime.setAuth(X);else if(D==="SIGNED_OUT"){if(this.realtime.setAuth(),$=="STORAGE")this.auth.signOut();this.changedAccessToken=void 0}}},uG=(D,$,X)=>{return new Xj(D,$,X)};function w4D(){if(typeof window<"u")return!1;let D=globalThis.process;if(!D)return!1;let $=D.version;if($===void 0||$===null)return!1;let X=$.match(/^v(\d+)\./);if(!X)return!1;return parseInt(X[1],10)<=18}if(w4D())console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");var mN=z0(yG(),1),Qr=z0(UE(),1),jw=z0(aJ(),1);var r$={name:"@capgo/cli",type:"module",version:"7.76.3",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLI#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsc --noEmit",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:mcp":"node test/test-mcp.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs",test:"bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:credentials && bun run test:credentials-validation && bun run test:checksum && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths"},devDependencies:{"@antfu/eslint-config":"^7.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.4","@capacitor/cli":"^8.0.0","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.0.0","@modelcontextprotocol/sdk":"^1.25.3","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.6","@supabase/supabase-js":"^2.79.0","@types/adm-zip":"^0.5.7","@types/node":"^25.0.0","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.4","adm-zip":"^0.5.16","ci-info":"^4.3.1",commander:"^14.0.2",eslint:"^9.38.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.0",micromatch:"^4.0.8",open:"^11.0.0",prettyjson:"^1.2.5",tmp:"^0.2.5","tus-js-client":"^4.3.1",typescript:"^5.9.3",partysocket:"^1.1.11",ws:"^8.18.3",zod:"^4.3.6"}};async function tJ(D){try{let X=`https://registry.npmjs.org/${encodeURIComponent(D.toLowerCase())}`,Y=await fetch(X,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});if(!Y.ok)return null;return(await Y.json())["dist-tags"]?.latest||null}catch{return null}}async function X0(){let D=await tJ("@capgo/cli")??"",$=D?.split(".")[0];if(D!==r$.version)H.warning(`\uD83D\uDEA8 You are using @capgo/cli@${r$.version} it's not the latest version.
|
|
339
339
|
Please use @capgo/cli@${D}" or @capgo/cli@${$} to keep up to date with the latest features and bug fixes.`)}async function bP(D,$,X,Y,J,Q="✅"){await ID(X,{channel:D,event:Y,icon:Q,user_id:$,...J?{tags:{"app-id":J}}:{},notify:!1})}import{Buffer as gP}from"node:buffer";import{createHash as VJD}from"node:crypto";var NJD=(()=>{let D=[];for(let $=0;$<256;$++){let X=$;for(let Y=0;Y<8;Y++)X=X&1?3988292384^X>>>1:X>>>1;D[$]=X}return D})();function MJD(D){let $=4294967295;for(let X=0;X<D.length;X++){let Y=D[X];$=NJD[($^Y)&255]^$>>>8}return $=$^4294967295,($>>>0).toString(16).padStart(8,"0")}async function k6(D,$="sha256"){let X=gP.isBuffer(D)?D:gP.from(D);if($==="crc32")return MJD(X);let Y=VJD($);return Y.update(X),Y.digest("hex")}var s3=z0(Rn(),1);async function jn(){let D=await s3.loadConfig();return{config:D.app.extConfig,path:D.app.extConfigFilePath}}async function Rz(D,$,X=!1){let Y=await s3.loadConfig(),{extConfig:J}=Y.app;if(J){if(!J.plugins)J.plugins={extConfig:{},[D]:{}};if(!J.plugins[D])J.plugins[D]={};if(!X)J.plugins[D]=$.config.plugins?.[D];else J=$.config;s3.writeConfig(J,Y.app.extConfigFilePath)}}async function J5(D,$=!1){await Rz("CapacitorUpdater",D,$)}var yD={};S1(yD,{xor:()=>ei,xid:()=>Ii,void:()=>pi,uuidv7:()=>Bi,uuidv6:()=>zi,uuidv4:()=>qi,uuid:()=>Ui,util:()=>DD,url:()=>Ki,uppercase:()=>K5,unknown:()=>V8,union:()=>qw,undefined:()=>ni,ulid:()=>Li,uint64:()=>ci,uint32:()=>hi,tuple:()=>mV,trim:()=>L5,treeifyError:()=>kz,transform:()=>Bw,toUpperCase:()=>A5,toLowerCase:()=>I5,toJSONSchema:()=>gF,templateLiteral:()=>qp,symbol:()=>li,superRefine:()=>BN,success:()=>Gp,stringbool:()=>Mp,stringFormat:()=>vi,string:()=>nF,strictObject:()=>ti,startsWith:()=>H5,slugify:()=>R5,size:()=>K8,setErrorMap:()=>iID,set:()=>Yp,safeParseAsync:()=>KV,safeParse:()=>BV,safeEncodeAsync:()=>IV,safeEncode:()=>MV,safeDecodeAsync:()=>AV,safeDecode:()=>LV,registry:()=>OF,regexes:()=>a1,regex:()=>z5,refine:()=>zN,record:()=>dV,readonly:()=>wN,property:()=>fF,promise:()=>zp,prettifyError:()=>yz,preprocess:()=>Ip,prefault:()=>DN,positive:()=>SF,pipe:()=>EX,partialRecord:()=>$p,parseAsync:()=>zV,parse:()=>qV,overwrite:()=>B$,optional:()=>RX,object:()=>ai,number:()=>jV,nullish:()=>Zp,nullable:()=>jX,null:()=>xV,normalize:()=>M5,nonpositive:()=>vF,nonoptional:()=>$N,nonnegative:()=>_F,never:()=>Uw,negative:()=>uF,nativeEnum:()=>Qp,nanoid:()=>Vi,nan:()=>Op,multipleOf:()=>X4,minSize:()=>b$,minLength:()=>w6,mime:()=>N5,meta:()=>Vp,maxSize:()=>J4,maxLength:()=>W8,map:()=>Jp,mac:()=>ji,lte:()=>f1,lt:()=>k$,lowercase:()=>B5,looseRecord:()=>Xp,looseObject:()=>si,locales:()=>NX,literal:()=>Fp,length:()=>H8,lazy:()=>ON,ksuid:()=>Ai,keyof:()=>oi,jwt:()=>ui,json:()=>Lp,iso:()=>T5,ipv6:()=>Ei,ipv4:()=>Ri,intersection:()=>gV,int64:()=>di,int32:()=>gi,int:()=>iF,instanceof:()=>Np,includes:()=>W5,httpUrl:()=>Wi,hostname:()=>_i,hex:()=>fi,hash:()=>ki,guid:()=>Oi,gte:()=>W1,gt:()=>y$,globalRegistry:()=>i0,getErrorMap:()=>pID,function:()=>Bp,fromJSONSchema:()=>Rp,formatError:()=>ZX,float64:()=>bi,float32:()=>yi,flattenError:()=>wX,file:()=>wp,exactOptional:()=>oV,enum:()=>zw,endsWith:()=>V5,encodeAsync:()=>VV,encode:()=>WV,emoji:()=>Hi,email:()=>Gi,e164:()=>Si,discriminatedUnion:()=>Dp,describe:()=>Hp,decodeAsync:()=>NV,decode:()=>HV,date:()=>ri,custom:()=>Wp,cuid2:()=>Mi,cuid:()=>Ni,core:()=>Z6,config:()=>x0,coerce:()=>WN,codec:()=>Up,clone:()=>K1,cidrv6:()=>Ci,cidrv4:()=>Ti,check:()=>Kp,catch:()=>YN,boolean:()=>EV,bigint:()=>mi,base64url:()=>xi,base64:()=>Pi,array:()=>PX,any:()=>ii,_function:()=>Bp,_default:()=>sV,_ZodString:()=>pF,ZodXor:()=>kV,ZodXID:()=>Dw,ZodVoid:()=>_V,ZodUnknown:()=>uV,ZodUnion:()=>SX,ZodUndefined:()=>CV,ZodUUID:()=>g$,ZodURL:()=>TX,ZodULID:()=>eF,ZodType:()=>TD,ZodTuple:()=>hV,ZodTransform:()=>pV,ZodTemplateLiteral:()=>ZN,ZodSymbol:()=>TV,ZodSuccess:()=>XN,ZodStringFormat:()=>rD,ZodString:()=>P5,ZodSet:()=>lV,ZodRecord:()=>uX,ZodRealError:()=>x1,ZodReadonly:()=>FN,ZodPromise:()=>UN,ZodPrefault:()=>eV,ZodPipe:()=>Hw,ZodOptional:()=>Kw,ZodObject:()=>xX,ZodNumberFormat:()=>N8,ZodNumber:()=>S5,ZodNullable:()=>aV,ZodNull:()=>PV,ZodNonOptional:()=>Ww,ZodNever:()=>vV,ZodNanoID:()=>aF,ZodNaN:()=>QN,ZodMap:()=>cV,ZodMAC:()=>RV,ZodLiteral:()=>nV,ZodLazy:()=>GN,ZodKSUID:()=>$w,ZodJWT:()=>Gw,ZodIssueCode:()=>nID,ZodIntersection:()=>bV,ZodISOTime:()=>cF,ZodISODuration:()=>lF,ZodISODateTime:()=>mF,ZodISODate:()=>dF,ZodIPv6:()=>Jw,ZodIPv4:()=>Xw,ZodGUID:()=>AX,ZodFunction:()=>qN,ZodFirstPartyTypeKind:()=>KN,ZodFile:()=>iV,ZodExactOptional:()=>rV,ZodError:()=>cID,ZodEnum:()=>C5,ZodEmoji:()=>oF,ZodEmail:()=>rF,ZodE164:()=>Zw,ZodDiscriminatedUnion:()=>yV,ZodDefault:()=>tV,ZodDate:()=>CX,ZodCustomStringFormat:()=>x5,ZodCustom:()=>vX,ZodCodec:()=>Vw,ZodCatch:()=>JN,ZodCUID2:()=>sF,ZodCUID:()=>tF,ZodCIDRv6:()=>Qw,ZodCIDRv4:()=>Yw,ZodBoolean:()=>u5,ZodBigIntFormat:()=>Ow,ZodBigInt:()=>v5,ZodBase64URL:()=>ww,ZodBase64:()=>Fw,ZodArray:()=>fV,ZodAny:()=>SV,TimePrecision:()=>mW,NEVER:()=>jz,$output:()=>fW,$input:()=>kW,$brand:()=>Ez});var Z6={};S1(Z6,{version:()=>uB,util:()=>DD,treeifyError:()=>kz,toJSONSchema:()=>gF,toDotPath:()=>Sn,safeParseAsync:()=>gz,safeParse:()=>bz,safeEncodeAsync:()=>rMD,safeEncode:()=>iMD,safeDecodeAsync:()=>oMD,safeDecode:()=>pMD,registry:()=>OF,regexes:()=>a1,process:()=>kD,prettifyError:()=>yz,parseAsync:()=>dQ,parse:()=>mQ,meta:()=>LH,locales:()=>NX,isValidJWT:()=>tn,isValidBase64URL:()=>an,isValidBase64:()=>DK,initializeContext:()=>Y4,globalRegistry:()=>i0,globalConfig:()=>e3,formatError:()=>ZX,flattenError:()=>wX,finalize:()=>F4,extractDefs:()=>Q4,encodeAsync:()=>lMD,encode:()=>dMD,describe:()=>MH,decodeAsync:()=>nMD,decode:()=>cMD,createToJSONSchemaMethod:()=>AH,createStandardJSONSchemaMethod:()=>E5,config:()=>x0,clone:()=>K1,_xor:()=>NID,_xid:()=>LF,_void:()=>UH,_uuidv7:()=>KF,_uuidv6:()=>BF,_uuidv4:()=>zF,_uuid:()=>qF,_url:()=>LX,_uppercase:()=>K5,_unknown:()=>GH,_union:()=>VID,_undefined:()=>FH,_ulid:()=>MF,_uint64:()=>YH,_uint32:()=>sW,_tuple:()=>IID,_trim:()=>L5,_transform:()=>PID,_toUpperCase:()=>A5,_toLowerCase:()=>I5,_templateLiteral:()=>bID,_symbol:()=>QH,_superRefine:()=>NH,_success:()=>_ID,_stringbool:()=>IH,_stringFormat:()=>j5,_string:()=>bW,_startsWith:()=>H5,_slugify:()=>R5,_size:()=>K8,_set:()=>jID,_safeParseAsync:()=>O5,_safeParse:()=>G5,_safeEncodeAsync:()=>oQ,_safeEncode:()=>pQ,_safeDecodeAsync:()=>aQ,_safeDecode:()=>rQ,_regex:()=>z5,_refine:()=>VH,_record:()=>AID,_readonly:()=>yID,_property:()=>fF,_promise:()=>hID,_positive:()=>SF,_pipe:()=>kID,_parseAsync:()=>Z5,_parse:()=>w5,_overwrite:()=>B$,_optional:()=>xID,_number:()=>iW,_nullable:()=>SID,_null:()=>wH,_normalize:()=>M5,_nonpositive:()=>vF,_nonoptional:()=>vID,_nonnegative:()=>_F,_never:()=>OH,_negative:()=>uF,_nativeEnum:()=>TID,_nanoid:()=>HF,_nan:()=>BH,_multipleOf:()=>X4,_minSize:()=>b$,_minLength:()=>w6,_min:()=>W1,_mime:()=>N5,_maxSize:()=>J4,_maxLength:()=>W8,_max:()=>f1,_map:()=>RID,_mac:()=>hW,_lte:()=>f1,_lt:()=>k$,_lowercase:()=>B5,_literal:()=>CID,_length:()=>H8,_lazy:()=>gID,_ksuid:()=>IF,_jwt:()=>xF,_isoTime:()=>lW,_isoDuration:()=>nW,_isoDateTime:()=>dW,_isoDate:()=>cW,_ipv6:()=>RF,_ipv4:()=>AF,_intersection:()=>LID,_int64:()=>JH,_int32:()=>tW,_int:()=>rW,_includes:()=>W5,_guid:()=>MX,_gte:()=>W1,_gt:()=>y$,_float64:()=>aW,_float32:()=>oW,_file:()=>WH,_enum:()=>EID,_endsWith:()=>V5,_encodeAsync:()=>nQ,_encode:()=>cQ,_emoji:()=>WF,_email:()=>UF,_e164:()=>PF,_discriminatedUnion:()=>MID,_default:()=>uID,_decodeAsync:()=>iQ,_decode:()=>lQ,_date:()=>qH,_custom:()=>HH,_cuid2:()=>NF,_cuid:()=>VF,_coercedString:()=>gW,_coercedNumber:()=>pW,_coercedDate:()=>zH,_coercedBoolean:()=>DH,_coercedBigint:()=>XH,_cidrv6:()=>EF,_cidrv4:()=>jF,_check:()=>Fi,_catch:()=>fID,_boolean:()=>eW,_bigint:()=>$H,_base64url:()=>CF,_base64:()=>TF,_array:()=>KH,_any:()=>ZH,TimePrecision:()=>mW,NEVER:()=>jz,JSONSchemaGenerator:()=>wV,JSONSchema:()=>wi,Doc:()=>DF,$output:()=>fW,$input:()=>kW,$constructor:()=>c,$brand:()=>Ez,$ZodXor:()=>VK,$ZodXID:()=>cB,$ZodVoid:()=>BK,$ZodUnknown:()=>qK,$ZodUnion:()=>zX,$ZodUndefined:()=>GK,$ZodUUID:()=>fB,$ZodURL:()=>yB,$ZodULID:()=>dB,$ZodType:()=>MD,$ZodTuple:()=>ZF,$ZodTransform:()=>TK,$ZodTemplateLiteral:()=>bK,$ZodSymbol:()=>ZK,$ZodSuccess:()=>vK,$ZodStringFormat:()=>pD,$ZodString:()=>B8,$ZodSet:()=>AK,$ZodRegistry:()=>yW,$ZodRecord:()=>LK,$ZodRealError:()=>P1,$ZodReadonly:()=>yK,$ZodPromise:()=>hK,$ZodPrefault:()=>SK,$ZodPipe:()=>kK,$ZodOptional:()=>GF,$ZodObjectJIT:()=>HK,$ZodObject:()=>Di,$ZodNumberFormat:()=>FK,$ZodNumber:()=>FF,$ZodNullable:()=>PK,$ZodNull:()=>OK,$ZodNonOptional:()=>uK,$ZodNever:()=>zK,$ZodNanoID:()=>gB,$ZodNaN:()=>fK,$ZodMap:()=>IK,$ZodMAC:()=>tB,$ZodLiteral:()=>jK,$ZodLazy:()=>mK,$ZodKSUID:()=>lB,$ZodJWT:()=>YK,$ZodIntersection:()=>MK,$ZodISOTime:()=>pB,$ZodISODuration:()=>rB,$ZodISODateTime:()=>nB,$ZodISODate:()=>iB,$ZodIPv6:()=>aB,$ZodIPv4:()=>oB,$ZodGUID:()=>_B,$ZodFunction:()=>gK,$ZodFile:()=>EK,$ZodExactOptional:()=>CK,$ZodError:()=>FX,$ZodEnum:()=>RK,$ZodEncodeError:()=>U8,$ZodEmoji:()=>bB,$ZodEmail:()=>kB,$ZodE164:()=>JK,$ZodDiscriminatedUnion:()=>NK,$ZodDefault:()=>xK,$ZodDate:()=>KK,$ZodCustomStringFormat:()=>QK,$ZodCustom:()=>dK,$ZodCodec:()=>BX,$ZodCheckUpperCase:()=>jB,$ZodCheckStringFormat:()=>U5,$ZodCheckStartsWith:()=>TB,$ZodCheckSizeEquals:()=>NB,$ZodCheckRegex:()=>AB,$ZodCheckProperty:()=>PB,$ZodCheckOverwrite:()=>SB,$ZodCheckNumberFormat:()=>KB,$ZodCheckMultipleOf:()=>BB,$ZodCheckMinSize:()=>VB,$ZodCheckMinLength:()=>LB,$ZodCheckMimeType:()=>xB,$ZodCheckMaxSize:()=>HB,$ZodCheckMaxLength:()=>MB,$ZodCheckLowerCase:()=>RB,$ZodCheckLessThan:()=>sQ,$ZodCheckLengthEquals:()=>IB,$ZodCheckIncludes:()=>EB,$ZodCheckGreaterThan:()=>eQ,$ZodCheckEndsWith:()=>CB,$ZodCheckBigIntFormat:()=>WB,$ZodCheck:()=>tD,$ZodCatch:()=>_K,$ZodCUID2:()=>mB,$ZodCUID:()=>hB,$ZodCIDRv6:()=>eB,$ZodCIDRv4:()=>sB,$ZodBoolean:()=>qX,$ZodBigIntFormat:()=>wK,$ZodBigInt:()=>wF,$ZodBase64URL:()=>XK,$ZodBase64:()=>$K,$ZodAsyncError:()=>f$,$ZodArray:()=>WK,$ZodAny:()=>UK});var jz=Object.freeze({status:"aborted"});function c(D,$,X){function Y(w,Z){if(!w._zod)Object.defineProperty(w,"_zod",{value:{def:Z,constr:F,traits:new Set},enumerable:!1});if(w._zod.traits.has(D))return;w._zod.traits.add(D),$(w,Z);let G=F.prototype,O=Object.keys(G);for(let U=0;U<O.length;U++){let z=O[U];if(!(z in w))w[z]=G[z].bind(w)}}let J=X?.Parent??Object;class Q extends J{}Object.defineProperty(Q,"name",{value:D});function F(w){var Z;let G=X?.Parent?new Q:this;Y(G,w),(Z=G._zod).deferred??(Z.deferred=[]);for(let O of G._zod.deferred)O();return G}return Object.defineProperty(F,"init",{value:Y}),Object.defineProperty(F,Symbol.hasInstance,{value:(w)=>{if(X?.Parent&&w instanceof X.Parent)return!0;return w?._zod?.traits?.has(D)}}),Object.defineProperty(F,"name",{value:D}),F}var Ez=Symbol("zod_brand");class f$ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class U8 extends Error{constructor(D){super(`Encountered unidirectional transform during encode: ${D}`);this.name="ZodEncodeError"}}var e3={};function x0(D){if(D)Object.assign(e3,D);return e3}var DD={};S1(DD,{unwrapMessage:()=>DX,uint8ArrayToHex:()=>hMD,uint8ArrayToBase64url:()=>bMD,uint8ArrayToBase64:()=>Cn,stringifyPrimitive:()=>s,slugify:()=>Pz,shallowClone:()=>Sz,safeExtend:()=>uMD,required:()=>fMD,randomString:()=>jMD,propertyKeyTypes:()=>JX,promiseAllObject:()=>RMD,primitiveTypes:()=>uz,prefixIssues:()=>_1,pick:()=>PMD,partial:()=>_MD,parsedType:()=>e,optionalKeys:()=>vz,omit:()=>xMD,objectClone:()=>LMD,numKeys:()=>EMD,nullish:()=>s6,normalizeParams:()=>$D,mergeDefs:()=>F6,merge:()=>vMD,jsonStringifyReplacer:()=>Y5,joinValues:()=>n,issue:()=>F5,isPlainObject:()=>D4,isObject:()=>q8,hexToUint8Array:()=>gMD,getSizableOrigin:()=>YX,getParsedType:()=>TMD,getLengthableOrigin:()=>QX,getEnumValues:()=>$X,getElementAtPath:()=>AMD,floatSafeRemainder:()=>Cz,finalizeIssue:()=>C1,extend:()=>SMD,escapeRegex:()=>o1,esc:()=>gQ,defineLazy:()=>PD,createTransparentProxy:()=>CMD,cloneDef:()=>IMD,clone:()=>K1,cleanRegex:()=>XX,cleanEnum:()=>kMD,captureStackTrace:()=>hQ,cached:()=>Q5,base64urlToUint8Array:()=>yMD,base64ToUint8Array:()=>Tn,assignProp:()=>e6,assertNotEqual:()=>HMD,assertNever:()=>NMD,assertIs:()=>VMD,assertEqual:()=>WMD,assert:()=>MMD,allowsEval:()=>xz,aborted:()=>$4,NUMBER_FORMAT_RANGES:()=>_z,Class:()=>Pn,BIGINT_FORMAT_RANGES:()=>fz});function WMD(D){return D}function HMD(D){return D}function VMD(D){}function NMD(D){throw Error("Unexpected value in exhaustive check")}function MMD(D){}function $X(D){let $=Object.values(D).filter((Y)=>typeof Y==="number");return Object.entries(D).filter(([Y,J])=>$.indexOf(+Y)===-1).map(([Y,J])=>J)}function n(D,$="|"){return D.map((X)=>s(X)).join($)}function Y5(D,$){if(typeof $==="bigint")return $.toString();return $}function Q5(D){return{get value(){{let X=D();return Object.defineProperty(this,"value",{value:X}),X}throw Error("cached value already set")}}}function s6(D){return D===null||D===void 0}function XX(D){let $=D.startsWith("^")?1:0,X=D.endsWith("$")?D.length-1:D.length;return D.slice($,X)}function Cz(D,$){let X=(D.toString().split(".")[1]||"").length,Y=$.toString(),J=(Y.split(".")[1]||"").length;if(J===0&&/\d?e-\d?/.test(Y)){let Z=Y.match(/\d?e-(\d?)/);if(Z?.[1])J=Number.parseInt(Z[1])}let Q=X>J?X:J,F=Number.parseInt(D.toFixed(Q).replace(".","")),w=Number.parseInt($.toFixed(Q).replace(".",""));return F%w/10**Q}var En=Symbol("evaluating");function PD(D,$,X){let Y=void 0;Object.defineProperty(D,$,{get(){if(Y===En)return;if(Y===void 0)Y=En,Y=X();return Y},set(J){Object.defineProperty(D,$,{value:J})},configurable:!0})}function LMD(D){return Object.create(Object.getPrototypeOf(D),Object.getOwnPropertyDescriptors(D))}function e6(D,$,X){Object.defineProperty(D,$,{value:X,writable:!0,enumerable:!0,configurable:!0})}function F6(...D){let $={};for(let X of D){let Y=Object.getOwnPropertyDescriptors(X);Object.assign($,Y)}return Object.defineProperties({},$)}function IMD(D){return F6(D._zod.def)}function AMD(D,$){if(!$)return D;return $.reduce((X,Y)=>X?.[Y],D)}function RMD(D){let $=Object.keys(D),X=$.map((Y)=>D[Y]);return Promise.all(X).then((Y)=>{let J={};for(let Q=0;Q<$.length;Q++)J[$[Q]]=Y[Q];return J})}function jMD(D=10){let X="";for(let Y=0;Y<D;Y++)X+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return X}function gQ(D){return JSON.stringify(D)}function Pz(D){return D.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var hQ="captureStackTrace"in Error?Error.captureStackTrace:(...D)=>{};function q8(D){return typeof D==="object"&&D!==null&&!Array.isArray(D)}var xz=Q5(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(D){return!1}});function D4(D){if(q8(D)===!1)return!1;let $=D.constructor;if($===void 0)return!0;if(typeof $!=="function")return!0;let X=$.prototype;if(q8(X)===!1)return!1;if(Object.prototype.hasOwnProperty.call(X,"isPrototypeOf")===!1)return!1;return!0}function Sz(D){if(D4(D))return{...D};if(Array.isArray(D))return[...D];return D}function EMD(D){let $=0;for(let X in D)if(Object.prototype.hasOwnProperty.call(D,X))$++;return $}var TMD=(D)=>{let $=typeof D;switch($){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(D)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(D))return"array";if(D===null)return"null";if(D.then&&typeof D.then==="function"&&D.catch&&typeof D.catch==="function")return"promise";if(typeof Map<"u"&&D instanceof Map)return"map";if(typeof Set<"u"&&D instanceof Set)return"set";if(typeof Date<"u"&&D instanceof Date)return"date";if(typeof File<"u"&&D instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${$}`)}},JX=new Set(["string","number","symbol"]),uz=new Set(["string","number","bigint","boolean","symbol","undefined"]);function o1(D){return D.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function K1(D,$,X){let Y=new D._zod.constr($??D._zod.def);if(!$||X?.parent)Y._zod.parent=D;return Y}function $D(D){let $=D;if(!$)return{};if(typeof $==="string")return{error:()=>$};if($?.message!==void 0){if($?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");$.error=$.message}if(delete $.message,typeof $.error==="string")return{...$,error:()=>$.error};return $}function CMD(D){let $;return new Proxy({},{get(X,Y,J){return $??($=D()),Reflect.get($,Y,J)},set(X,Y,J,Q){return $??($=D()),Reflect.set($,Y,J,Q)},has(X,Y){return $??($=D()),Reflect.has($,Y)},deleteProperty(X,Y){return $??($=D()),Reflect.deleteProperty($,Y)},ownKeys(X){return $??($=D()),Reflect.ownKeys($)},getOwnPropertyDescriptor(X,Y){return $??($=D()),Reflect.getOwnPropertyDescriptor($,Y)},defineProperty(X,Y,J){return $??($=D()),Reflect.defineProperty($,Y,J)}})}function s(D){if(typeof D==="bigint")return D.toString()+"n";if(typeof D==="string")return`"${D}"`;return`${D}`}function vz(D){return Object.keys(D).filter(($)=>{return D[$]._zod.optin==="optional"&&D[$]._zod.optout==="optional"})}var _z={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},fz={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function PMD(D,$){let X=D._zod.def,Y=X.checks;if(Y&&Y.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let Q=F6(D._zod.def,{get shape(){let F={};for(let w in $){if(!(w in X.shape))throw Error(`Unrecognized key: "${w}"`);if(!$[w])continue;F[w]=X.shape[w]}return e6(this,"shape",F),F},checks:[]});return K1(D,Q)}function xMD(D,$){let X=D._zod.def,Y=X.checks;if(Y&&Y.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let Q=F6(D._zod.def,{get shape(){let F={...D._zod.def.shape};for(let w in $){if(!(w in X.shape))throw Error(`Unrecognized key: "${w}"`);if(!$[w])continue;delete F[w]}return e6(this,"shape",F),F},checks:[]});return K1(D,Q)}function SMD(D,$){if(!D4($))throw Error("Invalid input to extend: expected a plain object");let X=D._zod.def.checks;if(X&&X.length>0){let Q=D._zod.def.shape;for(let F in $)if(Object.getOwnPropertyDescriptor(Q,F)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let J=F6(D._zod.def,{get shape(){let Q={...D._zod.def.shape,...$};return e6(this,"shape",Q),Q}});return K1(D,J)}function uMD(D,$){if(!D4($))throw Error("Invalid input to safeExtend: expected a plain object");let X=F6(D._zod.def,{get shape(){let Y={...D._zod.def.shape,...$};return e6(this,"shape",Y),Y}});return K1(D,X)}function vMD(D,$){let X=F6(D._zod.def,{get shape(){let Y={...D._zod.def.shape,...$._zod.def.shape};return e6(this,"shape",Y),Y},get catchall(){return $._zod.def.catchall},checks:[]});return K1(D,X)}function _MD(D,$,X){let J=$._zod.def.checks;if(J&&J.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let F=F6($._zod.def,{get shape(){let w=$._zod.def.shape,Z={...w};if(X)for(let G in X){if(!(G in w))throw Error(`Unrecognized key: "${G}"`);if(!X[G])continue;Z[G]=D?new D({type:"optional",innerType:w[G]}):w[G]}else for(let G in w)Z[G]=D?new D({type:"optional",innerType:w[G]}):w[G];return e6(this,"shape",Z),Z},checks:[]});return K1($,F)}function fMD(D,$,X){let Y=F6($._zod.def,{get shape(){let J=$._zod.def.shape,Q={...J};if(X)for(let F in X){if(!(F in Q))throw Error(`Unrecognized key: "${F}"`);if(!X[F])continue;Q[F]=new D({type:"nonoptional",innerType:J[F]})}else for(let F in J)Q[F]=new D({type:"nonoptional",innerType:J[F]});return e6(this,"shape",Q),Q}});return K1($,Y)}function $4(D,$=0){if(D.aborted===!0)return!0;for(let X=$;X<D.issues.length;X++)if(D.issues[X]?.continue!==!0)return!0;return!1}function _1(D,$){return $.map((X)=>{var Y;return(Y=X).path??(Y.path=[]),X.path.unshift(D),X})}function DX(D){return typeof D==="string"?D:D?.message}function C1(D,$,X){let Y={...D,path:D.path??[]};if(!D.message){let J=DX(D.inst?._zod.def?.error?.(D))??DX($?.error?.(D))??DX(X.customError?.(D))??DX(X.localeError?.(D))??"Invalid input";Y.message=J}if(delete Y.inst,delete Y.continue,!$?.reportInput)delete Y.input;return Y}function YX(D){if(D instanceof Set)return"set";if(D instanceof Map)return"map";if(D instanceof File)return"file";return"unknown"}function QX(D){if(Array.isArray(D))return"array";if(typeof D==="string")return"string";return"unknown"}function e(D){let $=typeof D;switch($){case"number":return Number.isNaN(D)?"nan":"number";case"object":{if(D===null)return"null";if(Array.isArray(D))return"array";let X=D;if(X&&Object.getPrototypeOf(X)!==Object.prototype&&"constructor"in X&&X.constructor)return X.constructor.name}}return $}function F5(...D){let[$,X,Y]=D;if(typeof $==="string")return{message:$,code:"custom",input:X,inst:Y};return{...$}}function kMD(D){return Object.entries(D).filter(([$,X])=>{return Number.isNaN(Number.parseInt($,10))}).map(($)=>$[1])}function Tn(D){let $=atob(D),X=new Uint8Array($.length);for(let Y=0;Y<$.length;Y++)X[Y]=$.charCodeAt(Y);return X}function Cn(D){let $="";for(let X=0;X<D.length;X++)$+=String.fromCharCode(D[X]);return btoa($)}function yMD(D){let $=D.replace(/-/g,"+").replace(/_/g,"/"),X="=".repeat((4-$.length%4)%4);return Tn($+X)}function bMD(D){return Cn(D).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function gMD(D){let $=D.replace(/^0x/,"");if($.length%2!==0)throw Error("Invalid hex string length");let X=new Uint8Array($.length/2);for(let Y=0;Y<$.length;Y+=2)X[Y/2]=Number.parseInt($.slice(Y,Y+2),16);return X}function hMD(D){return Array.from(D).map(($)=>$.toString(16).padStart(2,"0")).join("")}class Pn{constructor(...D){}}var xn=(D,$)=>{D.name="$ZodError",Object.defineProperty(D,"_zod",{value:D._zod,enumerable:!1}),Object.defineProperty(D,"issues",{value:$,enumerable:!1}),D.message=JSON.stringify($,Y5,2),Object.defineProperty(D,"toString",{value:()=>D.message,enumerable:!1})},FX=c("$ZodError",xn),P1=c("$ZodError",xn,{Parent:Error});function wX(D,$=(X)=>X.message){let X={},Y=[];for(let J of D.issues)if(J.path.length>0)X[J.path[0]]=X[J.path[0]]||[],X[J.path[0]].push($(J));else Y.push($(J));return{formErrors:Y,fieldErrors:X}}function ZX(D,$=(X)=>X.message){let X={_errors:[]},Y=(J)=>{for(let Q of J.issues)if(Q.code==="invalid_union"&&Q.errors.length)Q.errors.map((F)=>Y({issues:F}));else if(Q.code==="invalid_key")Y({issues:Q.issues});else if(Q.code==="invalid_element")Y({issues:Q.issues});else if(Q.path.length===0)X._errors.push($(Q));else{let F=X,w=0;while(w<Q.path.length){let Z=Q.path[w];if(w!==Q.path.length-1)F[Z]=F[Z]||{_errors:[]};else F[Z]=F[Z]||{_errors:[]},F[Z]._errors.push($(Q));F=F[Z],w++}}};return Y(D),X}function kz(D,$=(X)=>X.message){let X={errors:[]},Y=(J,Q=[])=>{var F,w;for(let Z of J.issues)if(Z.code==="invalid_union"&&Z.errors.length)Z.errors.map((G)=>Y({issues:G},Z.path));else if(Z.code==="invalid_key")Y({issues:Z.issues},Z.path);else if(Z.code==="invalid_element")Y({issues:Z.issues},Z.path);else{let G=[...Q,...Z.path];if(G.length===0){X.errors.push($(Z));continue}let O=X,U=0;while(U<G.length){let z=G[U],q=U===G.length-1;if(typeof z==="string")O.properties??(O.properties={}),(F=O.properties)[z]??(F[z]={errors:[]}),O=O.properties[z];else O.items??(O.items=[]),(w=O.items)[z]??(w[z]={errors:[]}),O=O.items[z];if(q)O.errors.push($(Z));U++}}};return Y(D),X}function Sn(D){let $=[],X=D.map((Y)=>typeof Y==="object"?Y.key:Y);for(let Y of X)if(typeof Y==="number")$.push(`[${Y}]`);else if(typeof Y==="symbol")$.push(`[${JSON.stringify(String(Y))}]`);else if(/[^\w$]/.test(Y))$.push(`[${JSON.stringify(Y)}]`);else{if($.length)$.push(".");$.push(Y)}return $.join("")}function yz(D){let $=[],X=[...D.issues].sort((Y,J)=>(Y.path??[]).length-(J.path??[]).length);for(let Y of X)if($.push(`✖ ${Y.message}`),Y.path?.length)$.push(` → at ${Sn(Y.path)}`);return $.join(`
|
|
340
340
|
`)}var w5=(D)=>($,X,Y,J)=>{let Q=Y?Object.assign(Y,{async:!1}):{async:!1},F=$._zod.run({value:X,issues:[]},Q);if(F instanceof Promise)throw new f$;if(F.issues.length){let w=new(J?.Err??D)(F.issues.map((Z)=>C1(Z,Q,x0())));throw hQ(w,J?.callee),w}return F.value},mQ=w5(P1),Z5=(D)=>async($,X,Y,J)=>{let Q=Y?Object.assign(Y,{async:!0}):{async:!0},F=$._zod.run({value:X,issues:[]},Q);if(F instanceof Promise)F=await F;if(F.issues.length){let w=new(J?.Err??D)(F.issues.map((Z)=>C1(Z,Q,x0())));throw hQ(w,J?.callee),w}return F.value},dQ=Z5(P1),G5=(D)=>($,X,Y)=>{let J=Y?{...Y,async:!1}:{async:!1},Q=$._zod.run({value:X,issues:[]},J);if(Q instanceof Promise)throw new f$;return Q.issues.length?{success:!1,error:new(D??FX)(Q.issues.map((F)=>C1(F,J,x0())))}:{success:!0,data:Q.value}},bz=G5(P1),O5=(D)=>async($,X,Y)=>{let J=Y?Object.assign(Y,{async:!0}):{async:!0},Q=$._zod.run({value:X,issues:[]},J);if(Q instanceof Promise)Q=await Q;return Q.issues.length?{success:!1,error:new D(Q.issues.map((F)=>C1(F,J,x0())))}:{success:!0,data:Q.value}},gz=O5(P1),cQ=(D)=>($,X,Y)=>{let J=Y?Object.assign(Y,{direction:"backward"}):{direction:"backward"};return w5(D)($,X,J)},dMD=cQ(P1),lQ=(D)=>($,X,Y)=>{return w5(D)($,X,Y)},cMD=lQ(P1),nQ=(D)=>async($,X,Y)=>{let J=Y?Object.assign(Y,{direction:"backward"}):{direction:"backward"};return Z5(D)($,X,J)},lMD=nQ(P1),iQ=(D)=>async($,X,Y)=>{return Z5(D)($,X,Y)},nMD=iQ(P1),pQ=(D)=>($,X,Y)=>{let J=Y?Object.assign(Y,{direction:"backward"}):{direction:"backward"};return G5(D)($,X,J)},iMD=pQ(P1),rQ=(D)=>($,X,Y)=>{return G5(D)($,X,Y)},pMD=rQ(P1),oQ=(D)=>async($,X,Y)=>{let J=Y?Object.assign(Y,{direction:"backward"}):{direction:"backward"};return O5(D)($,X,J)},rMD=oQ(P1),aQ=(D)=>async($,X,Y)=>{return O5(D)($,X,Y)},oMD=aQ(P1);var a1={};S1(a1,{xid:()=>cz,uuid7:()=>eMD,uuid6:()=>sMD,uuid4:()=>tMD,uuid:()=>z8,uppercase:()=>zB,unicodeEmail:()=>un,undefined:()=>UB,ulid:()=>dz,time:()=>YB,string:()=>FB,sha512_hex:()=>MLD,sha512_base64url:()=>ILD,sha512_base64:()=>LLD,sha384_hex:()=>HLD,sha384_base64url:()=>NLD,sha384_base64:()=>VLD,sha256_hex:()=>BLD,sha256_base64url:()=>WLD,sha256_base64:()=>KLD,sha1_hex:()=>ULD,sha1_base64url:()=>zLD,sha1_base64:()=>qLD,rfc5322Email:()=>$LD,number:()=>GX,null:()=>OB,nanoid:()=>nz,md5_hex:()=>ZLD,md5_base64url:()=>OLD,md5_base64:()=>GLD,mac:()=>sz,lowercase:()=>qB,ksuid:()=>lz,ipv6:()=>tz,ipv4:()=>az,integer:()=>ZB,idnEmail:()=>XLD,html5Email:()=>DLD,hostname:()=>QLD,hex:()=>wLD,guid:()=>pz,extendedDuration:()=>aMD,emoji:()=>oz,email:()=>rz,e164:()=>XB,duration:()=>iz,domain:()=>FLD,datetime:()=>QB,date:()=>JB,cuid2:()=>mz,cuid:()=>hz,cidrv6:()=>DB,cidrv4:()=>ez,browserEmail:()=>JLD,boolean:()=>GB,bigint:()=>wB,base64url:()=>tQ,base64:()=>$B});var hz=/^[cC][^\s-]{8,}$/,mz=/^[0-9a-z]+$/,dz=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,cz=/^[0-9a-vA-V]{20}$/,lz=/^[A-Za-z0-9]{27}$/,nz=/^[a-zA-Z0-9_-]{21}$/,iz=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,aMD=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,pz=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,z8=(D)=>{if(!D)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${D}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},tMD=z8(4),sMD=z8(6),eMD=z8(7),rz=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,DLD=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,$LD=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,un=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,XLD=un,JLD=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,YLD="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function oz(){return new RegExp(YLD,"u")}var az=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,tz=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,sz=(D)=>{let $=o1(D??":");return new RegExp(`^(?:[0-9A-F]{2}${$}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${$}){5}[0-9a-f]{2}$`)},ez=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,DB=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$B=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tQ=/^[A-Za-z0-9_-]*$/,QLD=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,FLD=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,XB=/^\+[1-9]\d{6,14}$/,vn="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",JB=new RegExp(`^${vn}$`);function _n(D){return typeof D.precision==="number"?D.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":D.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${D.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function YB(D){return new RegExp(`^${_n(D)}$`)}function QB(D){let $=_n({precision:D.precision}),X=["Z"];if(D.local)X.push("");if(D.offset)X.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let Y=`${$}(?:${X.join("|")})`;return new RegExp(`^${vn}T(?:${Y})$`)}var FB=(D)=>{let $=D?`[\\s\\S]{${D?.minimum??0},${D?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${$}$`)},wB=/^-?\d+n?$/,ZB=/^-?\d+$/,GX=/^-?\d+(?:\.\d+)?$/,GB=/^(?:true|false)$/i,OB=/^null$/i;var UB=/^undefined$/i;var qB=/^[^A-Z]*$/,zB=/^[^a-z]*$/,wLD=/^[0-9a-fA-F]*$/;function OX(D,$){return new RegExp(`^[A-Za-z0-9+/]{${D}}${$}$`)}function UX(D){return new RegExp(`^[A-Za-z0-9_-]{${D}}$`)}var ZLD=/^[0-9a-fA-F]{32}$/,GLD=OX(22,"=="),OLD=UX(22),ULD=/^[0-9a-fA-F]{40}$/,qLD=OX(27,"="),zLD=UX(27),BLD=/^[0-9a-fA-F]{64}$/,KLD=OX(43,"="),WLD=UX(43),HLD=/^[0-9a-fA-F]{96}$/,VLD=OX(64,""),NLD=UX(64),MLD=/^[0-9a-fA-F]{128}$/,LLD=OX(86,"=="),ILD=UX(86);var tD=c("$ZodCheck",(D,$)=>{var X;D._zod??(D._zod={}),D._zod.def=$,(X=D._zod).onattach??(X.onattach=[])}),kn={number:"number",bigint:"bigint",object:"date"},sQ=c("$ZodCheckLessThan",(D,$)=>{tD.init(D,$);let X=kn[typeof $.value];D._zod.onattach.push((Y)=>{let J=Y._zod.bag,Q=($.inclusive?J.maximum:J.exclusiveMaximum)??Number.POSITIVE_INFINITY;if($.value<Q)if($.inclusive)J.maximum=$.value;else J.exclusiveMaximum=$.value}),D._zod.check=(Y)=>{if($.inclusive?Y.value<=$.value:Y.value<$.value)return;Y.issues.push({origin:X,code:"too_big",maximum:typeof $.value==="object"?$.value.getTime():$.value,input:Y.value,inclusive:$.inclusive,inst:D,continue:!$.abort})}}),eQ=c("$ZodCheckGreaterThan",(D,$)=>{tD.init(D,$);let X=kn[typeof $.value];D._zod.onattach.push((Y)=>{let J=Y._zod.bag,Q=($.inclusive?J.minimum:J.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if($.value>Q)if($.inclusive)J.minimum=$.value;else J.exclusiveMinimum=$.value}),D._zod.check=(Y)=>{if($.inclusive?Y.value>=$.value:Y.value>$.value)return;Y.issues.push({origin:X,code:"too_small",minimum:typeof $.value==="object"?$.value.getTime():$.value,input:Y.value,inclusive:$.inclusive,inst:D,continue:!$.abort})}}),BB=c("$ZodCheckMultipleOf",(D,$)=>{tD.init(D,$),D._zod.onattach.push((X)=>{var Y;(Y=X._zod.bag).multipleOf??(Y.multipleOf=$.value)}),D._zod.check=(X)=>{if(typeof X.value!==typeof $.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof X.value==="bigint"?X.value%$.value===BigInt(0):Cz(X.value,$.value)===0)return;X.issues.push({origin:typeof X.value,code:"not_multiple_of",divisor:$.value,input:X.value,inst:D,continue:!$.abort})}}),KB=c("$ZodCheckNumberFormat",(D,$)=>{tD.init(D,$),$.format=$.format||"float64";let X=$.format?.includes("int"),Y=X?"int":"number",[J,Q]=_z[$.format];D._zod.onattach.push((F)=>{let w=F._zod.bag;if(w.format=$.format,w.minimum=J,w.maximum=Q,X)w.pattern=ZB}),D._zod.check=(F)=>{let w=F.value;if(X){if(!Number.isInteger(w)){F.issues.push({expected:Y,format:$.format,code:"invalid_type",continue:!1,input:w,inst:D});return}if(!Number.isSafeInteger(w)){if(w>0)F.issues.push({input:w,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:D,origin:Y,inclusive:!0,continue:!$.abort});else F.issues.push({input:w,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:D,origin:Y,inclusive:!0,continue:!$.abort});return}}if(w<J)F.issues.push({origin:"number",input:w,code:"too_small",minimum:J,inclusive:!0,inst:D,continue:!$.abort});if(w>Q)F.issues.push({origin:"number",input:w,code:"too_big",maximum:Q,inclusive:!0,inst:D,continue:!$.abort})}}),WB=c("$ZodCheckBigIntFormat",(D,$)=>{tD.init(D,$);let[X,Y]=fz[$.format];D._zod.onattach.push((J)=>{let Q=J._zod.bag;Q.format=$.format,Q.minimum=X,Q.maximum=Y}),D._zod.check=(J)=>{let Q=J.value;if(Q<X)J.issues.push({origin:"bigint",input:Q,code:"too_small",minimum:X,inclusive:!0,inst:D,continue:!$.abort});if(Q>Y)J.issues.push({origin:"bigint",input:Q,code:"too_big",maximum:Y,inclusive:!0,inst:D,continue:!$.abort})}}),HB=c("$ZodCheckMaxSize",(D,$)=>{var X;tD.init(D,$),(X=D._zod.def).when??(X.when=(Y)=>{let J=Y.value;return!s6(J)&&J.size!==void 0}),D._zod.onattach.push((Y)=>{let J=Y._zod.bag.maximum??Number.POSITIVE_INFINITY;if($.maximum<J)Y._zod.bag.maximum=$.maximum}),D._zod.check=(Y)=>{let J=Y.value;if(J.size<=$.maximum)return;Y.issues.push({origin:YX(J),code:"too_big",maximum:$.maximum,inclusive:!0,input:J,inst:D,continue:!$.abort})}}),VB=c("$ZodCheckMinSize",(D,$)=>{var X;tD.init(D,$),(X=D._zod.def).when??(X.when=(Y)=>{let J=Y.value;return!s6(J)&&J.size!==void 0}),D._zod.onattach.push((Y)=>{let J=Y._zod.bag.minimum??Number.NEGATIVE_INFINITY;if($.minimum>J)Y._zod.bag.minimum=$.minimum}),D._zod.check=(Y)=>{let J=Y.value;if(J.size>=$.minimum)return;Y.issues.push({origin:YX(J),code:"too_small",minimum:$.minimum,inclusive:!0,input:J,inst:D,continue:!$.abort})}}),NB=c("$ZodCheckSizeEquals",(D,$)=>{var X;tD.init(D,$),(X=D._zod.def).when??(X.when=(Y)=>{let J=Y.value;return!s6(J)&&J.size!==void 0}),D._zod.onattach.push((Y)=>{let J=Y._zod.bag;J.minimum=$.size,J.maximum=$.size,J.size=$.size}),D._zod.check=(Y)=>{let J=Y.value,Q=J.size;if(Q===$.size)return;let F=Q>$.size;Y.issues.push({origin:YX(J),...F?{code:"too_big",maximum:$.size}:{code:"too_small",minimum:$.size},inclusive:!0,exact:!0,input:Y.value,inst:D,continue:!$.abort})}}),MB=c("$ZodCheckMaxLength",(D,$)=>{var X;tD.init(D,$),(X=D._zod.def).when??(X.when=(Y)=>{let J=Y.value;return!s6(J)&&J.length!==void 0}),D._zod.onattach.push((Y)=>{let J=Y._zod.bag.maximum??Number.POSITIVE_INFINITY;if($.maximum<J)Y._zod.bag.maximum=$.maximum}),D._zod.check=(Y)=>{let J=Y.value;if(J.length<=$.maximum)return;let F=QX(J);Y.issues.push({origin:F,code:"too_big",maximum:$.maximum,inclusive:!0,input:J,inst:D,continue:!$.abort})}}),LB=c("$ZodCheckMinLength",(D,$)=>{var X;tD.init(D,$),(X=D._zod.def).when??(X.when=(Y)=>{let J=Y.value;return!s6(J)&&J.length!==void 0}),D._zod.onattach.push((Y)=>{let J=Y._zod.bag.minimum??Number.NEGATIVE_INFINITY;if($.minimum>J)Y._zod.bag.minimum=$.minimum}),D._zod.check=(Y)=>{let J=Y.value;if(J.length>=$.minimum)return;let F=QX(J);Y.issues.push({origin:F,code:"too_small",minimum:$.minimum,inclusive:!0,input:J,inst:D,continue:!$.abort})}}),IB=c("$ZodCheckLengthEquals",(D,$)=>{var X;tD.init(D,$),(X=D._zod.def).when??(X.when=(Y)=>{let J=Y.value;return!s6(J)&&J.length!==void 0}),D._zod.onattach.push((Y)=>{let J=Y._zod.bag;J.minimum=$.length,J.maximum=$.length,J.length=$.length}),D._zod.check=(Y)=>{let J=Y.value,Q=J.length;if(Q===$.length)return;let F=QX(J),w=Q>$.length;Y.issues.push({origin:F,...w?{code:"too_big",maximum:$.length}:{code:"too_small",minimum:$.length},inclusive:!0,exact:!0,input:Y.value,inst:D,continue:!$.abort})}}),U5=c("$ZodCheckStringFormat",(D,$)=>{var X,Y;if(tD.init(D,$),D._zod.onattach.push((J)=>{let Q=J._zod.bag;if(Q.format=$.format,$.pattern)Q.patterns??(Q.patterns=new Set),Q.patterns.add($.pattern)}),$.pattern)(X=D._zod).check??(X.check=(J)=>{if($.pattern.lastIndex=0,$.pattern.test(J.value))return;J.issues.push({origin:"string",code:"invalid_format",format:$.format,input:J.value,...$.pattern?{pattern:$.pattern.toString()}:{},inst:D,continue:!$.abort})});else(Y=D._zod).check??(Y.check=()=>{})}),AB=c("$ZodCheckRegex",(D,$)=>{U5.init(D,$),D._zod.check=(X)=>{if($.pattern.lastIndex=0,$.pattern.test(X.value))return;X.issues.push({origin:"string",code:"invalid_format",format:"regex",input:X.value,pattern:$.pattern.toString(),inst:D,continue:!$.abort})}}),RB=c("$ZodCheckLowerCase",(D,$)=>{$.pattern??($.pattern=qB),U5.init(D,$)}),jB=c("$ZodCheckUpperCase",(D,$)=>{$.pattern??($.pattern=zB),U5.init(D,$)}),EB=c("$ZodCheckIncludes",(D,$)=>{tD.init(D,$);let X=o1($.includes),Y=new RegExp(typeof $.position==="number"?`^.{${$.position}}${X}`:X);$.pattern=Y,D._zod.onattach.push((J)=>{let Q=J._zod.bag;Q.patterns??(Q.patterns=new Set),Q.patterns.add(Y)}),D._zod.check=(J)=>{if(J.value.includes($.includes,$.position))return;J.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:$.includes,input:J.value,inst:D,continue:!$.abort})}}),TB=c("$ZodCheckStartsWith",(D,$)=>{tD.init(D,$);let X=new RegExp(`^${o1($.prefix)}.*`);$.pattern??($.pattern=X),D._zod.onattach.push((Y)=>{let J=Y._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(X)}),D._zod.check=(Y)=>{if(Y.value.startsWith($.prefix))return;Y.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:$.prefix,input:Y.value,inst:D,continue:!$.abort})}}),CB=c("$ZodCheckEndsWith",(D,$)=>{tD.init(D,$);let X=new RegExp(`.*${o1($.suffix)}$`);$.pattern??($.pattern=X),D._zod.onattach.push((Y)=>{let J=Y._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(X)}),D._zod.check=(Y)=>{if(Y.value.endsWith($.suffix))return;Y.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:$.suffix,input:Y.value,inst:D,continue:!$.abort})}});function fn(D,$,X){if(D.issues.length)$.issues.push(..._1(X,D.issues))}var PB=c("$ZodCheckProperty",(D,$)=>{tD.init(D,$),D._zod.check=(X)=>{let Y=$.schema._zod.run({value:X.value[$.property],issues:[]},{});if(Y instanceof Promise)return Y.then((J)=>fn(J,X,$.property));fn(Y,X,$.property);return}}),xB=c("$ZodCheckMimeType",(D,$)=>{tD.init(D,$);let X=new Set($.mime);D._zod.onattach.push((Y)=>{Y._zod.bag.mime=$.mime}),D._zod.check=(Y)=>{if(X.has(Y.value.type))return;Y.issues.push({code:"invalid_value",values:$.mime,input:Y.value.type,inst:D,continue:!$.abort})}}),SB=c("$ZodCheckOverwrite",(D,$)=>{tD.init(D,$),D._zod.check=(X)=>{X.value=$.tx(X.value)}});class DF{constructor(D=[]){if(this.content=[],this.indent=0,this)this.args=D}indented(D){this.indent+=1,D(this),this.indent-=1}write(D){if(typeof D==="function"){D(this,{execution:"sync"}),D(this,{execution:"async"});return}let X=D.split(`
|
|
341
341
|
`).filter((Q)=>Q),Y=Math.min(...X.map((Q)=>Q.length-Q.trimStart().length)),J=X.map((Q)=>Q.slice(Y)).map((Q)=>" ".repeat(this.indent*2)+Q);for(let Q of J)this.content.push(Q)}compile(){let D=Function,$=this?.args,Y=[...(this?.content??[""]).map((J)=>` ${J}`)];return new D(...$,Y.join(`
|