@fluxlay/cli 1.2.1 → 1.2.2

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 CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{styleText as e,promisify as t}from"node:util";import n,{stdout as r,stdin as s}from"node:process";import*as i from"node:readline";import{ReadStream as o}from"node:tty";import a from"node:fs";import c from"node:path";import l from"node:events";import u,{execFile as d}from"node:child_process";import{build as h,createServer as m}from"vite";import{createRequire as g}from"node:module";import{fileURLToPath as p}from"node:url";import f from"node:os";import y from"fs";import b from"constants";import I from"stream";import w from"util";import v from"assert";import G from"path";import*as A from"node:zlib";import*as S from"node:http";import*as C from"node:https";import*as Z from"node:http2";import V from"node:net";import E,{constants as X}from"node:fs/promises";import{Buffer as B}from"node:buffer";import R from"node:crypto";import x from"os";import W from"crypto";var N,J,k="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function _(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var F=function(){if(J)return N;J=1;const e="[",t={to:(t,n)=>n?`${e}${n+1};${t+1}H`:`${e}${t+1}G`,move(t,n){let r="";return t<0?r+=`${e}${-t}D`:t>0&&(r+=`${e}${t}C`),n<0?r+=`${e}${-n}A`:n>0&&(r+=`${e}${n}B`),r},up:(t=1)=>`${e}${t}A`,down:(t=1)=>`${e}${t}B`,forward:(t=1)=>`${e}${t}C`,backward:(t=1)=>`${e}${t}D`,nextLine:(t=1)=>`${e}E`.repeat(t),prevLine:(t=1)=>`${e}F`.repeat(t),left:`${e}G`,hide:`${e}?25l`,show:`${e}?25h`,save:"7",restore:"8"},n={up:(t=1)=>`${e}S`.repeat(t),down:(t=1)=>`${e}T`.repeat(t)},r={screen:`${e}2J`,up:(t=1)=>`${e}1J`.repeat(t),down:(t=1)=>`${e}J`.repeat(t),line:`${e}2K`,lineEnd:`${e}K`,lineStart:`${e}1K`,lines(e){let n="";for(let r=0;r<e;r++)n+=this.line+(r<e-1?t.up():"");return e&&(n+=t.left),n}};return N={cursor:t,scroll:n,erase:r,beep:""}}();const Y={actions:new Set(["up","down","left","right","space","enter","cancel"]),aliases:/* @__PURE__ */new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0};function L(e,t){if("string"==typeof e)return Y.aliases.get(e)===t;for(const n of e)if(void 0!==n&&L(n,t))return!0;return!1}const H=globalThis.process.platform.startsWith("win");function T({input:e=s,output:t=r,overwrite:n=!0,hideCursor:a=!0}={}){const c=i.createInterface({input:e,output:t,prompt:"",tabSize:1});i.emitKeypressEvents(e,c),e instanceof o&&e.isTTY&&e.setRawMode(!0);const l=(r,{name:s,sequence:o})=>{if(L([String(r),s,o],"cancel"))return a&&t.write(F.cursor.show),void process.exit(0);if(!n)return;const c="return"===s?0:-1,u="return"===s?-1:0;i.moveCursor(t,c,u,()=>{i.clearLine(t,1,()=>{e.once("keypress",l)})})};return a&&t.write(F.cursor.hide),e.once("keypress",l),()=>{e.off("keypress",l),a&&t.write(F.cursor.show),e instanceof o&&e.isTTY&&!H&&e.setRawMode(!1),c.terminal=!1,c.close()}}const O=e=>"columns"in e&&"number"==typeof e.columns?e.columns:80;const M="win32"!==n.platform?"linux"!==n.env.TERM:!!n.env.CI||!!n.env.WT_SESSION||!!n.env.TERMINUS_SUBLIME||"{cmd::Cmder}"===n.env.ConEmuTask||"Terminus-Sublime"===n.env.TERM_PROGRAM||"vscode"===n.env.TERM_PROGRAM||"xterm-256color"===n.env.TERM||"alacritty"===n.env.TERM||"JetBrains-JediTerm"===n.env.TERMINAL_EMULATOR,K=(e,t)=>M?e:t,U=K("■","x"),z=K("▲","x"),D=K("◇","o"),P=K("┌","T"),j=K("│","|"),Q=K("└","—"),$=K("─","-"),q=K("╮","+"),ee=K("├","+"),te=K("╯","+"),ne=K("●","•"),re=K("◆","*"),se=K("▲","!"),ie=K("■","x"),oe=e=>161===e||164===e||167===e||168===e||170===e||173===e||174===e||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||198===e||208===e||215===e||216===e||e>=222&&e<=225||230===e||e>=232&&e<=234||236===e||237===e||240===e||242===e||243===e||e>=247&&e<=250||252===e||254===e||257===e||273===e||275===e||283===e||294===e||295===e||299===e||e>=305&&e<=307||312===e||e>=319&&e<=322||324===e||e>=328&&e<=331||333===e||338===e||339===e||358===e||359===e||363===e||462===e||464===e||466===e||468===e||470===e||472===e||474===e||476===e||593===e||609===e||708===e||711===e||e>=713&&e<=715||717===e||720===e||e>=728&&e<=731||733===e||735===e||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||1025===e||e>=1040&&e<=1103||1105===e||8208===e||e>=8211&&e<=8214||8216===e||8217===e||8220===e||8221===e||e>=8224&&e<=8226||e>=8228&&e<=8231||8240===e||8242===e||8243===e||8245===e||8251===e||8254===e||8308===e||8319===e||e>=8321&&e<=8324||8364===e||8451===e||8453===e||8457===e||8467===e||8470===e||8481===e||8482===e||8486===e||8491===e||8531===e||8532===e||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||8585===e||e>=8592&&e<=8601||8632===e||8633===e||8658===e||8660===e||8679===e||8704===e||8706===e||8707===e||8711===e||8712===e||8715===e||8719===e||8721===e||8725===e||8730===e||e>=8733&&e<=8736||8739===e||8741===e||e>=8743&&e<=8748||8750===e||e>=8756&&e<=8759||8764===e||8765===e||8776===e||8780===e||8786===e||8800===e||8801===e||e>=8804&&e<=8807||8810===e||8811===e||8814===e||8815===e||8834===e||8835===e||8838===e||8839===e||8853===e||8857===e||8869===e||8895===e||8978===e||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||9632===e||9633===e||e>=9635&&e<=9641||9650===e||9651===e||9654===e||9655===e||9660===e||9661===e||9664===e||9665===e||e>=9670&&e<=9672||9675===e||e>=9678&&e<=9681||e>=9698&&e<=9701||9711===e||9733===e||9734===e||9737===e||9742===e||9743===e||9756===e||9758===e||9792===e||9794===e||9824===e||9825===e||e>=9827&&e<=9829||e>=9831&&e<=9834||9836===e||9837===e||9839===e||9886===e||9887===e||9919===e||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||9955===e||9960===e||9961===e||e>=9963&&e<=9969||9972===e||e>=9974&&e<=9977||9979===e||9980===e||9982===e||9983===e||10045===e||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||65533===e||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||127375===e||127376===e||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,ae=e=>12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510,ce=e=>e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9800&&e<=9811||9855===e||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,le=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,ue=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,de=/\t{1,1000}/y,he=new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*","yu"),me=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,ge=new RegExp("\\p{M}+","gu"),pe={limit:1/0,ellipsis:""},fe=(e,t={},n={})=>{const r=t.limit??1/0,s=t.ellipsis??"",i=t?.ellipsisWidth??(s?fe(s,pe,n).width:0),o=n.ansiWidth??0,a=n.controlWidth??0,c=n.tabWidth??8,l=n.ambiguousWidth??1,u=n.emojiWidth??2,d=n.fullWidthWidth??2,h=n.regularWidth??1,m=n.wideWidth??2;let g=0,p=0,f=e.length,y=0,b=!1,I=f,w=Math.max(0,r-i),v=0,G=0,A=0,S=0;e:for(;;){if(G>v||p>=f&&p>g){const t=e.slice(v,G)||e.slice(g,p);y=0;for(const e of t.replaceAll(ge,"")){const t=e.codePointAt(0)||0;if(S=ae(t)?d:ce(t)?m:l!==h&&oe(t)?l:h,A+S>w&&(I=Math.min(I,Math.max(v,g)+y)),A+S>r){b=!0;break e}y+=e.length,A+=S}v=G=0}if(p>=f)break;if(me.lastIndex=p,me.test(e)){if(y=me.lastIndex-p,S=y*h,A+S>w&&(I=Math.min(I,p+Math.floor((w-A)/h))),A+S>r){b=!0;break}A+=S,v=g,G=p,p=g=me.lastIndex}else if(le.lastIndex=p,le.test(e)){if(A+o>w&&(I=Math.min(I,p)),A+o>r){b=!0;break}A+=o,v=g,G=p,p=g=le.lastIndex}else if(ue.lastIndex=p,ue.test(e)){if(y=ue.lastIndex-p,S=y*a,A+S>w&&(I=Math.min(I,p+Math.floor((w-A)/a))),A+S>r){b=!0;break}A+=S,v=g,G=p,p=g=ue.lastIndex}else if(de.lastIndex=p,de.test(e)){if(y=de.lastIndex-p,S=y*c,A+S>w&&(I=Math.min(I,p+Math.floor((w-A)/c))),A+S>r){b=!0;break}A+=S,v=g,G=p,p=g=de.lastIndex}else if(he.lastIndex=p,he.test(e)){if(A+u>w&&(I=Math.min(I,p)),A+u>r){b=!0;break}A+=u,v=g,G=p,p=g=he.lastIndex}else p+=1}return{width:b?w:A,index:b?I:f,truncated:b,ellipsed:b&&r>=i}},ye={limit:1/0,ellipsis:"",ellipsisWidth:0},be=(e,t={})=>fe(e,ye,t).width,Ie="",we="]8;;",ve=new RegExp(`(?:\\[(?<code>\\d+)m|\\${we}(?<uri>.*))`,"y"),Ge=e=>e>=30&&e<=37||e>=90&&e<=97?39:e>=40&&e<=47||e>=100&&e<=107?49:1===e||2===e?22:3===e?23:4===e?24:7===e?27:8===e?28:9===e?29:0===e?0:void 0,Ae=e=>`${Ie}[${e}m`,Se=e=>`${Ie}${we}${e}`,Ce=(e,t,n)=>{const r=t[Symbol.iterator]();let s=!1,i=!1,o=e.at(-1),a=void 0===o?0:be(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){const o=c.value,d=be(o);a+d<=n?e[e.length-1]+=o:(e.push(o),a=0),(o===Ie||"›"===o)&&(s=!0,i=t.startsWith(we,u+1)),s?i?""===o&&(s=!1,i=!1):"m"===o&&(s=!1):(a+=d,a===n&&!l.done&&(e.push(""),a=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!a&&void 0!==o&&o.length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Ze=(e,t,n={})=>{if(!1!==n.trim&&""===e.trim())return"";let r,s,i="";const o=e.split(" "),a=(e=>e.map(e=>be(e)))(o);let c=[""];for(const[g,p]of o.entries()){!1!==n.trim&&(c[c.length-1]=(c.at(-1)??"").trimStart());let e=be(c.at(-1)??"");if(0!==g&&(e>=t&&(!1===n.wordWrap||!1===n.trim)&&(c.push(""),e=0),(e>0||!1===n.trim)&&(c[c.length-1]+=" ",e++)),n.hard&&a[g]>t){const n=t-e,r=1+Math.floor((a[g]-n-1)/t);Math.floor((a[g]-1)/t)<r&&c.push(""),Ce(c,p,t);continue}if(e+a[g]>t&&e>0&&a[g]>0){if(!1===n.wordWrap&&e<t){Ce(c,p,t);continue}c.push("")}e+a[g]>t&&!1===n.wordWrap?Ce(c,p,t):c[c.length-1]+=p}!1!==n.trim&&(c=c.map(e=>(e=>{const t=e.split(" ");let n=t.length;for(;n>0&&!(be(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")})(e)));const l=c.join("\n"),u=l[Symbol.iterator]();let d=u.next(),h=u.next(),m=0;for(;!d.done;){const e=d.value,t=h.value;if(i+=e,e===Ie||"›"===e){ve.lastIndex=m+1;const e=ve.exec(l)?.groups;if(void 0!==e?.code){const t=Number.parseFloat(e.code);r=39===t?void 0:t}else void 0!==e?.uri&&(s=0===e.uri.length?void 0:e.uri)}const n=r?Ge(r):void 0;"\n"===t?(s&&(i+=Se("")),r&&n&&(i+=Ae(n))):"\n"===e&&(r&&n&&(i+=Ae(r)),s&&(i+=Se(s))),m+=e.length,d=h,h=u.next()}return i};function Ve(e,t,n){return String(e).normalize().replaceAll("\r\n","\n").split("\n").map(e=>Ze(e,t,n)).join("\n")}const Ee={message:(t=[],{symbol:n=e("gray",j),secondarySymbol:r=e("gray",j),output:s=process.stdout,spacing:i=1,withGuide:o}={})=>{const a=[],c=o??Y.withGuide,l=c?r:"",u=c?`${n} `:"",d=c?`${r} `:"";for(let e=0;e<i;e++)a.push(l);const h=Array.isArray(t)?t:t.split("\n");if(h.length>0){const[e,...t]=h;e.length>0?a.push(`${u}${e}`):a.push(c?n:"");for(const n of t)n.length>0?a.push(`${d}${n}`):a.push(c?r:"")}s.write(`${a.join("\n")}\n`)},info:(t,n)=>{Ee.message(t,{...n,symbol:e("blue",ne)})},success:(t,n)=>{Ee.message(t,{...n,symbol:e("green",re)})},step:(t,n)=>{Ee.message(t,{...n,symbol:e("green",D)})},warn:(t,n)=>{Ee.message(t,{...n,symbol:e("yellow",se)})},warning:(e,t)=>{Ee.warn(e,t)},error:(t,n)=>{Ee.message(t,{...n,symbol:e("red",ie)})}},Xe=(t="",n)=>{const r=process.stdout,s=`${e("gray",Q)} `;r.write(`${s}${e("red",t)}\n\n`)},Be=(t="",n)=>{const r=process.stdout,s=`${e("gray",P)} `;r.write(`${s}${t}\n`)},Re=(t="",n)=>{const r=process.stdout,s=`${e("gray",j)}\n${e("gray",Q)} `;r.write(`${s}${t}\n\n`)},xe=t=>e("dim",t),We=(e,t,n)=>{const r={hard:!0,trim:!1},s=Ve(e,t,r).split("\n"),i=s.reduce((e,t)=>Math.max(be(t),e),0);return Ve(e,t-(s.map(n).reduce((e,t)=>Math.max(be(t),e),0)-i),r)},Ne=(t="",r="",s)=>{const i=n.stdout,o=xe,a=["",...We(t,O(i)-6,o).split("\n").map(o),""],c=be(r),l=Math.max(a.reduce((e,t)=>{const n=be(t);return n>e?n:e},0),c)+2,u=a.map(t=>`${e("gray",j)} ${t}${" ".repeat(l-be(t))}${e("gray",j)}`).join("\n"),d=`${e("gray",j)}\n`,h=ee;i.write(`${d}${e("green",D)} ${e("reset",r)} ${e("gray",$.repeat(Math.max(l-c-1,1))+q)}\n${u}\n${e("gray",h+$.repeat(l+2)+te)}\n`)},Je=t=>e("magenta",t),ke=({indicator:t="dots",onCancel:n,output:r=process.stdout,cancelMessage:s,errorMessage:i,frames:o=(M?["◒","◐","◓","◑"]:["•","o","O","0"]),delay:a=(M?80:120),signal:c,...l}={})=>{const u="true"===process.env.CI;let d,h,m,g=!1,p=!1,f="",y=performance.now();const b=O(r),I=l?.styleFrame??Je,w=e=>{const t=e>1?i??Y.messages.error:s??Y.messages.cancel;p=1===e,g&&(V(t,e),p&&"function"==typeof n&&n())},v=()=>w(2),G=()=>w(1),A=()=>{if(void 0===m)return;u&&r.write("\n");const e=Ve(m,b,{hard:!0,trim:!1}).split("\n");e.length>1&&r.write(F.cursor.up(e.length-1)),r.write(F.cursor.to(0)),r.write(F.erase.down())},S=e=>e.replace(/\.+$/,""),C=e=>{const t=(performance.now()-e)/1e3,n=Math.floor(t/60),r=Math.floor(t%60);return n>0?`[${n}m ${r}s]`:`[${r}s]`},Z=l.withGuide??Y.withGuide,V=(n="",s=0,i=!1)=>{if(!g)return;g=!1,clearInterval(h),A();const o=0===s?e("green",D):e("red",1===s?U:z);f=n??f,i||("timer"===t?r.write(`${o} ${f} ${C(y)}\n`):r.write(`${o} ${f}\n`)),process.removeListener("uncaughtExceptionMonitor",v),process.removeListener("unhandledRejection",v),process.removeListener("SIGINT",G),process.removeListener("SIGTERM",G),process.removeListener("exit",w),c&&c.removeEventListener("abort",G),d()};return{start:(n="")=>{g=!0,d=T({output:r}),f=S(n),y=performance.now(),Z&&r.write(`${e("gray",j)}\n`);let s=0,i=0;process.on("uncaughtExceptionMonitor",v),process.on("unhandledRejection",v),process.on("SIGINT",G),process.on("SIGTERM",G),process.on("exit",w),c&&c.addEventListener("abort",G),h=setInterval(()=>{if(u&&f===m)return;A(),m=f;const e=I(o[s]);let n;if(u)n=`${e} ${f}...`;else if("timer"===t)n=`${e} ${f} ${C(y)}`;else{const t=".".repeat(Math.floor(i)).slice(0,3);n=`${e} ${f}${t}`}const a=Ve(n,b,{hard:!0,trim:!1});r.write(a),s=s+1<o.length?s+1:0,i=i<4?i+.125:0},a)},stop:(e="")=>V(e,0),message:(e="")=>{f=S(e??f)},cancel:(e="")=>V(e,1),error:(e="")=>V(e,2),clear:()=>V("",0,!0),get isCancelled(){return p}}};e("gray",j);const _e=(e=0)=>t=>`[${t+e}m`,Fe=(e=0)=>t=>`[${38+e};5;${t}m`,Ye=(e=0)=>(t,n,r)=>`[${38+e};2;${t};${n};${r}m`,Le={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(Le.modifier);Object.keys(Le.color),Object.keys(Le.bgColor);const He=function(){const e=/* @__PURE__ */new Map;for(const[t,n]of Object.entries(Le)){for(const[t,r]of Object.entries(n))Le[t]={open:`[${r[0]}m`,close:`[${r[1]}m`},n[t]=Le[t],e.set(r[0],r[1]);Object.defineProperty(Le,t,{value:n,enumerable:!1})}return Object.defineProperty(Le,"codes",{value:e,enumerable:!1}),Le.color.close="",Le.bgColor.close="",Le.color.ansi=_e(),Le.color.ansi256=Fe(),Le.color.ansi16m=Ye(),Le.bgColor.ansi=_e(10),Le.bgColor.ansi256=Fe(10),Le.bgColor.ansi16m=Ye(10),Object.defineProperties(Le,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;3===n.length&&(n=[...n].map(e=>e+e).join(""));const r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},enumerable:!1},hexToAnsi256:{value:e=>Le.rgbToAnsi256(...Le.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return e-8+90;let t,n,r;if(e>=232)t=(10*(e-232)+8)/255,n=t,r=t;else{const s=(e-=16)%36;t=Math.floor(e/36)/5,n=Math.floor(s/6)/5,r=s%6/5}const s=2*Math.max(t,n,r);if(0===s)return 30;let i=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return 2===s&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>Le.ansi256ToAnsi(Le.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>Le.ansi256ToAnsi(Le.hexToAnsi256(e)),enumerable:!1}}),Le}(),Te=(()=>{if(!("navigator"in globalThis))return 0;if(globalThis.navigator.userAgentData){const e=navigator.userAgentData.brands.find(({brand:e})=>"Chromium"===e);if(e&&e.version>93)return 3}return/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)?1:0})(),Oe=0!==Te&&{level:Te},Me={stdout:Oe,stderr:Oe};function Ke(e,t,n){let r=e.indexOf(t);if(-1===r)return e;const s=t.length;let i=0,o="";do{o+=e.slice(i,r)+t+n,i=r+s,r=e.indexOf(t,i)}while(-1!==r);return o+=e.slice(i),o}const{stdout:Ue,stderr:ze}=Me,De=/* @__PURE__ */Symbol("GENERATOR"),Pe=/* @__PURE__ */Symbol("STYLER"),je=/* @__PURE__ */Symbol("IS_EMPTY"),Qe=["ansi","ansi","ansi256","ansi16m"],$e=/* @__PURE__ */Object.create(null),qe=e=>{const t=(...e)=>e.join(" ");return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const n=Ue?Ue.level:0;e.level=void 0===t.level?n:t.level})(t,e),Object.setPrototypeOf(t,et.prototype),t};function et(e){return qe(e)}Object.setPrototypeOf(et.prototype,Function.prototype);for(const[dy,hy]of Object.entries(He))$e[dy]={get(){const e=it(this,st(hy.open,hy.close,this[Pe]),this[je]);return Object.defineProperty(this,dy,{value:e}),e}};$e.visible={get(){const e=it(this,this[Pe],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const tt=(e,t,n,...r)=>"rgb"===e?"ansi16m"===t?He[n].ansi16m(...r):"ansi256"===t?He[n].ansi256(He.rgbToAnsi256(...r)):He[n].ansi(He.rgbToAnsi(...r)):"hex"===e?tt("rgb",t,n,...He.hexToRgb(...r)):He[n][e](...r),nt=["rgb","hex","ansi256"];for(const dy of nt){$e[dy]={get(){const{level:e}=this;return function(...t){const n=st(tt(dy,Qe[e],"color",...t),He.color.close,this[Pe]);return it(this,n,this[je])}}};$e["bg"+dy[0].toUpperCase()+dy.slice(1)]={get(){const{level:e}=this;return function(...t){const n=st(tt(dy,Qe[e],"bgColor",...t),He.bgColor.close,this[Pe]);return it(this,n,this[je])}}}}const rt=Object.defineProperties(()=>{},{...$e,level:{enumerable:!0,get(){return this[De].level},set(e){this[De].level=e}}}),st=(e,t,n)=>{let r,s;return void 0===n?(r=e,s=t):(r=n.openAll+e,s=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:s,parent:n}},it=(e,t,n)=>{const r=(...e)=>ot(r,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(r,rt),r[De]=e,r[Pe]=t,r[je]=n,r},ot=(e,t)=>{if(e.level<=0||!t)return e[je]?"":t;let n=e[Pe];if(void 0===n)return t;const{openAll:r,closeAll:s}=n;if(t.includes(""))for(;void 0!==n;)t=Ke(t,n.close,n.open),n=n.parent;const i=t.indexOf("\n");return-1!==i&&(t=function(e,t,n,r){let s=0,i="";do{const o="\r"===e[r-1];i+=e.slice(s,o?r-1:r)+t+(o?"\r\n":"\n")+n,s=r+1,r=e.indexOf("\n",s)}while(-1!==r);return i+=e.slice(s),i}(t,s,r,i)),r+t+s};Object.defineProperties(et.prototype,$e);const at=et();et({level:ze?ze.level:0});var ct,lt,ut={},dt={},ht={};function mt(){if(ct)return ht;ct=1;class e extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}}return ht.CommanderError=e,ht.InvalidArgumentError=class extends e{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}},ht}function gt(){if(lt)return dt;lt=1;const{InvalidArgumentError:e}=mt();return dt.Argument=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.length>3&&"..."===this._name.slice(-3)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new e(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},dt.humanReadableArgName=function(e){const t=e.name()+(!0===e.variadic?"...":"");return e.required?"<"+t+">":"["+t+"]"},dt}var pt,ft={},yt={};function bt(){if(pt)return yt;pt=1;const{humanReadableArgName:e}=gt();return yt.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){const t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){const n=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){const t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){const r=n.short&&e._findOption(n.short),s=n.long&&e._findOption(n.long);r||s?n.long&&!s?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description)):t.push(n)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];const t=[];for(let n=e.parent;n;n=n.parent){const e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(t){const n=t.registeredArguments.map(t=>e(t)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(n?" "+n:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,t.subcommandTerm(n).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,t.optionTerm(n).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,t.optionTerm(n).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,t.argumentTerm(n).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let r=e.parent;r;r=r.parent)n=r.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue){(e.required||e.optional||e.isBoolean()&&"boolean"==typeof e.defaultValue)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}return void 0!==e.presetArg&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),void 0!==e.envVar&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){const n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,t){const n=t.padWidth(e,t),r=t.helpWidth||80;function s(e,s){if(s){const i=`${e.padEnd(n+2)}${s}`;return t.wrap(i,r-2,n+2)}return e}function i(e){return e.join("\n").replace(/^/gm," ".repeat(2))}let o=[`Usage: ${t.commandUsage(e)}`,""];const a=t.commandDescription(e);a.length>0&&(o=o.concat([t.wrap(a,r,0),""]));const c=t.visibleArguments(e).map(e=>s(t.argumentTerm(e),t.argumentDescription(e)));c.length>0&&(o=o.concat(["Arguments:",i(c),""]));const l=t.visibleOptions(e).map(e=>s(t.optionTerm(e),t.optionDescription(e)));if(l.length>0&&(o=o.concat(["Options:",i(l),""])),this.showGlobalOptions){const n=t.visibleGlobalOptions(e).map(e=>s(t.optionTerm(e),t.optionDescription(e)));n.length>0&&(o=o.concat(["Global Options:",i(n),""]))}const u=t.visibleCommands(e).map(e=>s(t.subcommandTerm(e),t.subcommandDescription(e)));return u.length>0&&(o=o.concat(["Commands:",i(u),""])),o.join("\n")}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,n,r=40){const s=new RegExp("[\\n][ \\f\\t\\v   -    \ufeff]+");if(e.match(s))return e;const i=t-n;if(i<r)return e;const o=e.slice(0,n),a=e.slice(n).replace("\r\n","\n"),c=" ".repeat(n),l="\\s​",u=new RegExp(`\n|.{1,${i-1}}([${l}]|$)|[^${l}]+?([${l}]|$)`,"g");return o+(a.match(u)||[]).map((e,t)=>"\n"===e?"":(t>0?c:"")+e.trimEnd()).join("\n")}},yt}var It,wt={};function vt(){if(It)return wt;It=1;const{InvalidArgumentError:e}=mt();return wt.Option=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const n=function(e){let t,n;const r=e.split(/[ |,]+/);r.length>1&&!/^[[<]/.test(r[1])&&(t=r.shift());n=r.shift(),!t&&/^-[^-]$/.test(n)&&(t=n,n=void 0);return{shortFlag:t,longFlag:n}}(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return"string"==typeof e&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}choices(t){return this.argChoices=t.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new e(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.name().replace(/^no-/,"").split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},wt.DualOptions=class{constructor(e){this.positiveOptions=/* @__PURE__ */new Map,this.negativeOptions=/* @__PURE__ */new Map,this.dualOptions=/* @__PURE__ */new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){const n=t.attributeName();if(!this.dualOptions.has(n))return!0;const r=this.negativeOptions.get(n).presetArg,s=void 0!==r&&r;return t.negate===(s===e)}},wt}var Gt,At,St,Ct={};function Zt(){if(Gt)return Ct;Gt=1;return Ct.suggestSimilar=function(e,t){if(!t||0===t.length)return"";t=Array.from(new Set(t));const n=e.startsWith("--");n&&(e=e.slice(2),t=t.map(e=>e.slice(2)));let r=[],s=3;return t.forEach(t=>{if(t.length<=1)return;const n=function(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);const n=[];for(let r=0;r<=e.length;r++)n[r]=[r];for(let r=0;r<=t.length;r++)n[0][r]=r;for(let r=1;r<=t.length;r++)for(let s=1;s<=e.length;s++){let i=1;i=e[s-1]===t[r-1]?0:1,n[s][r]=Math.min(n[s-1][r]+1,n[s][r-1]+1,n[s-1][r-1]+i),s>1&&r>1&&e[s-1]===t[r-2]&&e[s-2]===t[r-1]&&(n[s][r]=Math.min(n[s][r],n[s-2][r-2]+1))}return n[e.length][t.length]}(e,t),i=Math.max(e.length,t.length);(i-n)/i>.4&&(n<s?(s=n,r=[t]):n===s&&r.push(t))}),r.sort((e,t)=>e.localeCompare(t)),n&&(r=r.map(e=>`--${e}`)),r.length>1?`\n(Did you mean one of ${r.join(", ")}?)`:1===r.length?`\n(Did you mean ${r[0]}?)`:""},Ct}var Vt=function(){if(St)return ut;St=1;const{Argument:e}=gt(),{Command:t}=function(){if(At)return ft;At=1;const e=l.EventEmitter,t=u,r=c,s=a,i=n,{Argument:o,humanReadableArgName:d}=gt(),{CommanderError:h}=mt(),{Help:m}=bt(),{Option:g,DualOptions:p}=vt(),{suggestSimilar:f}=Zt();class y extends e{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:e=>i.stdout.write(e),writeErr:e=>i.stderr.write(e),getOutHelpWidth:()=>i.stdout.isTTY?i.stdout.columns:void 0,getErrHelpWidth:()=>i.stderr.isTTY?i.stderr.columns:void 0,outputError:(e,t)=>t(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){const e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,s=n;"object"==typeof r&&null!==r&&(s=r,r=null),s=s||{};const[,i,o]=e.match(/([^ ]+) *(.*)/),a=this.createCommand(i);return r&&(a.description(r),a._executableHandler=!0),s.isDefault&&(this._defaultCommandName=a._name),a._hidden=!(!s.noHelp&&!s.hidden),a._executableFile=s.executableFile||null,o&&a.arguments(o),this._registerCommand(a),a.parent=this,a.copyInheritedSettings(this),r?this:a}createCommand(e){return new y(e)}createHelp(){return Object.assign(new m,this.configureHelp())}configureHelp(e){return void 0===e?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return void 0===e?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return"string"!=typeof e&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()");return(t=t||{}).isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new o(e,t)}argument(e,t,n,r){const s=this.createArgument(e,t);return"function"==typeof n?s.default(r).argParser(n):s.default(n),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){const t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&void 0!==e.defaultValue&&void 0===e.parseArg)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if("boolean"==typeof e)return this._addImplicitHelpCommand=e,this;e=e??"help [command]";const[,n,r]=e.match(/([^ ]+) *(.*)/),s=t??"display help for command",i=this.createCommand(n);return i.helpOption(!1),r&&i.arguments(r),s&&i.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=i,this}addHelpCommand(e,t){return"object"!=typeof e?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(void 0===this._helpCommand&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){const n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.\nExpecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if("commander.executeSubCommandAsync"!==e.code)throw e}),this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new h(e,t,n)),i.exit(e)}action(e){return this._actionHandler=t=>{const n=this.registeredArguments.length,r=t.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)},this}createOption(e,t){return new g(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(s){if("commander.invalidArgument"===s.code){const e=`${r} ${s.message}`;this.error(e,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(e){const t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){const n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'\n- already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){const t=e=>[e.name()].concat(e.aliases()),n=t(e).find(e=>this._findCommand(e));if(n){const r=t(this._findCommand(n)).join("|"),s=t(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${r}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);const t=e.name(),n=e.attributeName();if(e.negate){const t=e.long.replace(/^--no-/,"--");this._findOption(t)||this.setOptionValueWithSource(n,void 0===e.defaultValue||e.defaultValue,"default")}else void 0!==e.defaultValue&&this.setOptionValueWithSource(n,e.defaultValue,"default");const r=(t,r,s)=>{null==t&&void 0!==e.presetArg&&(t=e.presetArg);const i=this.getOptionValue(n);null!==t&&e.parseArg?t=this._callParseArg(e,t,i,r):null!==t&&e.variadic&&(t=e._concatValue(t,i)),null==t&&(t=!e.negate&&(!(!e.isBoolean()&&!e.optional)||"")),this.setOptionValueWithSource(n,t,s)};return this.on("option:"+t,t=>{const n=`error: option '${e.flags}' argument '${t}' is invalid.`;r(t,n,"cli")}),e.envVar&&this.on("optionEnv:"+t,t=>{const n=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;r(t,n,"env")}),this}_optionEx(e,t,n,r,s){if("object"==typeof t&&t instanceof g)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const i=this.createOption(t,n);if(i.makeOptionMandatory(!!e.mandatory),"function"==typeof r)i.default(s).argParser(r);else if(r instanceof RegExp){const e=r;r=(t,n)=>{const r=e.exec(t);return r?r[0]:n},i.default(s).argParser(r)}else i.default(r);return this.addOption(i)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{void 0!==n.getOptionValueSource(e)&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(void 0!==e&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},void 0===e&&void 0===t.from){i.versions?.electron&&(t.from="electron");const e=i.execArgv??[];(e.includes("-e")||e.includes("--eval")||e.includes("-p")||e.includes("--print"))&&(t.from="eval")}let n;switch(void 0===e&&(e=i.argv),this.rawArgs=e.slice(),t.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":i.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,t){const n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){const n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_executeSubCommand(e,n){n=n.slice();let o=!1;const a=[".js",".ts",".tsx",".mjs",".cjs"];function c(e,t){const n=r.resolve(e,t);if(s.existsSync(n))return n;if(a.includes(r.extname(t)))return;const i=a.find(e=>s.existsSync(`${n}${e}`));return i?`${n}${i}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let l,u=e._executableFile||`${this._name}-${e._name}`,d=this._executableDir||"";if(this._scriptPath){let e;try{e=s.realpathSync(this._scriptPath)}catch(g){e=this._scriptPath}d=r.resolve(r.dirname(e),d)}if(d){let t=c(d,u);if(!t&&!e._executableFile&&this._scriptPath){const n=r.basename(this._scriptPath,r.extname(this._scriptPath));n!==this._name&&(t=c(d,`${n}-${e._name}`))}u=t||u}o=a.includes(r.extname(u)),"win32"!==i.platform?o?(n.unshift(u),n=b(i.execArgv).concat(n),l=t.spawn(i.argv[0],n,{stdio:"inherit"})):l=t.spawn(u,n,{stdio:"inherit"}):(n.unshift(u),n=b(i.execArgv).concat(n),l=t.spawn(i.execPath,n,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(e=>{i.on(e,()=>{!1===l.killed&&null===l.exitCode&&l.kill(e)})});const m=this._exitCallback;l.on("close",e=>{e=e??1,m?m(new h(e,"commander.executeSubCommandAsync","(close)")):i.exit(e)}),l.on("error",t=>{if("ENOENT"===t.code){const t=d?`searched for local subcommand relative to directory '${d}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",n=`'${u}' does not exist\n - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${t}`;throw new Error(n)}if("EACCES"===t.code)throw new Error(`'${u}' not executable`);if(m){const e=new h(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,m(e)}else i.exit(1)}),this.runningCommand=l}_dispatchSubcommand(e,t,n){const r=this._findCommand(e);let s;return r||this.help({error:!0}),s=this._chainOrCallSubCommandHook(s,r,"preSubcommand"),s=this._chainOrCall(s,()=>{if(!r._executableHandler)return r._parseCommand(t,n);this._executeSubCommand(r,t.concat(n))}),s}_dispatchHelpCommand(e){e||this.help();const t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&null==this.args[t]&&this.missingArgument(e.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic||this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){const e=(e,t,n)=>{let r=t;if(null!==t&&e.parseArg){const s=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,s)}return r};this._checkNumberOfArguments();const t=[];this.registeredArguments.forEach((n,r)=>{let s=n.defaultValue;n.variadic?r<this.args.length?(s=this.args.slice(r),n.parseArg&&(s=s.reduce((t,r)=>e(n,r,t),n.defaultValue))):void 0===s&&(s=[]):r<this.args.length&&(s=this.args[r],n.parseArg&&(s=e(n,s,n.defaultValue))),t[r]=s}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&"function"==typeof e.then?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e;const r=[];return this._getCommandAndAncestors().reverse().filter(e=>void 0!==e._lifeCycleHooks[t]).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),"postAction"===t&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return void 0!==this._lifeCycleHooks[n]&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){const n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){let n;return r(),this._processArguments(),n=this._chainOrCallHooks(n,"preAction"),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(s,e,t)})),n=this._chainOrCallHooks(n,"postAction"),n}if(this.parent&&this.parent.listenerCount(s))r(),this._processArguments(),this.parent.emit(s,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&void 0===e.getOptionValue(t.attributeName())&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){const e=this.options.filter(e=>{const t=e.attributeName();return void 0!==this.getOptionValue(t)&&"default"!==this.getOptionValueSource(t)});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{const n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){const t=[],n=[];let r=t;const s=e.slice();function i(e){return e.length>1&&"-"===e[0]}let o=null;for(;s.length;){const e=s.shift();if("--"===e){r===n&&r.push(e),r.push(...s);break}if(!o||i(e)){if(o=null,i(e)){const t=this._findOption(e);if(t){if(t.required){const e=s.shift();void 0===e&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,e)}else if(t.optional){let e=null;s.length>0&&!i(s[0])&&(e=s.shift()),this.emit(`option:${t.name()}`,e)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(e.length>2&&"-"===e[0]&&"-"!==e[1]){const t=this._findOption(`-${e[1]}`);if(t){t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${t.name()}`,e.slice(2)):(this.emit(`option:${t.name()}`),s.unshift(`-${e.slice(2)}`));continue}}if(/^--[^=]+=/.test(e)){const t=e.indexOf("="),n=this._findOption(e.slice(0,t));if(n&&(n.required||n.optional)){this.emit(`option:${n.name()}`,e.slice(t+1));continue}}if(i(e)&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&0===t.length&&0===n.length){if(this._findCommand(e)){t.push(e),s.length>0&&n.push(...s);break}if(this._getHelpCommand()&&e===this._getHelpCommand().name()){t.push(e),s.length>0&&t.push(...s);break}if(this._defaultCommandName){n.push(e),s.length>0&&n.push(...s);break}}if(this._passThroughOptions){r.push(e),s.length>0&&r.push(...s);break}r.push(e)}else this.emit(`option:${o.name()}`,e)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){const e={},t=this.options.length;for(let n=0;n<t;n++){const t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));const n=t||{},r=n.exitCode||1,s=n.code||"commander.error";this._exit(r,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in i.env){const t=e.attributeName();(void 0===this.getOptionValue(t)||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,i.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){const e=new p(this.options),t=e=>void 0!==this.getOptionValue(e)&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter(n=>void 0!==n.implied&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],"implied")})})}missingArgument(e){const t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){const t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){const t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){const n=e=>{const t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),s=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(void 0===r.presetArg&&!1===n||void 0!==r.presetArg&&n===r.presetArg)?r:s||e},r=e=>{const t=n(e),r=t.attributeName();return"env"===this.getOptionValueSource(r)?`environment variable '${t.envVar}'`:`option '${t.flags}'`},s=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],r=this;do{const e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=f(e,n)}const n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;const t=this.registeredArguments.length,n=1===t?"":"s",r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){const e=this.args[0];let t="";if(this._showSuggestionAfterError){const n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=f(e,n)}const n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(void 0===e)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";const r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on("option:"+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,"commander.version",e)}),this}description(e,t){return void 0===e&&void 0===t?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return void 0===e?this._summary:(this._summary=e,this)}alias(e){if(void 0===e)return this._aliases[0];let t=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");const n=this.parent?._findCommand(e);if(n){const t=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return void 0===e?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(void 0===e){if(this._usage)return this._usage;const e=this.registeredArguments.map(e=>d(e));return[].concat(this.options.length||null!==this._helpOption?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?e:[]).join(" ")}return this._usage=e,this}name(e){return void 0===e?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=r.basename(e,r.extname(e)),this}executableDir(e){return void 0===e?this._executableDir:(this._executableDir=e,this)}helpInformation(e){const t=this.createHelp();return void 0===t.helpWidth&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){const t={error:!!(e=e||{}).error};let n;return n=t.error?e=>this._outputConfiguration.writeErr(e):e=>this._outputConfiguration.writeOut(e),t.write=e.write||n,t.command=this,t}outputHelp(e){let t;"function"==typeof e&&(t=e,e=void 0);const n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(e=>e.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let r=this.helpInformation(n);if(t&&(r=t(r),"string"!=typeof r&&!Buffer.isBuffer(r)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(r),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(e=>e.emit("afterAllHelp",n))}helpOption(e,t){return"boolean"==typeof e?(this._helpOption=e?this._helpOption??void 0:null,this):(e=e??"-h, --help",t=t??"display help for command",this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return void 0===this._helpOption&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let t=i.exitCode||0;0===t&&e&&"function"!=typeof e&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){const n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${n.join("', '")}'`);const r=`${e}Help`;return this.on(r,e=>{let n;n="function"==typeof t?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){const t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function b(e){return e.map(e=>{if(!e.startsWith("--inspect"))return e;let t,n,r="127.0.0.1",s="9229";return null!==(n=e.match(/^(--inspect(-brk)?)$/))?t=n[1]:null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(t=n[1],/^\d+$/.test(n[3])?s=n[3]:r=n[3]):null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(t=n[1],r=n[3],s=n[4]),t&&"0"!==s?`${t}=${r}:${parseInt(s)+1}`:e})}return ft.Command=y,ft}(),{CommanderError:r,InvalidArgumentError:s}=mt(),{Help:i}=bt(),{Option:o}=vt();return ut.program=new t,ut.createCommand=e=>new t(e),ut.createOption=(e,t)=>new o(e,t),ut.createArgument=(t,n)=>new e(t,n),ut.Command=t,ut.Option=o,ut.Argument=e,ut.Help=i,ut.CommanderError=r,ut.InvalidArgumentError=s,ut.InvalidOptionArgumentError=s,ut}();const Et=/* @__PURE__ */_(Vt),{program:Xt,createCommand:Bt,createArgument:Rt,createOption:xt,CommanderError:Wt,InvalidArgumentError:Nt,InvalidOptionArgumentError:Jt,Command:kt,Argument:_t,Option:Ft,Help:Yt}=Et,Lt=g(import.meta.url),Ht=c.dirname(p(import.meta.url)),Tt=Lt(c.resolve(Ht,"./native/loader.cjs")),{getDeveloperKey:Ot,setDeveloperKey:Mt,validateManifest:Kt,packContent:Ut,unpackContent:zt,getContentKey:Dt,setContentKey:Pt}=Tt;function jt(e){if("string"!=typeof e)throw new TypeError("Expected a string");if(!function(e){if("string"!=typeof e)return!1;const t=e.trim();return""!==t&&"."!==t&&".."!==t&&!e.includes("/")&&!e.includes("\\")&&!e.includes("\0")}(e))throw new Error(`Unsafe filename: ${JSON.stringify(e)}`)}const Qt=f.homedir(),$t=f.tmpdir(),{env:qt}=n;function en(e,{suffix:t="nodejs"}={}){return jt(e),t&&(e+=`-${t}`),jt(e),"darwin"===n.platform?(e=>{const t=c.join(Qt,"Library");return{data:c.join(t,"Application Support",e),config:c.join(t,"Preferences",e),cache:c.join(t,"Caches",e),log:c.join(t,"Logs",e),temp:c.join($t,e)}})(e):"win32"===n.platform?(e=>{const t=qt.APPDATA||c.join(Qt,"AppData","Roaming"),n=qt.LOCALAPPDATA||c.join(Qt,"AppData","Local");return{data:c.join(n,e,"Data"),config:c.join(t,e,"Config"),cache:c.join(n,e,"Cache"),log:c.join(n,e,"Log"),temp:c.join($t,e)}})(e):(e=>{const t=c.basename(Qt);return{data:c.join(qt.XDG_DATA_HOME||c.join(Qt,".local","share"),e),config:c.join(qt.XDG_CONFIG_HOME||c.join(Qt,".config"),e),cache:c.join(qt.XDG_CACHE_HOME||c.join(Qt,".cache"),e),log:c.join(qt.XDG_STATE_HOME||c.join(Qt,".local","state"),e),temp:c.join($t,t,e)}})(e)}var tn,nn,rn,sn,on,an,cn,ln,un,dn,hn={},mn={};function gn(){return tn||(tn=1,mn.fromCallback=function(e){return Object.defineProperty(function(...t){if("function"!=typeof t[t.length-1])return new Promise((n,r)=>{t.push((e,t)=>null!=e?r(e):n(t)),e.apply(this,t)});e.apply(this,t)},"name",{value:e.name})},mn.fromPromise=function(e){return Object.defineProperty(function(...t){const n=t[t.length-1];if("function"!=typeof n)return e.apply(this,t);t.pop(),e.apply(this,t).then(e=>n(null,e),n)},"name",{value:e.name})}),mn}function pn(){if(un)return ln;un=1;var e,t,n=y,r=function(){if(rn)return nn;rn=1;var e=b,t=process.cwd,n=null,r=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return n||(n=t.call(process)),n};try{process.cwd()}catch(i){}if("function"==typeof process.chdir){var s=process.chdir;process.chdir=function(e){n=null,s.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,s)}return nn=function(t){var n;function s(e){return e?function(n,r,s){return e.call(t,n,r,function(e){d(e)&&(e=null),s&&s.apply(this,arguments)})}:e}function o(e){return e?function(n,r){try{return e.call(t,n,r)}catch(i){if(!d(i))throw i}}:e}function a(e){return e?function(n,r,s,i){return e.call(t,n,r,s,function(e){d(e)&&(e=null),i&&i.apply(this,arguments)})}:e}function c(e){return e?function(n,r,s){try{return e.call(t,n,r,s)}catch(i){if(!d(i))throw i}}:e}function l(e){return e?function(n,r,s){function i(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),s&&s.apply(this,arguments)}return"function"==typeof r&&(s=r,r=null),r?e.call(t,n,r,i):e.call(t,n,i)}:e}function u(e){return e?function(n,r){var s=r?e.call(t,n,r):e.call(t,n);return s&&(s.uid<0&&(s.uid+=4294967296),s.gid<0&&(s.gid+=4294967296)),s}:e}function d(e){return!e||"ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code)}e.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&((n=t).lchmod=function(t,r,s){n.open(t,e.O_WRONLY|e.O_SYMLINK,r,function(e,t){e?s&&s(e):n.fchmod(t,r,function(e){n.close(t,function(t){s&&s(e||t)})})})},n.lchmodSync=function(t,r){var s,o=n.openSync(t,e.O_WRONLY|e.O_SYMLINK,r),a=!0;try{s=n.fchmodSync(o,r),a=!1}finally{if(a)try{n.closeSync(o)}catch(i){}else n.closeSync(o)}return s}),t.lutimes||function(t){e.hasOwnProperty("O_SYMLINK")&&t.futimes?(t.lutimes=function(n,r,s,i){t.open(n,e.O_SYMLINK,function(e,n){e?i&&i(e):t.futimes(n,r,s,function(e){t.close(n,function(t){i&&i(e||t)})})})},t.lutimesSync=function(n,r,s){var o,a=t.openSync(n,e.O_SYMLINK),c=!0;try{o=t.futimesSync(a,r,s),c=!1}finally{if(c)try{t.closeSync(a)}catch(i){}else t.closeSync(a)}return o}):t.futimes&&(t.lutimes=function(e,t,n,r){r&&process.nextTick(r)},t.lutimesSync=function(){})}(t),t.chown=a(t.chown),t.fchown=a(t.fchown),t.lchown=a(t.lchown),t.chmod=s(t.chmod),t.fchmod=s(t.fchmod),t.lchmod=s(t.lchmod),t.chownSync=c(t.chownSync),t.fchownSync=c(t.fchownSync),t.lchownSync=c(t.lchownSync),t.chmodSync=o(t.chmodSync),t.fchmodSync=o(t.fchmodSync),t.lchmodSync=o(t.lchmodSync),t.stat=l(t.stat),t.fstat=l(t.fstat),t.lstat=l(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(e,t,n){n&&process.nextTick(n)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(e,t,n,r){r&&process.nextTick(r)},t.lchownSync=function(){}),"win32"===r&&(t.rename="function"!=typeof t.rename?t.rename:function(e){function n(n,r,s){var i=Date.now(),o=0;e(n,r,function a(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-i<6e4)return setTimeout(function(){t.stat(r,function(t,i){t&&"ENOENT"===t.code?e(n,r,a):s(c)})},o),void(o<100&&(o+=10));s&&s(c)})}return Object.setPrototypeOf&&Object.setPrototypeOf(n,e),n}(t.rename)),t.read="function"!=typeof t.read?t.read:function(e){function n(n,r,s,i,o,a){var c;if(a&&"function"==typeof a){var l=0;c=function(u,d,h){if(u&&"EAGAIN"===u.code&&l<10)return l++,e.call(t,n,r,s,i,o,c);a.apply(this,arguments)}}return e.call(t,n,r,s,i,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,e),n}(t.read),t.readSync="function"!=typeof t.readSync?t.readSync:/* @__PURE__ */function(e){return function(n,r,s,o,a){for(var c=0;;)try{return e.call(t,n,r,s,o,a)}catch(i){if("EAGAIN"===i.code&&c<10){c++;continue}throw i}}}(t.readSync)},nn}(),s=function(){if(on)return sn;on=1;var e=I.Stream;return sn=function(t){return{ReadStream:function n(r,s){if(!(this instanceof n))return new n(r,s);e.call(this);var i=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,s=s||{};for(var o=Object.keys(s),a=0,c=o.length;a<c;a++){var l=o[a];this[l]=s[l]}if(this.encoding&&this.setEncoding(this.encoding),void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}null===this.fd?t.open(this.path,this.flags,this.mode,function(e,t){if(e)return i.emit("error",e),void(i.readable=!1);i.fd=t,i.emit("open",t),i._read()}):process.nextTick(function(){i._read()})},WriteStream:function n(r,s){if(!(this instanceof n))return new n(r,s);e.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var i=Object.keys(s),o=0,a=i.length;o<a;o++){var c=i[o];this[c]=s[c]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}}}(),i=function(){if(cn)return an;cn=1,an=function(t){if(null===t||"object"!=typeof t)return t;if(t instanceof Object)var n={__proto__:e(t)};else n=/* @__PURE__ */Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}),n};var e=Object.getPrototypeOf||function(e){return e.__proto__};return an}(),o=w;function a(t,n){Object.defineProperty(t,e,{get:function(){return n}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(e=/* @__PURE__ */Symbol.for("graceful-fs.queue"),t=/* @__PURE__ */Symbol.for("graceful-fs.previous")):(e="___graceful-fs.queue",t="___graceful-fs.previous");var c,l=function(){};if(o.debuglog?l=o.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(l=function(){var e=o.format.apply(o,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!n[e]){var u=k[e]||[];a(n,u),n.close=function(e){function r(t,r){return e.call(n,t,function(e){e||m(),"function"==typeof r&&r.apply(this,arguments)})}return Object.defineProperty(r,t,{value:e}),r}(n.close),n.closeSync=function(e){function r(t){e.apply(n,arguments),m()}return Object.defineProperty(r,t,{value:e}),r}(n.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){l(n[e]),v.equal(n[e].length,0)})}function d(e){r(e),e.gracefulify=d,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,s,i){return t(n,r,function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof s&&s.apply(this,arguments):h([e,[n,r,s],t,i||Date.now(),Date.now()])})}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,s){"function"==typeof r&&(s=r,r=null);return function e(t,r,s,i,o){return n(t,r,s,function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof i&&i.apply(this,arguments):h([e,[t,r,s,i],n,o||Date.now(),Date.now()])})}(e,t,r,s)};var i=e.appendFile;i&&(e.appendFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=null);return function e(t,n,r,s,o){return i(t,n,r,function(i){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof s&&s.apply(this,arguments):h([e,[t,n,r,s],i,o||Date.now(),Date.now()])})}(e,t,n,r)});var o=e.copyFile;o&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,s,i){return o(t,n,r,function(o){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof s&&s.apply(this,arguments):h([e,[t,n,r,s],o,i||Date.now(),Date.now()])})}(e,t,n,r)});var a=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=c.test(process.version)?function(e,t,n,r){return a(e,s(e,t,n,r))}:function(e,t,n,r){return a(e,t,s(e,t,n,r))};return r(e,t,n);function s(e,t,n,s){return function(i,o){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?(o&&o.sort&&o.sort(),"function"==typeof n&&n.call(this,i,o)):h([r,[e,t,n],i,s||Date.now(),Date.now()])}}};var c=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var l=s(e);f=l.ReadStream,y=l.WriteStream}var u=e.ReadStream;u&&(f.prototype=Object.create(u.prototype),f.prototype.open=function(){var e=this;I(e.path,e.flags,e.mode,function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())})});var m=e.WriteStream;m&&(y.prototype=Object.create(m.prototype),y.prototype.open=function(){var e=this;I(e.path,e.flags,e.mode,function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))})}),Object.defineProperty(e,"ReadStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return y},set:function(e){y=e},enumerable:!0,configurable:!0});var g=f;Object.defineProperty(e,"FileReadStream",{get:function(){return g},set:function(e){g=e},enumerable:!0,configurable:!0});var p=y;function f(e,t){return this instanceof f?(u.apply(this,arguments),this):f.apply(Object.create(f.prototype),arguments)}function y(e,t){return this instanceof y?(m.apply(this,arguments),this):y.apply(Object.create(y.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return p},set:function(e){p=e},enumerable:!0,configurable:!0});var b=e.open;function I(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,s,i){return b(t,n,r,function(o,a){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof s&&s.apply(this,arguments):h([e,[t,n,r,s],o,i||Date.now(),Date.now()])})}(e,t,n,r)}return e.open=I,e}function h(t){l("ENQUEUE",t[0].name,t[1]),n[e].push(t),g()}function m(){for(var t=Date.now(),r=0;r<n[e].length;++r)n[e][r].length>2&&(n[e][r][3]=t,n[e][r][4]=t);g()}function g(){if(clearTimeout(c),c=void 0,0!==n[e].length){var t=n[e].shift(),r=t[0],s=t[1],i=t[2],o=t[3],a=t[4];if(void 0===o)l("RETRY",r.name,s),r.apply(null,s);else if(Date.now()-o>=6e4){l("TIMEOUT",r.name,s);var u=s.pop();"function"==typeof u&&u.call(null,i)}else{var d=Date.now()-a,h=Math.max(a-o,1);d>=Math.min(1.2*h,100)?(l("RETRY",r.name,s),r.apply(null,s.concat([o]))):n[e].push(t)}void 0===c&&(c=setTimeout(g,0))}}return k[e]||a(k,n[e]),ln=d(i(n)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!n.__patched&&(ln=d(n),n.__patched=!0),ln}function fn(){return dn||(dn=1,function(e){const t=gn().fromCallback,n=pn(),r=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(e=>"function"==typeof n[e]);Object.assign(e,n),r.forEach(r=>{e[r]=t(n[r])}),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise(t=>n.exists(e,t))},e.read=function(e,t,r,s,i,o){return"function"==typeof o?n.read(e,t,r,s,i,o):new Promise((o,a)=>{n.read(e,t,r,s,i,(e,t,n)=>{if(e)return a(e);o({bytesRead:t,buffer:n})})})},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise((s,i)=>{n.write(e,t,...r,(e,t,n)=>{if(e)return i(e);s({bytesWritten:t,buffer:n})})})},e.readv=function(e,t,...r){return"function"==typeof r[r.length-1]?n.readv(e,t,...r):new Promise((s,i)=>{n.readv(e,t,...r,(e,t,n)=>{if(e)return i(e);s({bytesRead:t,buffers:n})})})},e.writev=function(e,t,...r){return"function"==typeof r[r.length-1]?n.writev(e,t,...r):new Promise((s,i)=>{n.writev(e,t,...r,(e,t,n)=>{if(e)return i(e);s({bytesWritten:t,buffers:n})})})},"function"==typeof n.realpath.native?e.realpath.native=t(n.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(hn)),hn}var yn,bn,In,wn,vn,Gn,An,Sn,Cn,Zn,Vn,En,Xn,Bn,Rn,xn,Wn,Nn,Jn,kn,_n,Fn,Yn,Ln,Hn,Tn,On,Mn,Kn,Un,zn,Dn,Pn,jn,Qn,$n,qn,er,tr,nr,rr,sr,ir,or,ar,cr,lr,ur,dr,hr,mr,gr,pr,fr,yr,br,Ir={},wr={};function vr(){if(yn)return wr;yn=1;const e=G;return wr.checkPath=function(t){if("win32"===process.platform){if(/[<>:"|?*]/.test(t.replace(e.parse(t).root,""))){const e=new Error(`Path contains invalid characters: ${t}`);throw e.code="EINVAL",e}}},wr}function Gr(){if(bn)return Ir;bn=1;const e=/* @__PURE__ */fn(),{checkPath:t}=/* @__PURE__ */vr(),n=e=>"number"==typeof e?e:{mode:511,...e}.mode;return Ir.makeDir=async(r,s)=>(t(r),e.mkdir(r,{mode:n(s),recursive:!0})),Ir.makeDirSync=(r,s)=>(t(r),e.mkdirSync(r,{mode:n(s),recursive:!0})),Ir}function Ar(){if(wn)return In;wn=1;const e=gn().fromPromise,{makeDir:t,makeDirSync:n}=/* @__PURE__ */Gr(),r=e(t);return In={mkdirs:r,mkdirsSync:n,mkdirp:r,mkdirpSync:n,ensureDir:r,ensureDirSync:n}}function Sr(){if(Gn)return vn;Gn=1;const e=gn().fromPromise,t=/* @__PURE__ */fn();return vn={pathExists:e(function(e){return t.access(e).then(()=>!0).catch(()=>!1)}),pathExistsSync:t.existsSync}}function Cr(){if(Sn)return An;Sn=1;const e=/* @__PURE__ */fn(),t=gn().fromPromise;return An={utimesMillis:t(async function(t,n,r){const s=await e.open(t,"r+");let i=null;try{await e.futimes(s,n,r)}finally{try{await e.close(s)}catch(o){i=o}}if(i)throw i}),utimesMillisSync:function(t,n,r){const s=e.openSync(t,"r+");return e.futimesSync(s,n,r),e.closeSync(s)}}}function Zr(){if(Zn)return Cn;Zn=1;const e=/* @__PURE__ */fn(),t=G,n=gn().fromPromise;function r(e,t){return void 0!==t.ino&&void 0!==t.dev&&t.ino===e.ino&&t.dev===e.dev}function s(e,n){const r=t.resolve(e).split(t.sep).filter(e=>e),s=t.resolve(n).split(t.sep).filter(e=>e);return r.every((e,t)=>s[t]===e)}function i(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}return Cn={checkPaths:n(async function(n,o,a,c){const{srcStat:l,destStat:u}=await function(t,n,r){const s=r.dereference?t=>e.stat(t,{bigint:!0}):t=>e.lstat(t,{bigint:!0});return Promise.all([s(t),s(n).catch(e=>{if("ENOENT"===e.code)return null;throw e})]).then(([e,t])=>({srcStat:e,destStat:t}))}(n,o,c);if(u){if(r(l,u)){const e=t.basename(n),r=t.basename(o);if("move"===a&&e!==r&&e.toLowerCase()===r.toLowerCase())return{srcStat:l,destStat:u,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(l.isDirectory()&&!u.isDirectory())throw new Error(`Cannot overwrite non-directory '${o}' with directory '${n}'.`);if(!l.isDirectory()&&u.isDirectory())throw new Error(`Cannot overwrite directory '${o}' with non-directory '${n}'.`)}if(l.isDirectory()&&s(n,o))throw new Error(i(n,o,a));return{srcStat:l,destStat:u}}),checkPathsSync:function(n,o,a,c){const{srcStat:l,destStat:u}=function(t,n,r){let s;const i=r.dereference?t=>e.statSync(t,{bigint:!0}):t=>e.lstatSync(t,{bigint:!0}),o=i(t);try{s=i(n)}catch(a){if("ENOENT"===a.code)return{srcStat:o,destStat:null};throw a}return{srcStat:o,destStat:s}}(n,o,c);if(u){if(r(l,u)){const e=t.basename(n),r=t.basename(o);if("move"===a&&e!==r&&e.toLowerCase()===r.toLowerCase())return{srcStat:l,destStat:u,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(l.isDirectory()&&!u.isDirectory())throw new Error(`Cannot overwrite non-directory '${o}' with directory '${n}'.`);if(!l.isDirectory()&&u.isDirectory())throw new Error(`Cannot overwrite directory '${o}' with non-directory '${n}'.`)}if(l.isDirectory()&&s(n,o))throw new Error(i(n,o,a));return{srcStat:l,destStat:u}},checkParentPaths:n(async function n(s,o,a,c){const l=t.resolve(t.dirname(s)),u=t.resolve(t.dirname(a));if(u===l||u===t.parse(u).root)return;let d;try{d=await e.stat(u,{bigint:!0})}catch(h){if("ENOENT"===h.code)return;throw h}if(r(o,d))throw new Error(i(s,a,c));return n(s,o,u,c)}),checkParentPathsSync:function n(s,o,a,c){const l=t.resolve(t.dirname(s)),u=t.resolve(t.dirname(a));if(u===l||u===t.parse(u).root)return;let d;try{d=e.statSync(u,{bigint:!0})}catch(h){if("ENOENT"===h.code)return;throw h}if(r(o,d))throw new Error(i(s,a,c));return n(s,o,u,c)},isSrcSubdir:s,areIdentical:r},Cn}function Vr(){if(En)return Vn;return En=1,Vn={asyncIteratorConcurrentProcess:async function(e,t){const n=[];for await(const r of e)n.push(t(r).then(()=>null,e=>e??new Error("unknown error")));await Promise.all(n.map(e=>e.then(e=>{if(null!==e)throw e})))}}}function Er(){if(Bn)return Xn;Bn=1;const e=/* @__PURE__ */fn(),t=G,{mkdirs:n}=/* @__PURE__ */Ar(),{pathExists:r}=/* @__PURE__ */Sr(),{utimesMillis:s}=/* @__PURE__ */Cr(),i=/* @__PURE__ */Zr(),{asyncIteratorConcurrentProcess:o}=/* @__PURE__ */Vr();async function a(e,t,n){return!n.filter||n.filter(e,t)}async function c(n,r,s,u){const d=u.dereference?e.stat:e.lstat,h=await d(r);if(h.isDirectory())return async function(n,r,s,l,u){r||await e.mkdir(l);await o(await e.opendir(s),async e=>{const n=t.join(s,e.name),r=t.join(l,e.name);if(await a(n,r,u)){const{destStat:e}=await i.checkPaths(n,r,"copy",u);await c(e,n,r,u)}}),r||await e.chmod(l,n.mode)}(h,n,r,s,u);if(h.isFile()||h.isCharacterDevice()||h.isBlockDevice())return async function(t,n,r,s,i){if(!n)return l(t,r,s,i);if(i.overwrite)return await e.unlink(s),l(t,r,s,i);if(i.errorOnExist)throw new Error(`'${s}' already exists`)}(h,n,r,s,u);if(h.isSymbolicLink())return async function(n,r,s,o){let a=await e.readlink(r);o.dereference&&(a=t.resolve(process.cwd(),a));if(!n)return e.symlink(a,s);let c=null;try{c=await e.readlink(s)}catch(l){if("EINVAL"===l.code||"UNKNOWN"===l.code)return e.symlink(a,s);throw l}o.dereference&&(c=t.resolve(process.cwd(),c));if(a!==c){if(i.isSrcSubdir(a,c))throw new Error(`Cannot copy '${a}' to a subdirectory of itself, '${c}'.`);if(i.isSrcSubdir(c,a))throw new Error(`Cannot overwrite '${c}' with '${a}'.`)}return await e.unlink(s),e.symlink(a,s)}(n,r,s,u);if(h.isSocket())throw new Error(`Cannot copy a socket file: ${r}`);if(h.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${r}`);throw new Error(`Unknown file: ${r}`)}async function l(t,n,r,i){if(await e.copyFile(n,r),i.preserveTimestamps){128&t.mode||await function(t,n){return e.chmod(t,128|n)}(r,t.mode);const i=await e.stat(n);await s(r,i.atime,i.mtime)}return e.chmod(r,t.mode)}return Xn=async function(e,s,o={}){"function"==typeof o&&(o={filter:o}),o.clobber=!("clobber"in o)||!!o.clobber,o.overwrite="overwrite"in o?!!o.overwrite:o.clobber,o.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001");const{srcStat:l,destStat:u}=await i.checkPaths(e,s,"copy",o);if(await i.checkParentPaths(e,l,s,"copy"),!(await a(e,s,o)))return;const d=t.dirname(s);await r(d)||await n(d),await c(u,e,s,o)}}function Xr(){if(xn)return Rn;xn=1;const e=pn(),t=G,n=Ar().mkdirsSync,r=Cr().utimesMillisSync,s=/* @__PURE__ */Zr();function i(n,r,i,l){const u=(l.dereference?e.statSync:e.lstatSync)(r);if(u.isDirectory())return function(t,n,r,s,i){return n?c(r,s,i):function(t,n,r,s){return e.mkdirSync(r),c(n,r,s),a(r,t)}(t.mode,r,s,i)}(u,n,r,i,l);if(u.isFile()||u.isCharacterDevice()||u.isBlockDevice())return function(t,n,r,s,i){return n?function(t,n,r,s){if(s.overwrite)return e.unlinkSync(r),o(t,n,r,s);if(s.errorOnExist)throw new Error(`'${r}' already exists`)}(t,r,s,i):o(t,r,s,i)}(u,n,r,i,l);if(u.isSymbolicLink())return function(n,r,i,o){let a=e.readlinkSync(r);o.dereference&&(a=t.resolve(process.cwd(),a));if(n){let n;try{n=e.readlinkSync(i)}catch(c){if("EINVAL"===c.code||"UNKNOWN"===c.code)return e.symlinkSync(a,i);throw c}if(o.dereference&&(n=t.resolve(process.cwd(),n)),a!==n){if(s.isSrcSubdir(a,n))throw new Error(`Cannot copy '${a}' to a subdirectory of itself, '${n}'.`);if(s.isSrcSubdir(n,a))throw new Error(`Cannot overwrite '${n}' with '${a}'.`)}return function(t,n){return e.unlinkSync(n),e.symlinkSync(t,n)}(a,i)}return e.symlinkSync(a,i)}(n,r,i,l);if(u.isSocket())throw new Error(`Cannot copy a socket file: ${r}`);if(u.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${r}`);throw new Error(`Unknown file: ${r}`)}function o(t,n,s,i){return e.copyFileSync(n,s),i.preserveTimestamps&&function(t,n,s){(function(e){return!(128&e)})(t)&&function(e,t){a(e,128|t)}(s,t);(function(t,n){const s=e.statSync(t);r(n,s.atime,s.mtime)})(n,s)}(t.mode,n,s),a(s,t.mode)}function a(t,n){return e.chmodSync(t,n)}function c(t,n,r){const s=e.opendirSync(t);try{let e;for(;null!==(e=s.readSync());)l(e.name,t,n,r)}finally{s.closeSync()}}function l(e,n,r,o){const a=t.join(n,e),c=t.join(r,e);if(o.filter&&!o.filter(a,c))return;const{destStat:l}=s.checkPathsSync(a,c,"copy",o);return i(l,a,c,o)}return Rn=function(r,o,a){"function"==typeof a&&(a={filter:a}),(a=a||{}).clobber=!("clobber"in a)||!!a.clobber,a.overwrite="overwrite"in a?!!a.overwrite:a.clobber,a.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:c,destStat:l}=s.checkPathsSync(r,o,"copy",a);if(s.checkParentPathsSync(r,c,o,"copy"),a.filter&&!a.filter(r,o))return;const u=t.dirname(o);return e.existsSync(u)||n(u),i(l,r,o,a)}}function Br(){if(Nn)return Wn;Nn=1;const e=gn().fromPromise;return Wn={copy:e(/* @__PURE__ */Er()),copySync:/* @__PURE__ */Xr()}}function Rr(){if(kn)return Jn;kn=1;const e=pn(),t=gn().fromCallback;return Jn={remove:t(function(t,n){e.rm(t,{recursive:!0,force:!0},n)}),removeSync:function(t){e.rmSync(t,{recursive:!0,force:!0})}}}function xr(){if(Fn)return _n;Fn=1;const e=gn().fromPromise,t=/* @__PURE__ */fn(),n=G,r=/* @__PURE__ */Ar(),s=/* @__PURE__ */Rr(),i=e(async function(e){let i;try{i=await t.readdir(e)}catch{return r.mkdirs(e)}return Promise.all(i.map(t=>s.remove(n.join(e,t))))});function o(e){let i;try{i=t.readdirSync(e)}catch{return r.mkdirsSync(e)}i.forEach(t=>{t=n.join(e,t),s.removeSync(t)})}return _n={emptyDirSync:o,emptydirSync:o,emptyDir:i,emptydir:i}}function Wr(){if(Ln)return Yn;Ln=1;const e=gn().fromPromise,t=G,n=/* @__PURE__ */fn(),r=/* @__PURE__ */Ar();return Yn={createFile:e(async function(e){let s;try{s=await n.stat(e)}catch{}if(s&&s.isFile())return;const i=t.dirname(e);let o=null;try{o=await n.stat(i)}catch(a){if("ENOENT"===a.code)return await r.mkdirs(i),void(await n.writeFile(e,""));throw a}o.isDirectory()?await n.writeFile(e,""):await n.readdir(i)}),createFileSync:function(e){let s;try{s=n.statSync(e)}catch{}if(s&&s.isFile())return;const i=t.dirname(e);try{n.statSync(i).isDirectory()||n.readdirSync(i)}catch(o){if(!o||"ENOENT"!==o.code)throw o;r.mkdirsSync(i)}n.writeFileSync(e,"")}}}function Nr(){if(Tn)return Hn;Tn=1;const e=gn().fromPromise,t=G,n=/* @__PURE__ */fn(),r=/* @__PURE__ */Ar(),{pathExists:s}=/* @__PURE__ */Sr(),{areIdentical:i}=/* @__PURE__ */Zr();return Hn={createLink:e(async function(e,o){let a,c;try{a=await n.lstat(o)}catch{}try{c=await n.lstat(e)}catch(u){throw u.message=u.message.replace("lstat","ensureLink"),u}if(a&&i(c,a))return;const l=t.dirname(o);await s(l)||await r.mkdirs(l),await n.link(e,o)}),createLinkSync:function(e,s){let o;try{o=n.lstatSync(s)}catch{}try{const t=n.lstatSync(e);if(o&&i(t,o))return}catch(c){throw c.message=c.message.replace("lstat","ensureLink"),c}const a=t.dirname(s);return n.existsSync(a)||r.mkdirsSync(a),n.linkSync(e,s)}}}function Jr(){if(Mn)return On;Mn=1;const e=G,t=/* @__PURE__ */fn(),{pathExists:n}=/* @__PURE__ */Sr(),r=gn().fromPromise;return On={symlinkPaths:r(async function(r,s){if(e.isAbsolute(r)){try{await t.lstat(r)}catch(a){throw a.message=a.message.replace("lstat","ensureSymlink"),a}return{toCwd:r,toDst:r}}const i=e.dirname(s),o=e.join(i,r);if(await n(o))return{toCwd:o,toDst:r};try{await t.lstat(r)}catch(a){throw a.message=a.message.replace("lstat","ensureSymlink"),a}return{toCwd:r,toDst:e.relative(i,r)}}),symlinkPathsSync:function(n,r){if(e.isAbsolute(n)){if(!t.existsSync(n))throw new Error("absolute srcpath does not exist");return{toCwd:n,toDst:n}}const s=e.dirname(r),i=e.join(s,n);if(t.existsSync(i))return{toCwd:i,toDst:n};if(!t.existsSync(n))throw new Error("relative srcpath does not exist");return{toCwd:n,toDst:e.relative(s,n)}}}}function kr(){if(Un)return Kn;Un=1;const e=/* @__PURE__ */fn(),t=gn().fromPromise;return Kn={symlinkType:t(async function(t,n){if(n)return n;let r;try{r=await e.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}),symlinkTypeSync:function(t,n){if(n)return n;let r;try{r=e.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}}}function _r(){if(Dn)return zn;Dn=1;const e=gn().fromPromise,t=G,n=/* @__PURE__ */fn(),{mkdirs:r,mkdirsSync:s}=/* @__PURE__ */Ar(),{symlinkPaths:i,symlinkPathsSync:o}=/* @__PURE__ */Jr(),{symlinkType:a,symlinkTypeSync:c}=/* @__PURE__ */kr(),{pathExists:l}=/* @__PURE__ */Sr(),{areIdentical:u}=/* @__PURE__ */Zr();return zn={createSymlink:e(async function(e,s,o){let c;try{c=await n.lstat(s)}catch{}if(c&&c.isSymbolicLink()){let r;if(t.isAbsolute(e))r=await n.stat(e);else{const i=t.dirname(s),o=t.join(i,e);try{r=await n.stat(o)}catch{r=await n.stat(e)}}const i=await n.stat(s);if(u(r,i))return}const d=await i(e,s);e=d.toDst;const h=await a(d.toCwd,o),m=t.dirname(s);return await l(m)||await r(m),n.symlink(e,s,h)}),createSymlinkSync:function(e,r,i){let a;try{a=n.lstatSync(r)}catch{}if(a&&a.isSymbolicLink()){let s;if(t.isAbsolute(e))s=n.statSync(e);else{const i=t.dirname(r),o=t.join(i,e);try{s=n.statSync(o)}catch{s=n.statSync(e)}}const i=n.statSync(r);if(u(s,i))return}const l=o(e,r);e=l.toDst,i=c(l.toCwd,i);const d=t.dirname(r);return n.existsSync(d)||s(d),n.symlinkSync(e,r,i)}}}function Fr(){if(jn)return Pn;jn=1;const{createFile:e,createFileSync:t}=/* @__PURE__ */Wr(),{createLink:n,createLinkSync:r}=/* @__PURE__ */Nr(),{createSymlink:s,createSymlinkSync:i}=/* @__PURE__ */_r();return Pn={createFile:e,createFileSync:t,ensureFile:e,ensureFileSync:t,createLink:n,createLinkSync:r,ensureLink:n,ensureLinkSync:r,createSymlink:s,createSymlinkSync:i,ensureSymlink:s,ensureSymlinkSync:i}}function Yr(){if($n)return Qn;return $n=1,Qn={stringify:function(e,{EOL:t="\n",finalEOL:n=!0,replacer:r=null,spaces:s}={}){const i=n?t:"";return JSON.stringify(e,r,s).replace(/\n/g,t)+i},stripBom:function(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}}}function Lr(){if(nr)return tr;nr=1;const e=function(){if(er)return qn;let e;er=1;try{e=pn()}catch(o){e=y}const t=gn(),{stringify:n,stripBom:r}=Yr(),s=t.fromPromise(async function(n,s={}){"string"==typeof s&&(s={encoding:s});const i=s.fs||e,o=!("throws"in s)||s.throws;let a,c=await t.fromCallback(i.readFile)(n,s);c=r(c);try{a=JSON.parse(c,s?s.reviver:null)}catch(l){if(o)throw l.message=`${n}: ${l.message}`,l;return null}return a}),i=t.fromPromise(async function(r,s,i={}){const o=i.fs||e,a=n(s,i);await t.fromCallback(o.writeFile)(r,a,i)});return qn={readFile:s,readFileSync:function(t,n={}){"string"==typeof n&&(n={encoding:n});const s=n.fs||e,i=!("throws"in n)||n.throws;try{let e=s.readFileSync(t,n);return e=r(e),JSON.parse(e,n.reviver)}catch(o){if(i)throw o.message=`${t}: ${o.message}`,o;return null}},writeFile:i,writeFileSync:function(t,r,s={}){const i=s.fs||e,o=n(r,s);return i.writeFileSync(t,o,s)}}}();return tr={readJson:e.readFile,readJsonSync:e.readFileSync,writeJson:e.writeFile,writeJsonSync:e.writeFileSync}}function Hr(){if(sr)return rr;sr=1;const e=gn().fromPromise,t=/* @__PURE__ */fn(),n=G,r=/* @__PURE__ */Ar(),s=Sr().pathExists;return rr={outputFile:e(async function(e,i,o="utf-8"){const a=n.dirname(e);return await s(a)||await r.mkdirs(a),t.writeFile(e,i,o)}),outputFileSync:function(e,...s){const i=n.dirname(e);t.existsSync(i)||r.mkdirsSync(i),t.writeFileSync(e,...s)}}}function Tr(){if(or)return ir;or=1;const{stringify:e}=Yr(),{outputFile:t}=/* @__PURE__ */Hr();return ir=async function(n,r,s={}){const i=e(r,s);await t(n,i,s)}}function Or(){if(cr)return ar;cr=1;const{stringify:e}=Yr(),{outputFileSync:t}=/* @__PURE__ */Hr();return ar=function(n,r,s){const i=e(r,s);t(n,i,s)}}function Mr(){if(ur)return lr;ur=1;const e=gn().fromPromise,t=/* @__PURE__ */Lr();return t.outputJson=e(/* @__PURE__ */Tr()),t.outputJsonSync=/* @__PURE__ */Or(),t.outputJSON=t.outputJson,t.outputJSONSync=t.outputJsonSync,t.writeJSON=t.writeJson,t.writeJSONSync=t.writeJsonSync,t.readJSON=t.readJson,t.readJSONSync=t.readJsonSync,lr=t}function Kr(){if(hr)return dr;hr=1;const e=/* @__PURE__ */fn(),t=G,{copy:n}=/* @__PURE__ */Br(),{remove:r}=/* @__PURE__ */Rr(),{mkdirp:s}=/* @__PURE__ */Ar(),{pathExists:i}=/* @__PURE__ */Sr(),o=/* @__PURE__ */Zr();return dr=async function(a,c,l={}){const u=l.overwrite||l.clobber||!1,{srcStat:d,isChangingCase:h=!1}=await o.checkPaths(a,c,"move",l);await o.checkParentPaths(a,d,c,"move");const m=t.dirname(c);return t.parse(m).root!==m&&await s(m),async function(t,s,o,a){if(!a)if(o)await r(s);else if(await i(s))throw new Error("dest already exists.");try{await e.rename(t,s)}catch(c){if("EXDEV"!==c.code)throw c;await async function(e,t,s){const i={overwrite:s,errorOnExist:!0,preserveTimestamps:!0};return await n(e,t,i),r(e)}(t,s,o)}}(a,c,u,h)}}function Ur(){if(gr)return mr;gr=1;const e=pn(),t=G,n=Br().copySync,r=Rr().removeSync,s=Ar().mkdirpSync,i=/* @__PURE__ */Zr();function o(t,s,i){try{e.renameSync(t,s)}catch(o){if("EXDEV"!==o.code)throw o;return function(e,t,s){const i={overwrite:s,errorOnExist:!0,preserveTimestamps:!0};return n(e,t,i),r(e)}(t,s,i)}}return mr=function(n,a,c){const l=(c=c||{}).overwrite||c.clobber||!1,{srcStat:u,isChangingCase:d=!1}=i.checkPathsSync(n,a,"move",c);return i.checkParentPathsSync(n,u,a,"move"),function(e){const n=t.dirname(e);return t.parse(n).root===n}(a)||s(t.dirname(a)),function(t,n,s,i){if(i)return o(t,n,s);if(s)return r(n),o(t,n,s);if(e.existsSync(n))throw new Error("dest already exists.");return o(t,n,s)}(n,a,l,d)}}function zr(){if(fr)return pr;fr=1;const e=gn().fromPromise;return pr={move:e(/* @__PURE__ */Kr()),moveSync:/* @__PURE__ */Ur()}}function Dr(){return br?yr:(br=1,yr={.../* @__PURE__ */fn(),.../* @__PURE__ */Br(),.../* @__PURE__ */xr(),.../* @__PURE__ */Fr(),.../* @__PURE__ */Mr(),.../* @__PURE__ */Ar(),.../* @__PURE__ */zr(),.../* @__PURE__ */Hr(),.../* @__PURE__ */Sr(),.../* @__PURE__ */Rr()})}const Pr=/* @__PURE__ */_(/* @__PURE__ */Dr()),jr=en("com.fluxlay.core",{suffix:""});class Qr{static filePath=c.join(jr.data,"auth.json");static async saveSession(e){await Pr.ensureDir(jr.data),await Pr.writeJson(Qr.filePath,e,{spaces:2}),await Pr.chmod(Qr.filePath,384)}static async getSession(){if(!(await Pr.pathExists(Qr.filePath)))return null;try{return await Pr.readJson(Qr.filePath)}catch(e){return null}}static async clearSession(){await Pr.pathExists(Qr.filePath)&&await Pr.remove(Qr.filePath)}static async getValidSession(){const e=await Qr.getSession();if(!e)return null;const t=e.access_token.split(".")[1];return 1e3*JSON.parse(Buffer.from(t,"base64").toString("utf8")).exp<Date.now()?(await Qr.clearSession(),null):e}}var $r,qr,es,ts;function ns(e,t){return!(null===e||"object"!=typeof e||!("$typeName"in e)||"string"!=typeof e.$typeName)&&(void 0===t||t.typeName===e.$typeName)}function rs(){let e=0,t=0;for(let r=0;r<28;r+=7){let n=this.buf[this.pos++];if(e|=(127&n)<<r,!(128&n))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(15&n)<<28,t=(112&n)>>4,!(128&n))return this.assertBounds(),[e,t];for(let r=3;r<=31;r+=7){let n=this.buf[this.pos++];if(t|=(127&n)<<r,!(128&n))return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function ss(e,t,n){for(let i=0;i<28;i+=7){const r=e>>>i,s=!(r>>>7==0&&0==t),o=255&(s?128|r:r);if(n.push(o),!s)return}const r=e>>>28&15|(7&t)<<4,s=!!(t>>3);if(n.push(255&(s?128|r:r)),s){for(let e=3;e<31;e+=7){const r=t>>>e,s=!(r>>>7==0),i=255&(s?128|r:r);if(n.push(i),!s)return}n.push(t>>>31&1)}}(qr=$r||($r={}))[qr.Canceled=1]="Canceled",qr[qr.Unknown=2]="Unknown",qr[qr.InvalidArgument=3]="InvalidArgument",qr[qr.DeadlineExceeded=4]="DeadlineExceeded",qr[qr.NotFound=5]="NotFound",qr[qr.AlreadyExists=6]="AlreadyExists",qr[qr.PermissionDenied=7]="PermissionDenied",qr[qr.ResourceExhausted=8]="ResourceExhausted",qr[qr.FailedPrecondition=9]="FailedPrecondition",qr[qr.Aborted=10]="Aborted",qr[qr.OutOfRange=11]="OutOfRange",qr[qr.Unimplemented=12]="Unimplemented",qr[qr.Internal=13]="Internal",qr[qr.Unavailable=14]="Unavailable",qr[qr.DataLoss=15]="DataLoss",qr[qr.Unauthenticated=16]="Unauthenticated",(ts=es||(es={}))[ts.DOUBLE=1]="DOUBLE",ts[ts.FLOAT=2]="FLOAT",ts[ts.INT64=3]="INT64",ts[ts.UINT64=4]="UINT64",ts[ts.INT32=5]="INT32",ts[ts.FIXED64=6]="FIXED64",ts[ts.FIXED32=7]="FIXED32",ts[ts.BOOL=8]="BOOL",ts[ts.STRING=9]="STRING",ts[ts.BYTES=12]="BYTES",ts[ts.UINT32=13]="UINT32",ts[ts.SFIXED32=15]="SFIXED32",ts[ts.SFIXED64=16]="SFIXED64",ts[ts.SINT32=17]="SINT32",ts[ts.SINT64=18]="SINT64";const is=4294967296;function os(e){const t="-"===e[0];t&&(e=e.slice(1));const n=1e6;let r=0,s=0;function i(t,i){const o=Number(e.slice(t,i));s*=n,r=r*n+o,r>=is&&(s+=r/is|0,r%=is)}return i(-24,-18),i(-18,-12),i(-12,-6),i(-6),t?ls(r,s):cs(r,s)}function as(e,t){if(({lo:e,hi:t}=function(e,t){return{lo:e>>>0,hi:t>>>0}}(e,t)),t<=2097151)return String(is*t+e);const n=16777215&(e>>>24|t<<8),r=t>>16&65535;let s=(16777215&e)+6777216*n+6710656*r,i=n+8147497*r,o=2*r;const a=1e7;return s>=a&&(i+=Math.floor(s/a),s%=a),i>=a&&(o+=Math.floor(i/a),i%=a),o.toString()+us(i)+us(s)}function cs(e,t){return{lo:0|e,hi:0|t}}function ls(e,t){return t=~t,e?e=1+~e:t+=1,cs(e,t)}const us=e=>{const t=String(e);return"0000000".slice(t.length)+t};function ds(e,t){if(e>=0){for(;e>127;)t.push(127&e|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(127&e|128),e>>=7;t.push(1)}}function hs(){let e=this.buf[this.pos++],t=127&e;if(!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<7,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<14,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<21,!(128&e))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(15&e)<<28;for(let n=5;128&e&&n<10;n++)e=this.buf[this.pos++];if(128&e)throw new Error("invalid varint");return this.assertBounds(),t>>>0}const ms=/* @__PURE__ */gs();function gs(){const e=new DataView(new ArrayBuffer(8));if("function"==typeof BigInt&&"function"==typeof e.getBigInt64&&"function"==typeof e.getBigUint64&&"function"==typeof e.setBigInt64&&"function"==typeof e.setBigUint64&&(!!globalThis.Deno||"object"!=typeof process||"object"!=typeof process.env||"1"!==process.env.BUF_BIGINT_DISABLE)){const t=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),r=BigInt("0"),s=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(e){const r="bigint"==typeof e?e:BigInt(e);if(r>n||r<t)throw new Error(`invalid int64: ${e}`);return r},uParse(e){const t="bigint"==typeof e?e:BigInt(e);if(t>s||t<r)throw new Error(`invalid uint64: ${e}`);return t},enc(t){return e.setBigInt64(0,this.parse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(t){return e.setBigInt64(0,this.uParse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec:(t,n)=>(e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigInt64(0,!0)),uDec:(t,n)=>(e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigUint64(0,!0))}}return{zero:"0",supported:!1,parse:e=>("string"!=typeof e&&(e=e.toString()),ps(e),e),uParse:e=>("string"!=typeof e&&(e=e.toString()),fs(e),e),enc:e=>("string"!=typeof e&&(e=e.toString()),ps(e),os(e)),uEnc:e=>("string"!=typeof e&&(e=e.toString()),fs(e),os(e)),dec:(e,t)=>function(e,t){let n=cs(e,t);const r=2147483648&n.hi;r&&(n=ls(n.lo,n.hi));const s=as(n.lo,n.hi);return r?"-"+s:s}(e,t),uDec:(e,t)=>as(e,t)}}function ps(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function fs(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}function ys(e,t){switch(e){case es.STRING:return"";case es.BOOL:return!1;case es.DOUBLE:case es.FLOAT:return 0;case es.INT64:case es.UINT64:case es.SFIXED64:case es.FIXED64:case es.SINT64:return t?"0":ms.zero;case es.BYTES:return new Uint8Array(0);default:return 0}}const bs=/* @__PURE__ */Symbol.for("reflect unsafe local");function Is(e,t){const n=e[t.localName].case;return void 0===n?n:t.fields.find(e=>e.localName===n)}function ws(e,t){const n=t.localName;if(t.oneof)return e[t.oneof.localName].case===n;if(2!=t.presence)return void 0!==e[n]&&Object.prototype.hasOwnProperty.call(e,n);switch(t.fieldKind){case"list":return e[n].length>0;case"map":return Object.keys(e[n]).length>0;case"scalar":return!function(e,t){switch(e){case es.BOOL:return!1===t;case es.STRING:return""===t;case es.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return 0==t}}(t.scalar,e[n]);case"enum":return e[n]!==t.enum.values[0].number}throw new Error("message field with implicit presence")}function vs(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&void 0!==e[t]}function Gs(e,t){if(t.oneof){const n=e[t.oneof.localName];return n.case===t.localName?n.value:void 0}return e[t.localName]}function As(e,t,n){t.oneof?e[t.oneof.localName]={case:t.localName,value:n}:e[t.localName]=n}function Ss(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Cs(e,t){var n,r,s,i;if(Ss(e)&&bs in e&&"add"in e&&"field"in e&&"function"==typeof e.field){if(void 0!==t){const o=t,a=e.field();return o.listKind==a.listKind&&o.scalar===a.scalar&&(null===(n=o.message)||void 0===n?void 0:n.typeName)===(null===(r=a.message)||void 0===r?void 0:r.typeName)&&(null===(s=o.enum)||void 0===s?void 0:s.typeName)===(null===(i=a.enum)||void 0===i?void 0:i.typeName)}return!0}return!1}function Zs(e,t){var n,r,s,i;if(Ss(e)&&bs in e&&"has"in e&&"field"in e&&"function"==typeof e.field){if(void 0!==t){const o=t,a=e.field();return o.mapKey===a.mapKey&&o.mapKind==a.mapKind&&o.scalar===a.scalar&&(null===(n=o.message)||void 0===n?void 0:n.typeName)===(null===(r=a.message)||void 0===r?void 0:r.typeName)&&(null===(s=o.enum)||void 0===s?void 0:s.typeName)===(null===(i=a.enum)||void 0===i?void 0:i.typeName)}return!0}return!1}function Vs(e,t){return Ss(e)&&bs in e&&"desc"in e&&Ss(e.desc)&&"message"===e.desc.kind&&(void 0===t||e.desc.typeName==t.typeName)}function Es(e){const t=e.fields[0];return Xs(e.typeName)&&void 0!==t&&"scalar"==t.fieldKind&&"value"==t.name&&1==t.number}function Xs(e){return e.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(e.substring(16))}function Bs(e,t){if(ns(t,e))return t;const n=function(e){let t;if(function(e){switch(e.file.edition){case 999:return!1;case 998:return!0;default:return e.fields.some(e=>2!=e.presence&&"message"!=e.fieldKind&&!e.oneof)}}(e)){const n=Fs.get(e);let r,s;if(n)({prototype:r,members:s}=n);else{r={},s=/* @__PURE__ */new Set;for(const t of e.members)"oneof"!=t.kind&&("scalar"!=t.fieldKind&&"enum"!=t.fieldKind||2!=t.presence&&(s.add(t),r[t.localName]=Ys(t)));Fs.set(e,{prototype:r,members:s})}t=Object.create(r),t.$typeName=e.typeName;for(const i of e.members)if(!s.has(i)){if("field"==i.kind){if("message"==i.fieldKind)continue;if(("scalar"==i.fieldKind||"enum"==i.fieldKind)&&2!=i.presence)continue}t[i.localName]=Ys(i)}}else{t={$typeName:e.typeName};for(const n of e.members)"oneof"!=n.kind&&2!=n.presence||(t[n.localName]=Ys(n))}return t}(e);return void 0!==t&&function(e,t,n){for(const r of e.members){let e,s=n[r.localName];if(null!=s){if("oneof"==r.kind){const t=Is(n,r);if(!t)continue;e=t,s=Gs(n,t)}else e=r;switch(e.fieldKind){case"message":s=Ns(e,s);break;case"scalar":s=Rs(e,s);break;case"list":s=Ws(e,s);break;case"map":s=xs(e,s)}As(t,e,s)}}}(e,n,t),n}function Rs(e,t){return e.scalar==es.BYTES?Js(t):t}function xs(e,t){if(Ss(t)){if(e.scalar==es.BYTES)return ks(t,Js);if("message"==e.mapKind)return ks(t,t=>Ns(e,t))}return t}function Ws(e,t){if(Array.isArray(t)){if(e.scalar==es.BYTES)return t.map(Js);if("message"==e.listKind)return t.map(t=>Ns(e,t))}return t}function Ns(e,t){if("message"==e.fieldKind&&!e.oneof&&Es(e.message))return Rs(e.message.fields[0],t);if(Ss(t)){if("google.protobuf.Struct"==e.message.typeName&&"google.protobuf.Value"!==e.parent.typeName)return t;if(!ns(t,e.message))return Bs(e.message,t)}return t}function Js(e){return Array.isArray(e)?new Uint8Array(e):e}function ks(e,t){const n={};for(const r of Object.entries(e))n[r[0]]=t(r[1]);return n}const _s=/* @__PURE__ */Symbol(),Fs=/* @__PURE__ */new WeakMap;function Ys(e){if("oneof"==e.kind)return{case:void 0};if("list"==e.fieldKind)return[];if("map"==e.fieldKind)return{};if("message"==e.fieldKind)return _s;const t=e.getDefaultValue();return void 0!==t?"scalar"==e.fieldKind&&e.longAsString?t.toString():t:"scalar"==e.fieldKind?ys(e.scalar,e.longAsString):e.enum.values[0].number}const Ls=["FieldValueInvalidError","FieldListRangeError","ForeignFieldError"];class Hs extends Error{constructor(e,t,n="FieldValueInvalidError"){super(t),this.name=n,this.field=()=>e}}const Ts=/* @__PURE__ */Symbol.for("@bufbuild/protobuf/text-encoding");function Os(){if(null==globalThis[Ts]){const e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[Ts]={encodeUtf8:t=>e.encode(t),decodeUtf8:e=>t.decode(e),checkUtf8(e){try{return encodeURIComponent(e),!0}catch(t){return!1}}}}return globalThis[Ts]}var Ms,Ks;(Ks=Ms||(Ms={}))[Ks.Varint=0]="Varint",Ks[Ks.Bit64=1]="Bit64",Ks[Ks.LengthDelimited=2]="LengthDelimited",Ks[Ks.StartGroup=3]="StartGroup",Ks[Ks.EndGroup=4]="EndGroup",Ks[Ks.Bit32=5]="Bit32";const Us=34028234663852886e22,zs=-34028234663852886e22,Ds=4294967295,Ps=2147483647,js=-2147483648;class Qs{constructor(e=Os().encodeUtf8){this.encodeUtf8=e,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let e=0;for(let r=0;r<this.chunks.length;r++)e+=this.chunks[r].length;let t=new Uint8Array(e),n=0;for(let r=0;r<this.chunks.length;r++)t.set(this.chunks[r],n),n+=this.chunks[r].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(ei(e);e>127;)this.buf.push(127&e|128),e>>>=7;return this.buf.push(e),this}int32(e){return qs(e),ds(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.encodeUtf8(e);return this.uint32(t.byteLength),this.raw(t)}float(e){!function(e){if("string"==typeof e){const t=e;if(e=Number(e),Number.isNaN(e)&&"NaN"!==t)throw new Error("invalid float32: "+t)}else if("number"!=typeof e)throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>Us||e<zs))throw new Error("invalid float32: "+e)}(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){ei(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){qs(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return qs(e),ds(e=(e<<1^e>>31)>>>0,this.buf),this}sfixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=ms.enc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=ms.uEnc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}int64(e){let t=ms.enc(e);return ss(t.lo,t.hi,this.buf),this}sint64(e){const t=ms.enc(e),n=t.hi>>31;return ss(t.lo<<1^n,(t.hi<<1|t.lo>>>31)^n,this.buf),this}uint64(e){const t=ms.uEnc(e);return ss(t.lo,t.hi,this.buf),this}}class $s{constructor(e,t=Os().decodeUtf8){this.decodeUtf8=t,this.varint64=rs,this.uint32=hs,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),t=e>>>3,n=7&e;if(t<=0||n<0||n>5)throw new Error("illegal tag: field no "+t+" wire type "+n);return[t,n]}skip(e,t){let n=this.pos;switch(e){case Ms.Varint:for(;128&this.buf[this.pos++];);break;case Ms.Bit64:this.pos+=4;case Ms.Bit32:this.pos+=4;break;case Ms.LengthDelimited:let n=this.uint32();this.pos+=n;break;case Ms.StartGroup:for(;;){const[e,n]=this.tag();if(n===Ms.EndGroup){if(void 0!==t&&e!==t)throw new Error("invalid end group tag");break}this.skip(n,e)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){let e=this.uint32();return e>>>1^-(1&e)}int64(){return ms.dec(...this.varint64())}uint64(){return ms.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),n=-(1&e);return e=(e>>>1|(1&t)<<31)^n,t=t>>>1^n,ms.dec(e,t)}bool(){let[e,t]=this.varint64();return 0!==e||0!==t}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return ms.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return ms.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.decodeUtf8(this.bytes())}}function qs(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>Ps||e<js)throw new Error("invalid int32: "+e)}function ei(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>Ds||e<0)throw new Error("invalid uint32: "+e)}function ti(e,t){const n="list"==e.fieldKind?Cs(t,e):"map"==e.fieldKind?Zs(t,e):ri(e,t);if(!0===n)return;let r;switch(e.fieldKind){case"list":r=`expected ${ci(e)}, got ${oi(t)}`;break;case"map":r=`expected ${li(e)}, got ${oi(t)}`;break;default:r=ii(e,t,n)}return new Hs(e,r)}function ni(e,t,n){const r=ri(e,n);if(!0!==r)return new Hs(e,`list item #${t+1}: ${ii(e,n,r)}`)}function ri(e,t){return void 0!==e.scalar?si(t,e.scalar):void 0!==e.enum?e.enum.open?Number.isInteger(t):e.enum.values.some(e=>e.number===t):Vs(t,e.message)}function si(e,t){switch(t){case es.DOUBLE:return"number"==typeof e;case es.FLOAT:return"number"==typeof e&&(!(!Number.isNaN(e)&&Number.isFinite(e))||(!(e>Us||e<zs)||`${e.toFixed()} out of range`));case es.INT32:case es.SFIXED32:case es.SINT32:return!("number"!=typeof e||!Number.isInteger(e))&&(!(e>Ps||e<js)||`${e.toFixed()} out of range`);case es.FIXED32:case es.UINT32:return!("number"!=typeof e||!Number.isInteger(e))&&(!(e>Ds||e<0)||`${e.toFixed()} out of range`);case es.BOOL:return"boolean"==typeof e;case es.STRING:return"string"==typeof e&&(Os().checkUtf8(e)||"invalid UTF8");case es.BYTES:return e instanceof Uint8Array;case es.INT64:case es.SFIXED64:case es.SINT64:if("bigint"==typeof e||"number"==typeof e||"string"==typeof e&&e.length>0)try{return ms.parse(e),!0}catch(n){return`${e} out of range`}return!1;case es.FIXED64:case es.UINT64:if("bigint"==typeof e||"number"==typeof e||"string"==typeof e&&e.length>0)try{return ms.uParse(e),!0}catch(n){return`${e} out of range`}return!1}}function ii(e,t,n){return n="string"==typeof n?`: ${n}`:`, got ${oi(t)}`,void 0!==e.scalar?`expected ${function(e){switch(e){case es.STRING:return"string";case es.BOOL:return"boolean";case es.INT64:case es.SINT64:case es.SFIXED64:return"bigint (int64)";case es.UINT64:case es.FIXED64:return"bigint (uint64)";case es.BYTES:return"Uint8Array";case es.DOUBLE:return"number (float64)";case es.FLOAT:return"number (float32)";case es.FIXED32:case es.UINT32:return"number (uint32)";case es.INT32:case es.SFIXED32:case es.SINT32:return"number (int32)"}}(e.scalar)}`+n:void 0!==e.enum?`expected ${e.enum.toString()}`+n:`expected ${ai(e.message)}`+n}function oi(e){switch(typeof e){case"object":return null===e?"null":e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:Cs(e)?ci(e.field()):Zs(e)?li(e.field()):Vs(e)?ai(e.desc):ns(e)?`message ${e.$typeName}`:"object";case"string":return e.length>30?"string":`"${e.split('"').join('\\"')}"`;case"boolean":case"number":return String(e);case"bigint":return String(e)+"n";default:return typeof e}}function ai(e){return`ReflectMessage (${e.typeName})`}function ci(e){switch(e.listKind){case"message":return`ReflectList (${e.message.toString()})`;case"enum":return`ReflectList (${e.enum.toString()})`;case"scalar":return`ReflectList (${es[e.scalar]})`}}function li(e){switch(e.mapKind){case"message":return`ReflectMap (${es[e.mapKey]}, ${e.message.toString()})`;case"enum":return`ReflectMap (${es[e.mapKey]}, ${e.enum.toString()})`;case"scalar":return`ReflectMap (${es[e.mapKey]}, ${es[e.scalar]})`}}function ui(e,t,n=!0){return new hi(e,t,n)}const di=/* @__PURE__ */new WeakMap;class hi{get sortedFields(){const e=di.get(this.desc);if(e)return e;const t=this.desc.fields.concat().sort((e,t)=>e.number-t.number);return di.set(this.desc,t),t}constructor(e,t,n=!0){this.lists=/* @__PURE__ */new Map,this.maps=/* @__PURE__ */new Map,this.check=n,this.desc=e,this.message=this[bs]=null!=t?t:Bs(e),this.fields=e.fields,this.oneofs=e.oneofs,this.members=e.members}findNumber(e){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(e=>[e.number,e]))),this._fieldsByNumber.get(e)}oneofCase(e){return mi(this.message,e),Is(this.message,e)}isSet(e){return mi(this.message,e),ws(this.message,e)}clear(e){mi(this.message,e),function(e,t){const n=t.localName;if(t.oneof){const r=t.oneof.localName;e[r].case===n&&(e[r]={case:void 0})}else if(2!=t.presence)delete e[n];else switch(t.fieldKind){case"map":e[n]={};break;case"list":e[n]=[];break;case"enum":e[n]=t.enum.values[0].number;break;case"scalar":e[n]=ys(t.scalar,t.longAsString)}}(this.message,e)}get(e){mi(this.message,e);const t=Gs(this.message,e);switch(e.fieldKind){case"list":let n=this.lists.get(e);return n&&n[bs]===t||this.lists.set(e,n=new gi(e,t,this.check)),n;case"map":let r=this.maps.get(e);return r&&r[bs]===t||this.maps.set(e,r=new pi(e,t,this.check)),r;case"message":return yi(e,t,this.check);case"scalar":return void 0===t?ys(e.scalar,!1):Ai(e,t);case"enum":return null!=t?t:e.enum.values[0].number}}set(e,t){if(mi(this.message,e),this.check){const n=ti(e,t);if(n)throw n}let n;n="message"==e.fieldKind?fi(e,t):Zs(t)||Cs(t)?t[bs]:Si(e,t),As(this.message,e,n)}getUnknown(){return this.message.$unknown}setUnknown(e){this.message.$unknown=e}}function mi(e,t){if(t.parent.typeName!==e.$typeName)throw new Hs(t,`cannot use ${t.toString()} with message ${e.$typeName}`,"ForeignFieldError")}class gi{field(){return this._field}get size(){return this._arr.length}constructor(e,t,n){this._field=e,this._arr=this[bs]=t,this.check=n}get(e){const t=this._arr[e];return void 0===t?void 0:Ii(this._field,t,this.check)}set(e,t){if(e<0||e>=this._arr.length)throw new Hs(this._field,`list item #${e+1}: out of range`);if(this.check){const n=ni(this._field,e,t);if(n)throw n}this._arr[e]=bi(this._field,t)}add(e){if(this.check){const t=ni(this._field,this._arr.length,e);if(t)throw t}this._arr.push(bi(this._field,e))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const e of this._arr)yield Ii(this._field,e,this.check)}*entries(){for(let e=0;e<this._arr.length;e++)yield[e,Ii(this._field,this._arr[e],this.check)]}}class pi{constructor(e,t,n=!0){this.obj=this[bs]=null!=t?t:{},this.check=n,this._field=e}field(){return this._field}set(e,t){if(this.check){const n=function(e,t,n){const r=si(t,e.mapKey);if(!0!==r)return new Hs(e,`invalid map key: ${ii({scalar:e.mapKey},t,r)}`);const s=ri(e,n);return!0!==s?new Hs(e,`map entry ${oi(t)}: ${ii(e,n,s)}`):void 0}(this._field,e,t);if(n)throw n}return this.obj[vi(e)]=function(e,t){if("message"==e.mapKind)return fi(e,t);return Si(e,t)}(this._field,t),this}delete(e){const t=vi(e),n=Object.prototype.hasOwnProperty.call(this.obj,t);return n&&delete this.obj[t],n}clear(){for(const e of Object.keys(this.obj))delete this.obj[e]}get(e){let t=this.obj[vi(e)];return void 0!==t&&(t=wi(this._field,t,this.check)),t}has(e){return Object.prototype.hasOwnProperty.call(this.obj,vi(e))}*keys(){for(const e of Object.keys(this.obj))yield Gi(e,this._field.mapKey)}*entries(){for(const e of Object.entries(this.obj))yield[Gi(e[0],this._field.mapKey),wi(this._field,e[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const e of Object.values(this.obj))yield wi(this._field,e,this.check)}forEach(e,t){for(const n of this.entries())e.call(t,n[1],n[0],this)}}function fi(e,t){return Vs(t)?Xs(t.message.$typeName)&&!e.oneof&&"message"==e.fieldKind?t.message.value:"google.protobuf.Struct"==t.desc.typeName&&"google.protobuf.Value"!=e.parent.typeName?Zi(t.message):t.message:t}function yi(e,t,n){return void 0!==t&&(Es(e.message)&&!e.oneof&&"message"==e.fieldKind?t={$typeName:e.message.typeName,value:Ai(e.message.fields[0],t)}:"google.protobuf.Struct"==e.message.typeName&&"google.protobuf.Value"!=e.parent.typeName&&Ss(t)&&(t=Ci(t))),new hi(e.message,t,n)}function bi(e,t){return"message"==e.listKind?fi(e,t):Si(e,t)}function Ii(e,t,n){return"message"==e.listKind?yi(e,t,n):Ai(e,t)}function wi(e,t,n){return"message"==e.mapKind?yi(e,t,n):t}function vi(e){return"string"==typeof e||"number"==typeof e?e:String(e)}function Gi(e,t){switch(t){case es.STRING:return e;case es.INT32:case es.FIXED32:case es.UINT32:case es.SFIXED32:case es.SINT32:{const t=Number.parseInt(e);if(Number.isFinite(t))return t;break}case es.BOOL:switch(e){case"true":return!0;case"false":return!1}break;case es.UINT64:case es.FIXED64:try{return ms.uParse(e)}catch(n){}break;default:try{return ms.parse(e)}catch(r){}}return e}function Ai(e,t){switch(e.scalar){case es.INT64:case es.SFIXED64:case es.SINT64:"longAsString"in e&&e.longAsString&&"string"==typeof t&&(t=ms.parse(t));break;case es.FIXED64:case es.UINT64:"longAsString"in e&&e.longAsString&&"string"==typeof t&&(t=ms.uParse(t))}return t}function Si(e,t){switch(e.scalar){case es.INT64:case es.SFIXED64:case es.SINT64:"longAsString"in e&&e.longAsString?t=String(t):"string"!=typeof t&&"number"!=typeof t||(t=ms.parse(t));break;case es.FIXED64:case es.UINT64:"longAsString"in e&&e.longAsString?t=String(t):"string"!=typeof t&&"number"!=typeof t||(t=ms.uParse(t))}return t}function Ci(e){const t={$typeName:"google.protobuf.Struct",fields:{}};if(Ss(e))for(const[n,r]of Object.entries(e))t.fields[n]=Ei(r);return t}function Zi(e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=Vi(r);return t}function Vi(e){switch(e.kind.case){case"structValue":return Zi(e.kind.value);case"listValue":return e.kind.value.values.map(Vi);case"nullValue":case void 0:return null;default:return e.kind.value}}function Ei(e){const t={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof e){case"number":t.kind={case:"numberValue",value:e};break;case"string":t.kind={case:"stringValue",value:e};break;case"boolean":t.kind={case:"boolValue",value:e};break;case"object":if(null===e){const e=0;t.kind={case:"nullValue",value:e}}else if(Array.isArray(e)){const n={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(e))for(const t of e)n.values.push(Ei(t));t.kind={case:"listValue",value:n}}else t.kind={case:"structValue",value:Ci(e)}}return t}function Xi(e){const t=function(){if(!Wi){Wi=[];const e=Ni("std");for(let t=0;t<e.length;t++)Wi[e[t].charCodeAt(0)]=t;Wi["-".charCodeAt(0)]=e.indexOf("+"),Wi["_".charCodeAt(0)]=e.indexOf("/")}return Wi}();let n=3*e.length/4;"="==e[e.length-2]?n-=2:"="==e[e.length-1]&&(n-=1);let r,s=new Uint8Array(n),i=0,o=0,a=0;for(let c=0;c<e.length;c++){if(r=t[e.charCodeAt(c)],void 0===r)switch(e[c]){case"=":o=0;case"\n":case"\r":case"\t":case" ":continue;default:throw Error("invalid base64 string")}switch(o){case 0:a=r,o=1;break;case 1:s[i++]=a<<2|(48&r)>>4,a=r,o=2;break;case 2:s[i++]=(15&a)<<4|(60&r)>>2,a=r,o=3;break;case 3:s[i++]=(3&a)<<6|r,o=0}}if(1==o)throw Error("invalid base64 string");return s.subarray(0,i)}function Bi(e,t="std"){const n=Ni(t),r="std"==t;let s,i="",o=0,a=0;for(let c=0;c<e.length;c++)switch(s=e[c],o){case 0:i+=n[s>>2],a=(3&s)<<4,o=1;break;case 1:i+=n[a|s>>4],a=(15&s)<<2,o=2;break;case 2:i+=n[a|s>>6],i+=n[63&s],o=0}return o&&(i+=n[a],r&&(i+="=",1==o&&(i+="="))),i}let Ri,xi,Wi;function Ni(e){return Ri||(Ri="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),xi=Ri.slice(0,-2).concat("-","_")),"url"==e?xi:Ri}function Ji(e){let t=!1;const n=[];for(let r=0;r<e.length;r++){let s=e.charAt(r);switch(s){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n.push(s),t=!1;break;default:t&&(t=!1,s=s.toUpperCase()),n.push(s)}}return n.join("")}function ki(e){return e.replace(/[A-Z]/g,e=>"_"+e.toLowerCase())}const _i=/* @__PURE__ */new Set(["constructor","toString","toJSON","valueOf"]);function Fi(e){return _i.has(e)?e+"$":e}function Yi(e){for(const t of e.field)vs(t,"jsonName")||(t.jsonName=Ji(t.name));e.nestedType.forEach(Yi)}function Li(e,t){switch(e){case es.STRING:return t;case es.BYTES:{const n=function(e){const t=[],n={tail:e,c:"",next(){return 0!=this.tail.length&&(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(e){if(this.tail.length>=e){const t=this.tail.substring(0,e);return this.tail=this.tail.substring(e),t}return!1}};for(;n.next();)if("\\"===n.c){if(n.next())switch(n.c){case"\\":t.push(n.c.charCodeAt(0));break;case"b":t.push(8);break;case"f":t.push(12);break;case"n":t.push(10);break;case"r":t.push(13);break;case"t":t.push(9);break;case"v":t.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{const e=n.c,r=n.take(2);if(!1===r)return!1;const s=parseInt(e+r,8);if(Number.isNaN(s))return!1;t.push(s);break}case"x":{const e=n.c,r=n.take(2);if(!1===r)return!1;const s=parseInt(e+r,16);if(Number.isNaN(s))return!1;t.push(s);break}case"u":{const e=n.c,r=n.take(4);if(!1===r)return!1;const s=parseInt(e+r,16);if(Number.isNaN(s))return!1;const i=new Uint8Array(4);new DataView(i.buffer).setInt32(0,s,!0),t.push(i[0],i[1],i[2],i[3]);break}case"U":{const e=n.c,r=n.take(8);if(!1===r)return!1;const s=ms.uEnc(e+r),i=new Uint8Array(8),o=new DataView(i.buffer);o.setInt32(0,s.lo,!0),o.setInt32(4,s.hi,!0),t.push(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);break}}}else t.push(n.c.charCodeAt(0));return new Uint8Array(t)}(t);if(!1===n)throw new Error(`cannot parse ${es[e]} default value: ${t}`);return n}case es.INT64:case es.SFIXED64:case es.SINT64:return ms.parse(t);case es.UINT64:case es.FIXED64:return ms.uParse(t);case es.DOUBLE:case es.FLOAT:switch(t){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(t)}case es.BOOL:return"true"===t;case es.INT32:case es.UINT32:case es.SINT32:case es.FIXED32:case es.SFIXED32:return parseInt(t,10)}}function*Hi(e){switch(e.kind){case"file":for(const t of e.messages)yield t,yield*Hi(t);yield*e.enums,yield*e.services,yield*e.extensions;break;case"message":for(const t of e.nestedMessages)yield t,yield*Hi(t);yield*e.nestedEnums,yield*e.nestedExtensions}}function Ti(...e){const t=function(){const e=/* @__PURE__ */new Map,t=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map;return{kind:"registry",types:e,extendees:t,[Symbol.iterator]:()=>e.values(),get files(){return n.values()},addFile(e,t,r){if(n.set(e.proto.name,e),!t)for(const n of Hi(e))this.add(n);if(r)for(const n of e.dependencies)this.addFile(n,t,r)},add(n){if("extension"==n.kind){let e=t.get(n.extendee.typeName);e||t.set(n.extendee.typeName,e=/* @__PURE__ */new Map),e.set(n.number,n)}e.set(n.typeName,n)},get:t=>e.get(t),getFile:e=>n.get(e),getMessage(t){const n=e.get(t);return"message"==(null==n?void 0:n.kind)?n:void 0},getEnum(t){const n=e.get(t);return"enum"==(null==n?void 0:n.kind)?n:void 0},getExtension(t){const n=e.get(t);return"extension"==(null==n?void 0:n.kind)?n:void 0},getExtensionFor(e,n){var r;return null===(r=t.get(e.typeName))||void 0===r?void 0:r.get(n)},getService(t){const n=e.get(t);return"service"==(null==n?void 0:n.kind)?n:void 0}}}();if(!e.length)return t;if("$typeName"in e[0]&&"google.protobuf.FileDescriptorSet"==e[0].$typeName){for(const n of e[0].file)ao(n,t);return t}if("$typeName"in e[0]){let n=function(e){const r=[];for(const n of e.dependency){if(null!=t.getFile(n))continue;if(i.has(n))continue;const o=s(n);if(!o)throw new Error(`Unable to resolve ${n}, imported by ${e.name}`);"kind"in o?t.addFile(o,!1,!0):(i.add(o.name),r.push(o))}return r.concat(...r.map(n))};const r=e[0],s=e[1],i=/* @__PURE__ */new Set;for(const e of[r,...n(r)].reverse())ao(e,t)}else for(const n of e)for(const e of n.files)t.addFile(e);return t}const Oi=998,Mi=999,Ki=9,Ui=10,zi=11,Di=12,Pi=14,ji=3,Qi=2,$i=1,qi=0,eo=1,to=2,no=3,ro=1,so=2,io=1,oo={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function ao(e,t){var n,r;const s={kind:"file",proto:e,deprecated:null!==(r=null===(n=e.options)||void 0===n?void 0:n.deprecated)&&void 0!==r&&r,edition:fo(e),name:e.name.replace(/\.proto$/,""),dependencies:yo(e,t),enums:[],messages:[],extensions:[],services:[],toString:()=>`file ${e.name}`},i=/* @__PURE__ */new Map,o={get:e=>i.get(e),add(e){var t;So(!0===(null===(t=e.proto.options)||void 0===t?void 0:t.mapEntry)),i.set(e.typeName,e)}};for(const a of e.enumType)uo(a,s,void 0,t);for(const a of e.messageType)ho(a,s,void 0,t,o);for(const a of e.service)mo(a,s,t);co(s,t);for(const a of i.values())lo(a,t,o);for(const a of s.messages)lo(a,t,o),co(a,t);t.addFile(s,!0)}function co(e,t){switch(e.kind){case"file":for(const n of e.proto.extension){const r=po(n,e,t);e.extensions.push(r),t.add(r)}break;case"message":for(const n of e.proto.extension){const r=po(n,e,t);e.nestedExtensions.push(r),t.add(r)}for(const n of e.nestedMessages)co(n,t)}}function lo(e,t,n){const r=e.proto.oneofDecl.map(t=>function(e,t){return{kind:"oneof",proto:e,deprecated:!1,parent:t,fields:[],name:e.name,localName:Fi(Ji(e.name)),toString(){return`oneof ${t.typeName}.${this.name}`}}}(t,e)),s=/* @__PURE__ */new Set;for(const i of e.proto.field){const o=wo(i,r),a=po(i,e,t,o,n);e.fields.push(a),e.field[a.localName]=a,void 0===o?e.members.push(a):(o.fields.push(a),s.has(o)||(s.add(o),e.members.push(o)))}for(const i of r.filter(e=>s.has(e)))e.oneofs.push(i);for(const i of e.nestedMessages)lo(i,t,n)}function uo(e,t,n,r){var s,i,o,a,c;const l=function(e,t){const n=(r=e,(r.substring(0,1)+r.substring(1).replace(/[A-Z]/g,e=>"_"+e)).toLowerCase()+"_");var r;for(const s of t){if(!s.name.toLowerCase().startsWith(n))return;const e=s.name.substring(n.length);if(0==e.length)return;if(/^\d/.test(e))return}return n}(e.name,e.value),u={kind:"enum",proto:e,deprecated:null!==(i=null===(s=e.options)||void 0===s?void 0:s.deprecated)&&void 0!==i&&i,file:t,parent:n,open:!0,name:e.name,typeName:bo(e,n,t),value:{},values:[],sharedPrefix:l,toString(){return`enum ${this.typeName}`}};u.open=function(e){var t;return io==Ao("enumType",{proto:e.proto,parent:null!==(t=e.parent)&&void 0!==t?t:e.file})}(u),r.add(u);for(const d of e.value){const e=d.name;u.values.push(u.value[d.number]={kind:"enum_value",proto:d,deprecated:null!==(a=null===(o=d.options)||void 0===o?void 0:o.deprecated)&&void 0!==a&&a,parent:u,name:e,localName:Fi(null==l?e:e.substring(l.length)),number:d.number,toString:()=>`enum value ${u.typeName}.${e}`})}(null!==(c=null==n?void 0:n.nestedEnums)&&void 0!==c?c:t.enums).push(u)}function ho(e,t,n,r,s){var i,o,a,c;const l={kind:"message",proto:e,deprecated:null!==(o=null===(i=e.options)||void 0===i?void 0:i.deprecated)&&void 0!==o&&o,file:t,parent:n,name:e.name,typeName:bo(e,n,t),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};!0===(null===(a=e.options)||void 0===a?void 0:a.mapEntry)?s.add(l):((null!==(c=null==n?void 0:n.nestedMessages)&&void 0!==c?c:t.messages).push(l),r.add(l));for(const u of e.enumType)uo(u,t,l,r);for(const u of e.nestedType)ho(u,t,l,r,s)}function mo(e,t,n){var r,s;const i={kind:"service",proto:e,deprecated:null!==(s=null===(r=e.options)||void 0===r?void 0:r.deprecated)&&void 0!==s&&s,file:t,name:e.name,typeName:bo(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};t.services.push(i),n.add(i);for(const o of e.method){const e=go(o,i,n);i.methods.push(e),i.method[e.localName]=e}}function go(e,t,n){var r,s,i,o;let a;a=e.clientStreaming&&e.serverStreaming?"bidi_streaming":e.clientStreaming?"client_streaming":e.serverStreaming?"server_streaming":"unary";const c=n.getMessage(Io(e.inputType)),l=n.getMessage(Io(e.outputType));So(c,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),So(l,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);const u=e.name;return{kind:"rpc",proto:e,deprecated:null!==(s=null===(r=e.options)||void 0===r?void 0:r.deprecated)&&void 0!==s&&s,parent:t,name:u,localName:Fi(u.length?Fi(u[0].toLowerCase()+u.substring(1)):u),methodKind:a,input:c,output:l,idempotency:null!==(o=null===(i=e.options)||void 0===i?void 0:i.idempotencyLevel)&&void 0!==o?o:qi,toString:()=>`rpc ${t.typeName}.${u}`}}function po(e,t,n,r,s){var i,o,a;const c=void 0===s,l={kind:"field",proto:e,deprecated:null!==(o=null===(i=e.options)||void 0===i?void 0:i.deprecated)&&void 0!==o&&o,name:e.name,number:e.number,scalar:void 0,message:void 0,enum:void 0,presence:vo(e,r,c,t),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(c){const r="file"==t.kind?t:t.file,s="file"==t.kind?void 0:t,i=bo(e,s,r);l.kind="extension",l.file=r,l.parent=s,l.oneof=void 0,l.typeName=i,l.jsonName=`[${i}]`,l.toString=()=>`extension ${i}`;const o=n.getMessage(Io(e.extendee));So(o,`invalid FieldDescriptorProto: extendee ${e.extendee} not found`),l.extendee=o}else{const n=t;So("message"==n.kind),l.parent=n,l.oneof=r,l.localName=r?Ji(e.name):Fi(Ji(e.name)),l.jsonName=e.jsonName,l.toString=()=>`field ${n.typeName}.${e.name}`}const u=e.label,d=e.type,h=null===(a=e.options)||void 0===a?void 0:a.jstype;if(u===ji){const r=d==zi?null==s?void 0:s.get(Io(e.typeName)):void 0;if(r){l.fieldKind="map";const{key:e,value:t}=function(e){const t=e.fields.find(e=>1===e.number),n=e.fields.find(e=>2===e.number);return So(t&&"scalar"==t.fieldKind&&t.scalar!=es.BYTES&&t.scalar!=es.FLOAT&&t.scalar!=es.DOUBLE&&n&&"list"!=n.fieldKind&&"map"!=n.fieldKind),{key:t,value:n}}(r);return l.mapKey=e.scalar,l.mapKind=t.fieldKind,l.message=t.message,l.delimitedEncoding=!1,l.enum=t.enum,l.scalar=t.scalar,l}switch(l.fieldKind="list",d){case zi:case Ui:l.listKind="message",l.message=n.getMessage(Io(e.typeName)),So(l.message),l.delimitedEncoding=Go(e,t);break;case Pi:l.listKind="enum",l.enum=n.getEnum(Io(e.typeName)),So(l.enum);break;default:l.listKind="scalar",l.scalar=d,l.longAsString=h==$i}return l.packed=function(e,t){if(e.label!=ji)return!1;switch(e.type){case Ki:case Di:case Ui:case zi:return!1}const n=e.options;if(n&&vs(n,"packed"))return n.packed;return ro==Ao("repeatedFieldEncoding",{proto:e,parent:t})}(e,t),l}switch(d){case zi:case Ui:l.fieldKind="message",l.message=n.getMessage(Io(e.typeName)),So(l.message,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),l.delimitedEncoding=Go(e,t),l.getDefaultValue=()=>{};break;case Pi:{const t=n.getEnum(Io(e.typeName));So(void 0!==t,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),l.fieldKind="enum",l.enum=n.getEnum(Io(e.typeName)),l.getDefaultValue=()=>vs(e,"defaultValue")?function(e,t){const n=e.values.find(e=>e.name===t);if(!n)throw new Error(`cannot parse ${e} default value: ${t}`);return n.number}(t,e.defaultValue):void 0;break}default:l.fieldKind="scalar",l.scalar=d,l.longAsString=h==$i,l.getDefaultValue=()=>vs(e,"defaultValue")?Li(d,e.defaultValue):void 0}return l}function fo(e){switch(e.syntax){case"":case"proto2":return Oi;case"proto3":return Mi;case"editions":if(e.edition in oo)return e.edition;throw new Error(`${e.name}: unsupported edition`);default:throw new Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}function yo(e,t){return e.dependency.map(n=>{const r=t.getFile(n);if(!r)throw new Error(`Cannot find ${n}, imported by ${e.name}`);return r})}function bo(e,t,n){let r;return r=t?`${t.typeName}.${e.name}`:n.proto.package.length>0?`${n.proto.package}.${e.name}`:`${e.name}`,r}function Io(e){return e.startsWith(".")?e.substring(1):e}function wo(e,t){if(!vs(e,"oneofIndex"))return;if(e.proto3Optional)return;const n=t[e.oneofIndex];return So(n,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),n}function vo(e,t,n,r){if(e.label==Qi)return no;if(e.label==ji)return to;if(t||e.proto3Optional)return eo;if(n)return eo;const s=Ao("fieldPresence",{proto:e,parent:r});return s!=to||e.type!=zi&&e.type!=Ui?s:eo}function Go(e,t){return e.type==Ui||so==Ao("messageEncoding",{proto:e,parent:t})}function Ao(e,t){var n,r;const s=null===(n=t.proto.options)||void 0===n?void 0:n.features;if(s){const t=s[e];if(0!=t)return t}if("kind"in t){if("message"==t.kind)return Ao(e,null!==(r=t.parent)&&void 0!==r?r:t.file);const n=oo[t.edition];if(!n)throw new Error(`feature default for edition ${t.edition} not found`);return n[e]}return Ao(e,t.parent)}function So(e,t){if(!e)throw new Error(t)}function Co(e){const t=function(e){const t=/* @__PURE__ */Object.create({syntax:"",edition:0});return Object.assign(t,Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},e),{messageType:e.messageType.map(Zo),enumType:e.enumType.map(Xo)}))}(e);t.messageType.forEach(Yi);return Ti(t,()=>{}).getFile(t.name)}function Zo(e){var t,n,r,s,i,o,a,c;const l=/* @__PURE__ */Object.create({visibility:0});return Object.assign(l,{$typeName:"google.protobuf.DescriptorProto",name:e.name,field:null!==(n=null===(t=e.field)||void 0===t?void 0:t.map(Vo))&&void 0!==n?n:[],extension:[],nestedType:null!==(s=null===(r=e.nestedType)||void 0===r?void 0:r.map(Zo))&&void 0!==s?s:[],enumType:null!==(o=null===(i=e.enumType)||void 0===i?void 0:i.map(Xo))&&void 0!==o?o:[],extensionRange:null!==(c=null===(a=e.extensionRange)||void 0===a?void 0:a.map(e=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},e)))&&void 0!==c?c:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function Vo(e){const t=/* @__PURE__ */Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1});return Object.assign(t,Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},e),{options:e.options?Eo(e.options):void 0}))}function Eo(e){var t,n,r;const s=/* @__PURE__ */Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0});return Object.assign(s,Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},e),{targets:null!==(t=e.targets)&&void 0!==t?t:[],editionDefaults:null!==(r=null===(n=e.editionDefaults)||void 0===n?void 0:n.map(e=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},e)))&&void 0!==r?r:[],uninterpretedOption:[]}))}function Xo(e){const t=/* @__PURE__ */Object.create({visibility:0});return Object.assign(t,{$typeName:"google.protobuf.EnumDescriptorProto",name:e.name,reservedName:[],reservedRange:[],value:e.value.map(e=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},e))})}function Bo(e,t,...n){return n.reduce((e,t)=>e.nestedMessages[t],e.messages[t])}const Ro=/* @__PURE__ */Co({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"option_dependency",number:15,type:9,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3},{name:"visibility",number:11,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3},{name:"visibility",number:6,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false"},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false",options:{deprecated:!0}},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.OptionTargetType"},{name:"edition_defaults",number:20,type:11,label:3,typeName:".google.protobuf.FieldOptions.EditionDefault"},{name:"features",number:21,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"feature_support",number:22,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],nestedType:[{name:"EditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"value",number:2,type:9,label:1}]},{name:"FeatureSupport",field:[{name:"edition_introduced",number:1,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"edition_deprecated",number:2,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"deprecation_warning",number:3,type:9,label:1},{name:"edition_removed",number:4,type:14,label:1,typeName:".google.protobuf.Edition"}]}],enumType:[{name:"CType",value:[{name:"STRING",number:0},{name:"CORD",number:1},{name:"STRING_PIECE",number:2}]},{name:"JSType",value:[{name:"JS_NORMAL",number:0},{name:"JS_STRING",number:1},{name:"JS_NUMBER",number:2}]},{name:"OptionRetention",value:[{name:"RETENTION_UNKNOWN",number:0},{name:"RETENTION_RUNTIME",number:1},{name:"RETENTION_SOURCE",number:2}]},{name:"OptionTargetType",value:[{name:"TARGET_TYPE_UNKNOWN",number:0},{name:"TARGET_TYPE_FILE",number:1},{name:"TARGET_TYPE_EXTENSION_RANGE",number:2},{name:"TARGET_TYPE_MESSAGE",number:3},{name:"TARGET_TYPE_FIELD",number:4},{name:"TARGET_TYPE_ONEOF",number:5},{name:"TARGET_TYPE_ENUM",number:6},{name:"TARGET_TYPE_ENUM_ENTRY",number:7},{name:"TARGET_TYPE_SERVICE",number:8},{name:"TARGET_TYPE_METHOD",number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"OneofOptions",field:[{name:"features",number:1,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumOptions",field:[{name:"allow_alias",number:2,type:8,label:1},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"deprecated_legacy_json_field_conflicts",number:6,type:8,label:1,options:{deprecated:!0}},{name:"features",number:7,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumValueOptions",field:[{name:"deprecated",number:1,type:8,label:1,defaultValue:"false"},{name:"features",number:2,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"debug_redact",number:3,type:8,label:1,defaultValue:"false"},{name:"feature_support",number:4,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"ServiceOptions",field:[{name:"features",number:34,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"MethodOptions",field:[{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"idempotency_level",number:34,type:14,label:1,typeName:".google.protobuf.MethodOptions.IdempotencyLevel",defaultValue:"IDEMPOTENCY_UNKNOWN"},{name:"features",number:35,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"IdempotencyLevel",value:[{name:"IDEMPOTENCY_UNKNOWN",number:0},{name:"NO_SIDE_EFFECTS",number:1},{name:"IDEMPOTENT",number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"UninterpretedOption",field:[{name:"name",number:2,type:11,label:3,typeName:".google.protobuf.UninterpretedOption.NamePart"},{name:"identifier_value",number:3,type:9,label:1},{name:"positive_int_value",number:4,type:4,label:1},{name:"negative_int_value",number:5,type:3,label:1},{name:"double_value",number:6,type:1,label:1},{name:"string_value",number:7,type:12,label:1},{name:"aggregate_value",number:8,type:9,label:1}],nestedType:[{name:"NamePart",field:[{name:"name_part",number:1,type:9,label:2},{name:"is_extension",number:2,type:8,label:2}]}]},{name:"FeatureSet",field:[{name:"field_presence",number:1,type:14,label:1,typeName:".google.protobuf.FeatureSet.FieldPresence",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPLICIT",edition:900},{value:"IMPLICIT",edition:999},{value:"EXPLICIT",edition:1e3}]}},{name:"enum_type",number:2,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnumType",options:{retention:1,targets:[6,1],editionDefaults:[{value:"CLOSED",edition:900},{value:"OPEN",edition:999}]}},{name:"repeated_field_encoding",number:3,type:14,label:1,typeName:".google.protobuf.FeatureSet.RepeatedFieldEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPANDED",edition:900},{value:"PACKED",edition:999}]}},{name:"utf8_validation",number:4,type:14,label:1,typeName:".google.protobuf.FeatureSet.Utf8Validation",options:{retention:1,targets:[4,1],editionDefaults:[{value:"NONE",edition:900},{value:"VERIFY",edition:999}]}},{name:"message_encoding",number:5,type:14,label:1,typeName:".google.protobuf.FeatureSet.MessageEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"LENGTH_PREFIXED",edition:900}]}},{name:"json_format",number:6,type:14,label:1,typeName:".google.protobuf.FeatureSet.JsonFormat",options:{retention:1,targets:[3,6,1],editionDefaults:[{value:"LEGACY_BEST_EFFORT",edition:900},{value:"ALLOW",edition:999}]}},{name:"enforce_naming_style",number:7,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnforceNamingStyle",options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:"STYLE_LEGACY",edition:900},{value:"STYLE2024",edition:1001}]}},{name:"default_symbol_visibility",number:8,type:14,label:1,typeName:".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility",options:{retention:2,targets:[1],editionDefaults:[{value:"EXPORT_ALL",edition:900},{value:"EXPORT_TOP_LEVEL",edition:1001}]}}],nestedType:[{name:"VisibilityFeature",enumType:[{name:"DefaultSymbolVisibility",value:[{name:"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",number:0},{name:"EXPORT_ALL",number:1},{name:"EXPORT_TOP_LEVEL",number:2},{name:"LOCAL_ALL",number:3},{name:"STRICT",number:4}]}]}],enumType:[{name:"FieldPresence",value:[{name:"FIELD_PRESENCE_UNKNOWN",number:0},{name:"EXPLICIT",number:1},{name:"IMPLICIT",number:2},{name:"LEGACY_REQUIRED",number:3}]},{name:"EnumType",value:[{name:"ENUM_TYPE_UNKNOWN",number:0},{name:"OPEN",number:1},{name:"CLOSED",number:2}]},{name:"RepeatedFieldEncoding",value:[{name:"REPEATED_FIELD_ENCODING_UNKNOWN",number:0},{name:"PACKED",number:1},{name:"EXPANDED",number:2}]},{name:"Utf8Validation",value:[{name:"UTF8_VALIDATION_UNKNOWN",number:0},{name:"VERIFY",number:2},{name:"NONE",number:3}]},{name:"MessageEncoding",value:[{name:"MESSAGE_ENCODING_UNKNOWN",number:0},{name:"LENGTH_PREFIXED",number:1},{name:"DELIMITED",number:2}]},{name:"JsonFormat",value:[{name:"JSON_FORMAT_UNKNOWN",number:0},{name:"ALLOW",number:1},{name:"LEGACY_BEST_EFFORT",number:2}]},{name:"EnforceNamingStyle",value:[{name:"ENFORCE_NAMING_STYLE_UNKNOWN",number:0},{name:"STYLE2024",number:1},{name:"STYLE_LEGACY",number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:"FeatureSetDefaults",field:[{name:"defaults",number:1,type:11,label:3,typeName:".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"},{name:"minimum_edition",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"maximum_edition",number:5,type:14,label:1,typeName:".google.protobuf.Edition"}],nestedType:[{name:"FeatureSetEditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"overridable_features",number:4,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"fixed_features",number:5,type:11,label:1,typeName:".google.protobuf.FeatureSet"}]}]},{name:"SourceCodeInfo",field:[{name:"location",number:1,type:11,label:3,typeName:".google.protobuf.SourceCodeInfo.Location"}],nestedType:[{name:"Location",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"span",number:2,type:5,label:3,options:{packed:!0}},{name:"leading_comments",number:3,type:9,label:1},{name:"trailing_comments",number:4,type:9,label:1},{name:"leading_detached_comments",number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:"GeneratedCodeInfo",field:[{name:"annotation",number:1,type:11,label:3,typeName:".google.protobuf.GeneratedCodeInfo.Annotation"}],nestedType:[{name:"Annotation",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"source_file",number:2,type:9,label:1},{name:"begin",number:3,type:5,label:1},{name:"end",number:4,type:5,label:1},{name:"semantic",number:5,type:14,label:1,typeName:".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"}],enumType:[{name:"Semantic",value:[{name:"NONE",number:0},{name:"SET",number:1},{name:"ALIAS",number:2}]}]}]}],enumType:[{name:"Edition",value:[{name:"EDITION_UNKNOWN",number:0},{name:"EDITION_LEGACY",number:900},{name:"EDITION_PROTO2",number:998},{name:"EDITION_PROTO3",number:999},{name:"EDITION_2023",number:1e3},{name:"EDITION_2024",number:1001},{name:"EDITION_UNSTABLE",number:9999},{name:"EDITION_1_TEST_ONLY",number:1},{name:"EDITION_2_TEST_ONLY",number:2},{name:"EDITION_99997_TEST_ONLY",number:99997},{name:"EDITION_99998_TEST_ONLY",number:99998},{name:"EDITION_99999_TEST_ONLY",number:99999},{name:"EDITION_MAX",number:2147483647}]},{name:"SymbolVisibility",value:[{name:"VISIBILITY_UNSET",number:0},{name:"VISIBILITY_LOCAL",number:1},{name:"VISIBILITY_EXPORT",number:2}]}]}),xo=/* @__PURE__ */Bo(Ro,1);var Wo,No,Jo,ko,_o,Fo,Yo,Lo,Ho,To,Oo,Mo,Ko,Uo,zo,Do,Po,jo,Qo,$o,qo,ea,ta,na,ra,sa,ia,oa,aa,ca,la,ua,da,ha,ma,ga,pa,fa,ya,ba;(No=Wo||(Wo={}))[No.DECLARATION=0]="DECLARATION",No[No.UNVERIFIED=1]="UNVERIFIED",(ko=Jo||(Jo={}))[ko.DOUBLE=1]="DOUBLE",ko[ko.FLOAT=2]="FLOAT",ko[ko.INT64=3]="INT64",ko[ko.UINT64=4]="UINT64",ko[ko.INT32=5]="INT32",ko[ko.FIXED64=6]="FIXED64",ko[ko.FIXED32=7]="FIXED32",ko[ko.BOOL=8]="BOOL",ko[ko.STRING=9]="STRING",ko[ko.GROUP=10]="GROUP",ko[ko.MESSAGE=11]="MESSAGE",ko[ko.BYTES=12]="BYTES",ko[ko.UINT32=13]="UINT32",ko[ko.ENUM=14]="ENUM",ko[ko.SFIXED32=15]="SFIXED32",ko[ko.SFIXED64=16]="SFIXED64",ko[ko.SINT32=17]="SINT32",ko[ko.SINT64=18]="SINT64",(Fo=_o||(_o={}))[Fo.OPTIONAL=1]="OPTIONAL",Fo[Fo.REPEATED=3]="REPEATED",Fo[Fo.REQUIRED=2]="REQUIRED",(Lo=Yo||(Yo={}))[Lo.SPEED=1]="SPEED",Lo[Lo.CODE_SIZE=2]="CODE_SIZE",Lo[Lo.LITE_RUNTIME=3]="LITE_RUNTIME",(To=Ho||(Ho={}))[To.STRING=0]="STRING",To[To.CORD=1]="CORD",To[To.STRING_PIECE=2]="STRING_PIECE",(Mo=Oo||(Oo={}))[Mo.JS_NORMAL=0]="JS_NORMAL",Mo[Mo.JS_STRING=1]="JS_STRING",Mo[Mo.JS_NUMBER=2]="JS_NUMBER",(Uo=Ko||(Ko={}))[Uo.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",Uo[Uo.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",Uo[Uo.RETENTION_SOURCE=2]="RETENTION_SOURCE",(Do=zo||(zo={}))[Do.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",Do[Do.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",Do[Do.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",Do[Do.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",Do[Do.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",Do[Do.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",Do[Do.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",Do[Do.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",Do[Do.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",Do[Do.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD",(jo=Po||(Po={}))[jo.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",jo[jo.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",jo[jo.IDEMPOTENT=2]="IDEMPOTENT",($o=Qo||(Qo={}))[$o.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0]="DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",$o[$o.EXPORT_ALL=1]="EXPORT_ALL",$o[$o.EXPORT_TOP_LEVEL=2]="EXPORT_TOP_LEVEL",$o[$o.LOCAL_ALL=3]="LOCAL_ALL",$o[$o.STRICT=4]="STRICT",(ea=qo||(qo={}))[ea.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",ea[ea.EXPLICIT=1]="EXPLICIT",ea[ea.IMPLICIT=2]="IMPLICIT",ea[ea.LEGACY_REQUIRED=3]="LEGACY_REQUIRED",(na=ta||(ta={}))[na.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",na[na.OPEN=1]="OPEN",na[na.CLOSED=2]="CLOSED",(sa=ra||(ra={}))[sa.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",sa[sa.PACKED=1]="PACKED",sa[sa.EXPANDED=2]="EXPANDED",(oa=ia||(ia={}))[oa.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",oa[oa.VERIFY=2]="VERIFY",oa[oa.NONE=3]="NONE",(ca=aa||(aa={}))[ca.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",ca[ca.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",ca[ca.DELIMITED=2]="DELIMITED",(ua=la||(la={}))[ua.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",ua[ua.ALLOW=1]="ALLOW",ua[ua.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT",(ha=da||(da={}))[ha.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",ha[ha.STYLE2024=1]="STYLE2024",ha[ha.STYLE_LEGACY=2]="STYLE_LEGACY",(ga=ma||(ma={}))[ga.NONE=0]="NONE",ga[ga.SET=1]="SET",ga[ga.ALIAS=2]="ALIAS",(fa=pa||(pa={}))[fa.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",fa[fa.EDITION_LEGACY=900]="EDITION_LEGACY",fa[fa.EDITION_PROTO2=998]="EDITION_PROTO2",fa[fa.EDITION_PROTO3=999]="EDITION_PROTO3",fa[fa.EDITION_2023=1e3]="EDITION_2023",fa[fa.EDITION_2024=1001]="EDITION_2024",fa[fa.EDITION_UNSTABLE=9999]="EDITION_UNSTABLE",fa[fa.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",fa[fa.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",fa[fa.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",fa[fa.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",fa[fa.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",fa[fa.EDITION_MAX=2147483647]="EDITION_MAX",(ba=ya||(ya={}))[ba.VISIBILITY_UNSET=0]="VISIBILITY_UNSET",ba[ba.VISIBILITY_LOCAL=1]="VISIBILITY_LOCAL",ba[ba.VISIBILITY_EXPORT=2]="VISIBILITY_EXPORT";const Ia={readUnknownFields:!0};function wa(e,t,n){const r=ui(e,void 0,!1);return va(r,new $s(t),function(e){return e?Object.assign(Object.assign({},Ia),e):Ia}(n),!1,t.byteLength),r.message}function va(e,t,n,r,s){var i;const o=r?t.len:t.pos+s;let a,c;const l=null!==(i=e.getUnknown())&&void 0!==i?i:[];for(;t.pos<o&&([a,c]=t.tag(),!r||c!=Ms.EndGroup);){const r=e.findNumber(a);if(!r){const e=t.skip(c,a);n.readUnknownFields&&l.push({no:a,wireType:c,data:e});continue}Ga(e,t,r,c,n)}if(r&&(c!=Ms.EndGroup||a!==s))throw new Error("invalid end group tag");l.length>0&&e.setUnknown(l)}function Ga(e,t,n,r,s){var i;switch(n.fieldKind){case"scalar":e.set(n,Sa(t,n.scalar));break;case"enum":const o=Sa(t,es.INT32);if(n.enum.open)e.set(n,o);else{if(n.enum.values.some(e=>e.number===o))e.set(n,o);else if(s.readUnknownFields){const t=[];ds(o,t);const s=null!==(i=e.getUnknown())&&void 0!==i?i:[];s.push({no:n.number,wireType:r,data:new Uint8Array(t)}),e.setUnknown(s)}}break;case"message":e.set(n,Aa(t,s,n,e.get(n)));break;case"list":!function(e,t,n,r){var s;const i=n.field();if("message"===i.listKind)return void n.add(Aa(e,r,i));const o=null!==(s=i.scalar)&&void 0!==s?s:es.INT32,a=t==Ms.LengthDelimited&&o!=es.STRING&&o!=es.BYTES;if(!a)return void n.add(Sa(e,o));const c=e.uint32()+e.pos;for(;e.pos<c;)n.add(Sa(e,o))}(t,r,e.get(n),s);break;case"map":!function(e,t,n){const r=t.field();let s,i;const o=e.uint32(),a=e.pos+o;for(;e.pos<a;){const[t]=e.tag();switch(t){case 1:s=Sa(e,r.mapKey);break;case 2:switch(r.mapKind){case"scalar":i=Sa(e,r.scalar);break;case"enum":i=e.int32();break;case"message":i=Aa(e,n,r)}}}void 0===s&&(s=ys(r.mapKey,!1));if(void 0===i)switch(r.mapKind){case"scalar":i=ys(r.scalar,!1);break;case"enum":i=r.enum.values[0].number;break;case"message":i=ui(r.message,void 0,!1)}t.set(s,i)}(t,e.get(n),s)}}function Aa(e,t,n,r){const s=n.delimitedEncoding,i=null!=r?r:ui(n.message,void 0,!1);return va(i,e,t,s,s?n.number:e.uint32()),i}function Sa(e,t){switch(t){case es.STRING:return e.string();case es.BOOL:return e.bool();case es.DOUBLE:return e.double();case es.FLOAT:return e.float();case es.INT32:return e.int32();case es.INT64:return e.int64();case es.UINT64:return e.uint64();case es.FIXED64:return e.fixed64();case es.BYTES:return e.bytes();case es.FIXED32:return e.fixed32();case es.SFIXED32:return e.sfixed32();case es.SFIXED64:return e.sfixed64();case es.SINT64:return e.sint64();case es.UINT32:return e.uint32();case es.SINT32:return e.sint32()}}function Ca(e,t){var n;const r=wa(xo,Xi(e));r.messageType.forEach(Yi),r.dependency=null!==(n=null==t?void 0:t.map(e=>e.proto.name))&&void 0!==n?n:[];return Ti(r,e=>null==t?void 0:t.find(t=>t.proto.name===e)).getFile(r.name)}const Za=/* @__PURE__ */Ca("Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJvdG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MYAiABKAVChQEKE2NvbS5nb29nbGUucHJvdG9idWZCDlRpbWVzdGFtcFByb3RvUAFaMmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3RpbWVzdGFtcHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),Va=/* @__PURE__ */Ca("Ch5nb29nbGUvcHJvdG9idWYvZHVyYXRpb24ucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIqCghEdXJhdGlvbhIPCgdzZWNvbmRzGAEgASgDEg0KBW5hbm9zGAIgASgFQoMBChNjb20uZ29vZ2xlLnByb3RvYnVmQg1EdXJhdGlvblByb3RvUAFaMWdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2R1cmF0aW9ucGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw"),Ea=/* @__PURE__ */Bo(/* @__PURE__ */Ca("Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),0),Xa={writeUnknownFields:!0};function Ba(e,t,n){return Ra(new Qs,function(e){return e?Object.assign(Object.assign({},Xa),e):Xa}(n),ui(e,t)).finish()}function Ra(e,t,n){var r;for(const s of n.sortedFields)if(n.isSet(s))xa(e,t,n,s);else if(3==s.presence)throw new Error(`cannot encode ${s} to binary: required field not set`);if(t.writeUnknownFields)for(const{no:s,wireType:i,data:o}of null!==(r=n.getUnknown())&&void 0!==r?r:[])e.tag(s,i).raw(o);return e}function xa(e,t,n,r){var s;switch(r.fieldKind){case"scalar":case"enum":Wa(e,n.desc.typeName,r.name,null!==(s=r.scalar)&&void 0!==s?s:es.INT32,r.number,n.get(r));break;case"list":!function(e,t,n,r){var s;if("message"==n.listKind){for(const s of r)Na(e,t,n,s);return}const i=null!==(s=n.scalar)&&void 0!==s?s:es.INT32;if(n.packed){if(!r.size)return;e.tag(n.number,Ms.LengthDelimited).fork();for(const t of r)ka(e,n.parent.typeName,n.name,i,t);return void e.join()}for(const o of r)Wa(e,n.parent.typeName,n.name,i,n.number,o)}(e,t,r,n.get(r));break;case"message":Na(e,t,r,n.get(r));break;case"map":for(const[s,i]of n.get(r))Ja(e,t,r,s,i)}}function Wa(e,t,n,r,s,i){ka(e.tag(s,function(e){switch(e){case es.BYTES:case es.STRING:return Ms.LengthDelimited;case es.DOUBLE:case es.FIXED64:case es.SFIXED64:return Ms.Bit64;case es.FIXED32:case es.SFIXED32:case es.FLOAT:return Ms.Bit32;default:return Ms.Varint}}(r)),t,n,r,i)}function Na(e,t,n,r){n.delimitedEncoding?Ra(e.tag(n.number,Ms.StartGroup),t,r).tag(n.number,Ms.EndGroup):Ra(e.tag(n.number,Ms.LengthDelimited).fork(),t,r).join()}function Ja(e,t,n,r,s){var i;switch(e.tag(n.number,Ms.LengthDelimited).fork(),Wa(e,n.parent.typeName,n.name,n.mapKey,1,r),n.mapKind){case"scalar":case"enum":Wa(e,n.parent.typeName,n.name,null!==(i=n.scalar)&&void 0!==i?i:es.INT32,2,s);break;case"message":Ra(e.tag(2,Ms.LengthDelimited).fork(),t,s).join()}e.join()}function ka(e,t,n,r,s){try{switch(r){case es.STRING:e.string(s);break;case es.BOOL:e.bool(s);break;case es.DOUBLE:e.double(s);break;case es.FLOAT:e.float(s);break;case es.INT32:e.int32(s);break;case es.INT64:e.int64(s);break;case es.UINT64:e.uint64(s);break;case es.FIXED64:e.fixed64(s);break;case es.BYTES:e.bytes(s);break;case es.FIXED32:e.fixed32(s);break;case es.SFIXED32:e.sfixed32(s);break;case es.SFIXED64:e.sfixed64(s);break;case es.SINT64:e.sint64(s);break;case es.UINT32:e.uint32(s);break;case es.SINT32:e.sint32(s)}}catch(i){if(i instanceof Error)throw new Error(`cannot encode field ${t}.${n} to binary: ${i.message}`);throw i}}function _a(e,t){if(""===e.typeUrl)return;const n="message"==t.kind?t:t.getMessage(Fa(e.typeUrl));return n&&function(e,t){return""!==e.typeUrl&&("string"==typeof t?t:t.typeName)===Fa(e.typeUrl)}(e,n)?wa(n,e.value):void 0}function Fa(e){const t=e.lastIndexOf("/"),n=t>=0?e.substring(t+1):e;if(!n.length)throw new Error(`invalid type url: ${e}`);return n}const Ya=/* @__PURE__ */Ca("CiBnb29nbGUvcHJvdG9idWYvZmllbGRfbWFzay5wcm90bxIPZ29vZ2xlLnByb3RvYnVmIhoKCUZpZWxkTWFzaxINCgVwYXRocxgBIAMoCUKFAQoTY29tLmdvb2dsZS5wcm90b2J1ZkIORmllbGRNYXNrUHJvdG9QAVoyZ29vZ2xlLmdvbGFuZy5vcmcvcHJvdG9idWYvdHlwZXMva25vd24vZmllbGRtYXNrcGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw"),La=/* @__PURE__ */Ca("Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9idWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9idWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToCOAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJvdG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoMc3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8KDHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFaL2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),Ha=/* @__PURE__ */Bo(La,0),Ta=/* @__PURE__ */Bo(La,1),Oa=/* @__PURE__ */Bo(La,2);var Ma,Ka;function Ua(e,t){Pa(t,e);const n=function(e,t){if(void 0===e)return[];if("enum"===t.fieldKind||"scalar"===t.fieldKind){for(let n=e.length-1;n>=0;--n)if(e[n].no==t.number)return[e[n]];return[]}return e.filter(e=>e.no===t.number)}(e.$unknown,t),[r,s,i]=Da(t);for(const o of n)Ga(r,new $s(o.data),s,o.wireType,{readUnknownFields:!0});return i()}function za(e,t,n){var r;Pa(t,e);const s=(null!==(r=e.$unknown)&&void 0!==r?r:[]).filter(e=>e.no!==t.number),[i,o]=Da(t,n),a=new Qs;xa(a,{writeUnknownFields:!0},i,o);const c=new $s(a.finish());for(;c.pos<c.len;){const[e,t]=c.tag(),n=c.skip(t,e);s.push({no:e,wireType:t,data:n})}e.$unknown=s}function Da(e,t){const n=e.typeName,r=Object.assign(Object.assign({},e),{kind:"field",parent:e.extendee,localName:n}),s=Object.assign(Object.assign({},e.extendee),{fields:[r],members:[r],oneofs:[]}),i=Bs(s,void 0!==t?{[n]:t}:void 0);return[ui(s,i),r,()=>{const t=i[n];if(void 0===t){const t=e.message;return Es(t)?ys(t.fields[0].scalar,t.fields[0].longAsString):Bs(t)}return t}]}function Pa(e,t){if(e.extendee.typeName!=t.$typeName)throw new Error(`extension ${e.typeName} can only be applied to message ${e.extendee.typeName}`)}(Ka=Ma||(Ma={}))[Ka.NULL_VALUE=0]="NULL_VALUE";const ja={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function Qa(e,t,n){return $a(ui(e,t),function(e){return e?Object.assign(Object.assign({},ja),e):ja}(n))}function $a(e,t){var n;const r=function(e,t){if(!e.desc.typeName.startsWith("google.protobuf."))return;switch(e.desc.typeName){case"google.protobuf.Any":return function(e,t){if(""===e.typeUrl)return{};const{registry:n}=t;let r,s;n&&(r=_a(e,n),r&&(s=n.getMessage(r.$typeName)));if(!s||!r)throw new Error(`cannot encode message ${e.$typeName} to JSON: "${e.typeUrl}" is not in the type registry`);let i=$a(ui(s,r),t);(s.typeName.startsWith("google.protobuf.")||null===i||Array.isArray(i)||"object"!=typeof i)&&(i={value:i});return i["@type"]=e.typeUrl,i}(e.message,t);case"google.protobuf.Timestamp":return function(e){const t=1e3*Number(e.seconds);if(t<Date.parse("0001-01-01T00:00:00Z")||t>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot encode message ${e.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(e.nanos<0)throw new Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be negative`);if(e.nanos>999999999)throw new Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be greater than 99999999`);let n="Z";if(e.nanos>0){const t=(e.nanos+1e9).toString().substring(1);n="000000"===t.substring(3)?"."+t.substring(0,3)+"Z":"000"===t.substring(6)?"."+t.substring(0,6)+"Z":"."+t+"Z"}return new Date(t).toISOString().replace(".000Z",n)}(e.message);case"google.protobuf.Duration":return function(e){const t=Number(e.seconds),n=e.nanos;if(t>315576e6||t<-315576e6)throw new Error(`cannot encode message ${e.$typeName} to JSON: value out of range`);if(t>0&&n<0||t<0&&n>0)throw new Error(`cannot encode message ${e.$typeName} to JSON: nanos sign must match seconds sign`);let r=e.seconds.toString();if(0!==n){let e=Math.abs(n).toString();e="0".repeat(9-e.length)+e,"000000"===e.substring(3)?e=e.substring(0,3):"000"===e.substring(6)&&(e=e.substring(0,6)),r+="."+e,n<0&&0==t&&(r="-"+r)}return r+"s"}(e.message);case"google.protobuf.FieldMask":return(n=e.message).paths.map(e=>{if(ki(Ji(e))!==e)throw new Error(`cannot encode message ${n.$typeName} to JSON: lowerCamelCase of path name "${e}" is irreversible`);return Ji(e)}).join(",");case"google.protobuf.Struct":return rc(e.message);case"google.protobuf.Value":return sc(e.message);case"google.protobuf.ListValue":return ic(e.message);default:if(Es(e.desc)){const t=e.desc.fields[0];return tc(t,e.get(t))}return}var n}(e,t);if(void 0!==r)return r;const s={};for(const i of e.sortedFields){if(!e.isSet(i)){if(3==i.presence)throw new Error(`cannot encode ${i} to JSON: required field not set`);if(!t.alwaysEmitImplicit||2!==i.presence)continue}const n=qa(i,e.get(i),t);void 0!==n&&(s[nc(i,t)]=n)}if(t.registry){const r=/* @__PURE__ */new Set;for(const{no:i}of null!==(n=e.getUnknown())&&void 0!==n?n:[])if(!r.has(i)){r.add(i);const n=t.registry.getExtensionFor(e.desc,i);if(!n)continue;const o=Ua(e.message,n),[a,c]=Da(n,o),l=qa(c,a.get(c),t);void 0!==l&&(s[n.jsonName]=l)}}return s}function qa(e,t,n){switch(e.fieldKind){case"scalar":return tc(e,t);case"message":return $a(t,n);case"enum":return ec(e.enum,t,n.enumAsInteger);case"list":return function(e,t){const n=e.field(),r=[];switch(n.listKind){case"scalar":for(const t of e)r.push(tc(n,t));break;case"enum":for(const s of e)r.push(ec(n.enum,s,t.enumAsInteger));break;case"message":for(const n of e)r.push($a(n,t))}return t.alwaysEmitImplicit||r.length>0?r:void 0}(t,n);case"map":return function(e,t){const n=e.field(),r={};switch(n.mapKind){case"scalar":for(const[t,s]of e)r[t]=tc(n,s);break;case"message":for(const[n,s]of e)r[n]=$a(s,t);break;case"enum":for(const[s,i]of e)r[s]=ec(n.enum,i,t.enumAsInteger)}return t.alwaysEmitImplicit||e.size>0?r:void 0}(t,n)}}function ec(e,t,n){var r;if("number"!=typeof t)throw new Error(`cannot encode ${e} to JSON: expected number, got ${oi(t)}`);if("google.protobuf.NullValue"==e.typeName)return null;if(n)return t;const s=e.value[t];return null!==(r=null==s?void 0:s.name)&&void 0!==r?r:t}function tc(e,t){var n,r,s,i,o,a;switch(e.scalar){case es.INT32:case es.SFIXED32:case es.SINT32:case es.FIXED32:case es.UINT32:if("number"!=typeof t)throw new Error(`cannot encode ${e} to JSON: ${null===(n=ti(e,t))||void 0===n?void 0:n.message}`);return t;case es.FLOAT:case es.DOUBLE:if("number"!=typeof t)throw new Error(`cannot encode ${e} to JSON: ${null===(r=ti(e,t))||void 0===r?void 0:r.message}`);return Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t;case es.STRING:if("string"!=typeof t)throw new Error(`cannot encode ${e} to JSON: ${null===(s=ti(e,t))||void 0===s?void 0:s.message}`);return t;case es.BOOL:if("boolean"!=typeof t)throw new Error(`cannot encode ${e} to JSON: ${null===(i=ti(e,t))||void 0===i?void 0:i.message}`);return t;case es.UINT64:case es.FIXED64:case es.INT64:case es.SFIXED64:case es.SINT64:if("bigint"!=typeof t&&"string"!=typeof t)throw new Error(`cannot encode ${e} to JSON: ${null===(o=ti(e,t))||void 0===o?void 0:o.message}`);return t.toString();case es.BYTES:if(t instanceof Uint8Array)return Bi(t);throw new Error(`cannot encode ${e} to JSON: ${null===(a=ti(e,t))||void 0===a?void 0:a.message}`)}}function nc(e,t){return t.useProtoFieldName?e.name:e.jsonName}function rc(e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=sc(r);return t}function sc(e){switch(e.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(e.kind.value))throw new Error(`${e.$typeName} cannot be NaN or Infinity`);return e.kind.value;case"boolValue":case"stringValue":return e.kind.value;case"structValue":return rc(e.kind.value);case"listValue":return ic(e.kind.value);default:throw new Error(`${e.$typeName} must have a value`)}}function ic(e){return e.values.map(sc)}const oc={ignoreUnknownFields:!1};function ac(e,t,n){return function(e,t,n){const r=ui(e);try{uc(r,t,function(e){return e?Object.assign(Object.assign({},oc),e):oc}(n))}catch(i){if((s=i)instanceof Error&&Ls.includes(s.name)&&"field"in s&&"function"==typeof s.field)throw new Error(`cannot decode ${i.field()} from JSON: ${i.message}`,{cause:i});throw i}var s;return r.message}(e,function(e,t){try{return JSON.parse(e)}catch(n){const e=n instanceof Error?n.message:String(n);throw new Error(`cannot decode message ${t} from JSON: ${e}`,{cause:n})}}(t,e.typeName),n)}const cc=/* @__PURE__ */new WeakMap;function lc(e,t){var n;if(!cc.has(e)){const t=/* @__PURE__ */new Map;for(const n of e.fields)t.set(n.name,n).set(n.jsonName,n);cc.set(e,t)}return null===(n=cc.get(e))||void 0===n?void 0:n.get(t)}function uc(e,t,n){var r;if(function(e,t,n){if(!e.desc.typeName.startsWith("google.protobuf."))return!1;switch(e.desc.typeName){case"google.protobuf.Any":return function(e,t,n){var r;if(null===t||Array.isArray(t)||"object"!=typeof t)throw new Error(`cannot decode message ${e.$typeName} from JSON: expected object but got ${oi(t)}`);if(0==Object.keys(t).length)return;const s=t["@type"];if("string"!=typeof s||""==s)throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is empty`);const i=s.includes("/")?s.substring(s.lastIndexOf("/")+1):s;if(!i.length)throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is invalid`);const o=null===(r=n.registry)||void 0===r?void 0:r.getMessage(i);if(!o)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${s} is not in the type registry`);const a=ui(o);if(i.startsWith("google.protobuf.")&&Object.prototype.hasOwnProperty.call(t,"value")){uc(a,t.value,n)}else{const e=Object.assign({},t);delete e["@type"],uc(a,e,n)}!function(e,t,n){let r=!1;n||(n=Bs(Ea),r=!0),n.value=Ba(e,t),n.typeUrl=`type.googleapis.com/${t.$typeName}`}(a.desc,a.message,e)}(e.message,t,n),!0;case"google.protobuf.Timestamp":return function(e,t){if("string"!=typeof t)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${oi(t)}`);const n=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!n)throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);const r=Date.parse(n[1]+"-"+n[2]+"-"+n[3]+"T"+n[4]+":"+n[5]+":"+n[6]+(n[8]?n[8]:"Z"));if(Number.isNaN(r))throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);if(r<Date.parse("0001-01-01T00:00:00Z")||r>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot decode message ${e.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);e.seconds=ms.parse(r/1e3),e.nanos=0,n[7]&&(e.nanos=parseInt("1"+n[7]+"0".repeat(9-n[7].length))-1e9)}(e.message,t),!0;case"google.protobuf.Duration":return function(e,t){if("string"!=typeof t)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${oi(t)}`);const n=t.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(null===n)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${oi(t)}`);const r=Number(n[1]);if(r>315576e6||r<-315576e6)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${oi(t)}`);if(e.seconds=ms.parse(r),"string"!=typeof n[2])return;const s=n[2]+"0".repeat(9-n[2].length);e.nanos=parseInt(s),(r<0||Object.is(r,-0))&&(e.nanos=-e.nanos)}(e.message,t),!0;case"google.protobuf.FieldMask":return function(e,t){if("string"!=typeof t)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${oi(t)}`);if(""===t)return;e.paths=t.split(",").map(t=>{if(t.includes("_"))throw new Error(`cannot decode message ${e.$typeName} from JSON: path names must be lowerCamelCase`);return ki(t)})}(e.message,t),!0;case"google.protobuf.Struct":return Ic(e.message,t),!0;case"google.protobuf.Value":return wc(e.message,t),!0;case"google.protobuf.ListValue":return vc(e.message,t),!0;default:if(Es(e.desc)){const n=e.desc.fields[0];return null===t?e.clear(n):e.set(n,fc(n,t)),!0}return!1}}(e,t,n))return;if(null==t||Array.isArray(t)||"object"!=typeof t)throw new Error(`cannot decode ${e.desc} from JSON: ${oi(t)}`);const s=/* @__PURE__ */new Map;for(const[i,o]of Object.entries(t)){const t=lc(e.desc,i);if(t){if(t.oneof){if(null===o&&"scalar"==t.fieldKind)continue;const e=s.get(t.oneof);if(void 0!==e)throw new Hs(t.oneof,`oneof set multiple times by ${e.name} and ${t.name}`);s.set(t.oneof,t)}dc(e,t,o,n)}else{let t;if(i.startsWith("[")&&i.endsWith("]")&&(t=null===(r=n.registry)||void 0===r?void 0:r.getExtension(i.substring(1,i.length-1)))&&t.extendee.typeName===e.desc.typeName){const[r,s,i]=Da(t);dc(r,s,o,n),za(e.message,t,i())}if(!t&&!n.ignoreUnknownFields)throw new Error(`cannot decode ${e.desc} from JSON: key "${i}" is unknown`)}}}function dc(e,t,n,r){switch(t.fieldKind){case"scalar":!function(e,t,n){null===n?e.clear(t):e.set(t,fc(t,n))}(e,t,n);break;case"enum":!function(e,t,n,r){if(mc(t,n))return void e.clear(t);const s=pc(t.enum,n,r.ignoreUnknownFields);s!==gc&&e.set(t,s)}(e,t,n,r);break;case"message":!function(e,t,n,r){if(mc(t,n))return void e.clear(t);const s=e.isSet(t)?e.get(t):ui(t.message);uc(s,n,r),e.set(t,s)}(e,t,n,r);break;case"list":!function(e,t,n){if(null===t)return;const r=e.field();if(!Array.isArray(t))throw new Hs(r,"expected Array, got "+oi(t));for(const s of t){const t=hc(r,s,n);t!==gc&&e.add(t)}}(e.get(t),n,r);break;case"map":!function(e,t,n){if(null===t)return;const r=e.field();if("object"!=typeof t||Array.isArray(t))throw new Hs(r,"expected object, got "+oi(t));for(const[s,i]of Object.entries(t)){const t=yc(r.mapKey,s),o=hc(r,i,n);o!==gc&&e.set(t,o)}}(e.get(t),n,r)}}function hc(e,t,n){if(e.scalar&&null!==t)return fc(e,t);if(e.message&&!mc(e,t)){const r=ui(e.message);return uc(r,t,n),r}if(e.enum&&!mc(e,t))return pc(e.enum,t,n.ignoreUnknownFields);throw new Hs(e,("list"===e.fieldKind?"list item":"map value")+" must not be null")}function mc(e,t){var n,r;return null===t&&"google.protobuf.Value"!=(null===(n=e.message)||void 0===n?void 0:n.typeName)&&"google.protobuf.NullValue"!=(null===(r=e.enum)||void 0===r?void 0:r.typeName)}const gc=/* @__PURE__ */Symbol();function pc(e,t,n){if(null===t)return e.values[0].number;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":const r=e.values.find(e=>e.name===t);if(void 0!==r)return r.number;if(n)return gc}throw new Error(`cannot decode ${e} from JSON: ${oi(t)}`)}function fc(e,t){switch(e.scalar){case es.DOUBLE:case es.FLOAT:if("NaN"===t)return NaN;if("Infinity"===t)return Number.POSITIVE_INFINITY;if("-Infinity"===t)return Number.NEGATIVE_INFINITY;if("number"==typeof t){if(Number.isNaN(t))throw new Hs(e,"unexpected NaN number");if(!Number.isFinite(t))throw new Hs(e,"unexpected infinite number");break}if("string"==typeof t){if(""===t)break;if(t.trim().length!==t.length)break;const e=Number(t);if(!Number.isFinite(e))break;return e}break;case es.INT32:case es.FIXED32:case es.SFIXED32:case es.SINT32:case es.UINT32:return bc(t);case es.BYTES:if("string"==typeof t){if(""===t)return new Uint8Array(0);try{return Xi(t)}catch(n){const t=n instanceof Error?n.message:String(n);throw new Hs(e,t)}}}return t}function yc(e,t){switch(e){case es.BOOL:switch(t){case"true":return!0;case"false":return!1}return t;case es.INT32:case es.FIXED32:case es.UINT32:case es.SFIXED32:case es.SINT32:return bc(t);default:return t}}function bc(e){if("string"==typeof e){if(""===e)return e;if(e.trim().length!==e.length)return e;const t=Number(e);return Number.isNaN(t)?e:t}return e}function Ic(e,t){if("object"!=typeof t||null==t||Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${oi(t)}`);for(const[n,r]of Object.entries(t)){const t=Bs(Ta);wc(t,r),e.fields[n]=t}}function wc(e,t){switch(typeof t){case"number":e.kind={case:"numberValue",value:t};break;case"string":e.kind={case:"stringValue",value:t};break;case"boolean":e.kind={case:"boolValue",value:t};break;case"object":if(null===t)e.kind={case:"nullValue",value:Ma.NULL_VALUE};else if(Array.isArray(t)){const n=Bs(Oa);vc(n,t),e.kind={case:"listValue",value:n}}else{const n=Bs(Ha);Ic(n,t),e.kind={case:"structValue",value:n}}break;default:throw new Error(`cannot decode message ${e.$typeName} from JSON ${oi(t)}`)}return e}function vc(e,t){if(!Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${oi(t)}`);for(const n of t){const t=Bs(Ta);wc(t,n),e.values.push(t)}}function Gc(e){const t=$r[e];return"string"!=typeof t?e.toString():t[0].toLowerCase()+t.substring(1).replace(/[A-Z]/g,e=>"_"+e.toLowerCase())}let Ac;class Sc extends Error{constructor(e,t=$r.Unknown,n,r,s){super(function(e,t){return e.length?`[${Gc(t)}] ${e}`:`[${Gc(t)}]`}(e,t)),this.name="ConnectError",Object.setPrototypeOf(this,new.target.prototype),this.rawMessage=e,this.code=t,this.metadata=new Headers(null!=n?n:{}),this.details=null!=r?r:[],this.cause=s}static from(e,t=$r.Unknown){return e instanceof Sc?e:e instanceof Error?"AbortError"==e.name||"TimeoutError"==e.name?new Sc(e.message,$r.Canceled):new Sc(e.message,t,void 0,void 0,e):new Sc(String(e),t,void 0,void 0,e)}static[Symbol.hasInstance](e){return e instanceof Error&&(Object.getPrototypeOf(e)===Sc.prototype||"ConnectError"===e.name&&"code"in e&&"number"==typeof e.code&&"metadata"in e&&"details"in e&&Array.isArray(e.details)&&"rawMessage"in e&&"string"==typeof e.rawMessage&&"cause"in e)}findDetails(e){const t="message"===e.kind?{getMessage:t=>t===e.typeName?e:void 0}:e,n=[];for(const s of this.details){if("desc"in s){t.getMessage(s.desc.typeName)&&n.push(Bs(s.desc,s.value));continue}const e=t.getMessage(s.type);if(e)try{n.push(wa(e,s.value))}catch(r){}}return n}}function Cc(...e){const t=new Headers;for(const n of e)n.forEach((e,n)=>{t.append(n,e)});return t}const Zc=4294967295,Vc=Zc;function Ec(e,t,n=!1){if(t>e){let r=`message size is larger than configured readMaxBytes ${e}`;throw n&&(r=`message size ${t} is larger than configured readMaxBytes ${e}`),new Sc(r,$r.ResourceExhausted)}}class Xc{constructor(e){this.readMaxBytes=e,this.header=new Uint8Array(5),this.headerView=new DataView(this.header.buffer),this.buf=[]}get byteLength(){return this.buf.reduce((e,t)=>e+t.byteLength,0)}decode(e){this.buf.push(e);const t=[];for(;;){let e=this.pop();if(!e)break;t.push(e)}return t}pop(){if((this.env||(this.env=this.head(),this.env))&&this.cons(this.env.data)){const e=this.env;return this.env=void 0,e}}head(){if(!this.cons(this.header))return;const e=this.headerView.getUint8(0),t=this.headerView.getUint32(1);return Ec(this.readMaxBytes,t,!0),{flags:e,data:new Uint8Array(t)}}cons(e){const t=e.byteLength;if(this.byteLength<t)return!1;let n=0;for(;n<t;){const r=this.buf.shift();r.byteLength>t-n?(e.set(r.subarray(0,t-n),n),this.buf.unshift(r.subarray(t-n)),n+=t-n):(e.set(r,n),n+=r.byteLength)}return!0}}async function Bc(e,t,n){let{flags:r,data:s}=e;if(!(1&~r))throw new Sc("invalid envelope, already compressed",$r.Internal);return t&&s.byteLength>=n&&(s=await t.compress(s),r|=1),{data:s,flags:r}}async function Rc(e,t,n){let{flags:r,data:s}=e;if(!(1&~r)){if(!t)throw new Sc("received compressed envelope, but do not know how to decompress",$r.Internal);s=await t.decompress(s,n),r^=1}return{data:s,flags:r}}function xc(e,t){const n=new Uint8Array(t.length+5);n.set(t,5);const r=new DataView(n.buffer,n.byteOffset,n.byteLength);return r.setUint8(0,e),r.setUint32(1,t.length),n}var Wc=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,s){(function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)})(r,s,(t=e[n](t)).done,t.value)})}}},Nc=function(e){return this instanceof Nc?(this.v=e,this):new Nc(e)},Jc=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,s=n.apply(e,t||[]),i=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",function(e){return function(t){return Promise.resolve(t).then(e,l)}}),r[Symbol.asyncIterator]=function(){return this},r;function o(e,t){s[e]&&(r[e]=function(t){return new Promise(function(n,r){i.push([e,t,n,r])>1||a(e,t)})},t&&(r[e]=t(r[e])))}function a(e,t){try{(n=s[e](t)).value instanceof Nc?Promise.resolve(n.value.v).then(c,l):u(i[0][2],n)}catch(r){u(i[0][3],r)}var n}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}};function kc(e,t){return async n=>await async function(e,t,n){var r,s,i,o,a,c,l,u;const[d,h]=function(e){if(null==e)return[!1,0];const t="string"==typeof e?parseInt(e,10):e;if(!Number.isSafeInteger(t)||t<0)return[!1,t];return[!0,t]}(n);if(d){h>t&&Ec(t,h,!0);const n=new Uint8Array(h);let a=0;try{for(var m,g=!0,p=Wc(e);!(r=(m=await p.next()).done);g=!0){o=m.value,g=!1;const e=o;if(a+e.byteLength>h)throw new Sc(`protocol error: promised ${h} bytes, received ${a+e.byteLength}`,$r.InvalidArgument);n.set(e,a),a+=e.byteLength}}catch(A){s={error:A}}finally{try{g||r||!(i=p.return)||await i.call(p)}finally{if(s)throw s.error}}if(a<h)throw new Sc(`protocol error: promised ${h} bytes, received ${a}`,$r.InvalidArgument);return n}const f=[];let y=0;try{for(var b,I=!0,w=Wc(e);!(a=(b=await w.next()).done);I=!0){u=b.value,I=!1;const e=u;y+=e.byteLength,Ec(t,y),f.push(e)}}catch(S){c={error:S}}finally{try{I||a||!(l=w.return)||await l.call(w)}finally{if(c)throw c.error}}const v=new Uint8Array(y);let G=0;for(let C=f.shift();C;C=f.shift())v.set(C,G),G+=C.byteLength;return v}(n,e,t)}function _c(e,...t){return Jc(this,arguments,function*(){var n;const[r,s]=function(e){let t;"function"!=typeof e[e.length-1]&&(t=e.pop());return[e,t]}(t);let i;const o=e[Symbol.asyncIterator]();let a={[Symbol.asyncIterator]:()=>o};!0===(null==s?void 0:s.propagateDownStreamError)&&(a=i=Oc(a));for(const e of r)a=e(a);const c=a[Symbol.asyncIterator]();try{for(;;){const e=yield Nc(c.next());if(!0===e.done)break;if(i)try{yield yield Nc(e.value)}catch(l){throw yield Nc(i.abort(l)),l}else yield yield Nc(e.value)}}finally{!0===(null==s?void 0:s.propagateDownStreamError)&&(null===(n=o.return)||void 0===n||n.call(o).catch(()=>{}))}})}function Fc(e,t,n){return function(t){return Jc(this,arguments,function*(){var n,r,s,i;try{for(var o,a=!0,c=Wc(t);!(n=(o=yield Nc(c.next())).done);a=!0){i=o.value,a=!1;const t=i,n=e.serialize(t);yield yield Nc({flags:0,data:n})}}catch(l){r={error:l}}finally{try{a||n||!(s=c.return)||(yield Nc(s.call(c)))}finally{if(r)throw r.error}}})}}function Yc(e,t,n){return n&&void 0!==t?function(r){return Jc(this,arguments,function*(){var s,i,o,a;try{for(var c,l=!0,u=Wc(r);!(s=(c=yield Nc(u.next())).done);l=!0){a=c.value,l=!1;const{flags:r,data:s}=a;(r&t)===t?yield yield Nc({value:n.parse(s),end:!0}):yield yield Nc({value:e.parse(s),end:!1})}}catch(d){i={error:d}}finally{try{l||s||!(o=u.return)||(yield Nc(o.call(u)))}finally{if(i)throw i.error}}})}:function(r){return Jc(this,arguments,function*(){var s,i,o,a;try{for(var c,l=!0,u=Wc(r);!(s=(c=yield Nc(u.next())).done);l=!0){a=c.value,l=!1;const{flags:r,data:s}=a;if(void 0===t||(r&t)!==t)yield yield Nc(e.parse(s));else if(null===n)throw new Sc("unexpected end flag",$r.InvalidArgument)}}catch(d){i={error:d}}finally{try{l||s||!(o=u.return)||(yield Nc(o.call(u)))}finally{if(i)throw i.error}}})}}function Lc(e,t){return function(n){return Jc(this,arguments,function*(){var r,s,i,o;try{for(var a,c=!0,l=Wc(n);!(r=(a=yield Nc(l.next())).done);c=!0){o=a.value,c=!1;const n=o;yield yield Nc(yield Nc(Bc(n,e,t)))}}catch(u){s={error:u}}finally{try{c||r||!(i=l.return)||(yield Nc(i.call(l)))}finally{if(s)throw s.error}}})}}function Hc(e,t){return function(n){return Jc(this,arguments,function*(){var r,s,i,o;try{for(var a,c=!0,l=Wc(n);!(r=(a=yield Nc(l.next())).done);c=!0){o=a.value,c=!1;const n=o;yield yield Nc(yield Nc(Rc(n,e,t)))}}catch(u){s={error:u}}finally{try{c||r||!(i=l.return)||(yield Nc(i.call(l)))}finally{if(s)throw s.error}}})}}function Tc(e){return function(t){return Jc(this,arguments,function*(){var n,r,s,i;const o=function(e){return new Xc(e)}(e);try{for(var a,c=!0,l=Wc(t);!(n=(a=yield Nc(l.next())).done);c=!0){i=a.value,c=!1;const e=i;for(const t of o.decode(e))yield yield Nc(t)}}catch(u){r={error:u}}finally{try{c||n||!(s=l.return)||(yield Nc(s.call(l)))}finally{if(r)throw r.error}}if(o.byteLength>0)throw new Sc("protocol error: incomplete envelope",$r.InvalidArgument)})}}function Oc(e){const t=e[Symbol.asyncIterator]();if(void 0===t.throw)throw new Error("AsyncIterable does not implement throw");const n=t;let r,s,i={next:()=>(s=n.next().finally(()=>{s=void 0}),s),throw:e=>n.throw(e)};void 0!==t.return&&(i=Object.assign(Object.assign({},i),{return:e=>n.return(e)}));let o=!1;return{abort(e){if(r)return r.state;const t=()=>n.throw(e).then(e=>!0===e.done?"completed":"caught",()=>"rethrown");return s?(r={reason:e,state:s.then(t,t)},r.state):(r={reason:e,state:t()},r.state)},[Symbol.asyncIterator](){if(o)throw new Error("AsyncIterable cannot be re-used");return o=!0,i}}}function Mc(e){return Jc(this,arguments,function*(){yield Nc(yield*function(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,s){t[r]=e[r]?function(t){return(n=!n)?{value:Nc(e[r](t)),done:!1}:s?s(t):t}:s}}(Wc(e)))})}var Kc=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,s){(function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)})(r,s,(t=e[n](t)).done,t.value)})}}},Uc=function(e){return this instanceof Uc?(this.v=e,this):new Uc(e)},zc=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,s=n.apply(e,t||[]),i=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",function(e){return function(t){return Promise.resolve(t).then(e,l)}}),r[Symbol.asyncIterator]=function(){return this},r;function o(e,t){s[e]&&(r[e]=function(t){return new Promise(function(n,r){i.push([e,t,n,r])>1||a(e,t)})},t&&(r[e]=t(r[e])))}function a(e,t){try{(n=s[e](t)).value instanceof Uc?Promise.resolve(n.value.v).then(c,l):u(i[0][2],n)}catch(r){u(i[0][3],r)}var n}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}};function Dc(e,t){return function(e,t){const n={};for(const r of e.methods){const e=t(r);null!=e&&(n[r.localName]=e)}return n}(e,e=>{switch(e.methodKind){case"unary":return function(e,t){return async(n,r)=>{var s,i;const o=await e.unary(t,null==r?void 0:r.signal,null==r?void 0:r.timeoutMs,null==r?void 0:r.headers,n,null==r?void 0:r.contextValues);return null===(s=null==r?void 0:r.onHeader)||void 0===s||s.call(r,o.header),null===(i=null==r?void 0:r.onTrailer)||void 0===i||i.call(r,o.trailer),o.message}}(t,e);case"server_streaming":return function(e,t){return(n,r)=>Pc(e.stream(t,null==r?void 0:r.signal,null==r?void 0:r.timeoutMs,null==r?void 0:r.headers,Mc([n]),null==r?void 0:r.contextValues),r)}(t,e);case"client_streaming":return function(e,t){return async(n,r)=>{var s,i,o,a,c,l;const u=await e.stream(t,null==r?void 0:r.signal,null==r?void 0:r.timeoutMs,null==r?void 0:r.headers,n,null==r?void 0:r.contextValues);let d;null===(c=null==r?void 0:r.onHeader)||void 0===c||c.call(r,u.header);let h=0;try{for(var m,g=!0,p=Kc(u.message);!(s=(m=await p.next()).done);g=!0){a=m.value,g=!1;d=a,h++}}catch(f){i={error:f}}finally{try{g||s||!(o=p.return)||await o.call(p)}finally{if(i)throw i.error}}if(!d)throw new Sc("protocol error: missing response message",$r.Unimplemented);if(h>1)throw new Sc("protocol error: received extra messages for client streaming method",$r.Unimplemented);return null===(l=null==r?void 0:r.onTrailer)||void 0===l||l.call(r,u.trailer),d}}(t,e);case"bidi_streaming":return function(e,t){return(n,r)=>Pc(e.stream(t,null==r?void 0:r.signal,null==r?void 0:r.timeoutMs,null==r?void 0:r.headers,n,null==r?void 0:r.contextValues),r)}(t,e);default:return null}})}function Pc(e,t){const n=function(){return zc(this,arguments,function*(){var n,r;const s=yield Uc(e);null===(n=null==t?void 0:t.onHeader)||void 0===n||n.call(t,s.header),yield Uc(yield*function(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,s){t[r]=e[r]?function(t){return(n=!n)?{value:Uc(e[r](t)),done:!1}:s?s(t):t}:s}}(Kc(s.message))),null===(r=null==t?void 0:t.onTrailer)||void 0===r||r.call(t,s.trailer)})}()[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({next:()=>n.next()})}}function jc(e){if(!e.aborted)return;if(void 0!==e.reason)return e.reason;const t=new Error("This operation was aborted");return t.name="AbortError",t}function Qc(){return{get(e){return e.id in this?this[e.id]:e.defaultValue},set(e,t){return this[e.id]=t,this},delete(e){return delete this[e.id],this}}}function $c(e,t,...n){if(n.length>0)throw new Error;return e.services[t]}function qc(e,t){return e.toString().replace(/\/?$/,`/${t.parent.typeName}/${t.name}`)}function el(e,t){return Bs(e,t)}function tl(e,t){function n(t){return!0===t.done?t:{done:t.done,value:el(e,t.value)}}return{[Symbol.asyncIterator](){const e=t[Symbol.asyncIterator](),r={next:()=>e.next().then(n)};return void 0!==e.throw&&(r.throw=t=>e.throw(t).then(n)),void 0!==e.return&&(r.return=t=>e.return(t).then(n)),r}}}function nl(e,t){if(!t)return e;for(const n of t.concat().reverse())e=n(e);return e}function rl(e,t,n,r){const s=sl(il(e.input,t),r),i=sl(ol(e.input,n),r),o=sl(il(e.output,t),r),a=sl(ol(e.output,n),r);return{getI:e=>e?s:i,getO:e=>e?o:a}}function sl(e,t){return{serialize(n){const r=e.serialize(n);return function(e,t){if(t>e)throw new Sc(`message size ${t} is larger than configured writeMaxBytes ${e}`,$r.ResourceExhausted)}(t.writeMaxBytes,r.byteLength),r},parse:n=>(Ec(t.readMaxBytes,n.byteLength,!0),e.parse(n))}}function il(e,t){return{parse(n){try{return wa(e,n,t)}catch(r){const e=r instanceof Error?r.message:String(r);throw new Sc(`parse binary: ${e}`,$r.Internal)}},serialize(n){try{return Ba(e,n,t)}catch(r){const e=r instanceof Error?r.message:String(r);throw new Sc(`serialize binary: ${e}`,$r.Internal)}}}}function ol(e,t){var n,r;const s=null!==(n=null==t?void 0:t.textEncoder)&&void 0!==n?n:new TextEncoder,i=null!==(r=null==t?void 0:t.textDecoder)&&void 0!==r?r:new TextDecoder,o=function(e){var t;const n=Object.assign({},e);return null!==(t=n.ignoreUnknownFields)&&void 0!==t||(n.ignoreUnknownFields=!0),n}(t);return{parse(t){try{const n=i.decode(t);return ac(e,n,o)}catch(n){throw Sc.from(n,$r.InvalidArgument)}},serialize(t){try{const n=function(e,t,n){var r;const s=Qa(e,t,n);return JSON.stringify(s,null,null!==(r=null==n?void 0:n.prettySpaces)&&void 0!==r?r:0)}(e,t,o);return s.encode(n)}catch(n){throw Sc.from(n,$r.Internal)}}}}const al=/^application\/(connect\+)?(?:(json)(?:; ?charset=utf-?8)?|(proto))$/i;function cl(e,t,n){var r;if(t&&new Headers(t).forEach((e,t)=>n.metadata.append(t,e)),"object"!=typeof e||null==e||Array.isArray(e))throw n;let s=n.code;"code"in e&&"string"==typeof e.code&&(s=null!==(r=function(e){if(!Ac){Ac={};for(const e of Object.values($r))"string"!=typeof e&&(Ac[Gc(e)]=e)}return Ac[e]}(e.code))&&void 0!==r?r:s);const i=e.message;if(null!=i&&"string"!=typeof i)throw n;const o=new Sc(null!=i?i:"",s,t);if("details"in e&&Array.isArray(e.details))for(const c of e.details){if(null===c||"object"!=typeof c||Array.isArray(c)||"string"!=typeof c.type||"string"!=typeof c.value)throw n;try{o.details.push({type:c.type,value:Xi(c.value),debug:c.debug})}catch(a){throw n}}return o}function ll(e,t){const n={code:Gc(e.code)};return e.rawMessage.length>0&&(n.message=e.rawMessage),e.details.length>0&&(n.details=e.details.map(e=>{if("desc"in e){const r=Bs(e.desc,e.value),s={type:e.desc.typeName,value:Ba(e.desc,r)};try{s.debug=Qa(e.desc,r,t)}catch(n){}return s}return e}).map(e=>{var{value:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}(e,["value"]);return Object.assign(Object.assign({},n),{value:Bi(t,"std_raw")})})),n}function ul(e){const t=new TextEncoder;return{serialize(n){try{const r=function(e,t,n){const r={};void 0!==t&&(r.error=ll(t,n),e=Cc(e,t.metadata));let s=!1;const i={};return e.forEach((e,t)=>{s=!0,i[t]=[e]}),s&&(r.metadata=i),r}(n.metadata,n.error,e),s=JSON.stringify(r);return t.encode(s)}catch(r){const e=r instanceof Error?r.message:String(r);throw new Sc(`failed to serialize EndStreamResponse: ${e}`,$r.Internal)}},parse(e){try{return function(e){const t=new Sc("invalid end stream",$r.Unknown);let n;try{n=JSON.parse("string"==typeof e?e:(new TextDecoder).decode(e))}catch(s){throw t}if("object"!=typeof n||null==n||Array.isArray(n))throw t;const r=new Headers;if("metadata"in n){if("object"!=typeof n.metadata||null==n.metadata||Array.isArray(n.metadata))throw t;for(const[e,s]of Object.entries(n.metadata)){if(!Array.isArray(s)||s.some(e=>"string"!=typeof e))throw t;for(const t of s)r.append(e,t)}}return{metadata:r,error:"error"in n&&null!=n.error?cl(n.error,r,t):void 0}}(e)}catch(t){const e=t instanceof Error?t.message:String(t);throw new Sc(`failed to parse EndStreamResponse: ${e}`,$r.InvalidArgument)}}}}const dl="Content-Type",hl="Content-Length",ml="Content-Encoding",gl="Connect-Content-Encoding",pl="Accept-Encoding",fl="Connect-Protocol-Version",yl="User-Agent";function bl(e,t,n,r,s,i,o){const a=function(e,t,n,r,s){const i=new Headers(null!=r?r:{});return void 0!==n&&i.set("Connect-Timeout-Ms",`${n}`),i.set(dl,"unary"==e?t?"application/proto":"application/json":t?"application/connect+proto":"application/connect+json"),i.set(fl,"1"),!i.has(yl)&&s&&i.set(yl,"connect-es/2.1.1"),i}(e,t,n,r,o);if(null!=i){const t="unary"==e?ml:gl;a.set(t,i.name)}if(s.length>0){const t="unary"==e?pl:"Connect-Accept-Encoding";a.set(t,s.map(e=>e.name).join(","))}return a}function Il(e,t,n,r){const s=r.get(dl),i=function(e){const t=null==e?void 0:e.match(al);if(!t)return;return{stream:!!t[1],binary:!!t[3]}}(s);if(200!==n){const t=new Sc(`HTTP ${n}`,function(e){switch(e){case 400:return $r.Internal;case 401:return $r.Unauthenticated;case 403:return $r.PermissionDenied;case 404:return $r.Unimplemented;case 429:case 502:case 503:case 504:return $r.Unavailable;default:return $r.Unknown}}(n),r);if("unary"==e&&i&&!i.binary)return{isUnaryError:!0,unaryError:t};throw t}const o=t,a="unary"!==e;if((null==i?void 0:i.binary)!==o||i.stream!==a)throw new Sc(`unsupported content type ${s}`,void 0===i?$r.Unknown:$r.Internal,r);return{isUnaryError:!1}}function wl(e,t,n,r,s){let i;const o=s.get("unary"==e?ml:gl);if(null!=o&&"identity"!==o.toLowerCase()&&(i=t.find(e=>e.name===o),!i))throw new Sc(`unsupported response encoding "${o}"`,$r.Internal,s);return Object.assign({compression:i},Il(e,n,r,s))}const vl="application/";function Gl(e,t,n){let r="?connect=v1";const s=e.header.get(dl);0===(null==s?void 0:s.indexOf(vl))&&(r+="&encoding="+encodeURIComponent(s.slice(12)));const i=e.header.get(ml);null!==i&&"identity"!==i&&(r+="&compression="+encodeURIComponent(i),n=!0),n&&(r+="&base64=1"),r+="&message="+function(e,t){return t?Bi(e,"url"):encodeURIComponent((new TextDecoder).decode(e))}(t,n);const o=e.url+r,a=new Headers(e.header);for(const c of[fl,dl,hl,ml,pl])a.delete(c);return Object.assign(Object.assign({},e),{requestMethod:"GET",url:o,header:a})}function Al(e){const{signal:t,cleanup:n}=function(e){const t=new AbortController,n=()=>{t.abort(new Sc("the operation timed out",$r.DeadlineExceeded))};let r;return void 0!==e&&(e<=0?n():r=setTimeout(n,e)),{signal:t.signal,cleanup:()=>clearTimeout(r)}}(e.timeoutMs),r=function(...e){const t=new AbortController,n=e.filter(e=>void 0!==e).concat(t.signal);for(const s of n){if(s.aborted){r.apply(s);break}s.addEventListener("abort",r)}function r(){t.signal.aborted||t.abort(jc(this));for(const e of n)e.removeEventListener("abort",r)}return t}(e.signal,t);return[r.signal,function(e){const s=Sc.from(t.aborted?jc(t):e);return r.abort(s),n(),Promise.reject(s)},function(){n(),r.abort()}]}var Sl,Cl,Zl=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,s){(function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)})(r,s,(t=e[n](t)).done,t.value)})}}},Vl=function(e){return this instanceof Vl?(this.v=e,this):new Vl(e)},El=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,s=n.apply(e,t||[]),i=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",function(e){return function(t){return Promise.resolve(t).then(e,l)}}),r[Symbol.asyncIterator]=function(){return this},r;function o(e,t){s[e]&&(r[e]=function(t){return new Promise(function(n,r){i.push([e,t,n,r])>1||a(e,t)})},t&&(r[e]=t(r[e])))}function a(e,t){try{(n=s[e](t)).value instanceof Vl?Promise.resolve(n.value.v).then(c,l):u(i[0][2],n)}catch(r){u(i[0][3],r)}var n}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}};function Xl(e){return{async unary(t,n,r,s,i,o){const a=rl(t,e.binaryOptions,e.jsonOptions,e);return r=void 0===r?e.defaultTimeoutMs:r<=0?void 0:r,await function(e){const t=nl(e.next,e.interceptors),[n,r,s]=Al(e);return t(Object.assign(Object.assign({},e.req),{message:el(e.req.method.input,e.req.message),signal:n})).then(e=>(s(),e),r)}({interceptors:e.interceptors,signal:n,timeoutMs:r,req:{stream:!1,service:t.parent,method:t,requestMethod:"POST",url:qc(e.baseUrl,t),header:bl(t.methodKind,e.useBinaryFormat,r,s,e.acceptCompression,e.sendCompression,!0),contextValues:null!=o?o:Qc(),message:i},next:async n=>{let r=a.getI(e.useBinaryFormat).serialize(n.message);e.sendCompression&&r.byteLength>e.compressMinBytes?(r=await e.sendCompression.compress(r),n.header.set(ml,e.sendCompression.name)):n.header.delete(ml);let s;!0===e.useHttpGet&&t.idempotency===Po.NO_SIDE_EFFECTS?n=Gl(n,r,e.useBinaryFormat):s=Mc([r]);const i=await e.httpClient({url:n.url,method:n.requestMethod,header:n.header,signal:n.signal,body:s}),{compression:o,isUnaryError:c,unaryError:l}=wl(t.methodKind,e.acceptCompression,e.useBinaryFormat,i.status,i.header),[u,d]=function(e){const t=new Headers,n=new Headers;return e.forEach((e,r)=>{r.toLowerCase().startsWith("trailer-")?n.append(r.substring(8),e):t.append(r,e)}),[t,n]}(i.header);let h=await function(e,...t){const[n,r,s]=function(e){let t;"function"!=typeof e[e.length-1]&&(t=e.pop());const n=e.pop();return[e,n,t]}(t);let i,o=e;return!0===(null==s?void 0:s.propagateDownStreamError)&&(o=i=Oc(o)),o=_c(o,...n,{propagateDownStreamError:!1}),r(o).catch(e=>i?i.abort(e).then(()=>Promise.reject(e)):Promise.reject(e))}(i.body,kc(e.readMaxBytes,i.header.get(hl)),{propagateDownStreamError:!1});if(o&&(h=await o.decompress(h,e.readMaxBytes)),c)throw function(e,t,n){let r;try{r=JSON.parse((new TextDecoder).decode(e))}catch(s){throw n}return cl(r,t,n)}(h,Cc(u,d),l);return{stream:!1,service:t.parent,method:t,header:u,message:a.getO(e.useBinaryFormat).parse(h),trailer:d}}})},async stream(t,n,r,s,i,o){const a=rl(t,e.binaryOptions,e.jsonOptions,e),c=ul(e.jsonOptions);return r=void 0===r?e.defaultTimeoutMs:r<=0?void 0:r,function(e){const t=nl(e.next,e.interceptors),[n,r,s]=Al(e),i=Object.assign(Object.assign({},e.req),{message:tl(e.req.method.input,e.req.message),signal:n});let o=!1;return n.addEventListener("abort",function(){var t,n;const r=e.req.message[Symbol.asyncIterator]();o||null===(t=r.throw)||void 0===t||t.call(r,this.reason).catch(()=>{}),null===(n=r.return)||void 0===n||n.call(r).catch(()=>{})}),t(i).then(e=>Object.assign(Object.assign({},e),{message:{[Symbol.asyncIterator](){const t=e.message[Symbol.asyncIterator]();return{next:()=>t.next().then(e=>(1==e.done&&(o=!0,s()),e),r)}}}}),r)}({interceptors:e.interceptors,signal:n,timeoutMs:r,req:{stream:!0,service:t.parent,method:t,requestMethod:"POST",url:qc(e.baseUrl,t),header:bl(t.methodKind,e.useBinaryFormat,r,s,e.acceptCompression,e.sendCompression,!0),contextValues:null!=o?o:Qc(),message:i},next:async n=>{const r=await e.httpClient({url:n.url,method:"POST",header:n.header,signal:n.signal,body:_c(n.message,Fc(a.getI(e.useBinaryFormat)),Lc(e.sendCompression,e.compressMinBytes),function(e){return Jc(this,arguments,function*(){var t,n,r,s;try{for(var i,o=!0,a=Wc(e);!(t=(i=yield Nc(a.next())).done);o=!0){s=i.value,o=!1;const{flags:e,data:t}=s;yield yield Nc(xc(e,t))}}catch(c){n={error:c}}finally{try{o||t||!(r=a.return)||(yield Nc(r.call(a)))}finally{if(n)throw n.error}}})},{propagateDownStreamError:!0})}),{compression:s}=wl(t.methodKind,e.acceptCompression,e.useBinaryFormat,r.status,r.header),i=Object.assign(Object.assign({},n),{header:r.header,trailer:new Headers,message:_c(r.body,Tc(e.readMaxBytes),Hc(null!=s?s:null,e.readMaxBytes),Yc(a.getO(e.useBinaryFormat),2,c),function(e){return El(this,arguments,function*(){var t,n,s,o;let a=!1;try{for(var c,l=!0,u=Zl(e);!(t=(c=yield Vl(u.next())).done);l=!0){o=c.value,l=!1;const e=o;if(e.end){if(a)throw new Sc("protocol error: received extra EndStreamResponse",$r.InvalidArgument);if(a=!0,e.value.error){const t=e.value.error;throw r.header.forEach((e,n)=>{t.metadata.append(n,e)}),t}e.value.metadata.forEach((e,t)=>i.trailer.set(t,e))}else{if(a)throw new Sc("protocol error: received extra message after EndStreamResponse",$r.InvalidArgument);yield yield Vl(e.value)}}}catch(d){n={error:d}}finally{try{l||t||!(s=u.return)||(yield Vl(s.call(u)))}finally{if(n)throw n.error}}if(!a)throw new Sc("protocol error: missing EndStreamResponse",$r.InvalidArgument)})},{propagateDownStreamError:!0})});return i}})}}}function Bl(e){let t=$r.Internal;const n=Rl(e).map(xl);n.some(e=>"ERR_STREAM_WRITE_AFTER_END"==e.code)||n.some(e=>"ERR_STREAM_DESTROYED"==e.code||"ERR_HTTP2_INVALID_STREAM"==e.code||"ECONNRESET"==e.code)?t=$r.Aborted:n.some(e=>"ETIMEDOUT"==e.code||"ENOTFOUND"==e.code||"EAI_AGAIN"==e.code||"ECONNREFUSED"==e.code)&&(t=$r.Unavailable);const r=Sc.from(e,t);return r!==e&&(r.cause=e),r}function Rl(e){const t=[];for(;e instanceof Error&&!t.includes(e)&&(t.push(e),"cause"in e);)e=e.cause;return t}function xl(e){const t={};return e instanceof Error&&("code"in e&&"string"==typeof e.code&&(t.code=e.code),"syscall"in e&&"string"==typeof e.syscall&&(t.syscall=e.syscall)),t}(Cl=Sl||(Sl={}))[Cl.PROTOCOL_ERROR=1]="PROTOCOL_ERROR",Cl[Cl.INTERNAL_ERROR=2]="INTERNAL_ERROR",Cl[Cl.FLOW_CONTROL_ERROR=3]="FLOW_CONTROL_ERROR",Cl[Cl.SETTINGS_TIMEOUT=4]="SETTINGS_TIMEOUT",Cl[Cl.STREAM_CLOSED=5]="STREAM_CLOSED",Cl[Cl.FRAME_SIZE_ERROR=6]="FRAME_SIZE_ERROR",Cl[Cl.REFUSED_STREAM=7]="REFUSED_STREAM",Cl[Cl.CANCEL=8]="CANCEL",Cl[Cl.COMPRESSION_ERROR=9]="COMPRESSION_ERROR",Cl[Cl.CONNECT_ERROR=10]="CONNECT_ERROR",Cl[Cl.ENHANCE_YOUR_CALM=11]="ENHANCE_YOUR_CALM",Cl[Cl.INADEQUATE_SECURITY=12]="INADEQUATE_SECURITY",Cl[Cl.HTTP_1_1_REQUIRED=13]="HTTP_1_1_REQUIRED";const Wl=t(A.gzip),Nl=t(A.gunzip),Jl=t(A.brotliCompress),kl=t(A.brotliDecompress),_l={name:"gzip",compress:e=>Yl(Wl(e,{})),decompress:(e,t)=>0==e.length?Promise.resolve(new Uint8Array(0)):Yl(Ll(Nl(e,{maxOutputLength:t}),t))},Fl={name:"br",compress:e=>Yl(Jl(e,{})),decompress:(e,t)=>0==e.length?Promise.resolve(new Uint8Array(0)):Yl(Ll(kl(e,{maxOutputLength:t}),t))};function Yl(e){return e.then(e=>e.buffer instanceof ArrayBuffer?e:new Uint8Array(e))}function Ll(e,t){return e.catch(e=>{var n;const r=xl(e);let s=$r.Internal,i="decompression failed";switch(r.code){case"ERR_BUFFER_TOO_LARGE":s=$r.ResourceExhausted,i=`message is larger than configured readMaxBytes ${t} after decompression`;break;case"Z_DATA_ERROR":case"ERR_PADDING_2":s=$r.InvalidArgument;break;default:(null===(n=r.code)||void 0===n?void 0:n.startsWith("ERR__ERROR_FORMAT_"))&&(s=$r.InvalidArgument)}return Promise.reject(new Sc(i,s,void 0,void 0,e))})}function Hl(e){const t=new Headers;for(const[n,r]of Object.entries(e))if(!n.startsWith(":")&&void 0!==r)if("string"==typeof r)t.append(n,r);else if("number"==typeof r)t.append(n,String(r));else for(const e of r)t.append(n,e);return t}function Tl(e,t){if(void 0===e&&void 0===t)return;const n=/* @__PURE__ */Object.create(null);if(void 0!==t)if(Array.isArray(t))for(let r=0;r+1<t.length;r+=2){const e=t[r],s=t[r+1];Array.isArray(n[e])?n[e].push(s):"string"==typeof n[e]?n[e]=[n[e],s]:n[e]=s}else for(const[r,s]of Object.entries(t))Array.isArray(s)?n[r]=s.concat():void 0!==s&&(n[r]=s);if(void 0!==e)if(Array.isArray(e))for(const[r,s]of e)Ol(n,r,s);else if("forEach"in e)"function"==typeof e.forEach&&e.forEach((e,t)=>{Ol(n,t,e)});else for(const[r,s]of Object.entries(e))Ol(n,r,s);return n}function Ol(e,t,n){const r=e[t=t.toLowerCase()];Array.isArray(r)?r.push(n):e[t]=void 0===r?n:[r.toString(),n]}class Ml{state(){return"ready"==this.s.t?void 0!==this.verifying?"verifying":this.s.streamCount()>0?"open":"idle":this.s.t}error(){if("error"==this.s.t)return this.s.reason}constructor(e,t,n){var r,s,i,o;this.s={t:"closed"},this.shuttingDown=[],this.authority=new URL(e).origin,this.http2SessionOptions=n,this.options={pingIntervalMs:null!==(r=null==t?void 0:t.pingIntervalMs)&&void 0!==r?r:Number.POSITIVE_INFINITY,pingTimeoutMs:null!==(s=null==t?void 0:t.pingTimeoutMs)&&void 0!==s?s:15e3,pingIdleConnection:null!==(i=null==t?void 0:t.pingIdleConnection)&&void 0!==i&&i,idleConnectionTimeoutMs:null!==(o=null==t?void 0:t.idleConnectionTimeoutMs)&&void 0!==o?o:9e5}}async connect(){try{return(await this.gotoReady()).streamCount()>0?"open":"idle"}catch(e){return"error"}}async request(e,t,n,r){for(;;){const i=await this.gotoReady();try{const s=i.conn.request(Object.assign(Object.assign({},n),{":method":e,":path":t}),r);return i.registerRequest(s),s}catch(s){if(i.conn.closed||i.conn.destroyed)continue;throw s}}}notifyResponseByteRead(e){"ready"==this.s.t&&this.s.responseByteRead(e);for(const t of this.shuttingDown)t.responseByteRead(e)}abort(e){var t,n,r;const s=null!=e?e:new Sc("connection aborted",$r.Canceled);null===(n=(t=this.s).abort)||void 0===n||n.call(t,s);for(const i of this.shuttingDown)null===(r=i.abort)||void 0===r||r.call(i,s);this.setState(Kl(s))}async gotoReady(){for("ready"==this.s.t?this.s.isShuttingDown()||this.s.conn.closed||this.s.conn.destroyed?this.setState(Ul(this.authority,this.http2SessionOptions)):this.s.requiresVerify()&&await this.verify(this.s):"closed"!=this.s.t&&"error"!=this.s.t||this.setState(Ul(this.authority,this.http2SessionOptions));"ready"!==this.s.t;){if("error"===this.s.t)throw this.s.reason;"connecting"===this.s.t&&await this.s.conn}return this.s}setState(e){var t,n;if(null===(n=(t=this.s).onExitState)||void 0===n||n.call(t),"ready"==this.s.t&&this.s.isShuttingDown()){const e=this.s;this.shuttingDown.push(e),e.onClose=e.onError=()=>{const t=this.shuttingDown.indexOf(e);-1!==t&&this.shuttingDown.splice(t,1)}}switch(e.t){case"connecting":e.conn.then(e=>{this.setState(function(e,t){(function(e){if(e.connecting)throw new Sc("expected open session, but it is connecting",$r.Internal);if(e.destroyed)throw new Sc("expected open session, but it is destroyed",$r.Internal);if(e.closed)throw new Sc("expected open session, but it is closed",$r.Internal)})(e),e.unref();let n,r,s,i=Date.now(),o=0,a=!1,c=!1;p();const l={t:"ready",conn:e,streamCount:()=>o,requiresVerify:()=>Date.now()-i>t.pingIntervalMs,isShuttingDown:()=>a,onClose:void 0,onError:void 0,registerRequest(t){o++,1==o&&(e.ref(),u(),g()),t.once("response",()=>{i=Date.now(),u()}),t.once("close",()=>{o--,0==o&&(e.unref(),u(),p())})},responseByteRead(t){t.session===e&&(e.closed||e.destroyed||o<=0||(i=Date.now(),u()))},verify:()=>(e.ref(),new Promise(t=>{const n=()=>{t(!1)};m(()=>{0==o&&e.unref(),e.off("error",n),t(!0)}),e.once("error",n)})),abort(t){e.destroyed||(e.once("error",()=>{}),e.destroy(t,Z.constants.NGHTTP2_CANCEL))},onExitState(){l.isShuttingDown()||(w(),this.onError=void 0,this.onClose=void 0)}};function u(){d(),(o>0||t.pingIdleConnection)&&(n=zl(h,t.pingIntervalMs))}function d(){clearTimeout(n),clearTimeout(r)}function h(){m(u)}function m(n){clearTimeout(r),r=zl(()=>{e.destroy(new Sc("PING timed out",$r.Unavailable),Z.constants.NGHTTP2_CANCEL)},t.pingTimeoutMs),e.ping((s,o)=>{clearTimeout(r),null===s&&(o>t.pingTimeoutMs?e.destroy(new Sc("PING timed out",$r.Unavailable),Z.constants.NGHTTP2_CANCEL):(i=Date.now(),n()))})}function g(){clearTimeout(s)}function p(){s=zl(f,t.idleConnectionTimeoutMs)}function f(){e.close(),b()}function y(n,r,s){if(n===Z.constants.NGHTTP2_NO_ERROR&&0===o)return void e.destroy(new Sc("received GOAWAY without any open streams",$r.Canceled),Z.constants.NGHTTP2_NO_ERROR);a=!0;const i=Buffer.from("too_many_pings","ascii");(null==s?void 0:s.equals(i))&&(t.pingIntervalMs=2*t.pingIntervalMs,c=!0)}function b(){var e;w(),null===(e=l.onClose)||void 0===e||e.call(l)}function I(e){var t,n;if(w(),c){const e=new Sc(`http/2 connection closed with error code ENHANCE_YOUR_CALM (0x${Z.constants.NGHTTP2_ENHANCE_YOUR_CALM.toString(16)}), too_many_pings, doubled the interval`,$r.ResourceExhausted);null===(t=l.onError)||void 0===t||t.call(l,e)}else null===(n=l.onError)||void 0===n||n.call(l,Bl(e))}function w(){d(),g(),e.off("error",I),e.off("close",b),e.off("goaway",y)}return e.on("error",I),e.on("close",b),e.on("goaway",y),l}(e,this.options))},e=>{this.setState(Kl(e))});break;case"ready":e.onClose=()=>this.setState({t:"closed"}),e.onError=e=>this.setState(Kl(e))}this.s=e}verify(e){return void 0!==this.verifying||(this.verifying=e.verify().then(e=>{e||this.setState(Ul(this.authority,this.http2SessionOptions))},e=>{this.setState(Kl(e))}).finally(()=>{this.verifying=void 0})),this.verifying}}function Kl(e){return e instanceof Sc&&Sc.from(e).code==$r.Canceled?{t:"closed"}:function(e){return{t:"error",reason:e}}(e)}function Ul(e,t){let n,r;const s=new Promise((e,t)=>{n=e,r=t}),i=Z.connect(e,t);function o(){null==n||n(i),c()}function a(e){null==r||r(Bl(e)),c()}function c(){i.off("connect",o),i.off("error",a)}return i.on("connect",o),i.on("error",a),{t:"connecting",conn:s,abort(e){i.destroyed||i.destroy(void 0,Z.constants.NGHTTP2_CANCEL),null==r||r(e)},onExitState(){c()}}}function zl(e,t){if(!(t>2147483647))return setTimeout(e,t).unref()}function Dl(e){var t,n;if("1.1"==e.httpVersion)return n=e.nodeOptions,async function(e){const t=ql(e.signal);return new Promise((r,s)=>{t.onError(e=>{s(e)}),function(e,t,n,r){let s;s=new URL(t).protocol.startsWith("https")?C.request(t,n):S.request(t,n),e.onError(e=>s.destroy(e)),s.flushHeaders(),s.on("error",e.error),s.on("socket",function(e){function t(){e.off("connect",t),r(s)}"open"===e.readyState?r(s):e.on("connect",t)})}(t,e.url,Object.assign(Object.assign({},n),{headers:Tl(e.header,null==n?void 0:n.headers),method:e.method}),n=>{$l(e,n,t),n.on("response",e=>{var n;e.on("error",t.error),t.onError(t=>e.destroy(t));const s=new Headers;r({status:null!==(n=e.statusCode)&&void 0!==n?n:0,header:Hl(e.headers),body:Pl(t,e,s),trailer:s})})})})};return function(e){return function(t){const n=ql(t.signal),r=e(t.url);return new Promise((e,s)=>{n.onError(e=>{s(e)}),function(e,t,n,r,s,i,o){const a=new URL(n);if(a.origin!==t.authority){const n=`cannot make a request to ${a.origin}: the http2 session is connected to ${t.authority}`;return void e.error(new Sc(n,$r.Internal))}t.request(r,a.pathname+a.search,s,{}).then(t=>{e.onError(e=>{if(t.closed)return;const n=e.code==$r.Canceled?Sl.CANCEL:Sl.INTERNAL_ERROR;return new Promise(e=>t.close(n,e))}),t.on("error",function(n){t.writableEnded&&Rl(n).map(xl).some(e=>"ERR_STREAM_WRITE_AFTER_END"==e.code)||e.error(n)}),t.on("close",function(){const n=function(e){switch(e){case Sl.PROTOCOL_ERROR:case Sl.INTERNAL_ERROR:case Sl.FLOW_CONTROL_ERROR:case Sl.SETTINGS_TIMEOUT:case Sl.FRAME_SIZE_ERROR:case Sl.COMPRESSION_ERROR:case Sl.CONNECT_ERROR:return new Sc(`http/2 stream closed with error code ${Sl[e]} (0x${e.toString(16)})`,$r.Internal);case Sl.REFUSED_STREAM:return new Sc(`http/2 stream closed with error code ${Sl[e]} (0x${e.toString(16)})`,$r.Unavailable);case Sl.CANCEL:return new Sc(`http/2 stream closed with error code ${Sl[e]} (0x${e.toString(16)})`,$r.Canceled);case Sl.ENHANCE_YOUR_CALM:return new Sc(`http/2 stream closed with error code ${Sl[e]} (0x${e.toString(16)})`,$r.ResourceExhausted);case Sl.INADEQUATE_SECURITY:case Sl.HTTP_1_1_REQUIRED:return new Sc(`http/2 stream closed with error code ${Sl[e]} (0x${e.toString(16)})`,$r.PermissionDenied)}}(t.rstCode);n&&e.error(n)}),o(t)},t=>{e.error(t)})}(n,r,t.url,t.method,Tl(t.header),0,s=>{$l(t,s,n),s.on("response",t=>{var i;const o={status:null!==(i=t[":status"])&&void 0!==i?i:0,header:Hl(t),body:Ql(n,s,r),trailer:jl(s)};e(o)})})})}}(null!==(t=e.sessionProvider)&&void 0!==t?t:e=>new Ml(e))}function Pl(e,t,n){const r=t[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({async next(){const s=await e.race(r.next());return!0===s.done&&(Hl(t.trailers).forEach((e,t)=>{n.set(t,e)}),e.close()),s},throw(t){throw e.error(t),t}})}}function jl(e){const t=new Headers;return e.on("trailers",e=>{Hl(e).forEach((e,n)=>{t.set(n,e)})}),t}function Ql(e,t,n){const r=t[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({async next(){const s=await e.race(r.next());return!0===s.done&&e.close(),null==n||n.notifyResponseByteRead(t),s},throw(t){throw e.error(t),t}})}}async function $l(e,t,n){if(void 0===e.body)return void(await new Promise(e=>t.end(e)));const r=e.body[Symbol.asyncIterator]();return new Promise(e=>{!function s(){if(n.isClosed())return;r.next().then(i=>{!0!==i.done?t.write(i.value,"binary",e=>{null!=e?(void 0!==r.throw&&r.throw(Bl(e)).catch(()=>{}),t.writableEnded&&Rl(e).map(xl).some(e=>"ERR_STREAM_WRITE_AFTER_END"==e.code)||n.error(e)):s()}):t.end(e)},e=>{n.error(e)})}()})}function ql(e){let t,n,r=!1,s=[];const i={error(e){if(!r){r=!0,n=e instanceof Sc?e:Bl(e),null==t||t(n);for(const e of s)e(n);o()}},close(){r||(r=!0,t&&t(new Sc("sentinel completed early",$r.Internal)),o())},isClosed:()=>r,onError(e){r?void 0!==n&&e(n):s.push(e)},race(e){let s;const i=new Promise((e,n)=>{s=e,t=n});return e.then(e=>{null==s||s(e)},e=>{null==t||t(e)}),r&&(null==t||t(null!=n?n:new Sc("sentinel completed early",$r.Internal))),i}};function o(){e&&e.removeEventListener("abort",a),s=[],t=void 0}function a(){i.error(jc(this))}return e&&(e.addEventListener("abort",a),e.aborted&&i.error(jc(e))),i}function eu(e){var t,n,r,s;let i;if("2"==e.httpVersion){let t;t=e.sessionManager?e.sessionManager:new Ml(e.baseUrl,{pingIntervalMs:e.pingIntervalMs,pingIdleConnection:e.pingIdleConnection,pingTimeoutMs:e.pingTimeoutMs,idleConnectionTimeoutMs:e.idleConnectionTimeoutMs},e.nodeOptions),i=Dl({httpVersion:"2",sessionProvider:()=>t})}else i=Dl({httpVersion:"1.1",nodeOptions:e.nodeOptions});return Object.assign(Object.assign(Object.assign({},e),{httpClient:i,useBinaryFormat:null===(t=e.useBinaryFormat)||void 0===t||t,interceptors:null!==(n=e.interceptors)&&void 0!==n?n:[],sendCompression:null!==(r=e.sendCompression)&&void 0!==r?r:null,acceptCompression:null!==(s=e.acceptCompression)&&void 0!==s?s:[_l,Fl]}),function(e,t,n){if(null!=t||(t=Vc),null!=e||(e=Zc),null!=n||(n=1024),t<1||t>Vc)throw new Sc(`writeMaxBytes ${t} must be >= 1 and <= 4294967295`,$r.Internal);if(e<1||e>Zc)throw new Sc(`readMaxBytes ${e} must be >= 1 and <= 4294967295`,$r.Internal);return{readMaxBytes:e,writeMaxBytes:t,compressMinBytes:n}}(e.readMaxBytes,e.writeMaxBytes,e.compressMinBytes))}function tu(e){return Xl(eu(e))}const nu=/* @__PURE__ */Ca("ChpmbHV4bGF5L2F1dGgvdjEvYXV0aC5wcm90bxIPZmx1eGxheS5hdXRoLnYxIhkKF0NyZWF0ZURldmljZUNvZGVSZXF1ZXN0IoIBChhDcmVhdGVEZXZpY2VDb2RlUmVzcG9uc2USEwoLZGV2aWNlX2NvZGUYASABKAkSEQoJdXNlcl9jb2RlGAIgASgJEhgKEHZlcmlmaWNhdGlvbl91cmkYAyABKAkSEgoKZXhwaXJlc19pbhgEIAEoBRIQCghpbnRlcnZhbBgFIAEoBSItChZQb2xsRGV2aWNlVG9rZW5SZXF1ZXN0EhMKC2RldmljZV9jb2RlGAEgASgJInMKDURldmljZVNlc3Npb24SFAoMYWNjZXNzX3Rva2VuGAEgASgJEhUKDXJlZnJlc2hfdG9rZW4YAiABKAkSEgoKdG9rZW5fdHlwZRgDIAEoCRISCgpleHBpcmVzX2F0GAQgASgDEg0KBWVtYWlsGAUgASgJIn4KF1BvbGxEZXZpY2VUb2tlblJlc3BvbnNlEjIKBnN0YXR1cxgBIAEoDjIiLmZsdXhsYXkuYXV0aC52MS5EZXZpY2VUb2tlblN0YXR1cxIvCgdzZXNzaW9uGAIgASgLMh4uZmx1eGxheS5hdXRoLnYxLkRldmljZVNlc3Npb24iKQoUQXBwcm92ZURldmljZVJlcXVlc3QSEQoJdXNlcl9jb2RlGAEgASgJIhcKFUFwcHJvdmVEZXZpY2VSZXNwb25zZSrKAQoRRGV2aWNlVG9rZW5TdGF0dXMSIwofREVWSUNFX1RPS0VOX1NUQVRVU19VTlNQRUNJRklFRBAAEi0KKURFVklDRV9UT0tFTl9TVEFUVVNfQVVUSE9SSVpBVElPTl9QRU5ESU5HEAESIAocREVWSUNFX1RPS0VOX1NUQVRVU19BUFBST1ZFRBACEh8KG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BvbnNlIjIKE0NhbmNlbFVwbG9hZFJlcXVlc3QSGwoKdmVyc2lvbl9pZBgBIAEoCUIHukgEcgIQASIWChRDYW5jZWxVcGxvYWRSZXNwb25zZSqMAQoPV2FsbHBhcGVyU3RhdHVzEiAKHFdBTExQQVBFUl9TVEFUVVNfVU5TUEVDSUZJRUQQABIeChpXQUxMUEFQRVJfU1RBVFVTX1VQTE9BRElORxABEhoKFldBTExQQVBFUl9TVEFUVVNfRFJBRlQQAhIbChdXQUxMUEFQRVJfU1RBVFVTX0FDVElWRRADKnsKD1dhbGxwYXBlclNvcnRCeRIhCh1XQUxMUEFQRVJfU09SVF9CWV9VTlNQRUNJRklFRBAAEiAKHFdBTExQQVBFUl9TT1JUX0JZX0NSRUFURURfQVQQARIjCh9XQUxMUEFQRVJfU09SVF9CWV9MSUNFTlNFX0NPVU5UEAJC5QEKGGNvbS5mbHV4bGF5LndhbGxwYXBlci52MUIOV2FsbHBhcGVyUHJvdG9QAVpHZ2l0aHViLmNvbS9rZW4xMDkvZmx1eGxheS1wcm90by9nZW4vZ28vZmx1eGxheS93YWxscGFwZXIvdjE7d2FsbHBhcGVydjGiAgNGV1iqAhRGbHV4bGF5LldhbGxwYXBlci5WMcoCFEZsdXhsYXlcV2FsbHBhcGVyXFYx4gIgRmx1eGxheVxXYWxscGFwZXJcVjFcR1BCTWV0YWRhdGHqAhZGbHV4bGF5OjpXYWxscGFwZXI6OlYxYgZwcm90bzM",[su,au,Za])]),lu=/* @__PURE__ */$c(cu,1),uu=/* @__PURE__ */$c(cu,3),du="https://api.fluxlay.com",hu=tu({baseUrl:du,httpVersion:"1.1"}),mu=tu({baseUrl:du,httpVersion:"1.1",interceptors:[e=>async t=>{const n=await Qr.getValidSession();return n?.access_token&&t.header.set("Authorization",`Bearer ${n.access_token}`),e(t)}]}),gu=Dc(lu,hu),pu=Dc(uu,mu);class fu{static async saveDeveloperKey(e){Mt(e)}static async getDeveloperKey(){try{return await Ot()||null}catch(e){return console.error(`[KeyStore] Error getting developer key: ${e}`),null}}}function yu(){let e=Date.now();return{name:"fluxlay-dev-server",configureServer(t){t.watcher.on("change",()=>{e=Date.now()}),t.middlewares.use("/version",(t,n)=>{n.setHeader("Content-Type","application/json"),n.setHeader("Access-Control-Allow-Origin","*"),n.end(JSON.stringify({version:e}))})}}}async function bu(e){const t=c.resolve(process.cwd(),e),n=c.join(t,"fluxlay.yaml");a.existsSync(n)||(Ee.error(at.red("fluxlay.yaml is required in the project root.")),process.exit(1));try{const e=a.readFileSync(n,"utf-8");Kt(e)}catch(h){Ee.error(`Manifest Validation Error: ${h.message}`),process.exit(1)}const r=await Iu(3e3),s=ke();s.start(at.yellow(`Starting server on port ${r}...`));const i=await m({root:t,configFile:c.resolve(t,"vite.config.ts"),plugins:[yu()],server:{port:r,strictPort:!0,cors:!0,host:"127.0.0.1"},logLevel:"error"});await i.listen(),s.stop(`${at.green("✔")} Server started on port ${r}.`);const o=`http://127.0.0.1:${r}`;Ee.info(`Wallpaper server running at ${at.underline.cyan(o)}`);const l=en("com.fluxlay.core",{suffix:""}).data,u=c.join(l,"dev.json"),d=()=>{if(a.existsSync(u))try{a.unlinkSync(u)}catch(h){}};a.existsSync(l)||a.mkdirSync(l,{recursive:!0}),a.writeFileSync(u,JSON.stringify({url:o,root:t},null,2)),process.on("SIGINT",()=>{d(),process.exit()}),process.on("SIGTERM",()=>{d(),process.exit()}),process.on("exit",d),Ne(`Root: ${at.gray(t)}\nWatching for changes...`,"Dev Server Active")}async function Iu(e){return new Promise((t,n)=>{const r=V.createServer();r.unref(),r.on("error",r=>{"EADDRINUSE"===r.code?t(Iu(e+1)):n(r)}),r.listen(e,()=>{r.close(()=>t(e))})})}let wu,vu;function Gu(){return void 0===wu&&(wu=function(){try{return a.statSync("/.dockerenv"),!0}catch{return!1}}()||function(){try{return a.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}()),wu}function Au(){return void 0===vu&&(vu=(()=>{try{return a.statSync("/run/.containerenv"),!0}catch{return!1}})()||Gu()),vu}const Su=()=>{if("linux"!==n.platform)return!1;if(f.release().toLowerCase().includes("microsoft"))return!Au();try{if(a.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft"))return!Au()}catch{}return!(!a.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")&&!a.existsSync("/run/WSL"))&&!Au()},Cu=n.env.__IS_WSL_TEST__?Su:Su(),Zu=t(u.execFile),Vu=()=>`${n.env.SYSTEMROOT||n.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,Eu=async(e,t={})=>{const{powerShellPath:n,...r}=t,s=Eu.encodeCommand(e);return Zu(n??Vu(),[...Eu.argumentsPrefix,s],{encoding:"utf8",...r})};Eu.argumentsPrefix=["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"],Eu.encodeCommand=e=>B.from(e,"utf16le").toString("base64"),Eu.escapeArgument=e=>`'${String(e).replaceAll("'","''")}'`;const Xu=t(u.execFile),Bu=/* @__PURE__ */(()=>{const e="/mnt/";let t;return async function(){if(t)return t;const n="/etc/wsl.conf";let r=!1;try{await E.access(n,X.F_OK),r=!0}catch{}if(!r)return e;const s=function(e){for(const t of e.split("\n")){if(/^\s*#/.test(t))continue;const e=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(t);if(e)return e.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,"")}}(await E.readFile(n,{encoding:"utf8"}));return void 0===s?e:(t=s,t=t.endsWith("/")?t:`${t}/`,t)}})(),Ru=Cu?async()=>`${await Bu()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:Vu;let xu;function Wu(e,t,n){const r=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){const e=n();return r(e),e},set(e){r(e)}}),e}const Nu=t(d);const Ju=t(d);async function ku(e){return async function(e,{humanReadableOutput:t=!0,signal:r}={}){if("darwin"!==n.platform)throw new Error("macOS only");const s=t?[]:["-ss"],i={};r&&(i.signal=r);const{stdout:o}=await Ju("osascript",["-e",e,s],i);return o.trim()}(`tell application "Finder" to set app_path to application file id "${e}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}const _u=t(d),Fu={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},Yu=new Map(Object.entries(Fu));class Lu extends Error{}const Hu=t(d);async function Tu(){if("darwin"===n.platform){const e=await async function(){if("darwin"!==n.platform)throw new Error("macOS only");const{stdout:e}=await Nu("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),t=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e),r=t?.groups.id??"com.apple.Safari";return"com.apple.safari"===r?"com.apple.Safari":r}();return{name:await ku(e),id:e}}if("linux"===n.platform){const{stdout:e}=await Hu("xdg-mime",["query","default","x-scheme-handler/http"]),t=e.trim();return{name:t.replace(/.desktop$/,"").replace("-"," ").toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase()),id:t}}if("win32"===n.platform)return async function(e=_u){const{stdout:t}=await e("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),n=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(t);if(!n)throw new Lu(`Cannot find Windows browser in stdout: ${JSON.stringify(t)}`);const{id:r}=n.groups,s=r.lastIndexOf("."),i=r.lastIndexOf("-"),o=-1===s?void 0:r.slice(0,s),a=-1===i?void 0:r.slice(0,i);return Fu[r]??Fu[o]??Fu[a]??{name:r,id:r}}();throw new Error("Only macOS, Linux, and Windows are supported")}const Ou=Boolean(n.env.SSH_CONNECTION||n.env.SSH_CLIENT||n.env.SSH_TTY),Mu=/* @__PURE__ */Symbol("fallbackAttempt"),Ku=import.meta.url?c.dirname(p(import.meta.url)):"",Uu=c.join(Ku,"xdg-open"),{platform:zu,arch:Du}=n,Pu=async(e,t)=>{if(0===e.length)return;const n=[];for(const s of e)try{return await t(s)}catch(r){n.push(r)}throw new AggregateError(n,"Failed to open in all supported apps")},ju=async e=>{const t=!0===(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e})[Mu];if(delete e[Mu],Array.isArray(e.app))return Pu(e.app,t=>ju({...e,app:t,[Mu]:!0}));let r,{name:s,arguments:i=[]}=e.app??{};if(i=[...i],Array.isArray(s))return Pu(s,t=>ju({...e,app:{name:t,arguments:i},[Mu]:!0}));if("browser"===s||"browserPrivate"===s){const t={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge","com.apple.safari":"safari"},n={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"};let r;if(Cu){const e=await(async()=>{const e=await Ru(),t=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{stdout:n}=await Eu(t,{powerShellPath:e});return n.trim()})();r=Yu.get(e)??{}}else r=await Tu();if(r.id in t){const o=t[r.id.toLowerCase()];if("browserPrivate"===s){if("safari"===o)throw new Error("Safari doesn't support opening in private mode via command line");i.push(n[o])}return ju({...e,app:{name:qu[o],arguments:i}})}throw new Error(`${r.name} is not supported as a default browser`)}const o=[],a={};let c=!1;if(!Cu||Au()||Ou||s||(c=await(async()=>(xu??=(async()=>{try{const e=await Ru();return await E.access(e,X.X_OK),!0}catch{return!1}})(),xu))()),"darwin"===zu)r="open",e.wait&&o.push("--wait-apps"),e.background&&o.push("--background"),e.newInstance&&o.push("--new"),s&&o.push("-a",s);else if("win32"===zu||c){r=await Ru(),o.push(...Eu.argumentsPrefix),Cu||(a.windowsVerbatimArguments=!0),Cu&&e.target&&(e.target=await(async e=>{if(/^[a-z]+:\/\//i.test(e))return e;try{const{stdout:t}=await Xu("wslpath",["-aw",e],{encoding:"utf8"});return t.trim()}catch{return e}})(e.target));const t=["$ProgressPreference = 'SilentlyContinue';","Start"];e.wait&&t.push("-Wait"),s?(t.push(Eu.escapeArgument(s)),e.target&&i.push(e.target)):e.target&&t.push(Eu.escapeArgument(e.target)),i.length>0&&(i=i.map(e=>Eu.escapeArgument(e)),t.push("-ArgumentList",i.join(","))),e.target=Eu.encodeCommand(t.join(" ")),e.wait||(a.stdio="ignore")}else{if(s)r=s;else{const e=!Ku||"/"===Ku;let t=!1;try{await E.access(Uu,X.X_OK),t=!0}catch{}r=n.versions.electron??("android"===zu||e||!t)?"xdg-open":Uu}i.length>0&&o.push(...i),e.wait||(a.stdio="ignore",a.detached=!0)}"darwin"===zu&&i.length>0&&o.push("--args",...i),e.target&&o.push(e.target);const l=u.spawn(r,o,a);return e.wait?new Promise((t,n)=>{l.once("error",n),l.once("close",r=>{e.allowNonzeroExitCode||0===r?t(l):n(new Error(`Exited with code ${r}`))})}):t?new Promise((e,t)=>{l.once("error",t),l.once("spawn",()=>{l.once("close",n=>{l.off("error",t),0===n?(l.unref(),e(l)):t(new Error(`Exited with code ${n}`))})})}):(l.unref(),new Promise((e,t)=>{l.once("error",t),l.once("spawn",()=>{l.off("error",t),e(l)})}))};function Qu(e){if("string"==typeof e||Array.isArray(e))return e;const{[Du]:t}=e;if(!t)throw new Error(`${Du} is not supported`);return t}function $u({[zu]:e},{wsl:t}={}){if(t&&Cu)return Qu(t);if(!e)throw new Error(`${zu} is not supported`);return Qu(e)}const qu={browser:"browser",browserPrivate:"browserPrivate"};Wu(qu,"chrome",()=>$u({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium","chromium-browser"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}})),Wu(qu,"brave",()=>$u({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}})),Wu(qu,"firefox",()=>$u({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"})),Wu(qu,"edge",()=>$u({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"})),Wu(qu,"safari",()=>$u({darwin:"Safari"}));const ed=async()=>{const e=ke();try{const{deviceCode:t,userCode:n,verificationUri:r,interval:s}=await gu.createDeviceCode({});Ee.message(`ブラウザで以下を開いてください: ${at.underline.cyan(r)}`),Ee.message(`認証コード: ${at.bold.yellow(n)}`);const i=`${r}?user_code=${encodeURIComponent(n)}`;await((e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a `target`");return ju({...t,target:e})})(i),e.start(at.yellow("認証を待っています..."));const o=await async function(e,t){const n=Date.now()+9e5;for(;Date.now()<n;){await new Promise(e=>setTimeout(e,1e3*t));const n=await gu.pollDeviceToken({deviceCode:e});if(n.status===ru.APPROVED&&n.session)return n.session;if(n.status===ru.EXPIRED||n.status===ru.DENIED)return null}return null}(t,s||5);o||(e.stop(at.red("認証がタイムアウトまたはキャンセルされました")),process.exit(1)),await Qr.saveSession({access_token:o.accessToken,refresh_token:o.refreshToken,token_type:o.tokenType||"bearer",expires_at:Number(o.expiresAt),expires_in:3600,user:{email:o.email,id:"",aud:"",role:"",email_confirmed_at:"",phone:"",confirmed_at:"",last_sign_in_at:"",app_metadata:{},user_metadata:{},created_at:"",updated_at:"",is_anonymous:!1}}),e.stop(`${at.green("✔")} ${at.cyan(o.email)} としてログインしました`)}catch(t){e.stop(at.red("認証に失敗しました")),Ee.error(t instanceof Error?t.message:String(t)),process.exit(1)}};function td(e){return null==e}var nd={isNothing:td,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:td(e)?[]:[e]},repeat:function(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r},isNegativeZero:function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},extend:function(e,t){var n,r,s,i;if(t)for(n=0,r=(i=Object.keys(t)).length;n<r;n+=1)e[s=i[n]]=t[s];return e}};function rd(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+="\n\n"+e.mark.snippet),r+" "+n):r}function sd(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=rd(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}sd.prototype=Object.create(Error.prototype),sd.prototype.constructor=sd,sd.prototype.toString=function(e){return this.name+": "+rd(this,e)};var id=sd;function od(e,t,n,r,s){var i="",o="",a=Math.floor(s/2)-1;return r-t>a&&(t=r-a+(i=" ... ").length),n-r>a&&(n=r+a-(o=" ...").length),{str:i+e.slice(t,n).replace(/\t/g,"→")+o,pos:r-t+i.length}}function ad(e,t){return nd.repeat(" ",t-e.length)+e}var cd=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,r=/\r?\n|\r|\0/g,s=[0],i=[],o=-1;n=r.exec(e.buffer);)i.push(n.index),s.push(n.index+n[0].length),e.position<=n.index&&o<0&&(o=s.length-2);o<0&&(o=s.length-1);var a,c,l="",u=Math.min(e.line+t.linesAfter,i.length).toString().length,d=t.maxLength-(t.indent+u+3);for(a=1;a<=t.linesBefore&&!(o-a<0);a++)c=od(e.buffer,s[o-a],i[o-a],e.position-(s[o]-s[o-a]),d),l=nd.repeat(" ",t.indent)+ad((e.line-a+1).toString(),u)+" | "+c.str+"\n"+l;for(c=od(e.buffer,s[o],i[o],e.position,d),l+=nd.repeat(" ",t.indent)+ad((e.line+1).toString(),u)+" | "+c.str+"\n",l+=nd.repeat("-",t.indent+u+3+c.pos)+"^\n",a=1;a<=t.linesAfter&&!(o+a>=i.length);a++)c=od(e.buffer,s[o+a],i[o+a],e.position-(s[o]-s[o+a]),d),l+=nd.repeat(" ",t.indent)+ad((e.line+a+1).toString(),u)+" | "+c.str+"\n";return l.replace(/\n$/,"")},ld=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],ud=["scalar","sequence","mapping"];var dd=function(e,t){var n,r;if(t=t||{},Object.keys(t).forEach(function(t){if(-1===ld.indexOf(t))throw new id('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=(n=t.styleAliases||null,r={},null!==n&&Object.keys(n).forEach(function(e){n[e].forEach(function(t){r[String(t)]=e})}),r),-1===ud.indexOf(this.kind))throw new id('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function hd(e,t){var n=[];return e[t].forEach(function(e){var t=n.length;n.forEach(function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)}),n[t]=e}),n}function md(e){return this.extend(e)}md.prototype.extend=function(e){var t=[],n=[];if(e instanceof dd)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new id("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach(function(e){if(!(e instanceof dd))throw new id("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new id("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new id("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(e){if(!(e instanceof dd))throw new id("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(md.prototype);return r.implicit=(this.implicit||[]).concat(t),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=hd(r,"implicit"),r.compiledExplicit=hd(r,"explicit"),r.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}(r.compiledImplicit,r.compiledExplicit),r};var gd=md,pd=new dd("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}}),fd=new dd("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}}),yd=new dd("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}}),bd=new gd({explicit:[pd,fd,yd]});var Id=new dd("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});var wd=new dd("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function vd(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Gd(e){return 48<=e&&e<=55}function Ad(e){return 48<=e&&e<=57}var Sd=new dd("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n=e.length,r=0,s=!1;if(!n)return!1;if("-"!==(t=e[r])&&"+"!==t||(t=e[++r]),"0"===t){if(r+1===n)return!0;if("b"===(t=e[++r])){for(r++;r<n;r++)if("_"!==(t=e[r])){if("0"!==t&&"1"!==t)return!1;s=!0}return s&&"_"!==t}if("x"===t){for(r++;r<n;r++)if("_"!==(t=e[r])){if(!vd(e.charCodeAt(r)))return!1;s=!0}return s&&"_"!==t}if("o"===t){for(r++;r<n;r++)if("_"!==(t=e[r])){if(!Gd(e.charCodeAt(r)))return!1;s=!0}return s&&"_"!==t}}if("_"===t)return!1;for(;r<n;r++)if("_"!==(t=e[r])){if(!Ad(e.charCodeAt(r)))return!1;s=!0}return!(!s||"_"===t)},construct:function(e){var t,n=e,r=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(t=n[0])&&"+"!==t||("-"===t&&(r=-1),t=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===t){if("b"===n[1])return r*parseInt(n.slice(2),2);if("x"===n[1])return r*parseInt(n.slice(2),16);if("o"===n[1])return r*parseInt(n.slice(2),8)}return r*parseInt(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!nd.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Cd=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var Zd=/^[-+]?[0-9]+e/;var Vd=new dd("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!Cd.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||nd.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(nd.isNegativeZero(e))return"-0.0";return n=e.toString(10),Zd.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),Ed=bd.extend({implicit:[Id,wd,Sd,Vd]}),Xd=Ed,Bd=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Rd=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var xd=new dd("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==Bd.exec(e)||null!==Rd.exec(e))},construct:function(e){var t,n,r,s,i,o,a,c,l=0,u=null;if(null===(t=Bd.exec(e))&&(t=Rd.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,s=+t[3],!t[4])return new Date(Date.UTC(n,r,s));if(i=+t[4],o=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),c=new Date(Date.UTC(n,r,s,i,o,a,l)),u&&c.setTime(c.getTime()-u),c},instanceOf:Date,represent:function(e){return e.toISOString()}});var Wd=new dd("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),Nd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var Jd=new dd("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,s=e.length,i=Nd;for(n=0;n<s;n++)if(!((t=i.indexOf(e.charAt(n)))>64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,r=e.replace(/[\r\n=]/g,""),s=r.length,i=Nd,o=0,a=[];for(t=0;t<s;t++)t%4==0&&t&&(a.push(o>>16&255),a.push(o>>8&255),a.push(255&o)),o=o<<6|i.indexOf(r.charAt(t));return 0===(n=s%4*6)?(a.push(o>>16&255),a.push(o>>8&255),a.push(255&o)):18===n?(a.push(o>>10&255),a.push(o>>2&255)):12===n&&a.push(o>>4&255),new Uint8Array(a)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,r="",s=0,i=e.length,o=Nd;for(t=0;t<i;t++)t%3==0&&t&&(r+=o[s>>18&63],r+=o[s>>12&63],r+=o[s>>6&63],r+=o[63&s]),s=(s<<8)+e[t];return 0===(n=i%3)?(r+=o[s>>18&63],r+=o[s>>12&63],r+=o[s>>6&63],r+=o[63&s]):2===n?(r+=o[s>>10&63],r+=o[s>>4&63],r+=o[s<<2&63],r+=o[64]):1===n&&(r+=o[s>>2&63],r+=o[s<<4&63],r+=o[64],r+=o[64]),r}}),kd=Object.prototype.hasOwnProperty,_d=Object.prototype.toString;var Fd=new dd("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,s,i,o=[],a=e;for(t=0,n=a.length;t<n;t+=1){if(r=a[t],i=!1,"[object Object]"!==_d.call(r))return!1;for(s in r)if(kd.call(r,s)){if(i)return!1;i=!0}if(!i)return!1;if(-1!==o.indexOf(s))return!1;o.push(s)}return!0},construct:function(e){return null!==e?e:[]}}),Yd=Object.prototype.toString;var Ld=new dd("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,s,i,o=e;for(i=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],"[object Object]"!==Yd.call(r))return!1;if(1!==(s=Object.keys(r)).length)return!1;i[t]=[s[0],r[s[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,r,s,i,o=e;for(i=new Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],s=Object.keys(r),i[t]=[s[0],r[s[0]]];return i}}),Hd=Object.prototype.hasOwnProperty;var Td=new dd("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(Hd.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}}),Od=Xd.extend({implicit:[xd,Wd],explicit:[Jd,Fd,Ld,Td]}),Md=Object.prototype.hasOwnProperty,Kd=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Ud=/[\x85\u2028\u2029]/,zd=/[,\[\]\{\}]/,Dd=/^(?:!|!!|![a-z\-]+!)$/i,Pd=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function jd(e){return Object.prototype.toString.call(e)}function Qd(e){return 10===e||13===e}function $d(e){return 9===e||32===e}function qd(e){return 9===e||32===e||10===e||13===e}function eh(e){return 44===e||91===e||93===e||123===e||125===e}function th(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function nh(e){return 120===e?2:117===e?4:85===e?8:0}function rh(e){return 48<=e&&e<=57?e-48:-1}function sh(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function ih(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}function oh(e,t,n){"__proto__"===t?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}for(var ah=new Array(256),ch=new Array(256),lh=0;lh<256;lh++)ah[lh]=sh(lh)?1:0,ch[lh]=sh(lh);function uh(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Od,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function dh(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=cd(n),new id(t,n)}function hh(e,t){throw dh(e,t)}function mh(e,t){e.onWarning&&e.onWarning.call(null,dh(e,t))}var gh={YAML:function(e,t,n){var r,s,i;null!==e.version&&hh(e,"duplication of %YAML directive"),1!==n.length&&hh(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&hh(e,"ill-formed argument of the YAML directive"),s=parseInt(r[1],10),i=parseInt(r[2],10),1!==s&&hh(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=i<2,1!==i&&2!==i&&mh(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,s;2!==n.length&&hh(e,"TAG directive accepts exactly two arguments"),r=n[0],s=n[1],Dd.test(r)||hh(e,"ill-formed tag handle (first argument) of the TAG directive"),Md.call(e.tagMap,r)&&hh(e,'there is a previously declared suffix for "'+r+'" tag handle'),Pd.test(s)||hh(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch(i){hh(e,"tag prefix is malformed: "+s)}e.tagMap[r]=s}};function ph(e,t,n,r){var s,i,o,a;if(t<n){if(a=e.input.slice(t,n),r)for(s=0,i=a.length;s<i;s+=1)9===(o=a.charCodeAt(s))||32<=o&&o<=1114111||hh(e,"expected valid JSON character");else Kd.test(a)&&hh(e,"the stream contains non-printable characters");e.result+=a}}function fh(e,t,n,r){var s,i,o,a;for(nd.isObject(n)||hh(e,"cannot merge mappings; the provided source object is unacceptable"),o=0,a=(s=Object.keys(n)).length;o<a;o+=1)i=s[o],Md.call(t,i)||(oh(t,i,n[i]),r[i]=!0)}function yh(e,t,n,r,s,i,o,a,c){var l,u;if(Array.isArray(s))for(l=0,u=(s=Array.prototype.slice.call(s)).length;l<u;l+=1)Array.isArray(s[l])&&hh(e,"nested arrays are not supported inside keys"),"object"==typeof s&&"[object Object]"===jd(s[l])&&(s[l]="[object Object]");if("object"==typeof s&&"[object Object]"===jd(s)&&(s="[object Object]"),s=String(s),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(i))for(l=0,u=i.length;l<u;l+=1)fh(e,t,i[l],n);else fh(e,t,i,n);else e.json||Md.call(n,s)||!Md.call(t,s)||(e.line=o||e.line,e.lineStart=a||e.lineStart,e.position=c||e.position,hh(e,"duplicated mapping key")),oh(t,s,i),delete n[s];return t}function bh(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):hh(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Ih(e,t,n){for(var r=0,s=e.input.charCodeAt(e.position);0!==s;){for(;$d(s);)9===s&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),s=e.input.charCodeAt(++e.position);if(t&&35===s)do{s=e.input.charCodeAt(++e.position)}while(10!==s&&13!==s&&0!==s);if(!Qd(s))break;for(bh(e),s=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===s;)e.lineIndent++,s=e.input.charCodeAt(++e.position)}return-1!==n&&0!==r&&e.lineIndent<n&&mh(e,"deficient indentation"),r}function wh(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!qd(t)))}function vh(e,t){1===t?e.result+=" ":t>1&&(e.result+=nd.repeat("\n",t-1))}function Gh(e,t){var n,r,s=e.tag,i=e.anchor,o=[],a=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),r=e.input.charCodeAt(e.position);0!==r&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,hh(e,"tab characters must not be used in indentation")),45===r)&&qd(e.input.charCodeAt(e.position+1));)if(a=!0,e.position++,Ih(e,!0,-1)&&e.lineIndent<=t)o.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,Ch(e,t,3,!1,!0),o.push(e.result),Ih(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)hh(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!a&&(e.tag=s,e.anchor=i,e.kind="sequence",e.result=o,!0)}function Ah(e){var t,n,r,s,i=!1,o=!1;if(33!==(s=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&hh(e,"duplication of a tag property"),60===(s=e.input.charCodeAt(++e.position))?(i=!0,s=e.input.charCodeAt(++e.position)):33===s?(o=!0,n="!!",s=e.input.charCodeAt(++e.position)):n="!",t=e.position,i){do{s=e.input.charCodeAt(++e.position)}while(0!==s&&62!==s);e.position<e.length?(r=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):hh(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==s&&!qd(s);)33===s&&(o?hh(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),Dd.test(n)||hh(e,"named tag handle cannot contain such characters"),o=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),zd.test(r)&&hh(e,"tag suffix cannot contain flow indicator characters")}r&&!Pd.test(r)&&hh(e,"tag name cannot contain such characters: "+r);try{r=decodeURIComponent(r)}catch(a){hh(e,"tag name is malformed: "+r)}return i?e.tag=r:Md.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:hh(e,'undeclared tag handle "'+n+'"'),!0}function Sh(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&hh(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!qd(n)&&!eh(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&hh(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Ch(e,t,n,r,s){var i,o,a,c,l,u,d,h,m,g=1,p=!1,f=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=o=a=4===n||3===n,r&&Ih(e,!0,-1)&&(p=!0,e.lineIndent>t?g=1:e.lineIndent===t?g=0:e.lineIndent<t&&(g=-1)),1===g)for(;Ah(e)||Sh(e);)Ih(e,!0,-1)?(p=!0,a=i,e.lineIndent>t?g=1:e.lineIndent===t?g=0:e.lineIndent<t&&(g=-1)):a=!1;if(a&&(a=p||s),1!==g&&4!==n||(h=1===n||2===n?t:t+1,m=e.position-e.lineStart,1===g?a&&(Gh(e,m)||function(e,t,n){var r,s,i,o,a,c,l,u=e.tag,d=e.anchor,h={},m=/* @__PURE__ */Object.create(null),g=null,p=null,f=null,y=!1,b=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=h),l=e.input.charCodeAt(e.position);0!==l;){if(y||-1===e.firstTabInLine||(e.position=e.firstTabInLine,hh(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),i=e.line,63!==l&&58!==l||!qd(r)){if(o=e.line,a=e.lineStart,c=e.position,!Ch(e,n,2,!1,!0))break;if(e.line===i){for(l=e.input.charCodeAt(e.position);$d(l);)l=e.input.charCodeAt(++e.position);if(58===l)qd(l=e.input.charCodeAt(++e.position))||hh(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(yh(e,h,m,g,p,null,o,a,c),g=p=f=null),b=!0,y=!1,s=!1,g=e.tag,p=e.result;else{if(!b)return e.tag=u,e.anchor=d,!0;hh(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!b)return e.tag=u,e.anchor=d,!0;hh(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===l?(y&&(yh(e,h,m,g,p,null,o,a,c),g=p=f=null),b=!0,y=!0,s=!0):y?(y=!1,s=!0):hh(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,l=r;if((e.line===i||e.lineIndent>t)&&(y&&(o=e.line,a=e.lineStart,c=e.position),Ch(e,t,4,!0,s)&&(y?p=e.result:f=e.result),y||(yh(e,h,m,g,p,f,o,a,c),g=p=f=null),Ih(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>t)&&0!==l)hh(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&yh(e,h,m,g,p,null,o,a,c),b&&(e.tag=u,e.anchor=d,e.kind="mapping",e.result=h),b}(e,m,h))||function(e,t){var n,r,s,i,o,a,c,l,u,d,h,m,g=!0,p=e.tag,f=e.anchor,y=/* @__PURE__ */Object.create(null);if(91===(m=e.input.charCodeAt(e.position)))o=93,l=!1,i=[];else{if(123!==m)return!1;o=125,l=!0,i={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=i),m=e.input.charCodeAt(++e.position);0!==m;){if(Ih(e,!0,t),(m=e.input.charCodeAt(e.position))===o)return e.position++,e.tag=p,e.anchor=f,e.kind=l?"mapping":"sequence",e.result=i,!0;g?44===m&&hh(e,"expected the node content, but found ','"):hh(e,"missed comma between flow collection entries"),h=null,a=c=!1,63===m&&qd(e.input.charCodeAt(e.position+1))&&(a=c=!0,e.position++,Ih(e,!0,t)),n=e.line,r=e.lineStart,s=e.position,Ch(e,t,1,!1,!0),d=e.tag,u=e.result,Ih(e,!0,t),m=e.input.charCodeAt(e.position),!c&&e.line!==n||58!==m||(a=!0,m=e.input.charCodeAt(++e.position),Ih(e,!0,t),Ch(e,t,1,!1,!0),h=e.result),l?yh(e,i,y,d,u,h,n,r,s):a?i.push(yh(e,null,y,d,u,h,n,r,s)):i.push(u),Ih(e,!0,t),44===(m=e.input.charCodeAt(e.position))?(g=!0,m=e.input.charCodeAt(++e.position)):g=!1}hh(e,"unexpected end of the stream within a flow collection")}(e,h)?f=!0:(o&&function(e,t){var n,r,s,i,o=1,a=!1,c=!1,l=t,u=0,d=!1;if(124===(i=e.input.charCodeAt(e.position)))r=!1;else{if(62!==i)return!1;r=!0}for(e.kind="scalar",e.result="";0!==i;)if(43===(i=e.input.charCodeAt(++e.position))||45===i)1===o?o=43===i?3:2:hh(e,"repeat of a chomping mode identifier");else{if(!((s=rh(i))>=0))break;0===s?hh(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?hh(e,"repeat of an indentation width identifier"):(l=t+s-1,c=!0)}if($d(i)){do{i=e.input.charCodeAt(++e.position)}while($d(i));if(35===i)do{i=e.input.charCodeAt(++e.position)}while(!Qd(i)&&0!==i)}for(;0!==i;){for(bh(e),e.lineIndent=0,i=e.input.charCodeAt(e.position);(!c||e.lineIndent<l)&&32===i;)e.lineIndent++,i=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>l&&(l=e.lineIndent),Qd(i))u++;else{if(e.lineIndent<l){3===o?e.result+=nd.repeat("\n",a?1+u:u):1===o&&a&&(e.result+="\n");break}for(r?$d(i)?(d=!0,e.result+=nd.repeat("\n",a?1+u:u)):d?(d=!1,e.result+=nd.repeat("\n",u+1)):0===u?a&&(e.result+=" "):e.result+=nd.repeat("\n",u):e.result+=nd.repeat("\n",a?1+u:u),a=!0,c=!0,u=0,n=e.position;!Qd(i)&&0!==i;)i=e.input.charCodeAt(++e.position);ph(e,n,e.position,!1)}}return!0}(e,h)||function(e,t){var n,r,s;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=s=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(ph(e,r,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;r=e.position,e.position++,s=e.position}else Qd(n)?(ph(e,r,s,!0),vh(e,Ih(e,!1,t)),r=s=e.position):e.position===e.lineStart&&wh(e)?hh(e,"unexpected end of the document within a single quoted scalar"):(e.position++,s=e.position);hh(e,"unexpected end of the stream within a single quoted scalar")}(e,h)||function(e,t){var n,r,s,i,o,a;if(34!==(a=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(a=e.input.charCodeAt(e.position));){if(34===a)return ph(e,n,e.position,!0),e.position++,!0;if(92===a){if(ph(e,n,e.position,!0),Qd(a=e.input.charCodeAt(++e.position)))Ih(e,!1,t);else if(a<256&&ah[a])e.result+=ch[a],e.position++;else if((o=nh(a))>0){for(s=o,i=0;s>0;s--)(o=th(a=e.input.charCodeAt(++e.position)))>=0?i=(i<<4)+o:hh(e,"expected hexadecimal character");e.result+=ih(i),e.position++}else hh(e,"unknown escape sequence");n=r=e.position}else Qd(a)?(ph(e,n,r,!0),vh(e,Ih(e,!1,t)),n=r=e.position):e.position===e.lineStart&&wh(e)?hh(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}hh(e,"unexpected end of the stream within a double quoted scalar")}(e,h)?f=!0:!function(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!qd(r)&&!eh(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&hh(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Md.call(e.anchorMap,n)||hh(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],Ih(e,!0,-1),!0}(e)?function(e,t,n){var r,s,i,o,a,c,l,u,d=e.kind,h=e.result;if(qd(u=e.input.charCodeAt(e.position))||eh(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(qd(r=e.input.charCodeAt(e.position+1))||n&&eh(r)))return!1;for(e.kind="scalar",e.result="",s=i=e.position,o=!1;0!==u;){if(58===u){if(qd(r=e.input.charCodeAt(e.position+1))||n&&eh(r))break}else if(35===u){if(qd(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&wh(e)||n&&eh(u))break;if(Qd(u)){if(a=e.line,c=e.lineStart,l=e.lineIndent,Ih(e,!1,-1),e.lineIndent>=t){o=!0,u=e.input.charCodeAt(e.position);continue}e.position=i,e.line=a,e.lineStart=c,e.lineIndent=l;break}}o&&(ph(e,s,i,!1),vh(e,e.line-a),s=i=e.position,o=!1),$d(u)||(i=e.position+1),u=e.input.charCodeAt(++e.position)}return ph(e,s,i,!1),!!e.result||(e.kind=d,e.result=h,!1)}(e,h,1===n)&&(f=!0,null===e.tag&&(e.tag="?")):(f=!0,null===e.tag&&null===e.anchor||hh(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===g&&(f=a&&Gh(e,m))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&hh(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),c=0,l=e.implicitTypes.length;c<l;c+=1)if((d=e.implicitTypes[c]).resolve(e.result)){e.result=d.construct(e.result),e.tag=d.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else if("!"!==e.tag){if(Md.call(e.typeMap[e.kind||"fallback"],e.tag))d=e.typeMap[e.kind||"fallback"][e.tag];else for(d=null,c=0,l=(u=e.typeMap.multi[e.kind||"fallback"]).length;c<l;c+=1)if(e.tag.slice(0,u[c].tag.length)===u[c].tag){d=u[c];break}d||hh(e,"unknown tag !<"+e.tag+">"),null!==e.result&&d.kind!==e.kind&&hh(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result,e.tag)?(e.result=d.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):hh(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||f}function Zh(e){var t,n,r,s,i=e.position,o=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=/* @__PURE__ */Object.create(null),e.anchorMap=/* @__PURE__ */Object.create(null);0!==(s=e.input.charCodeAt(e.position))&&(Ih(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==s));){for(o=!0,s=e.input.charCodeAt(++e.position),t=e.position;0!==s&&!qd(s);)s=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&hh(e,"directive name must not be less than one character in length");0!==s;){for(;$d(s);)s=e.input.charCodeAt(++e.position);if(35===s){do{s=e.input.charCodeAt(++e.position)}while(0!==s&&!Qd(s));break}if(Qd(s))break;for(t=e.position;0!==s&&!qd(s);)s=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==s&&bh(e),Md.call(gh,n)?gh[n](e,n,r):mh(e,'unknown document directive "'+n+'"')}Ih(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,Ih(e,!0,-1)):o&&hh(e,"directives end mark is expected"),Ch(e,e.lineIndent-1,4,!1,!0),Ih(e,!0,-1),e.checkLineBreaks&&Ud.test(e.input.slice(i,e.position))&&mh(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&wh(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,Ih(e,!0,-1)):e.position<e.length-1&&hh(e,"end of the stream or a document separator is expected")}function Vh(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new uh(e,t),r=e.indexOf("\0");for(-1!==r&&(n.position=r,hh(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Zh(n);return n.documents}var Eh={loadAll:function(e,t,n){null!==t&&"object"==typeof t&&void 0===n&&(n=t,t=null);var r=Vh(e,n);if("function"!=typeof t)return r;for(var s=0,i=r.length;s<i;s+=1)t(r[s])},load:function(e,t){var n=Vh(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new id("expected a single document in the stream, but found more")}}},Xh=Object.prototype.toString,Bh=Object.prototype.hasOwnProperty,Rh=65279,xh={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},Wh=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Nh=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Jh(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else{if(!(e<=4294967295))throw new id("code point within a string may not be greater than 0xFFFFFFFF");n="U",r=8}return"\\"+n+nd.repeat("0",r-t.length)+t}function kh(e){this.schema=e.schema||Od,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=nd.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,r,s,i,o,a,c;if(null===t)return{};for(n={},s=0,i=(r=Object.keys(t)).length;s<i;s+=1)o=r[s],a=String(t[o]),"!!"===o.slice(0,2)&&(o="tag:yaml.org,2002:"+o.slice(2)),(c=e.compiledTypeMap.fallback[o])&&Bh.call(c.styleAliases,a)&&(a=c.styleAliases[a]),n[o]=a;return n}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType='"'===e.quotingType?2:1,this.forceQuotes=e.forceQuotes||!1,this.replacer="function"==typeof e.replacer?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function _h(e,t){for(var n,r=nd.repeat(" ",t),s=0,i=-1,o="",a=e.length;s<a;)-1===(i=e.indexOf("\n",s))?(n=e.slice(s),s=a):(n=e.slice(s,i+1),s=i+1),n.length&&"\n"!==n&&(o+=r),o+=n;return o}function Fh(e,t){return"\n"+nd.repeat(" ",e.indent*t)}function Yh(e){return 32===e||9===e}function Lh(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&e!==Rh||65536<=e&&e<=1114111}function Hh(e){return Lh(e)&&e!==Rh&&13!==e&&10!==e}function Th(e,t,n){var r=Hh(e),s=r&&!Yh(e);return(n?r:r&&44!==e&&91!==e&&93!==e&&123!==e&&125!==e)&&35!==e&&!(58===t&&!s)||Hh(t)&&!Yh(t)&&35===e||58===t&&s}function Oh(e,t){var n,r=e.charCodeAt(t);return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1))>=56320&&n<=57343?1024*(r-55296)+n-56320+65536:r}function Mh(e){return/^\n* /.test(e)}function Kh(e,t,n,r,s,i,o,a){var c,l,u=0,d=null,h=!1,m=!1,g=-1!==r,p=-1,f=Lh(l=Oh(e,0))&&l!==Rh&&!Yh(l)&&45!==l&&63!==l&&58!==l&&44!==l&&91!==l&&93!==l&&123!==l&&125!==l&&35!==l&&38!==l&&42!==l&&33!==l&&124!==l&&61!==l&&62!==l&&39!==l&&34!==l&&37!==l&&64!==l&&96!==l&&function(e){return!Yh(e)&&58!==e}(Oh(e,e.length-1));if(t||o)for(c=0;c<e.length;u>=65536?c+=2:c++){if(!Lh(u=Oh(e,c)))return 5;f=f&&Th(u,d,a),d=u}else{for(c=0;c<e.length;u>=65536?c+=2:c++){if(10===(u=Oh(e,c)))h=!0,g&&(m=m||c-p-1>r&&" "!==e[p+1],p=c);else if(!Lh(u))return 5;f=f&&Th(u,d,a),d=u}m=m||g&&c-p-1>r&&" "!==e[p+1]}return h||m?n>9&&Mh(e)?5:o?2===i?5:2:m?4:3:!f||o||s(e)?2===i?5:2:1}function Uh(e,t,n,r,s){e.dump=function(){if(0===t.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==Wh.indexOf(t)||Nh.test(t)))return 2===e.quotingType?'"'+t+'"':"'"+t+"'";var i=e.indent*Math.max(1,n),o=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),a=r||e.flowLevel>-1&&n>=e.flowLevel;switch(Kh(t,a,e.indent,o,function(t){return function(e,t){var n,r;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)},e.quotingType,e.forceQuotes&&!r,s)){case 1:return t;case 2:return"'"+t.replace(/'/g,"''")+"'";case 3:return"|"+zh(t,e.indent)+Dh(_h(t,i));case 4:return">"+zh(t,e.indent)+Dh(_h(function(e,t){var n,r,s=/(\n+)([^\n]*)/g,i=(a=e.indexOf("\n"),a=-1!==a?a:e.length,s.lastIndex=a,Ph(e.slice(0,a),t)),o="\n"===e[0]||" "===e[0];var a;for(;r=s.exec(e);){var c=r[1],l=r[2];n=" "===l[0],i+=c+(o||n||""===l?"":"\n")+Ph(l,t),o=n}return i}(t,o),i));case 5:return'"'+function(e){for(var t,n="",r=0,s=0;s<e.length;r>=65536?s+=2:s++)r=Oh(e,s),!(t=xh[r])&&Lh(r)?(n+=e[s],r>=65536&&(n+=e[s+1])):n+=t||Jh(r);return n}(t)+'"';default:throw new id("impossible error: invalid scalar style")}}()}function zh(e,t){var n=Mh(e)?String(t):"",r="\n"===e[e.length-1];return n+(r&&("\n"===e[e.length-2]||"\n"===e)?"+":r?"":"-")+"\n"}function Dh(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function Ph(e,t){if(""===e||" "===e[0])return e;for(var n,r,s=/ [^ ]/g,i=0,o=0,a=0,c="";n=s.exec(e);)(a=n.index)-i>t&&(r=o>i?o:a,c+="\n"+e.slice(i,r),i=r+1),o=a;return c+="\n",e.length-i>t&&o>i?c+=e.slice(i,o)+"\n"+e.slice(o+1):c+=e.slice(i),c.slice(1)}function jh(e,t,n,r){var s,i,o,a="",c=e.tag;for(s=0,i=n.length;s<i;s+=1)o=n[s],e.replacer&&(o=e.replacer.call(n,String(s),o)),($h(e,t+1,o,!0,!0,!1,!0)||void 0===o&&$h(e,t+1,null,!0,!0,!1,!0))&&(r&&""===a||(a+=Fh(e,t)),e.dump&&10===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=c,e.dump=a||"[]"}function Qh(e,t,n){var r,s,i,o,a,c;for(i=0,o=(s=n?e.explicitTypes:e.implicitTypes).length;i<o;i+=1)if(((a=s[i]).instanceOf||a.predicate)&&(!a.instanceOf||"object"==typeof t&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(n?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(c=e.styleMap[a.tag]||a.defaultStyle,"[object Function]"===Xh.call(a.represent))r=a.represent(t,c);else{if(!Bh.call(a.represent,c))throw new id("!<"+a.tag+'> tag resolver accepts not "'+c+'" style');r=a.represent[c](t,c)}e.dump=r}return!0}return!1}function $h(e,t,n,r,s,i,o){e.tag=null,e.dump=n,Qh(e,n,!1)||Qh(e,n,!0);var a,c=Xh.call(e.dump),l=r;r&&(r=e.flowLevel<0||e.flowLevel>t);var u,d,h="[object Object]"===c||"[object Array]"===c;if(h&&(d=-1!==(u=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||d||2!==e.indent&&t>0)&&(s=!1),d&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(h&&d&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),"[object Object]"===c)r&&0!==Object.keys(e.dump).length?(!function(e,t,n,r){var s,i,o,a,c,l,u="",d=e.tag,h=Object.keys(n);if(!0===e.sortKeys)h.sort();else if("function"==typeof e.sortKeys)h.sort(e.sortKeys);else if(e.sortKeys)throw new id("sortKeys must be a boolean or a function");for(s=0,i=h.length;s<i;s+=1)l="",r&&""===u||(l+=Fh(e,t)),a=n[o=h[s]],e.replacer&&(a=e.replacer.call(n,o,a)),$h(e,t+1,o,!0,!0,!0)&&((c=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&10===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,c&&(l+=Fh(e,t)),$h(e,t+1,a,!0,c)&&(e.dump&&10===e.dump.charCodeAt(0)?l+=":":l+=": ",u+=l+=e.dump));e.tag=d,e.dump=u||"{}"}(e,t,e.dump,s),d&&(e.dump="&ref_"+u+e.dump)):(!function(e,t,n){var r,s,i,o,a,c="",l=e.tag,u=Object.keys(n);for(r=0,s=u.length;r<s;r+=1)a="",""!==c&&(a+=", "),e.condenseFlow&&(a+='"'),o=n[i=u[r]],e.replacer&&(o=e.replacer.call(n,i,o)),$h(e,t,i,!1,!1)&&(e.dump.length>1024&&(a+="? "),a+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),$h(e,t,o,!1,!1)&&(c+=a+=e.dump));e.tag=l,e.dump="{"+c+"}"}(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if("[object Array]"===c)r&&0!==e.dump.length?(e.noArrayIndent&&!o&&t>0?jh(e,t-1,e.dump,s):jh(e,t,e.dump,s),d&&(e.dump="&ref_"+u+e.dump)):(!function(e,t,n){var r,s,i,o="",a=e.tag;for(r=0,s=n.length;r<s;r+=1)i=n[r],e.replacer&&(i=e.replacer.call(n,String(r),i)),($h(e,t,i,!1,!1)||void 0===i&&$h(e,t,null,!1,!1))&&(""!==o&&(o+=","+(e.condenseFlow?"":" ")),o+=e.dump);e.tag=a,e.dump="["+o+"]"}(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else{if("[object String]"!==c){if("[object Undefined]"===c)return!1;if(e.skipInvalid)return!1;throw new id("unacceptable kind of an object to dump "+c)}"?"!==e.tag&&Uh(e,e.dump,t,i,l)}null!==e.tag&&"?"!==e.tag&&(a=encodeURI("!"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,"%21"),a="!"===e.tag[0]?"!"+a:"tag:yaml.org,2002:"===a.slice(0,18)?"!!"+a.slice(18):"!<"+a+">",e.dump=a+" "+e.dump)}return!0}function qh(e,t){var n,r,s=[],i=[];for(em(e,s,i),n=0,r=i.length;n<r;n+=1)t.duplicates.push(s[i[n]]);t.usedDuplicates=new Array(r)}function em(e,t,n){var r,s,i;if(null!==e&&"object"==typeof e)if(-1!==(s=t.indexOf(e)))-1===n.indexOf(s)&&n.push(s);else if(t.push(e),Array.isArray(e))for(s=0,i=e.length;s<i;s+=1)em(e[s],t,n);else for(s=0,i=(r=Object.keys(e)).length;s<i;s+=1)em(e[r[s]],t,n)}function tm(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var nm={Type:dd,Schema:gd,FAILSAFE_SCHEMA:bd,JSON_SCHEMA:Ed,CORE_SCHEMA:Xd,DEFAULT_SCHEMA:Od,load:Eh.load,loadAll:Eh.loadAll,dump:{dump:function(e,t){var n=new kh(t=t||{});n.noRefs||qh(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),$h(n,0,r,!0,!0)?n.dump+"\n":""}}.dump,YAMLException:id,types:{binary:Jd,float:Vd,map:yd,null:Id,pairs:Ld,set:Td,timestamp:xd,bool:wd,int:Sd,merge:Wd,omap:Fd,seq:fd,str:pd},safeLoad:tm("safeLoad","load"),safeLoadAll:tm("safeLoadAll","loadAll"),safeDump:tm("safeDump","dump")};function rm(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}function sm(e,t,n,r){return new(n||(n=Promise))(function(s,i){function o(e){try{c(r.next(e))}catch(t){i(t)}}function a(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}c((r=r.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class im extends Error{constructor(e,t="FunctionsError",n){super(e),this.name=t,this.context=n}}class om extends im{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class am extends im{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class cm extends im{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var lm,um;(um=lm||(lm={})).Any="any",um.ApNortheast1="ap-northeast-1",um.ApNortheast2="ap-northeast-2",um.ApSouth1="ap-south-1",um.ApSoutheast1="ap-southeast-1",um.ApSoutheast2="ap-southeast-2",um.CaCentral1="ca-central-1",um.EuCentral1="eu-central-1",um.EuWest1="eu-west-1",um.EuWest2="eu-west-2",um.EuWest3="eu-west-3",um.SaEast1="sa-east-1",um.UsEast1="us-east-1",um.UsWest1="us-west-1",um.UsWest2="us-west-2";class dm{constructor(e,{headers:t={},customFetch:n,region:r=lm.Any}={}){this.url=e,this.headers=t,this.region=r,this.fetch=(e=>e?(...t)=>e(...t):(...e)=>fetch(...e))(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return sm(this,arguments,void 0,function*(e,t={}){var n;let r,s;try{const{headers:i,method:o,body:a,signal:c,timeout:l}=t;let u={},{region:d}=t;d||(d=this.region);const h=new URL(`${this.url}/${e}`);let m;d&&"any"!==d&&(u["x-region"]=d,h.searchParams.set("forceFunctionRegion",d)),a&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)?"undefined"!=typeof Blob&&a instanceof Blob||a instanceof ArrayBuffer?(u["Content-Type"]="application/octet-stream",m=a):"string"==typeof a?(u["Content-Type"]="text/plain",m=a):"undefined"!=typeof FormData&&a instanceof FormData?m=a:(u["Content-Type"]="application/json",m=JSON.stringify(a)):m=!a||"string"==typeof a||"undefined"!=typeof Blob&&a instanceof Blob||a instanceof ArrayBuffer||"undefined"!=typeof FormData&&a instanceof FormData?a:JSON.stringify(a);let g=c;l&&(s=new AbortController,r=setTimeout(()=>s.abort(),l),c?(g=s.signal,c.addEventListener("abort",()=>s.abort())):g=s.signal);const p=yield this.fetch(h.toString(),{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},u),this.headers),i),body:m,signal:g}).catch(e=>{throw new om(e)}),f=p.headers.get("x-relay-error");if(f&&"true"===f)throw new am(p);if(!p.ok)throw new cm(p);let y,b=(null!==(n=p.headers.get("Content-Type"))&&void 0!==n?n:"text/plain").split(";")[0].trim();return y="application/json"===b?yield p.json():"application/octet-stream"===b||"application/pdf"===b?yield p.blob():"text/event-stream"===b?p:"multipart/form-data"===b?yield p.formData():yield p.text(),{data:y,error:null,response:p}}catch(i){return{data:null,error:i,response:i instanceof cm||i instanceof am?i.context:void 0}}finally{r&&clearTimeout(r)}})}}var hm=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},mm=class{constructor(e){var t,n,r;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=null!==(t=e.shouldThrowOnError)&&void 0!==t&&t,this.signal=e.signal,this.isMaybeSingle=null!==(n=e.isMaybeSingle)&&void 0!==n&&n,this.urlLengthLimit=null!==(r=e.urlLengthLimit)&&void 0!==r?r:8e3,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var n=this;void 0===this.schema||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),"GET"!==this.method&&"HEAD"!==this.method&&this.headers.set("Content-Type","application/json");let r=(0,this.fetch)(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async e=>{let t=null,r=null,s=null,i=e.status,o=e.statusText;if(e.ok){var a,c;if("HEAD"!==n.method){var l;const t=await e.text();""===t||(r="text/csv"===n.headers.get("Accept")||n.headers.get("Accept")&&(null===(l=n.headers.get("Accept"))||void 0===l?void 0:l.includes("application/vnd.pgrst.plan+text"))?t:JSON.parse(t))}const u=null===(a=n.headers.get("Prefer"))||void 0===a?void 0:a.match(/count=(exact|planned|estimated)/),d=null===(c=e.headers.get("content-range"))||void 0===c?void 0:c.split("/");u&&d&&d.length>1&&(s=parseInt(d[1])),n.isMaybeSingle&&"GET"===n.method&&Array.isArray(r)&&(r.length>1?(t={code:"PGRST116",details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},r=null,s=null,i=406,o="Not Acceptable"):r=1===r.length?r[0]:null)}else{var u;const s=await e.text();try{t=JSON.parse(s),Array.isArray(t)&&404===e.status&&(r=[],t=null,i=200,o="OK")}catch(d){404===e.status&&""===s?(i=204,o="No Content"):t={message:s}}if(t&&n.isMaybeSingle&&(null==t||null===(u=t.details)||void 0===u?void 0:u.includes("0 rows"))&&(t=null,i=200,o="OK"),t&&n.shouldThrowOnError)throw new hm(t)}return{error:t,data:r,count:s,status:i,statusText:o}});return this.shouldThrowOnError||(r=r.catch(e=>{var t;let n="",r="",s="";const i=null==e?void 0:e.cause;if(i){var o,a,c,l;const t=null!==(o=null==i?void 0:i.message)&&void 0!==o?o:"",r=null!==(a=null==i?void 0:i.code)&&void 0!==a?a:"";n=`${null!==(c=null==e?void 0:e.name)&&void 0!==c?c:"FetchError"}: ${null==e?void 0:e.message}`,n+=`\n\nCaused by: ${null!==(l=null==i?void 0:i.name)&&void 0!==l?l:"Error"}: ${t}`,r&&(n+=` (${r})`),(null==i?void 0:i.stack)&&(n+=`\n${i.stack}`)}else{var u;n=null!==(u=null==e?void 0:e.stack)&&void 0!==u?u:""}const d=this.url.toString().length;return"AbortError"===(null==e?void 0:e.name)||"ABORT_ERR"===(null==e?void 0:e.code)?(s="",r="Request was aborted (timeout or manual cancellation)",d>this.urlLengthLimit&&(r+=`. Note: Your request URL is ${d} 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.`)):"HeadersOverflowError"!==(null==i?void 0:i.name)&&"UND_ERR_HEADERS_OVERFLOW"!==(null==i?void 0:i.code)||(s="",r="HTTP headers exceeded server limits (typically 16KB)",d>this.urlLengthLimit&&(r+=`. Your request URL is ${d} 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.`)),{error:{message:`${null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"FetchError"}: ${null==e?void 0:e.message}`,details:n,hint:r,code:s},data:null,count:null,status:0,statusText:""}})),r.then(e,t)}returns(){return this}overrideTypes(){return this}},gm=class extends mm{select(e){let t=!1;const n=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!t?"":('"'===e&&(t=!t),e)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:s=r}={}){const i=s?`${s}.order`:"order",o=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${void 0===n?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){const r=void 0===n?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){const s=void 0===r?"offset":`${r}.offset`,i=void 0===r?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(i,""+(t-e+1)),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return"GET"===this.method?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),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:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:s=!1,format:i="text"}={}){var o;const a=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"buffers":null,s?"wal":null].filter(Boolean).join("|"),c=null!==(o=this.headers.get("Accept"))&&void 0!==o?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${c}"; options=${a};`),this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const pm=/* @__PURE__ */new RegExp("[,()]");var fm=class extends gm{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const n=Array.from(new Set(t)).map(e=>"string"==typeof e&&pm.test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){const n=Array.from(new Set(t)).map(e=>"string"==typeof e&&pm.test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return"string"==typeof t?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:n,type:r}={}){let s="";"plain"===r?s="pl":"phrase"===r?s="ph":"websearch"===r&&(s="w");const i=void 0===n?"":`(${n})`;return this.url.searchParams.append(e,`${s}fts${i}.${t}`),this}match(e){return Object.entries(e).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},ym=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:s=8e3}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=s}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:n=!1,count:r}=null!=t?t:{},s=n?"HEAD":"GET";let i=!1;const o=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!i?"":('"'===e&&(i=!i),e)).join(""),{url:a,headers:c}=this.cloneRequestState();return a.searchParams.set("select",o),r&&c.append("Prefer",`count=${r}`),new fm({method:s,url:a,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}insert(e,{count:t,defaultToNull:n=!0}={}){var r;const{url:s,headers:i}=this.cloneRequestState();if(t&&i.append("Prefer",`count=${t}`),n||i.append("Prefer","missing=default"),Array.isArray(e)){const t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){const e=[...new Set(t)].map(e=>`"${e}"`);s.searchParams.set("columns",e.join(","))}}return new fm({method:"POST",url:s,headers:i,schema:this.schema,body:e,fetch:null!==(r=this.fetch)&&void 0!==r?r:fetch,urlLengthLimit:this.urlLengthLimit})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:s=!0}={}){var i;const{url:o,headers:a}=this.cloneRequestState();if(a.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),void 0!==t&&o.searchParams.set("on_conflict",t),r&&a.append("Prefer",`count=${r}`),s||a.append("Prefer","missing=default"),Array.isArray(e)){const t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){const e=[...new Set(t)].map(e=>`"${e}"`);o.searchParams.set("columns",e.join(","))}}return new fm({method:"POST",url:o,headers:a,schema:this.schema,body:e,fetch:null!==(i=this.fetch)&&void 0!==i?i:fetch,urlLengthLimit:this.urlLengthLimit})}update(e,{count:t}={}){var n;const{url:r,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new fm({method:"PATCH",url:r,headers:s,schema:this.schema,body:e,fetch:null!==(n=this.fetch)&&void 0!==n?n:fetch,urlLengthLimit:this.urlLengthLimit})}delete({count:e}={}){var t;const{url:n,headers:r}=this.cloneRequestState();return e&&r.append("Prefer",`count=${e}`),new fm({method:"DELETE",url:n,headers:r,schema:this.schema,fetch:null!==(t=this.fetch)&&void 0!==t?t:fetch,urlLengthLimit:this.urlLengthLimit})}};function bm(e){return(bm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Im(e){var t=function(e,t){if("object"!=bm(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=bm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==bm(t)?t:t+""}function wm(e,t,n){return(t=Im(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vm(Object(n),!0).forEach(function(t){wm(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vm(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Am=class e{constructor(e,{headers:t={},schema:n,fetch:r,timeout:s,urlLengthLimit:i=8e3}={}){this.url=e,this.headers=new Headers(t),this.schemaName=n,this.urlLengthLimit=i;const o=null!=r?r:globalThis.fetch;this.fetch=void 0!==s&&s>0?(e,t)=>{const n=new AbortController,r=setTimeout(()=>n.abort(),s),i=null==t?void 0:t.signal;if(i){if(i.aborted)return clearTimeout(r),o(e,t);const s=()=>{clearTimeout(r),n.abort()};return i.addEventListener("abort",s,{once:!0}),o(e,Gm(Gm({},t),{},{signal:n.signal})).finally(()=>{clearTimeout(r),i.removeEventListener("abort",s)})}return o(e,Gm(Gm({},t),{},{signal:n.signal})).finally(()=>clearTimeout(r))}:o}from(e){if(!e||"string"!=typeof e||""===e.trim())throw new Error("Invalid relation name: relation must be a non-empty string.");return new ym(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}rpc(e,t={},{head:n=!1,get:r=!1,count:s}={}){var i;let o;const a=new URL(`${this.url}/rpc/${e}`);let c;const l=e=>null!==e&&"object"==typeof e&&(!Array.isArray(e)||e.some(l)),u=n&&Object.values(t).some(l);u?(o="POST",c=t):n||r?(o=n?"HEAD":"GET",Object.entries(t).filter(([e,t])=>void 0!==t).map(([e,t])=>[e,Array.isArray(t)?`{${t.join(",")}}`:`${t}`]).forEach(([e,t])=>{a.searchParams.append(e,t)})):(o="POST",c=t);const d=new Headers(this.headers);return u?d.set("Prefer",s?`count=${s},return=minimal`:"return=minimal"):s&&d.set("Prefer",`count=${s}`),new fm({method:o,url:a,headers:d,schema:this.schemaName,body:c,fetch:null!==(i=this.fetch)&&void 0!==i?i:fetch,urlLengthLimit:this.urlLengthLimit})}};class Sm{constructor(){}static detectEnvironment(){var e;if("undefined"!=typeof WebSocket)return{type:"native",constructor:WebSocket};if("undefined"!=typeof globalThis&&void 0!==globalThis.WebSocket)return{type:"native",constructor:globalThis.WebSocket};if("undefined"!=typeof global&&void 0!==global.WebSocket)return{type:"native",constructor:global.WebSocket};if("undefined"!=typeof globalThis&&void 0!==globalThis.WebSocketPair&&void 0===globalThis.WebSocket)return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if("undefined"!=typeof globalThis&&globalThis.EdgeRuntime||"undefined"!=typeof navigator&&(null===(e=navigator.userAgent)||void 0===e?void 0:e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const t=globalThis.process;if(t){const e=t.versions;if(e&&e.node){const t=e.node,n=parseInt(t.replace(/^v/,"").split(".")[0]);return n>=22?void 0!==globalThis.WebSocket?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${n} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${n} detected without native WebSocket support.`,workaround:'For Node.js < 22, install "ws" package and provide it via the transport option:\nimport ws from "ws"\nnew RealtimeClient(url, { transport: ws })'}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let t=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(t+=`\n\nSuggested solution: ${e.workaround}`),new Error(t)}static createWebSocket(e,t){return new(this.getWebSocketConstructor())(e,t)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return"native"===e.type||"ws"===e.type}catch(e){return!1}}}const Cm="2.0.0",Zm=Cm,Vm=1e4;var Em,Xm,Bm,Rm,xm,Wm,Nm,Jm,km,_m,Fm;(Xm=Em||(Em={}))[Xm.connecting=0]="connecting",Xm[Xm.open=1]="open",Xm[Xm.closing=2]="closing",Xm[Xm.closed=3]="closed",(Rm=Bm||(Bm={})).closed="closed",Rm.errored="errored",Rm.joined="joined",Rm.joining="joining",Rm.leaving="leaving",(Wm=xm||(xm={})).close="phx_close",Wm.error="phx_error",Wm.join="phx_join",Wm.reply="phx_reply",Wm.leave="phx_leave",Wm.access_token="access_token",(Nm||(Nm={})).websocket="websocket",(km=Jm||(Jm={})).Connecting="connecting",km.Open="open",km.Closing="closing",km.Closed="closed";class Ym{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=null!=e?e:[]}encode(e,t){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&"string"==typeof e.payload.event)return t(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){var t;return this._isArrayBuffer(null===(t=e.payload)||void 0===t?void 0:t.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var t,n;const r=null!==(n=null===(t=e.payload)||void 0===t?void 0:t.payload)&&void 0!==n?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,r)}_encodeJsonUserBroadcastPush(e){var t,n;const r=null!==(n=null===(t=e.payload)||void 0===t?void 0:t.payload)&&void 0!==n?n:{},s=(new TextEncoder).encode(JSON.stringify(r)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,s)}_encodeUserBroadcastPush(e,t,n){var r,s;const i=e.topic,o=null!==(r=e.ref)&&void 0!==r?r:"",a=null!==(s=e.join_ref)&&void 0!==s?s:"",c=e.payload.event,l=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},u=0===Object.keys(l).length?"":JSON.stringify(l);if(a.length>255)throw new Error(`joinRef length ${a.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`ref length ${o.length} exceeds maximum of 255`);if(i.length>255)throw new Error(`topic length ${i.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`userEvent length ${c.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`metadata length ${u.length} exceeds maximum of 255`);const d=this.USER_BROADCAST_PUSH_META_LENGTH+a.length+o.length+i.length+c.length+u.length,h=new ArrayBuffer(this.HEADER_LENGTH+d);let m=new DataView(h),g=0;m.setUint8(g++,this.KINDS.userBroadcastPush),m.setUint8(g++,a.length),m.setUint8(g++,o.length),m.setUint8(g++,i.length),m.setUint8(g++,c.length),m.setUint8(g++,u.length),m.setUint8(g++,t),Array.from(a,e=>m.setUint8(g++,e.charCodeAt(0))),Array.from(o,e=>m.setUint8(g++,e.charCodeAt(0))),Array.from(i,e=>m.setUint8(g++,e.charCodeAt(0))),Array.from(c,e=>m.setUint8(g++,e.charCodeAt(0))),Array.from(u,e=>m.setUint8(g++,e.charCodeAt(0)));var p=new Uint8Array(h.byteLength+n.byteLength);return p.set(new Uint8Array(h),0),p.set(new Uint8Array(n),h.byteLength),p.buffer}decode(e,t){if(this._isArrayBuffer(e)){return t(this._binaryDecode(e))}if("string"==typeof e){const n=JSON.parse(e),[r,s,i,o,a]=n;return t({join_ref:r,ref:s,topic:i,event:o,payload:a})}return t({})}_binaryDecode(e){const t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;if(n===this.KINDS.userBroadcast)return this._decodeUserBroadcast(e,t,r)}_decodeUserBroadcast(e,t,n){const r=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),o=t.getUint8(4);let a=this.HEADER_LENGTH+4;const c=n.decode(e.slice(a,a+r));a+=r;const l=n.decode(e.slice(a,a+s));a+=s;const u=n.decode(e.slice(a,a+i));a+=i;const d=e.slice(a,e.byteLength),h=o===this.JSON_ENCODING?JSON.parse(n.decode(d)):d,m={type:this.BROADCAST_EVENT,event:l,payload:h};return i>0&&(m.meta=JSON.parse(u)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:m}}_isArrayBuffer(e){var t;return e instanceof ArrayBuffer||"ArrayBuffer"===(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)}_pick(e,t){return e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(([e])=>t.includes(e))):{}}}class Lm{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=t}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}(Fm=_m||(_m={})).abstime="abstime",Fm.bool="bool",Fm.date="date",Fm.daterange="daterange",Fm.float4="float4",Fm.float8="float8",Fm.int2="int2",Fm.int4="int4",Fm.int4range="int4range",Fm.int8="int8",Fm.int8range="int8range",Fm.json="json",Fm.jsonb="jsonb",Fm.money="money",Fm.numeric="numeric",Fm.oid="oid",Fm.reltime="reltime",Fm.text="text",Fm.time="time",Fm.timestamp="timestamp",Fm.timestamptz="timestamptz",Fm.timetz="timetz",Fm.tsrange="tsrange",Fm.tstzrange="tstzrange";const Hm=(e,t,n={})=>{var r;const s=null!==(r=n.skipTypes)&&void 0!==r?r:[];return t?Object.keys(t).reduce((n,r)=>(n[r]=Tm(r,e,t,s),n),{}):{}},Tm=(e,t,n,r)=>{const s=t.find(t=>t.name===e),i=null==s?void 0:s.type,o=n[e];return i&&!r.includes(i)?Om(i,o):Mm(o)},Om=(e,t)=>{if("_"===e.charAt(0)){const n=e.slice(1,e.length);return Dm(t,n)}switch(e){case _m.bool:return Km(t);case _m.float4:case _m.float8:case _m.int2:case _m.int4:case _m.int8:case _m.numeric:case _m.oid:return Um(t);case _m.json:case _m.jsonb:return zm(t);case _m.timestamp:return Pm(t);case _m.abstime:case _m.date:case _m.daterange:case _m.int4range:case _m.int8range:case _m.money:case _m.reltime:case _m.text:case _m.time:case _m.timestamptz:case _m.timetz:case _m.tsrange:case _m.tstzrange:default:return Mm(t)}},Mm=e=>e,Km=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},Um=e=>{if("string"==typeof e){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},zm=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e}return e},Dm=(e,t)=>{if("string"!=typeof e)return e;const n=e.length-1,r=e[n];if("{"===e[0]&&"}"===r){let r;const i=e.slice(1,n);try{r=JSON.parse("["+i+"]")}catch(s){r=i?i.split(","):[]}return r.map(e=>Om(t,e))}return e},Pm=e=>"string"==typeof e?e.replace(" ","T"):e,jm=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),""===t.pathname||"/"===t.pathname?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};class Qm{constructor(e,t,n={},r=1e4){this.channel=e,this.event=t,this.payload=n,this.timeout=r,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var n;return this._hasReceived(e)&&t(null===(n=this.receivedResp)||void 0===n?void 0:n.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);this.channel._on(this.refEvent,{},e=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=e,this._matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,t){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:t})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:t}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var $m,qm,eg,tg,ng,rg,sg,ig;(qm=$m||($m={})).SYNC="sync",qm.JOIN="join",qm.LEAVE="leave";class og{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(null==t?void 0:t.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},e=>{const{onJoin:t,onLeave:n,onSync:r}=this.caller;this.joinRef=this.channel._joinRef(),this.state=og.syncState(this.state,e,t,n),this.pendingDiffs.forEach(e=>{this.state=og.syncDiff(this.state,e,t,n)}),this.pendingDiffs=[],r()}),this.channel._on(n.diff,{},e=>{const{onJoin:t,onLeave:n,onSync:r}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(e):(this.state=og.syncDiff(this.state,e,t,n),r())}),this.onJoin((e,t,n)=>{this.channel._trigger("presence",{event:"join",key:e,currentPresences:t,newPresences:n})}),this.onLeave((e,t,n)=>{this.channel._trigger("presence",{event:"leave",key:e,currentPresences:t,leftPresences:n})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,n,r){const s=this.cloneDeep(e),i=this.transformState(t),o={},a={};return this.map(s,(e,t)=>{i[e]||(a[e]=t)}),this.map(i,(e,t)=>{const n=s[e];if(n){const r=t.map(e=>e.presence_ref),s=n.map(e=>e.presence_ref),i=t.filter(e=>s.indexOf(e.presence_ref)<0),c=n.filter(e=>r.indexOf(e.presence_ref)<0);i.length>0&&(o[e]=i),c.length>0&&(a[e]=c)}else o[e]=t}),this.syncDiff(s,{joins:o,leaves:a},n,r)}static syncDiff(e,t,n,r){const{joins:s,leaves:i}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return n||(n=()=>{}),r||(r=()=>{}),this.map(s,(t,r)=>{var s;const i=null!==(s=e[t])&&void 0!==s?s:[];if(e[t]=this.cloneDeep(r),i.length>0){const n=e[t].map(e=>e.presence_ref),r=i.filter(e=>n.indexOf(e.presence_ref)<0);e[t].unshift(...r)}n(t,i,r)}),this.map(i,(t,n)=>{let s=e[t];if(!s)return;const i=n.map(e=>e.presence_ref);s=s.filter(e=>i.indexOf(e.presence_ref)<0),e[t]=s,r(t,s,n),0===s.length&&delete e[t]}),e}static map(e,t){return Object.getOwnPropertyNames(e).map(n=>t(n,e[n]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((t,n)=>{const r=e[n];return t[n]="metas"in r?r.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e)):r,t},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}(tg=eg||(eg={})).ALL="*",tg.INSERT="INSERT",tg.UPDATE="UPDATE",tg.DELETE="DELETE",(rg=ng||(ng={})).BROADCAST="broadcast",rg.PRESENCE="presence",rg.POSTGRES_CHANGES="postgres_changes",rg.SYSTEM="system",(ig=sg||(sg={})).SUBSCRIBED="SUBSCRIBED",ig.TIMED_OUT="TIMED_OUT",ig.CLOSED="CLOSED",ig.CHANNEL_ERROR="CHANNEL_ERROR";class ag{constructor(e,t={config:{}},n){var r,s;if(this.topic=e,this.params=t,this.socket=n,this.bindings={},this.state=Bm.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config),this.timeout=this.socket.timeout,this.joinPush=new Qm(this,xm.join,this.params,this.timeout),this.rejoinTimer=new Lm(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Bm.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Bm.closed,this.socket._remove(this)}),this._onError(e=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,e),this.state=Bm.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Bm.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",e=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,e),this.state=Bm.errored,this.rejoinTimer.scheduleTimeout())}),this._on(xm.reply,{},(e,t)=>{this._trigger(this._replyEventName(t),e)}),this.presence=new og(this),this.broadcastEndpointURL=jm(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(null===(s=null===(r=this.params.config)||void 0===r?void 0:r.broadcast)||void 0===s?void 0:s.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(e,t=this.timeout){var n,r,s;if(this.socket.isConnected()||this.socket.connect(),this.state==Bm.closed){const{config:{broadcast:i,presence:o,private:a}}=this.params,c=null!==(r=null===(n=this.bindings.postgres_changes)||void 0===n?void 0:n.map(e=>e.filter))&&void 0!==r?r:[],l=!!this.bindings[ng.PRESENCE]&&this.bindings[ng.PRESENCE].length>0||!0===(null===(s=this.params.config.presence)||void 0===s?void 0:s.enabled),u={},d={broadcast:i,presence:Object.assign(Object.assign({},o),{enabled:l}),postgres_changes:c,private:a};this.socket.accessTokenValue&&(u.access_token=this.socket.accessTokenValue),this._onError(t=>null==e?void 0:e(sg.CHANNEL_ERROR,t)),this._onClose(()=>null==e?void 0:e(sg.CLOSED)),this.updateJoinPayload(Object.assign({config:d},u)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",async({postgres_changes:t})=>{var n;if(this.socket._isManualToken()||this.socket.setAuth(),void 0!==t){const r=this.bindings.postgres_changes,s=null!==(n=null==r?void 0:r.length)&&void 0!==n?n:0,i=[];for(let n=0;n<s;n++){const s=r[n],{filter:{event:o,schema:a,table:c,filter:l}}=s,u=t&&t[n];if(!(u&&u.event===o&&ag.isFilterValueEqual(u.schema,a)&&ag.isFilterValueEqual(u.table,c)&&ag.isFilterValueEqual(u.filter,l)))return this.unsubscribe(),this.state=Bm.errored,void(null==e||e(sg.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes")));i.push(Object.assign(Object.assign({},s),{id:u.id}))}return this.bindings.postgres_changes=i,void(e&&e(sg.SUBSCRIBED))}null==e||e(sg.SUBSCRIBED)}).receive("error",t=>{this.state=Bm.errored,null==e||e(sg.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(t).join(", ")||"error")))}).receive("timeout",()=>{null==e||e(sg.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,n){return this.state===Bm.joined&&e===ng.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(e,t,n)}async httpSend(e,t,n={}){var r;if(null==t)return Promise.reject("Payload is required for httpSend()");const s={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(s.Authorization=`Bearer ${this.socket.accessTokenValue}`);const i={method:"POST",headers:s,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:t,private:this.private}]})},o=await this._fetchWithTimeout(this.broadcastEndpointURL,i,null!==(r=n.timeout)&&void 0!==r?r:this.timeout);if(202===o.status)return{success:!0};let a=o.statusText;try{const e=await o.json();a=e.error||e.message||a}catch(c){}return Promise.reject(new Error(a))}async send(e,t={}){var n,r;if(this._canPush()||"broadcast"!==e.type)return new Promise(n=>{var r,s,i;const o=this._push(e.type,e,t.timeout||this.timeout);"broadcast"!==e.type||(null===(i=null===(s=null===(r=this.params)||void 0===r?void 0:r.config)||void 0===s?void 0:s.broadcast)||void 0===i?void 0:i.ack)||n("ok"),o.receive("ok",()=>n("ok")),o.receive("error",()=>n("error")),o.receive("timeout",()=>n("timed out"))});{console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:o}=e,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const e=await this._fetchWithTimeout(this.broadcastEndpointURL,c,null!==(n=t.timeout)&&void 0!==n?n:this.timeout);return await(null===(r=e.body)||void 0===r?void 0:r.cancel()),e.ok?"ok":"error"}catch(s){return"AbortError"===s.name?"timed out":"error"}}}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=Bm.leaving;const t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(xm.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(r=>{n=new Qm(this,xm.leave,{},e),n.receive("ok",()=>{t(),r("ok")}).receive("timeout",()=>{t(),r("timed out")}).receive("error",()=>{r("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{null==n||n.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Bm.closed,this.bindings={}}async _fetchWithTimeout(e,t,n){const r=new AbortController,s=setTimeout(()=>r.abort(),n),i=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(s),i}_push(e,t,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let r=new Qm(this,e,t,n);return this._canPush()?r.send():this._addToPushBuffer(r),r}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>100){const e=this.pushBuffer.shift();e&&(e.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${e.event}`,e.payload))}}_onMessage(e,t,n){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,n){var r,s;const i=e.toLocaleLowerCase(),{close:o,error:a,leave:c,join:l}=xm;if(n&&[o,a,c,l].indexOf(i)>=0&&n!==this._joinRef())return;let u=this._onMessage(i,t,n);if(t&&!u)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(i)?null===(r=this.bindings.postgres_changes)||void 0===r||r.filter(e=>{var t,n,r;return"*"===(null===(t=e.filter)||void 0===t?void 0:t.event)||(null===(r=null===(n=e.filter)||void 0===n?void 0:n.event)||void 0===r?void 0:r.toLocaleLowerCase())===i}).map(e=>e.callback(u,n)):null===(s=this.bindings[i])||void 0===s||s.filter(e=>{var n,r,s,o,a,c;if(["broadcast","presence","postgres_changes"].includes(i)){if("id"in e){const i=e.id,o=null===(n=e.filter)||void 0===n?void 0:n.event;return i&&(null===(r=t.ids)||void 0===r?void 0:r.includes(i))&&("*"===o||(null==o?void 0:o.toLocaleLowerCase())===(null===(s=t.data)||void 0===s?void 0:s.type.toLocaleLowerCase()))}{const n=null===(a=null===(o=null==e?void 0:e.filter)||void 0===o?void 0:o.event)||void 0===a?void 0:a.toLocaleLowerCase();return"*"===n||n===(null===(c=null==t?void 0:t.event)||void 0===c?void 0:c.toLocaleLowerCase())}}return e.type.toLocaleLowerCase()===i}).map(e=>{if("object"==typeof u&&"ids"in u){const e=u.data,{schema:t,table:n,commit_timestamp:r,type:s,errors:i}=e,o={schema:t,table:n,commit_timestamp:r,eventType:s,new:{},old:{},errors:i};u=Object.assign(Object.assign({},o),this._getPayloadRecords(e))}e.callback(u,n)})}_isClosed(){return this.state===Bm.closed}_isJoined(){return this.state===Bm.joined}_isJoining(){return this.state===Bm.joining}_isLeaving(){return this.state===Bm.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,t,n){const r=e.toLocaleLowerCase(),s={type:r,filter:t,callback:n};return this.bindings[r]?this.bindings[r].push(s):this.bindings[r]=[s],this}_off(e,t){const n=e.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(e=>{var r;return!((null===(r=e.type)||void 0===r?void 0:r.toLocaleLowerCase())===n&&ag.isEqual(e.filter,t))})),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}static isFilterValueEqual(e,t){return(null!=e?e:void 0)===(null!=t?t:void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(xm.close,{},e)}_onError(e){this._on(xm.error,{},t=>e(t))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Bm.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const t={new:{},old:{}};return"INSERT"!==e.type&&"UPDATE"!==e.type||(t.new=Hm(e.columns,e.record)),"UPDATE"!==e.type&&"DELETE"!==e.type||(t.old=Hm(e.columns,e.old_record)),t}}const cg=()=>{},lg=25e3,ug=10,dg=100,hg=[1e3,2e3,5e3,1e4];class mg{constructor(e,t){var n;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Vm,this.transport=null,this.heartbeatIntervalMs=lg,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=cg,this.ref=0,this.reconnectTimer=null,this.vsn=Zm,this.logger=cg,this.conn=null,this.sendBuffer=[],this.serializer=new Ym,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),!(null===(n=null==t?void 0:t.params)||void 0===n?void 0:n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=t.params.apikey,this.endPoint=`${e}/${Nm.websocket}`,this.httpEndpoint=jm(e),this._initializeOptions(t),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(null==t?void 0:t.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||null!==this.conn&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=Sm.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const t=e.message;if(t.includes("Node.js"))throw new Error(`${t}\n\nTo use Realtime in Node.js, you need to provide a WebSocket implementation:\n\nOption 1: Use Node.js 22+ which has native WebSocket support\nOption 2: Install and provide the "ws" package:\n\n npm install ws\n\n import ws from "ws"\n const client = new RealtimeClient(url, {\n ...options,\n transport: ws\n })`);throw new Error(`WebSocket not available: ${t}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(e,t){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},"function"==typeof this.conn.close&&(e?this.conn.close(e,null!=t?t:""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const t=await e.unsubscribe();return 0===this.channels.length&&this.disconnect(),t}async removeAllChannels(){const e=await Promise.all(this.channels.map(e=>e.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,t,n){this.logger(e,t,n)}connectionState(){switch(this.conn&&this.conn.readyState){case Em.connecting:return Jm.Connecting;case Em.open:return Jm.Open;case Em.closing:return Jm.Closing;default:return Jm.Closed}}isConnected(){return this.connectionState()===Jm.Open}isConnecting(){return"connecting"===this._connectionState}isDisconnecting(){return"disconnecting"===this._connectionState}channel(e,t={config:{}}){const n=`realtime:${e}`,r=this.getChannels().find(e=>e.topic===n);if(r)return r;{const n=new ag(`realtime:${e}`,t,this);return this.channels.push(n),n}}push(e){const{topic:t,event:n,payload:r,ref:s}=e,i=()=>{this.encode(e,e=>{var t;null===(t=this.conn)||void 0===t||t.send(e)})};this.log("push",`${t} ${n} (${s})`,r),this.isConnected()?i():this.sendBuffer.push(i)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(t){this.log("error","error in heartbeat callback",t)}return this._wasManualDisconnect=!1,null===(e=this.conn)||void 0===e||e.close(1e3,"heartbeat timeout"),void setTimeout(()=>{var e;this.isConnected()||null===(e=this.reconnectTimer)||void 0===e||e.scheduleTimeout()},dg)}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(t){this.log("error","error in heartbeat callback",t)}this._setAuthSafely("heartbeat")}else try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t._isJoined()||t._isJoining()));t&&(this.log("transport",`leaving duplicate topic "${e}"`),t.unsubscribe())}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,e=>{if("phoenix"===e.topic&&"phx_reply"===e.event&&e.ref&&e.ref===this.pendingHeartbeatRef){const t=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback("ok"===e.payload.status?"ok":"error",t)}catch(a){this.log("error","error in heartbeat callback",a)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:t,event:n,payload:r,ref:s}=e,i=s?`(${s})`:"",o=r.status||"";this.log("receive",`${o} ${t} ${n} ${i}`.trim(),r),this.channels.filter(e=>e._isMember(t)).forEach(e=>e._trigger(n,r,s)),this._triggerStateCallbacks("message",e)})}_clearTimer(e){var t;"heartbeat"===e&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):"reconnect"===e&&(null===(t=this.reconnectTimer)||void 0===t||t.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e),this.conn.readyState===Em.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===Em.open||this.conn.readyState===Em.connecting)try{this.conn.close()}catch(e){this.log("error","Error closing connection",e)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`);(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.accessTokenValue&&(this.channels.forEach(e=>{e.updateJoinPayload({access_token:this.accessTokenValue})}),this.sendBuffer=[],this.channels.forEach(e=>{e._isJoining()&&(e.joinPush.sent=!1,e.joinPush.send())})),this.flushSendBuffer()}).catch(e=>{this.log("error","error waiting for auth on connect",e),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=e=>{this.log("worker","worker error",e.message),this._terminateWorker()},this.workerRef.onmessage=e=>{"keepAlive"===e.data.event&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(e){var t;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||null===(t=this.reconnectTimer)||void 0===t||t.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e);try{this.heartbeatCallback("error")}catch(t){this.log("error","error in heartbeat callback",t)}}_triggerChanError(){this.channels.forEach(e=>e._trigger(xm.error))}_appendParams(e,t){if(0===Object.keys(t).length)return e;const n=e.match(/\?/)?"&":"?";return`${e}${n}${new URLSearchParams(t)}`}_workerObjectUrl(e){let t;if(e)t=e;else{const e=new Blob(['\n addEventListener("message", (e) => {\n if (e.data.event === "start") {\n setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);\n }\n });'],{type:"application/javascript"});t=URL.createObjectURL(e)}return t}_setConnectionState(e,t=!1){this._connectionState=e,"connecting"===e?this._wasManualDisconnect=!1:"disconnecting"===e&&(this._wasManualDisconnect=t)}async _performAuth(e=null){let t,n=!1;if(e)t=e,n=!0;else if(this.accessToken)try{t=await this.accessToken()}catch(r){this.log("error","Error fetching access token from callback",r),t=this.accessTokenValue}else t=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(e=>{const n={access_token:t,version:"realtime-js/2.99.0"};t&&e.updateJoinPayload(n),e.joinedOnce&&e._isJoined()&&e._push(xm.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(t=>{this.log("error",`Error setting auth in ${e}`,t)})}_triggerStateCallbacks(e,t){try{this.stateChangeCallbacks[e].forEach(n=>{try{n(t)}catch(r){this.log("error",`error in ${e} callback`,r)}})}catch(n){this.log("error",`error triggering ${e} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new Lm(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},ug)},this.reconnectAfterMs)}_initializeOptions(e){var t,n,r,s,i,o,a,c,l,u,d,h;switch(this.transport=null!==(t=null==e?void 0:e.transport)&&void 0!==t?t:null,this.timeout=null!==(n=null==e?void 0:e.timeout)&&void 0!==n?n:Vm,this.heartbeatIntervalMs=null!==(r=null==e?void 0:e.heartbeatIntervalMs)&&void 0!==r?r:lg,this.worker=null!==(s=null==e?void 0:e.worker)&&void 0!==s&&s,this.accessToken=null!==(i=null==e?void 0:e.accessToken)&&void 0!==i?i:null,this.heartbeatCallback=null!==(o=null==e?void 0:e.heartbeatCallback)&&void 0!==o?o:cg,this.vsn=null!==(a=null==e?void 0:e.vsn)&&void 0!==a?a:Zm,(null==e?void 0:e.params)&&(this.params=e.params),(null==e?void 0:e.logger)&&(this.logger=e.logger),((null==e?void 0:e.logLevel)||(null==e?void 0:e.log_level))&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=null!==(c=null==e?void 0:e.reconnectAfterMs)&&void 0!==c?c:e=>hg[e-1]||1e4,this.vsn){case"1.0.0":this.encode=null!==(l=null==e?void 0:e.encode)&&void 0!==l?l:(e,t)=>t(JSON.stringify(e)),this.decode=null!==(u=null==e?void 0:e.decode)&&void 0!==u?u:(e,t)=>t(JSON.parse(e));break;case Cm:this.encode=null!==(d=null==e?void 0:e.encode)&&void 0!==d?d:this.serializer.encode.bind(this.serializer),this.decode=null!==(h=null==e?void 0:e.decode)&&void 0!==h?h:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if("undefined"!=typeof window&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=null==e?void 0:e.workerUrl}}}var gg=class extends Error{constructor(e,t){super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown="CommitStateUnknownException"===t.icebergType||[500,502,504].includes(t.status)&&!0===t.icebergType?.includes("CommitState")}isNotFound(){return 404===this.status}isConflict(){return 409===this.status}isAuthenticationTimeout(){return 419===this.status}};function pg(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:s,body:i,headers:o}){const a=function(e,t,n){const r=new URL(t,e);if(n)for(const[s,i]of Object.entries(n))void 0!==i&&r.searchParams.set(s,i);return r.toString()}(e.baseUrl,r,s),c=await async function(e){return e&&"none"!==e.type?"bearer"===e.type?{Authorization:`Bearer ${e.token}`}:"header"===e.type?{[e.name]:e.value}:"custom"===e.type?await e.getHeaders():{}:{}}(e.auth),l=await t(a,{method:n,headers:{...i?{"Content-Type":"application/json"}:{},...c,...o},body:i?JSON.stringify(i):void 0}),u=await l.text(),d=(l.headers.get("content-type")||"").includes("application/json"),h=d&&u?JSON.parse(u):u;if(!l.ok){const e=d?h:void 0,t=e?.error;throw new gg(t?.message??`Request failed with status ${l.status}`,{status:l.status,icebergType:t?.type,icebergCode:t?.code,details:e})}return{status:l.status,headers:l.headers,data:h}}}}function fg(e){return e.join("")}var yg=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:fg(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(e=>({namespace:e}))}async createNamespace(e,t){const n={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${fg(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${fg(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${fg(e.namespace)}`}),!0}catch(t){if(t instanceof gg&&404===t.status)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof gg&&409===n.status)return;throw n}}};function bg(e){return e.join("")}var Ig=class{constructor(e,t="",n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${bg(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const n={};this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation);return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${bg(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${bg(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${bg(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${bg(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${bg(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof gg&&404===n.status)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof gg&&409===n.status)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},wg=class{constructor(e){let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=pg({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(","),this.namespaceOps=new yg(this.client,t),this.tableOps=new Ig(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},vg=class extends Error{constructor(e,t="storage",n,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name="vectors"===t?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}};function Gg(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}var Ag=class extends vg{constructor(e,t,n,r="storage"){super(e,r,t,n),this.name="vectors"===r?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},Sg=class extends vg{constructor(e,t,n="storage"){super(e,n),this.name="vectors"===n?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};const Cg=e=>{if(Array.isArray(e))return e.map(e=>Cg(e));if("function"==typeof e||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([e,n])=>{const r=e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(/[-_]/g,""));t[r]=Cg(n)}),t};function Zg(e){return(Zg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vg(e){var t=function(e,t){if("object"!=Zg(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=Zg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Zg(t)?t:t+""}function Eg(e,t,n){return(t=Vg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Bg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xg(Object(n),!0).forEach(function(t){Eg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Rg=e=>{var t;return e.msg||e.message||e.error_description||("string"==typeof e.error?e.error:null===(t=e.error)||void 0===t?void 0:t.message)||JSON.stringify(e)},xg=(e,t,n,r)=>{const s={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"!==e&&"HEAD"!==e&&r?((e=>{if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)})(r)?(s.headers=Bg({"Content-Type":"application/json"},null==t?void 0:t.headers),s.body=JSON.stringify(r)):s.body=r,(null==t?void 0:t.duplex)&&(s.duplex=t.duplex),Bg(Bg({},s),n)):Bg(Bg({},s),n)};async function Wg(e,t,n,r,s,i,o){return new Promise((a,c)=>{e(n,xg(t,r,s,i)).then(e=>{if(!e.ok)throw e;if(null==r?void 0:r.noResolveJson)return e;if("vectors"===o){const t=e.headers.get("content-type");if("0"===e.headers.get("content-length")||204===e.status)return{};if(!t||!t.includes("application/json"))return{}}return e.json()}).then(e=>a(e)).catch(e=>(async(e,t,n,r)=>{if(e&&"object"==typeof e&&"status"in e&&"ok"in e&&"number"==typeof e.status){const n=e,s=n.status||500;if("function"==typeof n.json)n.json().then(e=>{const n=(null==e?void 0:e.statusCode)||(null==e?void 0:e.code)||s+"";t(new Ag(Rg(e),s,n,r))}).catch(()=>{if("vectors"===r){const e=s+"";t(new Ag(n.statusText||`HTTP ${s} error`,s,e,r))}else{const e=s+"";t(new Ag(n.statusText||`HTTP ${s} error`,s,e,r))}});else{const e=s+"";t(new Ag(n.statusText||`HTTP ${s} error`,s,e,r))}}else t(new Sg(Rg(e),e,r))})(e,c,0,o))})}function Ng(e="storage"){return{get:async(t,n,r,s)=>Wg(t,"GET",n,r,s,void 0,e),post:async(t,n,r,s,i)=>Wg(t,"POST",n,s,i,r,e),put:async(t,n,r,s,i)=>Wg(t,"PUT",n,s,i,r,e),head:async(t,n,r,s)=>Wg(t,"HEAD",n,Bg(Bg({},r),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,n,r,s,i)=>Wg(t,"DELETE",n,s,i,r,e)}}const Jg=Ng("storage"),{get:kg,post:_g,put:Fg,head:Yg,remove:Lg}=Jg,Hg=Ng("vectors");var Tg=class{constructor(e,t={},n,r="storage"){var s;this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.fetch=(s=n)?(...e)=>s(...e):(...e)=>fetch(...e),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Bg(Bg({},this.headers),{},{[e]:t}),this}async handleOperation(e){try{return{data:await e(),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(Gg(t))return{data:null,error:t};throw t}}},Og=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){try{return{data:(await this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(Gg(e))return{data:null,error:e};throw e}}};let Mg;Mg=Symbol.toStringTag;var Kg=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Mg]="BlobDownloadBuilder",this.promise=null}asStream(){return new Og(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){try{return{data:await(await this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(Gg(e))return{data:null,error:e};throw e}}};const Ug={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},zg={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var Dg=class extends Tg{constructor(e,t={},n,r){super(e,t,r,"storage"),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var s=this;return s.handleOperation(async()=>{let i;const o=Bg(Bg({},zg),r);let a=Bg(Bg({},s.headers),"POST"===e&&{"x-upsert":String(o.upsert)});const c=o.metadata;"undefined"!=typeof Blob&&n instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",s.encodeMetadata(c)),i.append("",n)):"undefined"!=typeof FormData&&n instanceof FormData?(i=n,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),c&&!i.has("metadata")&&i.append("metadata",s.encodeMetadata(c))):(i=n,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,c&&(a["x-metadata"]=s.toBase64(s.encodeMetadata(c))),("undefined"!=typeof ReadableStream&&i instanceof ReadableStream||i&&"object"==typeof i&&"pipe"in i&&"function"==typeof i.pipe)&&!o.duplex&&(o.duplex="half")),(null==r?void 0:r.headers)&&(a=Bg(Bg({},a),r.headers));const l=s._removeEmptyFolders(t),u=s._getFinalPath(l),d=await("PUT"==e?Fg:_g)(s.fetch,`${s.url}/object/${u}`,i,Bg({headers:a},(null==o?void 0:o.duplex)?{duplex:o.duplex}:{}));return{path:l,id:d.Id,fullPath:d.Key}})}async upload(e,t,n){return this.uploadOrUpdate("POST",e,t,n)}async uploadToSignedUrl(e,t,n,r){var s=this;const i=s._removeEmptyFolders(e),o=s._getFinalPath(i),a=new URL(s.url+`/object/upload/sign/${o}`);return a.searchParams.set("token",t),s.handleOperation(async()=>{let e;const t=Bg({upsert:zg.upsert},r),o=Bg(Bg({},s.headers),{"x-upsert":String(t.upsert)});return"undefined"!=typeof Blob&&n instanceof Blob?(e=new FormData,e.append("cacheControl",t.cacheControl),e.append("",n)):"undefined"!=typeof FormData&&n instanceof FormData?(e=n,e.append("cacheControl",t.cacheControl)):(e=n,o["cache-control"]=`max-age=${t.cacheControl}`,o["content-type"]=t.contentType),{path:i,fullPath:(await Fg(s.fetch,a.toString(),e,{headers:o})).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e);const s=Bg({},n.headers);(null==t?void 0:t.upsert)&&(s["x-upsert"]="true");const i=await _g(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:s}),o=new URL(n.url+i.url),a=o.searchParams.get("token");if(!a)throw new vg("No token returned by API");return{signedUrl:o.toString(),path:e,token:a}})}async update(e,t,n){return this.uploadOrUpdate("PUT",e,t,n)}async move(e,t,n){var r=this;return r.handleOperation(async()=>await _g(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:null==n?void 0:n.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await _g(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:null==n?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let s=r._getFinalPath(e),i=await _g(r.fetch,`${r.url}/object/sign/${s}`,Bg({expiresIn:t},(null==n?void 0:n.transform)?{transform:n.transform}:{}),{headers:r.headers});const o=(null==n?void 0:n.download)?`&download=${!0===n.download?"":n.download}`:"",a=(null==n?void 0:n.transform)&&i.signedURL.includes("/object/sign/")?i.signedURL.replace("/object/sign/","/render/image/sign/"):i.signedURL;return{signedUrl:encodeURI(`${r.url}${a}${o}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{const s=await _g(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),i=(null==n?void 0:n.download)?`&download=${!0===n.download?"":n.download}`:"";return s.map(e=>Bg(Bg({},e),{},{signedUrl:e.signedURL?encodeURI(`${r.url}${e.signedURL}${i}`):null}))})}download(e,t,n){const r=void 0!==(null==t?void 0:t.transform)?"render/image/authenticated":"object",s=this.transformOptsToQueryString((null==t?void 0:t.transform)||{}),i=s?`?${s}`:"",o=this._getFinalPath(e);return new Kg(()=>kg(this.fetch,`${this.url}/${r}/${o}${i}`,{headers:this.headers,noResolveJson:!0},n),this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);return t.handleOperation(async()=>Cg(await kg(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await Yg(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(s){if(t.shouldThrowOnError)throw s;if(Gg(s)){var r;const e=s instanceof Ag?s.status:s instanceof Sg?null===(r=s.originalError)||void 0===r?void 0:r.status:void 0;if(void 0!==e&&[400,404].includes(e))return{data:!1,error:s}}throw s}}getPublicUrl(e,t){const n=this._getFinalPath(e),r=[],s=(null==t?void 0:t.download)?`download=${!0===t.download?"":t.download}`:"";""!==s&&r.push(s);const i=void 0!==(null==t?void 0:t.transform)?"render/image":"object",o=this.transformOptsToQueryString((null==t?void 0:t.transform)||{});""!==o&&r.push(o);let a=r.join("&");return""!==a&&(a=`?${a}`),{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${n}${a}`)}}}async remove(e){var t=this;return t.handleOperation(async()=>await Lg(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,n){var r=this;return r.handleOperation(async()=>{const s=Bg(Bg(Bg({},Ug),t),{},{prefix:e||""});return await _g(r.fetch,`${r.url}/object/list/${r.bucketId}`,s,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{const r=Bg({},e);return await _g(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return"undefined"!=typeof Buffer?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}};const Pg={"X-Client-Info":"storage-js/2.99.0"};var jg=class extends Tg{constructor(e,t={},n,r){const s=new URL(e);(null==r?void 0:r.useNewHostname)&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));super(s.href.replace(/\/$/,""),Bg(Bg({},Pg),t),n,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=t.listBucketOptionsToQueryString(e);return await kg(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await kg(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await _g(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await Fg(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await _g(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Lg(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},Qg=class extends Tg{constructor(e,t={},n){super(e.replace(/\/$/,""),Bg(Bg({},Pg),t),n,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await _g(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=new URLSearchParams;void 0!==(null==e?void 0:e.limit)&&n.set("limit",e.limit.toString()),void 0!==(null==e?void 0:e.offset)&&n.set("offset",e.offset.toString()),(null==e?void 0:e.sortColumn)&&n.set("sortColumn",e.sortColumn),(null==e?void 0:e.sortOrder)&&n.set("sortOrder",e.sortOrder),(null==e?void 0:e.search)&&n.set("search",e.search);const r=n.toString(),s=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await kg(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Lg(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!(e=>!(!e||"string"!=typeof e)&&!(0===e.length||e.length>100)&&e.trim()===e&&!e.includes("/")&&!e.includes("\\")&&/^[\w!.\*'() &$@=;:+,?-]+$/.test(e))(e))throw new vg("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new wg({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(e,t){const n=e[t];return"function"!=typeof n?n:async(...t)=>{try{return{data:await n.apply(e,t),error:null}}catch(s){if(r)throw s;return{data:null,error:s}}}}})}},$g=class extends Tg{constructor(e,t={},n){super(e.replace(/\/$/,""),Bg(Bg({},Pg),{},{"Content-Type":"application/json"},t),n,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await Hg.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await Hg.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Hg.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await Hg.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},qg=class extends Tg{constructor(e,t={},n){super(e.replace(/\/$/,""),Bg(Bg({},Pg),{},{"Content-Type":"application/json"},t),n,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Hg.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Hg.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(void 0!==e.segmentCount){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(void 0!==e.segmentIndex&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error("segmentIndex must be between 0 and "+(e.segmentCount-1))}return t.handleOperation(async()=>await Hg.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Hg.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Hg.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},ep=class extends Tg{constructor(e,t={},n){super(e.replace(/\/$/,""),Bg(Bg({},Pg),{},{"Content-Type":"application/json"},t),n,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Hg.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Hg.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Hg.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Hg.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},tp=class extends ep{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new np(this.url,this.headers,e,this.fetch)}async createBucket(e){return(()=>super.createBucket)().call(this,e)}async getBucket(e){return(()=>super.getBucket)().call(this,e)}async listBuckets(e={}){return(()=>super.listBuckets)().call(this,e)}async deleteBucket(e){return(()=>super.deleteBucket)().call(this,e)}},np=class extends $g{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){return(()=>super.createIndex)().call(this,Bg(Bg({},e),{},{vectorBucketName:this.vectorBucketName}))}async listIndexes(e={}){return(()=>super.listIndexes)().call(this,Bg(Bg({},e),{},{vectorBucketName:this.vectorBucketName}))}async getIndex(e){return(()=>super.getIndex)().call(this,this.vectorBucketName,e)}async deleteIndex(e){return(()=>super.deleteIndex)().call(this,this.vectorBucketName,e)}index(e){return new rp(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},rp=class extends qg{constructor(e,t,n,r,s){super(e,t,s),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=this;return(()=>super.putVectors)().call(t,Bg(Bg({},e),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async getVectors(e){var t=this;return(()=>super.getVectors)().call(t,Bg(Bg({},e),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async listVectors(e={}){var t=this;return(()=>super.listVectors)().call(t,Bg(Bg({},e),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async queryVectors(e){var t=this;return(()=>super.queryVectors)().call(t,Bg(Bg({},e),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async deleteVectors(e){var t=this;return(()=>super.deleteVectors)().call(t,Bg(Bg({},e),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}},sp=class extends jg{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new Dg(this.url,this.headers,e,this.fetch)}get vectors(){return new tp(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new Qg(this.url+"/iceberg",this.headers,this.fetch)}};const ip="2.99.0",op=3e4,ap=9e4,cp={"X-Client-Info":`gotrue-js/${ip}`},lp="X-Supabase-Api-Version",up={timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"},dp=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i;class hp extends Error{constructor(e,t,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=n}}function mp(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}class gp extends hp{constructor(e,t,n){super(e,t,n),this.name="AuthApiError",this.status=t,this.code=n}}class pp extends hp{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class fp extends hp{constructor(e,t,n,r){super(e,n,r),this.name=t,this.status=n}}class yp extends fp{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function bp(e){return mp(e)&&"AuthSessionMissingError"===e.name}class Ip extends fp{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class wp extends fp{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class vp extends fp{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Gp extends fp{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Ap extends fp{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class Sp extends fp{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function Cp(e){return mp(e)&&"AuthRetryableFetchError"===e.name}class Zp extends fp{constructor(e,t,n){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=n}}class Vp extends fp{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const Ep="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Xp=" \t\n\r=".split(""),Bp=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<Xp.length;t+=1)e[Xp[t].charCodeAt(0)]=-2;for(let t=0;t<Ep.length;t+=1)e[Ep[t].charCodeAt(0)]=t;return e})();function Rp(e,t,n){if(null!==e)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const e=t.queue>>t.queuedBits-6&63;n(Ep[e]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const e=t.queue>>t.queuedBits-6&63;n(Ep[e]),t.queuedBits-=6}}function xp(e,t,n){const r=Bp[e];if(!(r>-1)){if(-2===r)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8}function Wp(e){const t=[],n=e=>{t.push(String.fromCodePoint(e))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=e=>{!function(e,t,n){if(0===t.utf8seq){if(e<=127)return void n(e);for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(2===t.utf8seq)t.codepoint=31&e;else if(3===t.utf8seq)t.codepoint=15&e;else{if(4!==t.utf8seq)throw new Error("Invalid UTF-8 sequence");t.codepoint=7&e}t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|63&e,t.utf8seq-=1,0===t.utf8seq&&n(t.codepoint)}}(e,r,n)};for(let o=0;o<e.length;o+=1)xp(e.charCodeAt(o),s,i);return t.join("")}function Np(e,t){if(!(e<=127)){if(e<=2047)return t(192|e>>6),void t(128|63&e);if(e<=65535)return t(224|e>>12),t(128|e>>6&63),void t(128|63&e);if(e<=1114111)return t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),void t(128|63&e);throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}t(e)}function Jp(e){const t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};for(let s=0;s<e.length;s+=1)xp(e.charCodeAt(s),n,r);return new Uint8Array(t)}function kp(e){const t=[];return function(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const t=1024*(r-55296)&65535;r=65536+(e.charCodeAt(n+1)-56320&65535|t),n+=1}Np(r,t)}}(e,e=>t.push(e)),new Uint8Array(t)}function _p(e){const t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};return e.forEach(e=>Rp(e,n,r)),Rp(null,n,r),t.join("")}const Fp=()=>"undefined"!=typeof window&&"undefined"!=typeof document,Yp={tested:!1,writable:!1},Lp=()=>{if(!Fp())return!1;try{if("object"!=typeof globalThis.localStorage)return!1}catch(t){return!1}if(Yp.tested)return Yp.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Yp.tested=!0,Yp.writable=!0}catch(t){Yp.tested=!0,Yp.writable=!1}return Yp.writable};const Hp=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),Tp=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},Op=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch(r){return n}},Mp=async(e,t)=>{await e.removeItem(t)};class Kp{constructor(){this.promise=new Kp.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}function Up(e){const t=e.split(".");if(3!==t.length)throw new Vp("Invalid JWT structure");for(let n=0;n<t.length;n++)if(!dp.test(t[n]))throw new Vp("JWT not in base64url format");return{header:JSON.parse(Wp(t[0])),payload:JSON.parse(Wp(t[1])),signature:Jp(t[2]),raw:{header:t[0],payload:t[1]}}}function zp(e){return("0"+e.toString(16)).substr(-2)}async function Dp(e){if(!("undefined"!=typeof crypto&&void 0!==crypto.subtle&&"undefined"!=typeof TextEncoder))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const t=await async function(e){const t=(new TextEncoder).encode(e),n=await crypto.subtle.digest("SHA-256",t),r=new Uint8Array(n);return Array.from(r).map(e=>String.fromCharCode(e)).join("")}(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Pp(e,t,n=!1){const r=function(){const e=new Uint32Array(56);if("undefined"==typeof crypto){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",t=e.length;let n="";for(let r=0;r<56;r++)n+=e.charAt(Math.floor(Math.random()*t));return n}return crypto.getRandomValues(e),Array.from(e,zp).join("")}();let s=r;n&&(s+="/PASSWORD_RECOVERY"),await Tp(e,`${t}-code-verifier`,s);const i=await Dp(r);return[i,r===i?"plain":"s256"]}Kp.promiseConstructor=Promise;const jp=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;const Qp=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function $p(e){if(!Qp.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function qp(){return new Proxy({},{get:(e,t)=>{if("__isUserNotAvailableProxy"===t)return!0;if("symbol"==typeof t){const e=t.toString();if("Symbol(Symbol.toPrimitive)"===e||"Symbol(Symbol.toStringTag)"===e||"Symbol(util.inspect.custom)"===e)return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function ef(e){return JSON.parse(JSON.stringify(e))}const tf=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),nf=[502,503,504];async function rf(e){var t,n;if(!("object"==typeof(n=e)&&null!==n&&"status"in n&&"ok"in n&&"json"in n&&"function"==typeof n.json))throw new Sp(tf(e),0);if(nf.includes(e.status))throw new Sp(tf(e),e.status);let r,s;try{r=await e.json()}catch(o){throw new pp(tf(o),o)}const i=function(e){const t=e.headers.get(lp);if(!t)return null;if(!t.match(jp))return null;try{/* @__PURE__ */
3
- return new Date(`${t}T00:00:00.0Z`)}catch(o){return null}}(e);if(i&&i.getTime()>=up.timestamp&&"object"==typeof r&&r&&"string"==typeof r.code?s=r.code:"object"==typeof r&&r&&"string"==typeof r.error_code&&(s=r.error_code),s){if("weak_password"===s)throw new Zp(tf(r),e.status,(null===(t=r.weak_password)||void 0===t?void 0:t.reasons)||[]);if("session_not_found"===s)throw new yp}else if("object"==typeof r&&r&&"object"==typeof r.weak_password&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((e,t)=>e&&"string"==typeof t,!0))throw new Zp(tf(r),e.status,r.weak_password.reasons);throw new gp(tf(r),e.status||500,s)}async function sf(e,t,n,r){var s;const i=Object.assign({},null==r?void 0:r.headers);i[lp]||(i[lp]=up.name),(null==r?void 0:r.jwt)&&(i.Authorization=`Bearer ${r.jwt}`);const o=null!==(s=null==r?void 0:r.query)&&void 0!==s?s:{};(null==r?void 0:r.redirectTo)&&(o.redirect_to=r.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await async function(e,t,n,r,s,i){const o=((e,t,n,r)=>{const s={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},null==t?void 0:t.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),n))})(t,r,s,i);let a;try{a=await e(n,Object.assign({},o))}catch(c){throw console.error(c),new Sp(tf(c),0)}a.ok||await rf(a);if(null==r?void 0:r.noResolveJson)return a;try{return await a.json()}catch(c){await rf(c)}}(e,t,n+a,{headers:i,noResolveJson:null==r?void 0:r.noResolveJson},{},null==r?void 0:r.body);return(null==r?void 0:r.xform)?null==r?void 0:r.xform(c):{data:Object.assign({},c),error:null}}function of(e){var t;let n=null;var r;(function(e){return e.access_token&&e.refresh_token&&e.expires_in})(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=(r=e.expires_in,Math.round(Date.now()/1e3)+r)));return{data:{session:n,user:null!==(t=e.user)&&void 0!==t?t:e},error:null}}function af(e){const t=of(e);return!t.error&&e.weak_password&&"object"==typeof e.weak_password&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&"string"==typeof e.weak_password.message&&e.weak_password.reasons.reduce((e,t)=>e&&"string"==typeof t,!0)&&(t.data.weak_password=e.weak_password),t}function cf(e){var t;return{data:{user:null!==(t=e.user)&&void 0!==t?t:e},error:null}}function lf(e){return{data:e,error:null}}function uf(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i}=e,o=rm(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]);return{data:{properties:{action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i},user:Object.assign({},o)},error:null}}function df(e){return e}const hf=["global","local","others"];class mf{constructor({url:e="",headers:t={},fetch:n}){this.url=e,this.headers=t,this.fetch=Hp(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)}}async signOut(e,t=hf[0]){if(hf.indexOf(t)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${hf.join(", ")}`);try{return await sf(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(mp(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,t={}){try{return await sf(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:cf})}catch(n){if(mp(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:t}=e,n=rm(e,["options"]),r=Object.assign(Object.assign({},n),t);return"newEmail"in n&&(r.new_email=null==n?void 0:n.newEmail,delete r.newEmail),await sf(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:r,headers:this.headers,xform:uf,redirectTo:null==t?void 0:t.redirectTo})}catch(t){if(mp(t))return{data:{properties:null,user:null},error:t};throw t}}async createUser(e){try{return await sf(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:cf})}catch(t){if(mp(t))return{data:{user:null},error:t};throw t}}async listUsers(e){var t,n,r,s,i,o,a;try{const c={nextPage:null,lastPage:0,total:0},l=await sf(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:null!==(n=null===(t=null==e?void 0:e.page)||void 0===t?void 0:t.toString())&&void 0!==n?n:"",per_page:null!==(s=null===(r=null==e?void 0:e.perPage)||void 0===r?void 0:r.toString())&&void 0!==s?s:""},xform:df});if(l.error)throw l.error;const u=await l.json(),d=null!==(i=l.headers.get("x-total-count"))&&void 0!==i?i:0,h=null!==(a=null===(o=l.headers.get("link"))||void 0===o?void 0:o.split(","))&&void 0!==a?a:[];return h.length>0&&(h.forEach(e=>{const t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),n=JSON.parse(e.split(";")[1].split("=")[1]);c[`${n}Page`]=t}),c.total=parseInt(d)),{data:Object.assign(Object.assign({},u),c),error:null}}catch(c){if(mp(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){$p(e);try{return await sf(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:cf})}catch(t){if(mp(t))return{data:{user:null},error:t};throw t}}async updateUserById(e,t){$p(e);try{return await sf(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:cf})}catch(n){if(mp(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,t=!1){$p(e);try{return await sf(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:cf})}catch(n){if(mp(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){$p(e.userId);try{const{data:t,error:n}=await sf(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:n}}catch(t){if(mp(t))return{data:null,error:t};throw t}}async _deleteFactor(e){$p(e.userId),$p(e.id);try{return{data:await sf(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(t){if(mp(t))return{data:null,error:t};throw t}}async _listOAuthClients(e){var t,n,r,s,i,o,a;try{const c={nextPage:null,lastPage:0,total:0},l=await sf(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:null!==(n=null===(t=null==e?void 0:e.page)||void 0===t?void 0:t.toString())&&void 0!==n?n:"",per_page:null!==(s=null===(r=null==e?void 0:e.perPage)||void 0===r?void 0:r.toString())&&void 0!==s?s:""},xform:df});if(l.error)throw l.error;const u=await l.json(),d=null!==(i=l.headers.get("x-total-count"))&&void 0!==i?i:0,h=null!==(a=null===(o=l.headers.get("link"))||void 0===o?void 0:o.split(","))&&void 0!==a?a:[];return h.length>0&&(h.forEach(e=>{const t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),n=JSON.parse(e.split(";")[1].split("=")[1]);c[`${n}Page`]=t}),c.total=parseInt(d)),{data:Object.assign(Object.assign({},u),c),error:null}}catch(c){if(mp(c))return{data:{clients:[]},error:c};throw c}}async _createOAuthClient(e){try{return await sf(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(t){if(mp(t))return{data:null,error:t};throw t}}async _getOAuthClient(e){try{return await sf(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(t){if(mp(t))return{data:null,error:t};throw t}}async _updateOAuthClient(e,t){try{return await sf(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(n){if(mp(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{return await sf(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(t){if(mp(t))return{data:null,error:t};throw t}}async _regenerateOAuthClientSecret(e){try{return await sf(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(t){if(mp(t))return{data:null,error:t};throw t}}async _listCustomProviders(e){try{const t={};return(null==e?void 0:e.type)&&(t.type=e.type),await sf(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:e=>{var t;return{data:{providers:null!==(t=null==e?void 0:e.providers)&&void 0!==t?t:[]},error:null}}})}catch(t){if(mp(t))return{data:{providers:[]},error:t};throw t}}async _createCustomProvider(e){try{return await sf(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(t){if(mp(t))return{data:null,error:t};throw t}}async _getCustomProvider(e){try{return await sf(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(t){if(mp(t))return{data:null,error:t};throw t}}async _updateCustomProvider(e,t){try{return await sf(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(n){if(mp(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(e){try{return await sf(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(t){if(mp(t))return{data:null,error:t};throw t}}}function gf(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const pf=!!(globalThis&&Lp()&&globalThis.localStorage&&"true"===globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug"));class ff extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class yf extends ff{}async function bf(e,t,n){pf&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;t>0&&setTimeout(()=>{r.abort(),pf&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,0===t?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async r=>{if(!r){if(0===t)throw pf&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new yf(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(pf)try{const e=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(e,null," "))}catch(s){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",s)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await n()}pf&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,r.name);try{return await n()}finally{pf&&console.log("@supabase/gotrue-js: navigatorLock: released",e,r.name)}})}catch(s){if("AbortError"===(null==s?void 0:s.name)&&t>0)return pf&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async t=>{if(!t)return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await n();pf&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,t.name);try{return await n()}finally{pf&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,t.name)}}));throw s}}function If(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function wf(e){const t=(new TextEncoder).encode(e);return"0x"+Array.from(t,e=>e.toString(16).padStart(2,"0")).join("")}class vf extends Error{constructor({message:e,code:t,cause:n,name:r}){var s;super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=null!==(s=null!=r?r:n instanceof Error?n.name:void 0)&&void 0!==s?s:"Unknown Error",this.code=t}}class Gf extends vf{constructor(e,t){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t,message:e}),this.name="WebAuthnUnknownError",this.originalError=t}}function Af({error:e,options:t}){var n,r,s;const{publicKey:i}=t;if(!i)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new vf({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("ConstraintError"===e.name){if(!0===(null===(n=i.authenticatorSelection)||void 0===n?void 0:n.requireResidentKey))return new vf({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if("conditional"===t.mediation&&"required"===(null===(r=i.authenticatorSelection)||void 0===r?void 0:r.userVerification))return new vf({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if("required"===(null===(s=i.authenticatorSelection)||void 0===s?void 0:s.userVerification))return new vf({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if("InvalidStateError"===e.name)return new vf({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if("NotAllowedError"===e.name)return new vf({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if("NotSupportedError"===e.name){return 0===i.pubKeyCredParams.filter(e=>"public-key"===e.type).length?new vf({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new vf({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e})}if("SecurityError"===e.name){const t=window.location.hostname;if(!Bf(t))return new vf({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(i.rp.id!==t)return new vf({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("TypeError"===e.name){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new vf({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if("UnknownError"===e.name)return new vf({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new vf({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function Sf({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new vf({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if("NotAllowedError"===e.name)return new vf({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if("SecurityError"===e.name){const t=window.location.hostname;if(!Bf(t))return new vf({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(n.rpId!==t)return new vf({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("UnknownError"===e.name)return new vf({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new vf({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}const Cf=new class{createNewAbortSignal(){if(this.controller){const e=new Error("Cancelling existing WebAuthn API call for new one");e.name="AbortError",this.controller.abort(e)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}};function Zf(e){if(!e)throw new Error("Credential creation options are required");if("undefined"!=typeof PublicKeyCredential&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseCreationOptionsFromJSON)return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:n,excludeCredentials:r}=e,s=rm(e,["challenge","user","excludeCredentials"]),i=Jp(t).buffer,o=Object.assign(Object.assign({},n),{id:Jp(n.id).buffer}),a=Object.assign(Object.assign({},s),{challenge:i,user:o});if(r&&r.length>0){a.excludeCredentials=new Array(r.length);for(let e=0;e<r.length;e++){const t=r[e];a.excludeCredentials[e]=Object.assign(Object.assign({},t),{id:Jp(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return a}function Vf(e){if(!e)throw new Error("Credential request options are required");if("undefined"!=typeof PublicKeyCredential&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseRequestOptionsFromJSON)return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:n}=e,r=rm(e,["challenge","allowCredentials"]),s=Jp(t).buffer,i=Object.assign(Object.assign({},r),{challenge:s});if(n&&n.length>0){i.allowCredentials=new Array(n.length);for(let e=0;e<n.length;e++){const t=n[e];i.allowCredentials[e]=Object.assign(Object.assign({},t),{id:Jp(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return i}function Ef(e){var t;if("toJSON"in e&&"function"==typeof e.toJSON)return e.toJSON();const n=e;return{id:e.id,rawId:e.id,response:{attestationObject:_p(new Uint8Array(e.response.attestationObject)),clientDataJSON:_p(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:null!==(t=n.authenticatorAttachment)&&void 0!==t?t:void 0}}function Xf(e){var t;if("toJSON"in e&&"function"==typeof e.toJSON)return e.toJSON();const n=e,r=e.getClientExtensionResults(),s=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:_p(new Uint8Array(s.authenticatorData)),clientDataJSON:_p(new Uint8Array(s.clientDataJSON)),signature:_p(new Uint8Array(s.signature)),userHandle:s.userHandle?_p(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:null!==(t=n.authenticatorAttachment)&&void 0!==t?t:void 0}}function Bf(e){return"localhost"===e||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function Rf(){var e,t;return!!(Fp()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&"function"==typeof(null===(e=null===navigator||void 0===navigator?void 0:navigator.credentials)||void 0===e?void 0:e.create)&&"function"==typeof(null===(t=null===navigator||void 0===navigator?void 0:navigator.credentials)||void 0===t?void 0:t.get))}const xf={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},Wf={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Nf(...e){const t=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),n=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),r={};for(const s of e)if(s)for(const e in s){const i=s[e];if(void 0!==i)if(Array.isArray(i))r[e]=i;else if(n(i))r[e]=i;else if(t(i)){const n=r[e];t(n)?r[e]=Nf(n,i):r[e]=Nf(i)}else r[e]=i}return r}class Jf{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:t,friendlyName:n,signal:r},s){var i;try{const{data:o,error:a}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!o)return{data:null,error:a};const c=null!=r?r:Cf.createNewAbortSignal();if("create"===o.webauthn.type){const{user:e}=o.webauthn.credential_options.publicKey;if(!e.name){const t=n;if(t)e.name=`${e.id}:${t}`;else{const t=(await this.client.getUser()).data.user,n=(null===(i=null==t?void 0:t.user_metadata)||void 0===i?void 0:i.name)||(null==t?void 0:t.email)||(null==t?void 0:t.id)||"User";e.name=`${e.id}:${n}`}}e.displayName||(e.displayName=e.name)}switch(o.webauthn.type){case"create":{const t=function(e,t){return Nf(xf,e,t||{})}(o.webauthn.credential_options.publicKey,null==s?void 0:s.create),{data:n,error:r}=await async function(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Gf("Browser returned unexpected credential type",t)}:{data:null,error:new Gf("Empty credential response",t)}}catch(t){return{data:null,error:Af({error:t,options:e})}}}({publicKey:t,signal:c});return n?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:n}},error:null}:{data:null,error:r}}case"request":{const t=function(e,t){return Nf(Wf,e,t||{})}(o.webauthn.credential_options.publicKey,null==s?void 0:s.request),{data:n,error:r}=await async function(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Gf("Browser returned unexpected credential type",t)}:{data:null,error:new Gf("Empty credential response",t)}}catch(t){return{data:null,error:Sf({error:t,options:e})}}}(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:t,signal:c}));return n?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:n}},error:null}:{data:null,error:r}}}}catch(o){return mp(o)?{data:null,error:o}:{data:null,error:new pp("Unexpected error in challenge",o)}}}async _verify({challengeId:e,factorId:t,webauthn:n}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:t=("undefined"!=typeof window?window.location.hostname:void 0),rpOrigins:n=("undefined"!=typeof window?[window.location.origin]:void 0),signal:r}={}},s){if(!t)return{data:null,error:new hp("rpId is required for WebAuthn authentication")};try{if(!Rf())return{data:null,error:new pp("Browser does not support WebAuthn",null)};const{data:i,error:o}=await this.challenge({factorId:e,webauthn:{rpId:t,rpOrigins:n},signal:r},{request:s});if(!i)return{data:null,error:o};const{webauthn:a}=i;return this._verify({factorId:e,challengeId:i.challengeId,webauthn:{type:a.type,rpId:t,rpOrigins:n,credential_response:a.credential_response}})}catch(i){return mp(i)?{data:null,error:i}:{data:null,error:new pp("Unexpected error in authenticate",i)}}}async _register({friendlyName:e,webauthn:{rpId:t=("undefined"!=typeof window?window.location.hostname:void 0),rpOrigins:n=("undefined"!=typeof window?[window.location.origin]:void 0),signal:r}={}},s){if(!t)return{data:null,error:new hp("rpId is required for WebAuthn registration")};try{if(!Rf())return{data:null,error:new pp("Browser does not support WebAuthn",null)};const{data:i,error:o}=await this._enroll({friendlyName:e});if(!i)return await this.client.mfa.listFactors().then(t=>{var n;return null===(n=t.data)||void 0===n?void 0:n.all.find(t=>"webauthn"===t.factor_type&&t.friendly_name===e&&"unverified"!==t.status)}).then(e=>e?this.client.mfa.unenroll({factorId:null==e?void 0:e.id}):void 0),{data:null,error:o};const{data:a,error:c}=await this._challenge({factorId:i.id,friendlyName:i.friendly_name,webauthn:{rpId:t,rpOrigins:n},signal:r},{create:s});return a?this._verify({factorId:i.id,challengeId:a.challengeId,webauthn:{rpId:t,rpOrigins:n,type:a.webauthn.type,credential_response:a.webauthn.credential_response}}):{data:null,error:c}}catch(i){return mp(i)?{data:null,error:i}:{data:null,error:new pp("Unexpected error in register",i)}}}}!function(){if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch(e){"undefined"!=typeof self&&(self.globalThis=self)}}();const kf={url:"http://localhost:9999",storageKey:"supabase.auth.token",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:cp,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function _f(e,t,n){return await n()}const Ff={};class Yf{get jwks(){var e,t;return null!==(t=null===(e=Ff[this.storageKey])||void 0===e?void 0:e.jwks)&&void 0!==t?t:{keys:[]}}set jwks(e){Ff[this.storageKey]=Object.assign(Object.assign({},Ff[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,t;return null!==(t=null===(e=Ff[this.storageKey])||void 0===e?void 0:e.cachedAt)&&void 0!==t?t:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Ff[this.storageKey]=Object.assign(Object.assign({},Ff[this.storageKey]),{cachedAt:e})}constructor(e){var t,n,r;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=/* @__PURE__ */new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const s=Object.assign(Object.assign({},kf),e);if(this.storageKey=s.storageKey,this.instanceID=null!==(t=Yf.nextInstanceID[this.storageKey])&&void 0!==t?t:0,Yf.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!s.debug,"function"==typeof s.debug&&(this.logger=s.debug),this.instanceID>0&&Fp()){const e=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(e),this.logDebugMessages&&console.trace(e)}if(this.persistSession=s.persistSession,this.autoRefreshToken=s.autoRefreshToken,this.admin=new mf({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=Hp(s.fetch),this.lock=s.lock||_f,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,this.throwOnError=s.throwOnError,this.lockAcquireTimeout=s.lockAcquireTimeout,s.lock?this.lock=s.lock:this.persistSession&&Fp()&&(null===(n=null===globalThis||void 0===globalThis?void 0:globalThis.navigator)||void 0===n?void 0:n.locks)?this.lock=bf:this.lock=_f,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new Jf(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(s.storage?this.storage=s.storage:Lp()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=gf(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=gf(this.memoryStorage)),Fp()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}null===(r=this.broadcastChannel)||void 0===r||r.addEventListener("message",async e=>{this._debug("received broadcast notification from other tab or client",e);try{await this._notifyAllSubscribers(e.data.event,e.data.session,!1)}catch(t){this._debug("#broadcastChannel","error",t)}})}s.skipAutoInitialize||this.initialize().catch(e=>{this._debug("#initialize()","error",e)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${ip}) ${/* @__PURE__ */(new Date).toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise||(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))()),await this.initializePromise}async _initialize(){var e;try{let t={},n="none";if(Fp()&&(t=function(e){const t={},n=new URL(e);if(n.hash&&"#"===n.hash[0])try{new URLSearchParams(n.hash.substring(1)).forEach((e,n)=>{t[n]=e})}catch(r){}return n.searchParams.forEach((e,n)=>{t[n]=e}),t}(window.location.href),this._isImplicitGrantCallback(t)?n="implicit":await this._isPKCECallback(t)&&(n="pkce")),Fp()&&this.detectSessionInUrl&&"none"!==n){const{data:r,error:s}=await this._getSessionFromURL(t,n);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),function(e){return mp(e)&&"AuthImplicitGrantRedirectError"===e.name}(s)){const t=null===(e=s.details)||void 0===e?void 0:e.code;if("identity_already_exists"===t||"identity_not_found"===t||"single_identity_not_deletable"===t)return{error:s}}return{error:s}}const{session:i,redirectType:o}=r;return this._debug("#_initialize()","detected session in URL",i,"redirect type",o),await this._saveSession(i),setTimeout(async()=>{"recovery"===o?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(t){return mp(t)?this._returnResult({error:t}):this._returnResult({error:new pp("Unexpected error during initialization",t)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,n,r;try{const s=await sf(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:null!==(n=null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.data)&&void 0!==n?n:{},gotrue_meta_security:{captcha_token:null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.captchaToken}},xform:of}),{data:i,error:o}=s;if(o||!i)return this._returnResult({data:{user:null,session:null},error:o});const a=i.session,c=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",a)),this._returnResult({data:{user:c,session:a},error:null})}catch(s){if(mp(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signUp(e){var t,n,r;try{let s;if("email"in e){const{email:n,password:r,options:i}=e;let o=null,a=null;"pkce"===this.flowType&&([o,a]=await Pp(this.storage,this.storageKey)),s=await sf(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:null==i?void 0:i.emailRedirectTo,body:{email:n,password:r,data:null!==(t=null==i?void 0:i.data)&&void 0!==t?t:{},gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken},code_challenge:o,code_challenge_method:a},xform:of})}else{if(!("phone"in e))throw new wp("You must provide either an email or phone number and a password");{const{phone:t,password:i,options:o}=e;s=await sf(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:t,password:i,data:null!==(n=null==o?void 0:o.data)&&void 0!==n?n:{},channel:null!==(r=null==o?void 0:o.channel)&&void 0!==r?r:"sms",gotrue_meta_security:{captcha_token:null==o?void 0:o.captchaToken}},xform:of})}}const{data:i,error:o}=s;if(o||!i)return await Mp(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:o});const a=i.session,c=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",a)),this._returnResult({data:{user:c,session:a},error:null})}catch(s){if(await Mp(this.storage,`${this.storageKey}-code-verifier`),mp(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithPassword(e){try{let t;if("email"in e){const{email:n,password:r,options:s}=e;t=await sf(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:r,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},xform:af})}else{if(!("phone"in e))throw new wp("You must provide either an email or phone number and a password");{const{phone:n,password:r,options:s}=e;t=await sf(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:r,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},xform:af})}}const{data:n,error:r}=t;if(r)return this._returnResult({data:{user:null,session:null},error:r});if(!n||!n.session||!n.user){const e=new Ip;return this._returnResult({data:{user:null,session:null},error:e})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:r})}catch(t){if(mp(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async signInWithOAuth(e){var t,n,r,s;return await this._handleProviderSignIn(e.provider,{redirectTo:null===(t=e.options)||void 0===t?void 0:t.redirectTo,scopes:null===(n=e.options)||void 0===n?void 0:n.scopes,queryParams:null===(r=e.options)||void 0===r?void 0:r.queryParams,skipBrowserRedirect:null===(s=e.options)||void 0===s?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:t}=e;switch(t){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){var t,n,r,s,i,o,a,c,l,u,d;let h,m;if("message"in e)h=e.message,m=e.signature;else{const{chain:u,wallet:d,statement:g,options:p}=e;let f;if(Fp())if("object"==typeof d)f=d;else{const e=window;if(!("ethereum"in e)||"object"!=typeof e.ethereum||!("request"in e.ethereum)||"function"!=typeof e.ethereum.request)throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.");f=e.ethereum}else{if("object"!=typeof d||!(null==p?void 0:p.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");f=d}const y=new URL(null!==(t=null==p?void 0:p.url)&&void 0!==t?t:window.location.href),b=await f.request({method:"eth_requestAccounts"}).then(e=>e).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!b||0===b.length)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const I=If(b[0]);let w=null===(n=null==p?void 0:p.signInWithEthereum)||void 0===n?void 0:n.chainId;if(!w){const e=await f.request({method:"eth_chainId"});w=parseInt(e,16)}h=function(e){var t;const{chainId:n,domain:r,expirationTime:s,issuedAt:i=/* @__PURE__ */new Date,nonce:o,notBefore:a,requestId:c,resources:l,scheme:u,uri:d,version:h}=e;if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if("1"!==h)throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${h}`);if(null===(t=e.statement)||void 0===t?void 0:t.includes("\n"))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`);const m=`${u?`${u}://${r}`:r} wants you to sign in with your Ethereum account:\n${If(e.address)}\n\n${e.statement?`${e.statement}\n`:""}`;let g=`URI: ${d}\nVersion: ${h}\nChain ID: ${n}${o?`\nNonce: ${o}`:""}\nIssued At: ${i.toISOString()}`;if(s&&(g+=`\nExpiration Time: ${s.toISOString()}`),a&&(g+=`\nNot Before: ${a.toISOString()}`),c&&(g+=`\nRequest ID: ${c}`),l){let e="\nResources:";for(const t of l){if(!t||"string"!=typeof t)throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${t}`);e+=`\n- ${t}`}g+=e}return`${m}\n${g}`}({domain:y.host,address:I,statement:g,uri:y.href,version:"1",chainId:w,nonce:null===(r=null==p?void 0:p.signInWithEthereum)||void 0===r?void 0:r.nonce,issuedAt:null!==(i=null===(s=null==p?void 0:p.signInWithEthereum)||void 0===s?void 0:s.issuedAt)&&void 0!==i?i:/* @__PURE__ */new Date,expirationTime:null===(o=null==p?void 0:p.signInWithEthereum)||void 0===o?void 0:o.expirationTime,notBefore:null===(a=null==p?void 0:p.signInWithEthereum)||void 0===a?void 0:a.notBefore,requestId:null===(c=null==p?void 0:p.signInWithEthereum)||void 0===c?void 0:c.requestId,resources:null===(l=null==p?void 0:p.signInWithEthereum)||void 0===l?void 0:l.resources}),m=await f.request({method:"personal_sign",params:[wf(h),I]})}try{const{data:t,error:n}=await sf(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:h,signature:m},(null===(u=e.options)||void 0===u?void 0:u.captchaToken)?{gotrue_meta_security:{captcha_token:null===(d=e.options)||void 0===d?void 0:d.captchaToken}}:null),xform:of});if(n)throw n;if(!t||!t.session||!t.user){const e=new Ip;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:n})}catch(g){if(mp(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(e){var t,n,r,s,i,o,a,c,l,u,d,h;let m,g;if("message"in e)m=e.message,g=e.signature;else{const{chain:d,wallet:h,statement:p,options:f}=e;let y;if(Fp())if("object"==typeof h)y=h;else{const e=window;if(!("solana"in e)||"object"!=typeof e.solana||!("signIn"in e.solana&&"function"==typeof e.solana.signIn||"signMessage"in e.solana&&"function"==typeof e.solana.signMessage))throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.");y=e.solana}else{if("object"!=typeof h||!(null==f?void 0:f.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");y=h}const b=new URL(null!==(t=null==f?void 0:f.url)&&void 0!==t?t:window.location.href);if("signIn"in y&&y.signIn){const e=await y.signIn(Object.assign(Object.assign(Object.assign({issuedAt:/* @__PURE__ */(new Date).toISOString()},null==f?void 0:f.signInWithSolana),{version:"1",domain:b.host,uri:b.href}),p?{statement:p}:null));let t;if(Array.isArray(e)&&e[0]&&"object"==typeof e[0])t=e[0];else{if(!(e&&"object"==typeof e&&"signedMessage"in e&&"signature"in e))throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");t=e}if(!("signedMessage"in t&&"signature"in t&&("string"==typeof t.signedMessage||t.signedMessage instanceof Uint8Array)&&t.signature instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields");m="string"==typeof t.signedMessage?t.signedMessage:(new TextDecoder).decode(t.signedMessage),g=t.signature}else{if(!("signMessage"in y&&"function"==typeof y.signMessage&&"publicKey"in y&&"object"==typeof y&&y.publicKey&&"toBase58"in y.publicKey&&"function"==typeof y.publicKey.toBase58))throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");m=[`${b.host} wants you to sign in with your Solana account:`,y.publicKey.toBase58(),...p?["",p,""]:[""],"Version: 1",`URI: ${b.href}`,`Issued At: ${null!==(r=null===(n=null==f?void 0:f.signInWithSolana)||void 0===n?void 0:n.issuedAt)&&void 0!==r?r:/* @__PURE__ */(new Date).toISOString()}`,...(null===(s=null==f?void 0:f.signInWithSolana)||void 0===s?void 0:s.notBefore)?[`Not Before: ${f.signInWithSolana.notBefore}`]:[],...(null===(i=null==f?void 0:f.signInWithSolana)||void 0===i?void 0:i.expirationTime)?[`Expiration Time: ${f.signInWithSolana.expirationTime}`]:[],...(null===(o=null==f?void 0:f.signInWithSolana)||void 0===o?void 0:o.chainId)?[`Chain ID: ${f.signInWithSolana.chainId}`]:[],...(null===(a=null==f?void 0:f.signInWithSolana)||void 0===a?void 0:a.nonce)?[`Nonce: ${f.signInWithSolana.nonce}`]:[],...(null===(c=null==f?void 0:f.signInWithSolana)||void 0===c?void 0:c.requestId)?[`Request ID: ${f.signInWithSolana.requestId}`]:[],...(null===(u=null===(l=null==f?void 0:f.signInWithSolana)||void 0===l?void 0:l.resources)||void 0===u?void 0:u.length)?["Resources",...f.signInWithSolana.resources.map(e=>`- ${e}`)]:[]].join("\n");const e=await y.signMessage((new TextEncoder).encode(m),"utf8");if(!(e&&e instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=e}}try{const{data:t,error:n}=await sf(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:m,signature:_p(g)},(null===(d=e.options)||void 0===d?void 0:d.captchaToken)?{gotrue_meta_security:{captcha_token:null===(h=e.options)||void 0===h?void 0:h.captchaToken}}:null),xform:of});if(n)throw n;if(!t||!t.session||!t.user){const e=new Ip;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:n})}catch(p){if(mp(p))return this._returnResult({data:{user:null,session:null},error:p});throw p}}async _exchangeCodeForSession(e){const t=await Op(this.storage,`${this.storageKey}-code-verifier`),[n,r]=(null!=t?t:"").split("/");try{if(!n&&"pkce"===this.flowType)throw new Ap;const{data:t,error:s}=await sf(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:of});if(await Mp(this.storage,`${this.storageKey}-code-verifier`),s)throw s;if(!t||!t.session||!t.user){const e=new Ip;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign(Object.assign({},t),{redirectType:null!=r?r:null}),error:s})}catch(s){if(await Mp(this.storage,`${this.storageKey}-code-verifier`),mp(s))return this._returnResult({data:{user:null,session:null,redirectType:null},error:s});throw s}}async signInWithIdToken(e){try{const{options:t,provider:n,token:r,access_token:s,nonce:i}=e,o=await sf(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:r,access_token:s,nonce:i,gotrue_meta_security:{captcha_token:null==t?void 0:t.captchaToken}},xform:of}),{data:a,error:c}=o;if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!a||!a.session||!a.user){const e=new Ip;return this._returnResult({data:{user:null,session:null},error:e})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:a,error:c})}catch(t){if(mp(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async signInWithOtp(e){var t,n,r,s,i;try{if("email"in e){const{email:r,options:s}=e;let i=null,o=null;"pkce"===this.flowType&&([i,o]=await Pp(this.storage,this.storageKey));const{error:a}=await sf(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:r,data:null!==(t=null==s?void 0:s.data)&&void 0!==t?t:{},create_user:null===(n=null==s?void 0:s.shouldCreateUser)||void 0===n||n,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken},code_challenge:i,code_challenge_method:o},redirectTo:null==s?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}if("phone"in e){const{phone:t,options:n}=e,{data:o,error:a}=await sf(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:null!==(r=null==n?void 0:n.data)&&void 0!==r?r:{},create_user:null===(s=null==n?void 0:n.shouldCreateUser)||void 0===s||s,gotrue_meta_security:{captcha_token:null==n?void 0:n.captchaToken},channel:null!==(i=null==n?void 0:n.channel)&&void 0!==i?i:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:null==o?void 0:o.message_id},error:a})}throw new wp("You must provide either an email or phone number.")}catch(o){if(await Mp(this.storage,`${this.storageKey}-code-verifier`),mp(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async verifyOtp(e){var t,n;try{let r,s;"options"in e&&(r=null===(t=e.options)||void 0===t?void 0:t.redirectTo,s=null===(n=e.options)||void 0===n?void 0:n.captchaToken);const{data:i,error:o}=await sf(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:r,xform:of});if(o)throw o;if(!i){throw new Error("An error occurred on token verification.")}const a=i.session,c=i.user;return(null==a?void 0:a.access_token)&&(await this._saveSession(a),await this._notifyAllSubscribers("recovery"==e.type?"PASSWORD_RECOVERY":"SIGNED_IN",a)),this._returnResult({data:{user:c,session:a},error:null})}catch(r){if(mp(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithSSO(e){var t,n,r,s,i;try{let o=null,a=null;"pkce"===this.flowType&&([o,a]=await Pp(this.storage,this.storageKey));const c=await sf(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:null!==(n=null===(t=e.options)||void 0===t?void 0:t.redirectTo)&&void 0!==n?n:void 0}),(null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.captchaToken)?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:a}),headers:this.headers,xform:lf});return(null===(s=c.data)||void 0===s?void 0:s.url)&&Fp()&&!(null===(i=e.options)||void 0===i?void 0:i.skipBrowserRedirect)&&window.location.assign(c.data.url),this._returnResult(c)}catch(o){if(await Mp(this.storage,`${this.storageKey}-code-verifier`),mp(o))return this._returnResult({data:null,error:o});throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:t},error:n}=e;if(n)throw n;if(!t)throw new yp;const{error:r}=await sf(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:r})})}catch(e){if(mp(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const t=`${this.url}/resend`;if("email"in e){const{email:n,type:r,options:s}=e,{error:i}=await sf(this.fetch,"POST",t,{headers:this.headers,body:{email:n,type:r,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},redirectTo:null==s?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:i})}if("phone"in e){const{phone:n,type:r,options:s}=e,{data:i,error:o}=await sf(this.fetch,"POST",t,{headers:this.headers,body:{phone:n,type:r,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:null==i?void 0:i.message_id},error:o})}throw new wp("You must provide either an email or phone number and a type")}catch(t){if(mp(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async getSession(){await this.initializePromise;return await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await n}catch(e){}})()),n}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const e=t();for(this.pendingInLock.push((async()=>{try{await e}catch(t){}})()),await e;this.pendingInLock.length;){const e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",(new Error).stack);try{let e=null;const t=await Op(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),null!==t&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const n=!!e.expires_at&&1e3*e.expires_at-Date.now()<ap;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){const t=await Op(this.userStorage,this.storageKey+"-user");(null==t?void 0:t.user)?e.user=t.user:e.user=qp()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const t={value:this.suppressGetSessionWarning};e.user=function(e,t){return new Proxy(e,{get:(e,n,r)=>{if("__isInsecureUserWarningProxy"===n)return!0;if("symbol"==typeof n){const t=n.toString();if("Symbol(Symbol.toPrimitive)"===t||"Symbol(Symbol.toStringTag)"===t||"Symbol(util.inspect.custom)"===t||"Symbol(nodejs.util.inspect.custom)"===t)return Reflect.get(e,n,r)}return t.value||"string"!=typeof n||(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(e,n,r)}})}(e.user,t),t.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:r,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{session:null},error:s}):this._returnResult({data:{session:r},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;const t=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{return e?await sf(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:cf}):await this._useSession(async e=>{var t,n,r;const{data:s,error:i}=e;if(i)throw i;return(null===(t=s.session)||void 0===t?void 0:t.access_token)||this.hasCustomAuthorizationHeader?await sf(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:null!==(r=null===(n=s.session)||void 0===n?void 0:n.access_token)&&void 0!==r?r:void 0,xform:cf}):{data:{user:null},error:new yp}})}catch(t){if(mp(t))return bp(t)&&(await this._removeSession(),await Mp(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:t});throw t}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async n=>{const{data:r,error:s}=n;if(s)throw s;if(!r.session)throw new yp;const i=r.session;let o=null,a=null;"pkce"===this.flowType&&null!=e.email&&([o,a]=await Pp(this.storage,this.storageKey));const{data:c,error:l}=await sf(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:null==t?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:a}),jwt:i.access_token,xform:cf});if(l)throw l;return i.user=c.user,await this._saveSession(i),await this._notifyAllSubscribers("USER_UPDATED",i),this._returnResult({data:{user:i.user},error:null})})}catch(n){if(await Mp(this.storage,`${this.storageKey}-code-verifier`),mp(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new yp;const t=Date.now()/1e3;let n=t,r=!0,s=null;const{payload:i}=Up(e.access_token);if(i.exp&&(n=i.exp,r=n<=t),r){const{data:t,error:n}=await this._callRefreshToken(e.refresh_token);if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!t)return{data:{user:null,session:null},error:null};s=t}else{const{data:r,error:i}=await this._getUser(e.access_token);if(i)return this._returnResult({data:{user:null,session:null},error:i});s={access_token:e.access_token,refresh_token:e.refresh_token,user:r.user,token_type:"bearer",expires_in:n-t,expires_at:n},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(t){if(mp(t))return this._returnResult({data:{session:null,user:null},error:t});throw t}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var n;if(!e){const{data:r,error:s}=t;if(s)throw s;e=null!==(n=r.session)&&void 0!==n?n:void 0}if(!(null==e?void 0:e.refresh_token))throw new yp;const{data:r,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):r?this._returnResult({data:{user:r.user,session:r},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(t){if(mp(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async _getSessionFromURL(e,t){try{if(!Fp())throw new vp("No browser detected.");if(e.error||e.error_description||e.error_code)throw new vp(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(t){case"implicit":if("pkce"===this.flowType)throw new Gp("Not a valid PKCE flow url.");break;case"pkce":if("implicit"===this.flowType)throw new vp("Not a valid implicit grant flow url.")}if("pkce"===t){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new Gp("No code detected.");const{data:t,error:n}=await this._exchangeCodeForSession(e.code);if(n)throw n;const r=new URL(window.location.href);return r.searchParams.delete("code"),window.history.replaceState(window.history.state,"",r.toString()),{data:{session:t.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:r,access_token:s,refresh_token:i,expires_in:o,expires_at:a,token_type:c}=e;if(!(s&&o&&i&&c))throw new vp("No session defined in URL");const l=Math.round(Date.now()/1e3),u=parseInt(o);let d=l+u;a&&(d=parseInt(a));const h=d-l;1e3*h<=op&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${h}s, should have been closer to ${u}s`);const m=d-u;l-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,d,l):l-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,d,l);const{data:g,error:p}=await this._getUser(s);if(p)throw p;const f={provider_token:n,provider_refresh_token:r,access_token:s,expires_in:u,expires_at:d,refresh_token:i,token_type:c,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:f,redirectType:e.type},error:null})}catch(n){if(mp(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(e){return"function"==typeof this.detectSessionInUrl?this.detectSessionInUrl(new URL(window.location.href),e):Boolean(e.access_token||e.error_description)}async _isPKCECallback(e){const t=await Op(this.storage,`${this.storageKey}-code-verifier`);return!(!e.code||!t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var n;const{data:r,error:s}=t;if(s&&!bp(s))return this._returnResult({error:s});const i=null===(n=r.session)||void 0===n?void 0:n.access_token;if(i){const{error:t}=await this.admin.signOut(i,e);if(t&&(!function(e){return mp(e)&&"AuthApiError"===e.name}(t)||404!==t.status&&401!==t.status&&403!==t.status)&&!bp(t))return this._returnResult({error:t})}return"others"!==e&&(await this._removeSession(),await Mp(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const t=/* @__PURE__ */Symbol("auth-callback"),n={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,n),(async()=>{await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async t=>{var n,r;try{const{data:{session:r},error:s}=t;if(s)throw s;await(null===(n=this.stateChangeEmitters.get(e))||void 0===n?void 0:n.callback("INITIAL_SESSION",r)),this._debug("INITIAL_SESSION","callback id",e,"session",r)}catch(s){await(null===(r=this.stateChangeEmitters.get(e))||void 0===r?void 0:r.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",s),console.error(s)}})}async resetPasswordForEmail(e,t={}){let n=null,r=null;"pkce"===this.flowType&&([n,r]=await Pp(this.storage,this.storageKey,!0));try{return await sf(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(s){if(await Mp(this.storage,`${this.storageKey}-code-verifier`),mp(s))return this._returnResult({data:null,error:s});throw s}}async getUserIdentities(){var e;try{const{data:t,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:null!==(e=t.user.identities)&&void 0!==e?e:[]},error:null})}catch(t){if(mp(t))return this._returnResult({data:null,error:t});throw t}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var t;try{const{data:n,error:r}=await this._useSession(async t=>{var n,r,s,i,o;const{data:a,error:c}=t;if(c)throw c;const l=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:null===(n=e.options)||void 0===n?void 0:n.redirectTo,scopes:null===(r=e.options)||void 0===r?void 0:r.scopes,queryParams:null===(s=e.options)||void 0===s?void 0:s.queryParams,skipBrowserRedirect:!0});return await sf(this.fetch,"GET",l,{headers:this.headers,jwt:null!==(o=null===(i=a.session)||void 0===i?void 0:i.access_token)&&void 0!==o?o:void 0})});if(r)throw r;return Fp()&&!(null===(t=e.options)||void 0===t?void 0:t.skipBrowserRedirect)&&window.location.assign(null==n?void 0:n.url),this._returnResult({data:{provider:e.provider,url:null==n?void 0:n.url},error:null})}catch(n){if(mp(n))return this._returnResult({data:{provider:e.provider,url:null},error:n});throw n}}async linkIdentityIdToken(e){return await this._useSession(async t=>{var n;try{const{error:r,data:{session:s}}=t;if(r)throw r;const{options:i,provider:o,token:a,access_token:c,nonce:l}=e,u=await sf(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:null!==(n=null==s?void 0:s.access_token)&&void 0!==n?n:void 0,body:{provider:o,id_token:a,access_token:c,nonce:l,link_identity:!0,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:of}),{data:d,error:h}=u;return h?this._returnResult({data:{user:null,session:null},error:h}):d&&d.session&&d.user?(d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("USER_UPDATED",d.session)),this._returnResult({data:d,error:h})):this._returnResult({data:{user:null,session:null},error:new Ip})}catch(r){if(await Mp(this.storage,`${this.storageKey}-code-verifier`),mp(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{var n,r;const{data:s,error:i}=t;if(i)throw i;return await sf(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:null!==(r=null===(n=s.session)||void 0===n?void 0:n.access_token)&&void 0!==r?r:void 0})})}catch(t){if(mp(t))return this._returnResult({data:null,error:t});throw t}}async _refreshAccessToken(e){const t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{const s=Date.now();return await(n=async n=>(n>0&&await async function(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}(200*Math.pow(2,n-1)),this._debug(t,"refreshing attempt",n),await sf(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:of})),r=(e,t)=>{const n=200*Math.pow(2,e);return t&&Cp(t)&&Date.now()+n-s<op},new Promise((e,t)=>{(async()=>{for(let i=0;i<1/0;i++)try{const t=await n(i);if(!r(i,null,t))return void e(t)}catch(s){if(!r(i,s))return void t(s)}})()}))}catch(s){if(this._debug(t,"error",s),mp(s))return this._returnResult({data:{session:null,user:null},error:s});throw s}finally{this._debug(t,"end")}var n,r}_isValidSession(e){return"object"==typeof e&&null!==e&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){const n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",n),Fp()&&!t.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e,t;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const s=await Op(this.storage,this.storageKey);if(s&&this.userStorage){let t=await Op(this.userStorage,this.storageKey+"-user");this.storage.isServer||!Object.is(this.storage,this.userStorage)||t||(t={user:s.user},await Tp(this.userStorage,this.storageKey+"-user",t)),s.user=null!==(e=null==t?void 0:t.user)&&void 0!==e?e:qp()}else if(s&&!s.user&&!s.user){const e=await Op(this.storage,this.storageKey+"-user");e&&(null==e?void 0:e.user)?(s.user=e.user,await Mp(this.storage,this.storageKey+"-user"),await Tp(this.storage,this.storageKey,s)):s.user=qp()}if(this._debug(n,"session from storage",s),!this._isValidSession(s))return this._debug(n,"session is not valid"),void(null!==s&&await this._removeSession());const i=1e3*(null!==(t=s.expires_at)&&void 0!==t?t:1/0)-Date.now()<ap;if(this._debug(n,`session has${i?"":" not"} expired with margin of 90000s`),i){if(this.autoRefreshToken&&s.refresh_token){const{error:e}=await this._callRefreshToken(s.refresh_token);e&&(console.error(e),Cp(e)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",e),await this._removeSession()))}}else if(s.user&&!0===s.user.__isUserNotAvailableProxy)try{const{data:e,error:t}=await this._getUser(s.access_token);!t&&(null==e?void 0:e.user)?(s.user=e.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(r){console.error("Error getting user data:",r),this._debug(n,"error getting user data, skipping SIGNED_IN notification",r)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){return this._debug(n,"error",s),void console.error(s)}finally{this._debug(n,"end")}}async _callRefreshToken(e){var t,n;if(!e)throw new yp;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const r=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{this.refreshingDeferred=new Kp;const{data:t,error:n}=await this._refreshAccessToken(e);if(n)throw n;if(!t.session)throw new yp;await this._saveSession(t.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",t.session);const r={data:t.session,error:null};return this.refreshingDeferred.resolve(r),r}catch(s){if(this._debug(r,"error",s),mp(s)){const e={data:null,error:s};return Cp(s)||await this._removeSession(),null===(t=this.refreshingDeferred)||void 0===t||t.resolve(e),e}throw null===(n=this.refreshingDeferred)||void 0===n||n.reject(s),s}finally{this.refreshingDeferred=null,this._debug(r,"end")}}async _notifyAllSubscribers(e,t,n=!0){const r=`#_notifyAllSubscribers(${e})`;this._debug(r,"begin",t,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:t});const r=[],s=Array.from(this.stateChangeEmitters.values()).map(async n=>{try{await n.callback(e,t)}catch(s){r.push(s)}});if(await Promise.all(s),r.length>0){for(let e=0;e<r.length;e+=1)console.error(r[e]);throw r[0]}}finally{this._debug(r,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await Mp(this.storage,`${this.storageKey}-code-verifier`);const t=Object.assign({},e),n=t.user&&!0===t.user.__isUserNotAvailableProxy;if(this.userStorage){!n&&t.user&&await Tp(this.userStorage,this.storageKey+"-user",{user:t.user});const e=Object.assign({},t);delete e.user;const r=ef(e);await Tp(this.storage,this.storageKey,r)}else{const e=ef(t);await Tp(this.storage,this.storageKey,e)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Mp(this.storage,this.storageKey),await Mp(this.storage,this.storageKey+"-code-verifier"),await Mp(this.storage,this.storageKey+"-user"),this.userStorage&&await Mp(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Fp()&&(null===window||void 0===window?void 0:window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(t){console.error("removing visibilitychange callback failed",t)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),op);this.autoRefreshTicker=e,e&&"object"==typeof e&&"function"==typeof e.unref?e.unref():"undefined"!=typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(e);const t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&"object"==typeof t&&"function"==typeof t.unref?t.unref():"undefined"!=typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async e=>{const{data:{session:n}}=e;if(!n||!n.refresh_token||!n.expires_at)return void this._debug("#_autoRefreshTokenTick()","no session");const r=Math.floor((1e3*n.expires_at-t)/op);this._debug("#_autoRefreshTokenTick()",`access token expires in ${r} ticks, a tick lasts 30000ms, refresh threshold is 3 ticks`),r<=3&&await this._callRefreshToken(n.refresh_token)})}catch(e){console.error("Auto refresh tick failed with error. This is likely a transient error.",e)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(!(e.isAcquireTimeout||e instanceof ff))throw e;this._debug("auto refresh token tick lock not available")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Fp()||!(null===window||void 0===window?void 0:window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},null===window||void 0===window||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),"visible"===document.visibilityState?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{"visible"===document.visibilityState?await this._recoverAndRefresh():this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting")}))):"hidden"===document.visibilityState&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,n){const r=[`provider=${encodeURIComponent(t)}`];if((null==n?void 0:n.redirectTo)&&r.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),(null==n?void 0:n.scopes)&&r.push(`scopes=${encodeURIComponent(n.scopes)}`),"pkce"===this.flowType){const[e,t]=await Pp(this.storage,this.storageKey),n=new URLSearchParams({code_challenge:`${encodeURIComponent(e)}`,code_challenge_method:`${encodeURIComponent(t)}`});r.push(n.toString())}if(null==n?void 0:n.queryParams){const e=new URLSearchParams(n.queryParams);r.push(e.toString())}return(null==n?void 0:n.skipBrowserRedirect)&&r.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${r.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var n;const{data:r,error:s}=t;return s?this._returnResult({data:null,error:s}):await sf(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:null===(n=null==r?void 0:r.session)||void 0===n?void 0:n.access_token})})}catch(t){if(mp(t))return this._returnResult({data:null,error:t});throw t}}async _enroll(e){try{return await this._useSession(async t=>{var n,r;const{data:s,error:i}=t;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},"phone"===e.factorType?{phone:e.phone}:"totp"===e.factorType?{issuer:e.issuer}:{}),{data:a,error:c}=await sf(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:null===(n=null==s?void 0:s.session)||void 0===n?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):("totp"===e.factorType&&"totp"===a.type&&(null===(r=null==a?void 0:a.totp)||void 0===r?void 0:r.qr_code)&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),this._returnResult({data:a,error:null}))})}catch(t){if(mp(t))return this._returnResult({data:null,error:t});throw t}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{var n;const{data:r,error:s}=t;if(s)return this._returnResult({data:null,error:s});const i=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:"create"===e.webauthn.type?Ef(e.webauthn.credential_response):Xf(e.webauthn.credential_response)})}:{code:e.code}),{data:o,error:a}=await sf(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:i,headers:this.headers,jwt:null===(n=null==r?void 0:r.session)||void 0===n?void 0:n.access_token});return a?this._returnResult({data:null,error:a}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),this._returnResult({data:o,error:a}))})}catch(t){if(mp(t))return this._returnResult({data:null,error:t});throw t}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{var n;const{data:r,error:s}=t;if(s)return this._returnResult({data:null,error:s});const i=await sf(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:null===(n=null==r?void 0:r.session)||void 0===n?void 0:n.access_token});if(i.error)return i;const{data:o}=i;if("webauthn"!==o.type)return{data:o,error:null};switch(o.webauthn.type){case"create":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:Zf(o.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:Vf(o.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(t){if(mp(t))return this._returnResult({data:null,error:t});throw t}})}async _challengeAndVerify(e){const{data:t,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){var e;const{data:{user:t},error:n}=await this.getUser();if(n)return{data:null,error:n};const r={all:[],phone:[],totp:[],webauthn:[]};for(const s of null!==(e=null==t?void 0:t.factors)&&void 0!==e?e:[])r.all.push(s),"verified"===s.status&&r[s.factor_type].push(s);return{data:r,error:null}}async _getAuthenticatorAssuranceLevel(e){var t,n,r,s;if(e)try{const{payload:r}=Up(e);let s=null;r.aal&&(s=r.aal);let i=s;const{data:{user:o},error:a}=await this.getUser(e);if(a)return this._returnResult({data:null,error:a});(null!==(n=null===(t=null==o?void 0:o.factors)||void 0===t?void 0:t.filter(e=>"verified"===e.status))&&void 0!==n?n:[]).length>0&&(i="aal2");return{data:{currentLevel:s,nextLevel:i,currentAuthenticationMethods:r.amr||[]},error:null}}catch(u){if(mp(u))return this._returnResult({data:null,error:u});throw u}const{data:{session:i},error:o}=await this.getSession();if(o)return this._returnResult({data:null,error:o});if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:a}=Up(i.access_token);let c=null;a.aal&&(c=a.aal);let l=c;(null!==(s=null===(r=i.user.factors)||void 0===r?void 0:r.filter(e=>"verified"===e.status))&&void 0!==s?s:[]).length>0&&(l="aal2");return{data:{currentLevel:c,nextLevel:l,currentAuthenticationMethods:a.amr||[]},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await sf(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new yp})})}catch(t){if(mp(t))return this._returnResult({data:null,error:t});throw t}}async _approveAuthorization(e,t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!r)return this._returnResult({data:null,error:new yp});const i=await sf(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:"approve"},xform:e=>({data:e,error:null})});return i.data&&i.data.redirect_url&&Fp()&&!(null==t?void 0:t.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(n){if(mp(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(e,t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!r)return this._returnResult({data:null,error:new yp});const i=await sf(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:"deny"},xform:e=>({data:e,error:null})});return i.data&&i.data.redirect_url&&Fp()&&!(null==t?void 0:t.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(n){if(mp(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:t},error:n}=e;return n?this._returnResult({data:null,error:n}):t?await sf(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new yp})})}catch(e){if(mp(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?(await sf(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new yp})})}catch(t){if(mp(t))return this._returnResult({data:null,error:t});throw t}}async fetchJwk(e,t={keys:[]}){let n=t.keys.find(t=>t.kid===e);if(n)return n;const r=Date.now();if(n=this.jwks.keys.find(t=>t.kid===e),n&&this.jwks_cached_at+6e5>r)return n;const{data:s,error:i}=await sf(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(i)throw i;return s.keys&&0!==s.keys.length?(this.jwks=s,this.jwks_cached_at=r,n=s.keys.find(t=>t.kid===e),n||null):null}async getClaims(e,t={}){try{let n=e;if(!n){const{data:e,error:t}=await this.getSession();if(t||!e.session)return this._returnResult({data:null,error:t});n=e.session.access_token}const{header:r,payload:s,signature:i,raw:{header:o,payload:a}}=Up(n);(null==t?void 0:t.allowExpired)||function(e){if(!e)throw new Error("Missing exp claim");if(e<=Math.floor(Date.now()/1e3))throw new Error("JWT has expired")}(s.exp);const c=r.alg&&!r.alg.startsWith("HS")&&r.kid&&"crypto"in globalThis&&"subtle"in globalThis.crypto?await this.fetchJwk(r.kid,(null==t?void 0:t.keys)?{keys:t.keys}:null==t?void 0:t.jwks):null;if(!c){const{error:e}=await this.getUser(n);if(e)throw e;return{data:{claims:s,header:r,signature:i},error:null}}const l=function(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}(r.alg),u=await crypto.subtle.importKey("jwk",c,l,!0,["verify"]);if(!(await crypto.subtle.verify(l,u,i,kp(`${o}.${a}`))))throw new Vp("Invalid JWT signature");return{data:{claims:s,header:r,signature:i},error:null}}catch(n){if(mp(n))return this._returnResult({data:null,error:n});throw n}}}Yf.nextInstanceID={};const Lf=Yf;let Hf="";Hf="undefined"!=typeof Deno?"deno":"undefined"!=typeof document?"web":"undefined"!=typeof navigator&&"ReactNative"===navigator.product?"react-native":"node";const Tf={headers:{"X-Client-Info":`supabase-js-${Hf}/2.99.0`}},Of={schema:"public"},Mf={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Kf={};function Uf(e){return(Uf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zf(e){var t=function(e,t){if("object"!=Uf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=Uf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Uf(t)?t:t+""}function Df(e,t,n){return(t=zf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pf(Object(n),!0).forEach(function(t){Df(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pf(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Qf=(e,t,n)=>{const r=(e=>e?(...t)=>e(...t):(...e)=>fetch(...e))(n),s=Headers;return async(n,i)=>{var o;const a=null!==(o=await t())&&void 0!==o?o:e;let c=new s(null==i?void 0:i.headers);return c.has("apikey")||c.set("apikey",e),c.has("Authorization")||c.set("Authorization",`Bearer ${a}`),r(n,jf(jf({},i),{},{headers:c}))}};var $f=class extends Lf{constructor(e){super(e)}},qf=class{constructor(e,t,n){var r,s;this.supabaseUrl=e,this.supabaseKey=t;const i=function(e){const t=null==e?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL((n=t).endsWith("/")?n:n+"/")}catch(r){throw Error("Invalid supabaseUrl: Provided URL is malformed.")}var n}(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",i),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",i),this.storageUrl=new URL("storage/v1",i),this.functionsUrl=new URL("functions/v1",i);const o=`sb-${i.hostname.split(".")[0]}-auth-token`,a=function(e,t){var n,r;const{db:s,auth:i,realtime:o,global:a}=e,{db:c,auth:l,realtime:u,global:d}=t,h={db:jf(jf({},c),s),auth:jf(jf({},l),i),realtime:jf(jf({},u),o),storage:{},global:jf(jf(jf({},d),a),{},{headers:jf(jf({},null!==(n=null==d?void 0:d.headers)&&void 0!==n?n:{}),null!==(r=null==a?void 0:a.headers)&&void 0!==r?r:{})}),accessToken:async()=>""};return e.accessToken?h.accessToken=e.accessToken:delete h.accessToken,h}(null!=n?n:{},{db:Of,realtime:Kf,auth:jf(jf({},Mf),{},{storageKey:o}),global:Tf});var c;(this.storageKey=null!==(r=a.auth.storageKey)&&void 0!==r?r:"",this.headers=null!==(s=a.global.headers)&&void 0!==s?s:{},a.accessToken)?(this.accessToken=a.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(t)} is not possible`)}})):this.auth=this._initSupabaseAuthClient(null!==(c=a.auth)&&void 0!==c?c:{},this.headers,a.global.fetch);this.fetch=Qf(t,this._getAccessToken.bind(this),a.global.fetch),this.realtime=this._initRealtimeClient(jf({headers:this.headers,accessToken:this._getAccessToken.bind(this)},a.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(e=>this.realtime.setAuth(e)).catch(e=>console.warn("Failed to set initial Realtime auth token:",e)),this.rest=new Am(new URL("rest/v1",i).href,{headers:this.headers,schema:a.db.schema,fetch:this.fetch,timeout:a.db.timeout,urlLengthLimit:a.db.urlLengthLimit}),this.storage=new sp(this.storageUrl.href,this.headers,this.fetch,null==n?void 0:n.storage),a.accessToken||this._listenForAuthEvents()}get functions(){return new dm(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e,t,n=this;if(n.accessToken)return await n.accessToken();const{data:r}=await n.auth.getSession();return null!==(e=null===(t=r.session)||void 0===t?void 0:t.access_token)&&void 0!==e?e:n.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,storageKey:i,flowType:o,lock:a,debug:c,throwOnError:l},u,d){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new $f({url:this.authUrl.href,headers:jf(jf({},h),u),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,flowType:o,lock:a,debug:c,throwOnError:l,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(e=>"authorization"===e.toLowerCase())})}_initRealtimeClient(e){return new mg(this.realtimeUrl.href,jf(jf({},e),{},{params:jf(jf({},{apikey:this.supabaseKey}),null==e?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",null==t?void 0:t.access_token)})}_handleTokenChanged(e,t,n){"TOKEN_REFRESHED"!==e&&"SIGNED_IN"!==e||this.changedAccessToken===n?"SIGNED_OUT"===e&&(this.realtime.setAuth(),"STORAGE"==t&&this.auth.signOut(),this.changedAccessToken=void 0):(this.changedAccessToken=n,this.realtime.setAuth(n))}};(function(){if("undefined"!=typeof window)return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(null==t)return!1;const n=t.match(/^v(\d+)\./);return!!n&&parseInt(n[1],10)<=18})()&&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 ey={exports:{}};const ty={version:"17.3.1"};var ny,ry,sy,iy,oy,ay;function cy(){if(ny)return ey.exports;ny=1;const e=y,t=G,n=x,r=W,s=ty.version,i=["🔐 encrypt with Dotenvx: https://dotenvx.com","🔐 prevent committing .env to code: https://dotenvx.com/precommit","🔐 prevent building .env in docker: https://dotenvx.com/prebuild","🤖 agentic secret storage: https://dotenvx.com/as2","⚡️ secrets for agents: https://dotenvx.com/as2","🛡️ auth for agents: https://vestauth.com","🛠️ run anywhere with `dotenvx run -- yourcommand`","⚙️ specify custom .env file path with { path: '/custom/path/.env' }","⚙️ enable debug logging with { debug: true }","⚙️ override existing env vars with { override: true }","⚙️ suppress all logs with { quiet: true }","⚙️ write to custom object with { processEnv: myObject }","⚙️ load multiple .env files with { path: ['.env.local', '.env'] }"];function o(e){return"string"==typeof e?!["false","0","no","off",""].includes(e.toLowerCase()):Boolean(e)}function a(e){return process.stdout.isTTY?`${e}`:e}const c=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;function l(e){console.log(`[dotenv@${s}][DEBUG] ${e}`)}function u(e){console.log(`[dotenv@${s}] ${e}`)}function d(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function h(e,t){let n;try{n=new URL(t)}catch(a){if("ERR_INVALID_URL"===a.code){const e=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw e.code="INVALID_DOTENV_KEY",e}throw a}const r=n.password;if(!r){const e=new Error("INVALID_DOTENV_KEY: Missing key part");throw e.code="INVALID_DOTENV_KEY",e}const s=n.searchParams.get("environment");if(!s){const e=new Error("INVALID_DOTENV_KEY: Missing environment part");throw e.code="INVALID_DOTENV_KEY",e}const i=`DOTENV_VAULT_${s.toUpperCase()}`,o=e.parsed[i];if(!o){const e=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${i} in your .env.vault file.`);throw e.code="NOT_FOUND_DOTENV_ENVIRONMENT",e}return{ciphertext:o,key:r}}function m(n){let r=null;if(n&&n.path&&n.path.length>0)if(Array.isArray(n.path))for(const t of n.path)e.existsSync(t)&&(r=t.endsWith(".vault")?t:`${t}.vault`);else r=n.path.endsWith(".vault")?n.path:`${n.path}.vault`;else r=t.resolve(process.cwd(),".env.vault");return e.existsSync(r)?r:null}function g(e){return"~"===e[0]?t.join(n.homedir(),e.slice(1)):e}const p={configDotenv:function(n){const r=t.resolve(process.cwd(),".env");let s="utf8",c=process.env;n&&null!=n.processEnv&&(c=n.processEnv);let d=o(c.DOTENV_CONFIG_DEBUG||n&&n.debug),h=o(c.DOTENV_CONFIG_QUIET||n&&n.quiet);n&&n.encoding?s=n.encoding:d&&l("No encoding is specified. UTF-8 is used by default");let m,f=[r];if(n&&n.path)if(Array.isArray(n.path)){f=[];for(const e of n.path)f.push(g(e))}else f=[g(n.path)];const y={};for(const t of f)try{const r=p.parse(e.readFileSync(t,{encoding:s}));p.populate(y,r,n)}catch(I){d&&l(`Failed to load ${t} ${I.message}`),m=I}const b=p.populate(c,y,n);if(d=o(c.DOTENV_CONFIG_DEBUG||d),h=o(c.DOTENV_CONFIG_QUIET||h),d||!h){const e=Object.keys(b).length,n=[];for(const r of f)try{const e=t.relative(process.cwd(),r);n.push(e)}catch(I){d&&l(`Failed to load ${r} ${I.message}`),m=I}u(`injecting env (${e}) from ${n.join(",")} ${a(`-- tip: ${i[Math.floor(Math.random()*i.length)]}`)}`)}return m?{parsed:y,error:m}:{parsed:y}},_configVault:function(e){const t=o(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),n=o(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);!t&&n||u("Loading env from encrypted .env.vault");const r=p._parseVault(e);let s=process.env;return e&&null!=e.processEnv&&(s=e.processEnv),p.populate(s,r,e),{parsed:r}},_parseVault:function(e){const t=m(e=e||{});e.path=t;const n=p.configDotenv(e);if(!n.parsed){const e=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw e.code="MISSING_DATA",e}const r=d(e).split(","),s=r.length;let i;for(let a=0;a<s;a++)try{const e=h(n,r[a].trim());i=p.decrypt(e.ciphertext,e.key);break}catch(o){if(a+1>=s)throw o}return p.parse(i)},config:function(e){if(0===d(e).length)return p.configDotenv(e);const t=m(e);return t?p._configVault(e):(n=`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`,console.error(`[dotenv@${s}][WARN] ${n}`),p.configDotenv(e));var n},decrypt:function(e,t){const n=Buffer.from(t.slice(-64),"hex");let s=Buffer.from(e,"base64");const i=s.subarray(0,12),o=s.subarray(-16);s=s.subarray(12,-16);try{const e=r.createDecipheriv("aes-256-gcm",n,i);return e.setAuthTag(o),`${e.update(s)}${e.final()}`}catch(a){const e=a instanceof RangeError,t="Invalid key length"===a.message,n="Unsupported state or unable to authenticate data"===a.message;if(e||t){const e=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw e.code="INVALID_DOTENV_KEY",e}if(n){const e=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw e.code="DECRYPTION_FAILED",e}throw a}},parse:function(e){const t={};let n,r=e.toString();for(r=r.replace(/\r\n?/gm,"\n");null!=(n=c.exec(r));){const e=n[1];let r=n[2]||"";r=r.trim();const s=r[0];r=r.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),'"'===s&&(r=r.replace(/\\n/g,"\n"),r=r.replace(/\\r/g,"\r")),t[e]=r}return t},populate:function(e,t,n={}){const r=Boolean(n&&n.debug),s=Boolean(n&&n.override),i={};if("object"!=typeof t){const e=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw e.code="OBJECT_REQUIRED",e}for(const o of Object.keys(t))Object.prototype.hasOwnProperty.call(e,o)?(!0===s&&(e[o]=t[o],i[o]=t[o]),r&&l(!0===s?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):(e[o]=t[o],i[o]=t[o]);return i}};return ey.exports.configDotenv=p.configDotenv,ey.exports._configVault=p._configVault,ey.exports._parseVault=p._parseVault,ey.exports.config=p.config,ey.exports.decrypt=p.decrypt,ey.exports.parse=p.parse,ey.exports.populate=p.populate,ey.exports=p,ey.exports}ay||(ay=1,cy().config(Object.assign({},function(){if(sy)return ry;sy=1;const e={};return null!=process.env.DOTENV_CONFIG_ENCODING&&(e.encoding=process.env.DOTENV_CONFIG_ENCODING),null!=process.env.DOTENV_CONFIG_PATH&&(e.path=process.env.DOTENV_CONFIG_PATH),null!=process.env.DOTENV_CONFIG_QUIET&&(e.quiet=process.env.DOTENV_CONFIG_QUIET),null!=process.env.DOTENV_CONFIG_DEBUG&&(e.debug=process.env.DOTENV_CONFIG_DEBUG),null!=process.env.DOTENV_CONFIG_OVERRIDE&&(e.override=process.env.DOTENV_CONFIG_OVERRIDE),null!=process.env.DOTENV_CONFIG_DOTENV_KEY&&(e.DOTENV_KEY=process.env.DOTENV_CONFIG_DOTENV_KEY),ry=e}(),function(){if(oy)return iy;oy=1;const e=/^dotenv_config_(encoding|path|quiet|debug|override|DOTENV_KEY)=(.+)$/;return iy=function(t){const n=t.reduce(function(t,n){const r=n.match(e);return r&&(t[r[1]]=r[2]),t},{});return"quiet"in n||(n.quiet="true"),n}}()(process.argv))));const ly=async()=>{const e=await Qr.getValidSession(),t=new qf("https://bfyrfypcnrfqiqtnhksg.supabase.co","sb_publishable_UE64XbixbCKCdNP20YLmqg_S1_Zchd6",{auth:{persistSession:!1,autoRefreshToken:!1,detectSessionInUrl:!1}});if(e){const{error:n}=await t.auth.setSession({access_token:e.access_token,refresh_token:e.refresh_token});n&&console.error("[Fluxlay] Error setting session:",n.message)}return t},uy=new kt;uy.name("fluxlay").description("Fluxlay CLI for building and managing wallpapers").version("0.1.0"),uy.command("login").description("Login to Supabase").action(async()=>{Be(at.bgCyan.black.bold(" Fluxlay CLI "));try{await ed(),Re(at.green("Login process completed."))}catch(e){Xe(at.red(`Login failed: ${e}`)),process.exit(1)}}),uy.command("logout").description("Logout from Supabase").action(async()=>{Be(at.bgCyan.black.bold(" Fluxlay CLI "));try{await(async()=>{await Qr.clearSession(),Ee.success(at.green("Logged out successfully."))})(),Re(at.green("Logged out successfully."))}catch(e){Xe(at.red(`Logout failed: ${e}`)),process.exit(1)}}),uy.command("whoami").description("Show current logged in user").action(async()=>{Be(at.bgCyan.black.bold(" Fluxlay CLI "));try{await(async()=>{const e=await ly(),{data:{user:t},error:n}=await e.auth.getUser();if(n||!t)return n&&Ee.error(`Auth error: ${n.message}`),void Ee.warn("Not logged in.");Ee.info(`Logged in as: ${at.green(t.email??"unknown")}`)})(),Re(at.green("Done."))}catch(e){Xe(at.red(`Failed to get user info: ${e}`)),process.exit(1)}}),uy.command("build").description("Build a Fluxlay wallpaper").argument("[dir]","Directory to build",".").option("-o, --output <name>","Output filename","wallpaper.fluxlay").action(async(e,t)=>{Be(at.bgCyan.black.bold(" Fluxlay CLI "));try{await async function(e,t){await Qr.getSession()||(Ee.error(at.red("You must be logged in to build. Run `fluxlay login`.")),process.exit(1));const n=c.resolve(process.cwd(),e),r=c.join(n,"fluxlay.yaml");a.existsSync(r)||(Ee.error(at.red("fluxlay.yaml is required in the project root.")),process.exit(1));const s=ke();s.start(at.yellow("Validating manifest..."));try{const e=a.readFileSync(r,"utf-8");Kt(e),s.stop(`${at.green("✔")} Manifest validated.`)}catch(u){s.stop(at.red("Manifest validation failed")),Ee.error(u.message),process.exit(1)}const i=c.join(n,"dist"),o=c.resolve(n,t.output);s.start(`Building component in ${at.cyan(n)}...`);try{await h({root:n,configFile:c.resolve(n,"vite.config.ts"),build:{outDir:"dist"},logLevel:"error"}),s.stop(`${at.green("✔")} Component built.`)}catch(u){s.stop(at.red("Build failed")),Ee.error(u.message),process.exit(1)}let l;s.start(at.yellow("Fetching developer key..."));try{const e=await fu.getDeveloperKey();if(e)l=Buffer.from(e).toString("hex"),s.stop(`${at.green("✔")} Using cached developer key.`);else{const{developerKey:e}=await pu.getDeveloperKey({});l=Buffer.from(e).toString("hex"),await fu.saveDeveloperKey(e),s.stop(`${at.green("✔")} Developer key fetched from API.`)}}catch(u){s.stop(at.red("Failed to fetch developer key")),Ee.error(u.message),process.exit(1)}s.start(at.yellow("Packaging with DRM..."));try{await Ut(i,o,l,0),s.stop(`${at.green("✔")} Packaging completed.`)}catch(u){s.stop(at.red("Packaging failed")),Ee.error(u.message),process.exit(1)}Ne(`Output: ${at.underline.cyan(o)}`,"Success!")}(e,t),Re(at.green("Build completed."))}catch(n){Xe(at.red(`Build failed: ${n}`)),process.exit(1)}}),uy.command("publish").description("Publish a Fluxlay wallpaper to the store").argument("[dir]","Directory to publish",".").action(async e=>{Be(at.bgCyan.black.bold(" Fluxlay CLI "));try{await async function(e){await Qr.getSession()||(Ee.error(at.red("You must be logged in to publish. Run `fluxlay login`.")),process.exit(1));const t=c.resolve(process.cwd(),e),n=c.join(t,"fluxlay.yaml");a.existsSync(n)||(Ee.error(at.red("fluxlay.yaml is required in the project root.")),process.exit(1));const r=ke();let s;r.start(at.yellow("Validating manifest..."));try{const e=a.readFileSync(n,"utf-8");Kt(e),s=nm.load(e),r.stop(`${at.green("✔")} Manifest validated: ${at.cyan(s.name)} (v${s.version})`)}catch(g){r.stop(at.red("Manifest validation failed")),Ee.error(g.message),process.exit(1)}const i=R.randomBytes(32),o=i.toString("hex");let l,u;r.start(at.yellow("Registering wallpaper with API..."));try{const e=await pu.registerWallpaper({slug:s.slug,name:s.name,version:s.version,contentKey:i});l=e.versionId,u=e.uploadUrl,r.stop(`${at.green("✔")} Wallpaper registered.`)}catch(g){r.stop(at.red("Registration failed")),Ee.error(g.message),process.exit(1)}const d=c.join(t,"dist"),m=c.join(t,`.fluxlay-${l}.tmp`);try{r.start(at.yellow("Building component with Vite...")),await h({root:t,configFile:c.resolve(t,"vite.config.ts"),build:{outDir:"dist"},logLevel:"error"}),r.stop(`${at.green("✔")} Component built.`),r.start(at.yellow("Packaging with Content Key...")),await Ut(d,m,o,1),r.stop(`${at.green("✔")} Package created.`),r.start(at.yellow("Uploading to storage..."));const e=a.readFileSync(m),n=await fetch(u,{method:"PUT",body:e,headers:{"Content-Type":"application/octet-stream"}});if(!n.ok)throw new Error(`Upload failed: ${n.statusText}`);r.stop(`${at.green("✔")} Upload completed.`),r.start(at.yellow("Confirming upload with API...")),await pu.confirmUpload({versionId:l}),r.stop(`${at.green("✔")} Upload confirmed.`),Ne(`Wallpaper ID: ${at.cyan(l)}`,"Success!")}catch(g){r.stop(at.red("Publishing process failed")),Ee.error(g.message),Ee.warn(at.yellow("Cancelling upload..."));try{await pu.cancelUpload({versionId:l})}catch(p){Ee.error(`Failed to cancel upload: ${p.message}`)}process.exit(1)}finally{a.existsSync(m)&&a.unlinkSync(m)}}(e),Re(at.green("Published successfully."))}catch(t){Xe(at.red(`Publish failed: ${t}`)),process.exit(1)}}),uy.command("dev").description("Start development server for a Fluxlay wallpaper").argument("[dir]","Directory to watch",".").action(async e=>{Be(at.bgCyan.black.bold(" Fluxlay CLI "));try{await bu(e)}catch(t){Xe(at.red(`Dev server failed: ${t}`)),process.exit(1)}}),uy.parse();
2
+ import{promisify as e,stripVTControlCharacters as t,styleText as n}from"node:util";import r,{stdin as s,stdout as i}from"node:process";import*as o from"node:readline";import a from"node:readline";import{ReadStream as c}from"node:tty";import l,{existsSync as u,lstatSync as d,readdirSync as h}from"node:fs";import m,{dirname as g,join as p}from"node:path";import f,{execFile as y}from"node:child_process";import{build as b,createServer as I}from"vite";import{createRequire as w}from"node:module";import{fileURLToPath as v}from"node:url";import G from"node:os";import*as A from"node:zlib";import*as S from"node:http";import*as Z from"node:https";import*as C from"node:http2";import V from"node:net";import E,{constants as X}from"node:fs/promises";import{Buffer as B}from"node:buffer";import x from"node:crypto";var R=Object.create,W=Object.defineProperty,N=Object.getOwnPropertyDescriptor,J=Object.getOwnPropertyNames,k=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty,_=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Y=(e,t)=>{let n={};for(var r in e)W(n,r,{get:e[r],enumerable:!0});return t||W(n,Symbol.toStringTag,{value:"Module"}),n},H=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var s,i=J(t),o=0,a=i.length;o<a;o++)s=i[o],F.call(e,s)||s===n||W(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=N(t,s))||r.enumerable});return e},L=(e,t,n)=>(n=null!=e?R(k(e)):{},H(!t&&e&&e.__esModule?n:W(n,"default",{value:e,enumerable:!0}),e)),T=/* @__PURE__ */(e=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(e,{get:(e,t)=>("undefined"!=typeof require?require:e)[t]}):e)(function(e){if("undefined"!=typeof require)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")}),O=/* @__PURE__ */_((e,t)=>{var n="[",r={to:(e,t)=>t?`${n}${t+1};${e+1}H`:`${n}${e+1}G`,move(e,t){let r="";return e<0?r+=`${n}${-e}D`:e>0&&(r+=`${n}${e}C`),t<0?r+=`${n}${-t}A`:t>0&&(r+=`${n}${t}B`),r},up:(e=1)=>`${n}${e}A`,down:(e=1)=>`${n}${e}B`,forward:(e=1)=>`${n}${e}C`,backward:(e=1)=>`${n}${e}D`,nextLine:(e=1)=>`${n}E`.repeat(e),prevLine:(e=1)=>`${n}F`.repeat(e),left:`${n}G`,hide:`${n}?25l`,show:`${n}?25h`,save:"7",restore:"8"},s={up:(e=1)=>`${n}S`.repeat(e),down:(e=1)=>`${n}T`.repeat(e)},i={screen:`${n}2J`,up:(e=1)=>`${n}1J`.repeat(e),down:(e=1)=>`${n}J`.repeat(e),line:`${n}2K`,lineEnd:`${n}K`,lineStart:`${n}1K`,lines(e){let t="";for(let n=0;n<e;n++)t+=this.line+(n<e-1?r.up():"");return e&&(t+=r.left),t}};t.exports={cursor:r,scroll:s,erase:i,beep:""}}),M=O();var K="]8;;";new RegExp(`(?:\\[(?<code>\\d+)m|\\${K}(?<uri>.*))`,"y");var U={actions:new Set(["up","down","left","right","space","enter","cancel"]),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0};function z(e,t){if("string"==typeof e)return U.aliases.get(e)===t;for(const n of e)if(void 0!==n&&z(n,t))return!0;return!1}var D=globalThis.process.platform.startsWith("win");Symbol("clack:cancel");function j({input:e=s,output:t=i,overwrite:n=!0,hideCursor:r=!0}={}){const a=o.createInterface({input:e,output:t,prompt:"",tabSize:1});o.emitKeypressEvents(e,a),e instanceof c&&e.isTTY&&e.setRawMode(!0);const l=(s,{name:i,sequence:a})=>{if(z([String(s),i,a],"cancel"))return r&&t.write(M.cursor.show),void process.exit(0);if(!n)return;const c="return"===i?0:-1,u="return"===i?-1:0;o.moveCursor(t,c,u,()=>{o.clearLine(t,1,()=>{e.once("keypress",l)})})};return r&&t.write(M.cursor.hide),e.once("keypress",l),()=>{e.off("keypress",l),r&&t.write(M.cursor.show),e instanceof c&&e.isTTY&&!D&&e.setRawMode(!1),a.terminal=!1,a.close()}}var P=e=>"columns"in e&&"number"==typeof e.columns?e.columns:80;var Q="win32"!==r.platform?"linux"!==r.env.TERM:!!r.env.CI||!!r.env.WT_SESSION||!!r.env.TERMINUS_SUBLIME||"{cmd::Cmder}"===r.env.ConEmuTask||"Terminus-Sublime"===r.env.TERM_PROGRAM||"vscode"===r.env.TERM_PROGRAM||"xterm-256color"===r.env.TERM||"alacritty"===r.env.TERM||"JetBrains-JediTerm"===r.env.TERMINAL_EMULATOR,$=()=>"true"===process.env.CI,q=(e,t)=>Q?e:t,ee=(q("◆","*"),q("■","x")),te=q("▲","x"),ne=q("◇","o"),re=q("┌","T"),se=q("│","|"),ie=q("└","—"),oe=(q("┐","T"),q("┘","—"),q("●",">"),q("○"," "),q("◻","[•]"),q("◼","[+]"),q("◻","[ ]"),q("▪","•"),q("─","-")),ae=q("╮","+"),ce=q("├","+"),le=q("╯","+"),ue=q("╰","+"),de=(q("╭","+"),q("●","•")),he=q("◆","*"),me=q("▲","!"),ge=q("■","x"),pe=e=>161===e||164===e||167===e||168===e||170===e||173===e||174===e||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||198===e||208===e||215===e||216===e||e>=222&&e<=225||230===e||e>=232&&e<=234||236===e||237===e||240===e||242===e||243===e||e>=247&&e<=250||252===e||254===e||257===e||273===e||275===e||283===e||294===e||295===e||299===e||e>=305&&e<=307||312===e||e>=319&&e<=322||324===e||e>=328&&e<=331||333===e||338===e||339===e||358===e||359===e||363===e||462===e||464===e||466===e||468===e||470===e||472===e||474===e||476===e||593===e||609===e||708===e||711===e||e>=713&&e<=715||717===e||720===e||e>=728&&e<=731||733===e||735===e||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||1025===e||e>=1040&&e<=1103||1105===e||8208===e||e>=8211&&e<=8214||8216===e||8217===e||8220===e||8221===e||e>=8224&&e<=8226||e>=8228&&e<=8231||8240===e||8242===e||8243===e||8245===e||8251===e||8254===e||8308===e||8319===e||e>=8321&&e<=8324||8364===e||8451===e||8453===e||8457===e||8467===e||8470===e||8481===e||8482===e||8486===e||8491===e||8531===e||8532===e||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||8585===e||e>=8592&&e<=8601||8632===e||8633===e||8658===e||8660===e||8679===e||8704===e||8706===e||8707===e||8711===e||8712===e||8715===e||8719===e||8721===e||8725===e||8730===e||e>=8733&&e<=8736||8739===e||8741===e||e>=8743&&e<=8748||8750===e||e>=8756&&e<=8759||8764===e||8765===e||8776===e||8780===e||8786===e||8800===e||8801===e||e>=8804&&e<=8807||8810===e||8811===e||8814===e||8815===e||8834===e||8835===e||8838===e||8839===e||8853===e||8857===e||8869===e||8895===e||8978===e||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||9632===e||9633===e||e>=9635&&e<=9641||9650===e||9651===e||9654===e||9655===e||9660===e||9661===e||9664===e||9665===e||e>=9670&&e<=9672||9675===e||e>=9678&&e<=9681||e>=9698&&e<=9701||9711===e||9733===e||9734===e||9737===e||9742===e||9743===e||9756===e||9758===e||9792===e||9794===e||9824===e||9825===e||e>=9827&&e<=9829||e>=9831&&e<=9834||9836===e||9837===e||9839===e||9886===e||9887===e||9919===e||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||9955===e||9960===e||9961===e||e>=9963&&e<=9969||9972===e||e>=9974&&e<=9977||9979===e||9980===e||9982===e||9983===e||10045===e||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||65533===e||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||127375===e||127376===e||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,fe=e=>12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510,ye=e=>e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9800&&e<=9811||9855===e||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,be=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,Ie=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,we=/\t{1,1000}/y,ve=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,Ge=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Ae=/\p{M}+/gu,Se={limit:1/0,ellipsis:""},Ze=(e,t={},n={})=>{const r=t.limit??1/0,s=t.ellipsis??"",i=t?.ellipsisWidth??(s?Ze(s,Se,n).width:0),o=n.ansiWidth??0,a=n.controlWidth??0,c=n.tabWidth??8,l=n.ambiguousWidth??1,u=n.emojiWidth??2,d=n.fullWidthWidth??2,h=n.regularWidth??1,m=n.wideWidth??2;let g=0,p=0,f=e.length,y=0,b=!1,I=f,w=Math.max(0,r-i),v=0,G=0,A=0,S=0;e:for(;;){if(G>v||p>=f&&p>g){const t=e.slice(v,G)||e.slice(g,p);y=0;for(const e of t.replaceAll(Ae,"")){const t=e.codePointAt(0)||0;if(S=fe(t)?d:ye(t)?m:l!==h&&pe(t)?l:h,A+S>w&&(I=Math.min(I,Math.max(v,g)+y)),A+S>r){b=!0;break e}y+=e.length,A+=S}v=G=0}if(p>=f)break;if(Ge.lastIndex=p,Ge.test(e)){if(y=Ge.lastIndex-p,S=y*h,A+S>w&&(I=Math.min(I,p+Math.floor((w-A)/h))),A+S>r){b=!0;break}A+=S,v=g,G=p,p=g=Ge.lastIndex}else if(be.lastIndex=p,be.test(e)){if(A+o>w&&(I=Math.min(I,p)),A+o>r){b=!0;break}A+=o,v=g,G=p,p=g=be.lastIndex}else if(Ie.lastIndex=p,Ie.test(e)){if(y=Ie.lastIndex-p,S=y*a,A+S>w&&(I=Math.min(I,p+Math.floor((w-A)/a))),A+S>r){b=!0;break}A+=S,v=g,G=p,p=g=Ie.lastIndex}else if(we.lastIndex=p,we.test(e)){if(y=we.lastIndex-p,S=y*c,A+S>w&&(I=Math.min(I,p+Math.floor((w-A)/c))),A+S>r){b=!0;break}A+=S,v=g,G=p,p=g=we.lastIndex}else if(ve.lastIndex=p,ve.test(e)){if(A+u>w&&(I=Math.min(I,p)),A+u>r){b=!0;break}A+=u,v=g,G=p,p=g=ve.lastIndex}else p+=1}return{width:b?w:A,index:b?I:f,truncated:b,ellipsed:b&&r>=i}},Ce={limit:1/0,ellipsis:"",ellipsisWidth:0},Ve=(e,t={})=>Ze(e,Ce,t).width,Ee="",Xe="]8;;",Be=new RegExp(`(?:\\[(?<code>\\d+)m|\\${Xe}(?<uri>.*))`,"y"),xe=e=>e>=30&&e<=37||e>=90&&e<=97?39:e>=40&&e<=47||e>=100&&e<=107?49:1===e||2===e?22:3===e?23:4===e?24:7===e?27:8===e?28:9===e?29:0===e?0:void 0,Re=e=>`${Ee}[${e}m`,We=e=>`${Ee}${Xe}${e}`,Ne=(e,t,n)=>{const r=t[Symbol.iterator]();let s=!1,i=!1,o=e.at(-1),a=void 0===o?0:Ve(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){const o=c.value,d=Ve(o);a+d<=n?e[e.length-1]+=o:(e.push(o),a=0),(o===Ee||"›"===o)&&(s=!0,i=t.startsWith(Xe,u+1)),s?i?""===o&&(s=!1,i=!1):"m"===o&&(s=!1):(a+=d,a===n&&!l.done&&(e.push(""),a=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!a&&void 0!==o&&o.length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Je=(e,t,n={})=>{if(!1!==n.trim&&""===e.trim())return"";let r,s,i="";const o=e.split(" "),a=(e=>e.map(e=>Ve(e)))(o);let c=[""];for(const[g,p]of o.entries()){!1!==n.trim&&(c[c.length-1]=(c.at(-1)??"").trimStart());let e=Ve(c.at(-1)??"");if(0!==g&&(e>=t&&(!1===n.wordWrap||!1===n.trim)&&(c.push(""),e=0),(e>0||!1===n.trim)&&(c[c.length-1]+=" ",e++)),n.hard&&a[g]>t){const n=t-e,r=1+Math.floor((a[g]-n-1)/t);Math.floor((a[g]-1)/t)<r&&c.push(""),Ne(c,p,t);continue}if(e+a[g]>t&&e>0&&a[g]>0){if(!1===n.wordWrap&&e<t){Ne(c,p,t);continue}c.push("")}e+a[g]>t&&!1===n.wordWrap?Ne(c,p,t):c[c.length-1]+=p}!1!==n.trim&&(c=c.map(e=>(e=>{const t=e.split(" ");let n=t.length;for(;n>0&&!(Ve(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")})(e)));const l=c.join("\n"),u=l[Symbol.iterator]();let d=u.next(),h=u.next(),m=0;for(;!d.done;){const e=d.value,t=h.value;if(i+=e,e===Ee||"›"===e){Be.lastIndex=m+1;const e=Be.exec(l)?.groups;if(void 0!==e?.code){const t=Number.parseFloat(e.code);r=39===t?void 0:t}else void 0!==e?.uri&&(s=0===e.uri.length?void 0:e.uri)}const n=r?xe(r):void 0;"\n"===t?(s&&(i+=We("")),r&&n&&(i+=Re(n))):"\n"===e&&(r&&n&&(i+=Re(r)),s&&(i+=We(s))),m+=e.length,d=h,h=u.next()}return i};function ke(e,t,n){return String(e).normalize().replaceAll("\r\n","\n").split("\n").map(e=>Je(e,t,n)).join("\n")}var Fe={message:(e=[],{symbol:t=n("gray",se),secondarySymbol:r=n("gray",se),output:s=process.stdout,spacing:i=1,withGuide:o}={})=>{const a=[],c=o??U.withGuide,l=c?r:"",u=c?`${t} `:"",d=c?`${r} `:"";for(let n=0;n<i;n++)a.push(l);const h=Array.isArray(e)?e:e.split("\n");if(h.length>0){const[e,...n]=h;e.length>0?a.push(`${u}${e}`):a.push(c?t:"");for(const t of n)t.length>0?a.push(`${d}${t}`):a.push(c?r:"")}s.write(`${a.join("\n")}\n`)},info:(e,t)=>{Fe.message(e,{...t,symbol:n("blue",de)})},success:(e,t)=>{Fe.message(e,{...t,symbol:n("green",he)})},step:(e,t)=>{Fe.message(e,{...t,symbol:n("green",ne)})},warn:(e,t)=>{Fe.message(e,{...t,symbol:n("yellow",me)})},warning:(e,t)=>{Fe.warn(e,t)},error:(e,t)=>{Fe.message(e,{...t,symbol:n("red",ge)})}},_e=(e="",t)=>{const r=t?.output??process.stdout,s=t?.withGuide??U.withGuide?`${n("gray",ie)} `:"";r.write(`${s}${n("red",e)}\n\n`)},Ye=(e="",t)=>{const r=t?.output??process.stdout,s=t?.withGuide??U.withGuide?`${n("gray",re)} `:"";r.write(`${s}${e}\n`)},He=(e="",t)=>{const r=t?.output??process.stdout,s=t?.withGuide??U.withGuide?`${n("gray",se)}\n${n("gray",ie)} `:"";r.write(`${s}${e}\n\n`)},Le=e=>n("dim",e),Te=(e,t,n)=>{const r={hard:!0,trim:!1},s=ke(e,t,r).split("\n"),i=s.reduce((e,t)=>Math.max(Ve(t),e),0);return ke(e,t-(s.map(n).reduce((e,t)=>Math.max(Ve(t),e),0)-i),r)},Oe=(e="",t="",s)=>{const i=s?.output??r.stdout,o=s?.withGuide??U.withGuide,a=s?.format??Le,c=["",...Te(e,P(i)-6,a).split("\n").map(a),""],l=Ve(t),u=Math.max(c.reduce((e,t)=>{const n=Ve(t);return n>e?n:e},0),l)+2,d=c.map(e=>`${n("gray",se)} ${e}${" ".repeat(u-Ve(e))}${n("gray",se)}`).join("\n"),h=o?`${n("gray",se)}\n`:"",m=o?ce:ue;i.write(`${h}${n("green",ne)} ${n("reset",t)} ${n("gray",oe.repeat(Math.max(u-l-1,1))+ae)}\n${d}\n${n("gray",m+oe.repeat(u+2)+le)}\n`)},Me=e=>n("magenta",e),Ke=({indicator:e="dots",onCancel:t,output:r=process.stdout,cancelMessage:s,errorMessage:i,frames:o=(Q?["◒","◐","◓","◑"]:["•","o","O","0"]),delay:a=(Q?80:120),signal:c,...l}={})=>{const u=$();let d,h,m,g=!1,p=!1,f="",y=performance.now();const b=P(r),I=l?.styleFrame??Me,w=e=>{const n=e>1?i??U.messages.error:s??U.messages.cancel;p=1===e,g&&(V(n,e),p&&"function"==typeof t&&t())},v=()=>w(2),G=()=>w(1),A=()=>{if(void 0===m)return;u&&r.write("\n");const e=ke(m,b,{hard:!0,trim:!1}).split("\n");e.length>1&&r.write(M.cursor.up(e.length-1)),r.write(M.cursor.to(0)),r.write(M.erase.down())},S=e=>e.replace(/\.+$/,""),Z=e=>{const t=(performance.now()-e)/1e3,n=Math.floor(t/60),r=Math.floor(t%60);return n>0?`[${n}m ${r}s]`:`[${r}s]`},C=l.withGuide??U.withGuide,V=(t="",s=0,i=!1)=>{if(!g)return;g=!1,clearInterval(h),A();const o=0===s?n("green",ne):n("red",1===s?ee:te);f=t??f,i||("timer"===e?r.write(`${o} ${f} ${Z(y)}\n`):r.write(`${o} ${f}\n`)),process.removeListener("uncaughtExceptionMonitor",v),process.removeListener("unhandledRejection",v),process.removeListener("SIGINT",G),process.removeListener("SIGTERM",G),process.removeListener("exit",w),c&&c.removeEventListener("abort",G),d()};return{start:(t="")=>{g=!0,d=j({output:r}),f=S(t),y=performance.now(),C&&r.write(`${n("gray",se)}\n`);let s=0,i=0;process.on("uncaughtExceptionMonitor",v),process.on("unhandledRejection",v),process.on("SIGINT",G),process.on("SIGTERM",G),process.on("exit",w),c&&c.addEventListener("abort",G),h=setInterval(()=>{if(u&&f===m)return;A(),m=f;const t=I(o[s]);let n;if(u)n=`${t} ${f}...`;else if("timer"===e)n=`${t} ${f} ${Z(y)}`;else{const e=".".repeat(Math.floor(i)).slice(0,3);n=`${t} ${f}${e}`}const a=ke(n,b,{hard:!0,trim:!1});r.write(a),s=s+1<o.length?s+1:0,i=i<4?i+.125:0},a)},stop:(e="")=>V(e,0),message:(e="")=>{f=S(e??f)},cancel:(e="")=>V(e,1),error:(e="")=>V(e,2),clear:()=>V("",0,!0),get isCancelled(){return p}}},Ue=(q("─","-"),q("━","="),q("█","#"),n("gray",se),(e=0)=>t=>`[${t+e}m`),ze=(e=0)=>t=>`[${38+e};5;${t}m`,De=(e=0)=>(t,n,r)=>`[${38+e};2;${t};${n};${r}m`,je={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(je.modifier),Object.keys(je.color),Object.keys(je.bgColor);var Pe=function(){const e=/* @__PURE__ */new Map;for(const[t,n]of Object.entries(je)){for(const[t,r]of Object.entries(n))je[t]={open:`[${r[0]}m`,close:`[${r[1]}m`},n[t]=je[t],e.set(r[0],r[1]);Object.defineProperty(je,t,{value:n,enumerable:!1})}return Object.defineProperty(je,"codes",{value:e,enumerable:!1}),je.color.close="",je.bgColor.close="",je.color.ansi=Ue(),je.color.ansi256=ze(),je.color.ansi16m=De(),je.bgColor.ansi=Ue(10),je.bgColor.ansi256=ze(10),je.bgColor.ansi16m=De(10),Object.defineProperties(je,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;3===n.length&&(n=[...n].map(e=>e+e).join(""));const r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},enumerable:!1},hexToAnsi256:{value:e=>je.rgbToAnsi256(...je.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return e-8+90;let t,n,r;if(e>=232)t=(10*(e-232)+8)/255,n=t,r=t;else{const s=(e-=16)%36;t=Math.floor(e/36)/5,n=Math.floor(s/6)/5,r=s%6/5}const s=2*Math.max(t,n,r);if(0===s)return 30;let i=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return 2===s&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>je.ansi256ToAnsi(je.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>je.ansi256ToAnsi(je.hexToAnsi256(e)),enumerable:!1}}),je}(),Qe=(()=>{if(!("navigator"in globalThis))return 0;if(globalThis.navigator.userAgentData){const e=navigator.userAgentData.brands.find(({brand:e})=>"Chromium"===e);if(e&&e.version>93)return 3}return/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)?1:0})(),$e=0!==Qe&&{level:Qe,hasBasic:!0,has256:Qe>=2,has16m:Qe>=3},qe={stdout:$e,stderr:$e};function et(e,t,n){let r=e.indexOf(t);if(-1===r)return e;const s=t.length;let i=0,o="";do{o+=e.slice(i,r)+t+n,i=r+s,r=e.indexOf(t,i)}while(-1!==r);return o+=e.slice(i),o}var{stdout:tt,stderr:nt}=qe,rt=Symbol("GENERATOR"),st=Symbol("STYLER"),it=Symbol("IS_EMPTY"),ot=["ansi","ansi","ansi256","ansi16m"],at=Object.create(null),ct=e=>{const t=(...e)=>e.join(" ");return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const n=tt?tt.level:0;e.level=void 0===t.level?n:t.level})(t,e),Object.setPrototypeOf(t,lt.prototype),t};function lt(e){return ct(e)}Object.setPrototypeOf(lt.prototype,Function.prototype);for(const[Sp,Zp]of Object.entries(Pe))at[Sp]={get(){const e=mt(this,ht(Zp.open,Zp.close,this[st]),this[it]);return Object.defineProperty(this,Sp,{value:e}),e}};at.visible={get(){const e=mt(this,this[st],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var ut=(e,t,n,...r)=>"rgb"===e?"ansi16m"===t?Pe[n].ansi16m(...r):"ansi256"===t?Pe[n].ansi256(Pe.rgbToAnsi256(...r)):Pe[n].ansi(Pe.rgbToAnsi(...r)):"hex"===e?ut("rgb",t,n,...Pe.hexToRgb(...r)):Pe[n][e](...r);for(const Sp of["rgb","hex","ansi256"]){at[Sp]={get(){const{level:e}=this;return function(...t){const n=ht(ut(Sp,ot[e],"color",...t),Pe.color.close,this[st]);return mt(this,n,this[it])}}};at["bg"+Sp[0].toUpperCase()+Sp.slice(1)]={get(){const{level:e}=this;return function(...t){const n=ht(ut(Sp,ot[e],"bgColor",...t),Pe.bgColor.close,this[st]);return mt(this,n,this[it])}}}}var dt=Object.defineProperties(()=>{},{...at,level:{enumerable:!0,get(){return this[rt].level},set(e){this[rt].level=e}}}),ht=(e,t,n)=>{let r,s;return void 0===n?(r=e,s=t):(r=n.openAll+e,s=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:s,parent:n}},mt=(e,t,n)=>{const r=(...e)=>gt(r,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(r,dt),r[rt]=e,r[st]=t,r[it]=n,r},gt=(e,t)=>{if(e.level<=0||!t)return e[it]?"":t;let n=e[st];if(void 0===n)return t;const{openAll:r,closeAll:s}=n;if(t.includes(""))for(;void 0!==n;)t=et(t,n.close,n.open),n=n.parent;const i=t.indexOf("\n");return-1!==i&&(t=function(e,t,n,r){let s=0,i="";do{const o="\r"===e[r-1];i+=e.slice(s,o?r-1:r)+t+(o?"\r\n":"\n")+n,s=r+1,r=e.indexOf("\n",s)}while(-1!==r);return i+=e.slice(s),i}(t,s,r,i)),r+t+s};Object.defineProperties(lt.prototype,at);var pt=lt(),ft=(/* @__PURE__ */lt({level:nt?nt.level:0}),_(e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}};e.CommanderError=t,e.InvalidArgumentError=class extends t{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}})),yt=/* @__PURE__ */_(e=>{var{InvalidArgumentError:t}=ft();e.Argument=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.length>3&&"..."===this._name.slice(-3)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},e.humanReadableArgName=function(e){const t=e.name()+(!0===e.variadic?"...":"");return e.required?"<"+t+">":"["+t+"]"}}),bt=/* @__PURE__ */_(e=>{var{humanReadableArgName:t}=yt();e.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){const t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){const n=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){const t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){const r=n.short&&e._findOption(n.short),s=n.long&&e._findOption(n.long);r||s?n.long&&!s?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description)):t.push(n)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];const t=[];for(let n=e.parent;n;n=n.parent){const e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){const n=e.registeredArguments.map(e=>t(e)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(n?" "+n:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,t.subcommandTerm(n).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,t.optionTerm(n).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,t.optionTerm(n).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,t.argumentTerm(n).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let r=e.parent;r;r=r.parent)n=r.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue&&(e.required||e.optional||e.isBoolean()&&"boolean"==typeof e.defaultValue)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),void 0!==e.presetArg&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),void 0!==e.envVar&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){const n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,t){const n=t.padWidth(e,t),r=t.helpWidth||80;function s(e,s){if(s){const i=`${e.padEnd(n+2)}${s}`;return t.wrap(i,r-2,n+2)}return e}function i(e){return e.join("\n").replace(/^/gm," ".repeat(2))}let o=[`Usage: ${t.commandUsage(e)}`,""];const a=t.commandDescription(e);a.length>0&&(o=o.concat([t.wrap(a,r,0),""]));const c=t.visibleArguments(e).map(e=>s(t.argumentTerm(e),t.argumentDescription(e)));c.length>0&&(o=o.concat(["Arguments:",i(c),""]));const l=t.visibleOptions(e).map(e=>s(t.optionTerm(e),t.optionDescription(e)));if(l.length>0&&(o=o.concat(["Options:",i(l),""])),this.showGlobalOptions){const n=t.visibleGlobalOptions(e).map(e=>s(t.optionTerm(e),t.optionDescription(e)));n.length>0&&(o=o.concat(["Global Options:",i(n),""]))}const u=t.visibleCommands(e).map(e=>s(t.subcommandTerm(e),t.subcommandDescription(e)));return u.length>0&&(o=o.concat(["Commands:",i(u),""])),o.join("\n")}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,n,r=40){const s=new RegExp("[\\n][ \\f\\t\\v   -    \ufeff]+");if(e.match(s))return e;const i=t-n;if(i<r)return e;const o=e.slice(0,n),a=e.slice(n).replace("\r\n","\n"),c=" ".repeat(n),l="\\s​",u=new RegExp(`\n|.{1,${i-1}}([${l}]|$)|[^${l}]+?([${l}]|$)`,"g");return o+(a.match(u)||[]).map((e,t)=>"\n"===e?"":(t>0?c:"")+e.trimEnd()).join("\n")}}}),It=/* @__PURE__ */_(e=>{var{InvalidArgumentError:t}=ft();e.Option=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const n=function(e){let t,n;const r=e.split(/[ |,]+/);r.length>1&&!/^[[<]/.test(r[1])&&(t=r.shift());n=r.shift(),!t&&/^-[^-]$/.test(n)&&(t=n,n=void 0);return{shortFlag:t,longFlag:n}}(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return"string"==typeof e&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,n):e},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return function(e){return e.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},e.DualOptions=class{constructor(e){this.positiveOptions=/* @__PURE__ */new Map,this.negativeOptions=/* @__PURE__ */new Map,this.dualOptions=/* @__PURE__ */new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){const n=t.attributeName();if(!this.dualOptions.has(n))return!0;const r=this.negativeOptions.get(n).presetArg,s=void 0!==r&&r;return t.negate===(s===e)}}}),wt=/* @__PURE__ */_(e=>{e.suggestSimilar=function(e,t){if(!t||0===t.length)return"";t=Array.from(new Set(t));const n=e.startsWith("--");n&&(e=e.slice(2),t=t.map(e=>e.slice(2)));let r=[],s=3;return t.forEach(t=>{if(t.length<=1)return;const n=function(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);const n=[];for(let r=0;r<=e.length;r++)n[r]=[r];for(let r=0;r<=t.length;r++)n[0][r]=r;for(let r=1;r<=t.length;r++)for(let s=1;s<=e.length;s++){let i=1;i=e[s-1]===t[r-1]?0:1,n[s][r]=Math.min(n[s-1][r]+1,n[s][r-1]+1,n[s-1][r-1]+i),s>1&&r>1&&e[s-1]===t[r-2]&&e[s-2]===t[r-1]&&(n[s][r]=Math.min(n[s][r],n[s-2][r-2]+1))}return n[e.length][t.length]}(e,t),i=Math.max(e.length,t.length);(i-n)/i>.4&&(n<s?(s=n,r=[t]):n===s&&r.push(t))}),r.sort((e,t)=>e.localeCompare(t)),n&&(r=r.map(e=>`--${e}`)),r.length>1?`\n(Did you mean one of ${r.join(", ")}?)`:1===r.length?`\n(Did you mean ${r[0]}?)`:""}}),vt=/* @__PURE__ */_(e=>{var t=T("node:events").EventEmitter,n=T("node:child_process"),r=T("node:path"),s=T("node:fs"),i=T("node:process"),{Argument:o,humanReadableArgName:a}=yt(),{CommanderError:c}=ft(),{Help:l}=bt(),{Option:u,DualOptions:d}=It(),{suggestSimilar:h}=wt();function m(e){return e.map(e=>{if(!e.startsWith("--inspect"))return e;let t,n,r="127.0.0.1",s="9229";return null!==(n=e.match(/^(--inspect(-brk)?)$/))?t=n[1]:null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(t=n[1],/^\d+$/.test(n[3])?s=n[3]:r=n[3]):null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(t=n[1],r=n[3],s=n[4]),t&&"0"!==s?`${t}=${r}:${parseInt(s)+1}`:e})}e.Command=class e extends t{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:e=>i.stdout.write(e),writeErr:e=>i.stderr.write(e),getOutHelpWidth:()=>i.stdout.isTTY?i.stdout.columns:void 0,getErrHelpWidth:()=>i.stderr.isTTY?i.stderr.columns:void 0,outputError:(e,t)=>t(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){const e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,s=n;"object"==typeof r&&null!==r&&(s=r,r=null),s=s||{};const[,i,o]=e.match(/([^ ]+) *(.*)/),a=this.createCommand(i);return r&&(a.description(r),a._executableHandler=!0),s.isDefault&&(this._defaultCommandName=a._name),a._hidden=!(!s.noHelp&&!s.hidden),a._executableFile=s.executableFile||null,o&&a.arguments(o),this._registerCommand(a),a.parent=this,a.copyInheritedSettings(this),r?this:a}createCommand(t){return new e(t)}createHelp(){return Object.assign(new l,this.configureHelp())}configureHelp(e){return void 0===e?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return void 0===e?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return"string"!=typeof e&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()");return(t=t||{}).isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new o(e,t)}argument(e,t,n,r){const s=this.createArgument(e,t);return"function"==typeof n?s.default(r).argParser(n):s.default(n),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){const t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&void 0!==e.defaultValue&&void 0===e.parseArg)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if("boolean"==typeof e)return this._addImplicitHelpCommand=e,this;e=e??"help [command]";const[,n,r]=e.match(/([^ ]+) *(.*)/),s=t??"display help for command",i=this.createCommand(n);return i.helpOption(!1),r&&i.arguments(r),s&&i.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=i,this}addHelpCommand(e,t){return"object"!=typeof e?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(void 0===this._helpCommand&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){const n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.\nExpecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if("commander.executeSubCommandAsync"!==e.code)throw e}),this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new c(e,t,n)),i.exit(e)}action(e){return this._actionHandler=t=>{const n=this.registeredArguments.length,r=t.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)},this}createOption(e,t){return new u(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(s){if("commander.invalidArgument"===s.code){const e=`${r} ${s.message}`;this.error(e,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(e){const t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){const n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'\n- already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){const t=e=>[e.name()].concat(e.aliases()),n=t(e).find(e=>this._findCommand(e));if(n){const r=t(this._findCommand(n)).join("|"),s=t(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${r}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);const t=e.name(),n=e.attributeName();if(e.negate){const t=e.long.replace(/^--no-/,"--");this._findOption(t)||this.setOptionValueWithSource(n,void 0===e.defaultValue||e.defaultValue,"default")}else void 0!==e.defaultValue&&this.setOptionValueWithSource(n,e.defaultValue,"default");const r=(t,r,s)=>{null==t&&void 0!==e.presetArg&&(t=e.presetArg);const i=this.getOptionValue(n);null!==t&&e.parseArg?t=this._callParseArg(e,t,i,r):null!==t&&e.variadic&&(t=e._concatValue(t,i)),null==t&&(t=!e.negate&&(!(!e.isBoolean()&&!e.optional)||"")),this.setOptionValueWithSource(n,t,s)};return this.on("option:"+t,t=>{r(t,`error: option '${e.flags}' argument '${t}' is invalid.`,"cli")}),e.envVar&&this.on("optionEnv:"+t,t=>{r(t,`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`,"env")}),this}_optionEx(e,t,n,r,s){if("object"==typeof t&&t instanceof u)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const i=this.createOption(t,n);if(i.makeOptionMandatory(!!e.mandatory),"function"==typeof r)i.default(s).argParser(r);else if(r instanceof RegExp){const e=r;r=(t,n)=>{const r=e.exec(t);return r?r[0]:n},i.default(s).argParser(r)}else i.default(r);return this.addOption(i)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{void 0!==n.getOptionValueSource(e)&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(void 0!==e&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},void 0===e&&void 0===t.from){i.versions?.electron&&(t.from="electron");const e=i.execArgv??[];(e.includes("-e")||e.includes("--eval")||e.includes("-p")||e.includes("--print"))&&(t.from="eval")}let n;switch(void 0===e&&(e=i.argv),this.rawArgs=e.slice(),t.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":i.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,t){const n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){const n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_executeSubCommand(e,t){t=t.slice();let o=!1;const a=[".js",".ts",".tsx",".mjs",".cjs"];function l(e,t){const n=r.resolve(e,t);if(s.existsSync(n))return n;if(a.includes(r.extname(t)))return;const i=a.find(e=>s.existsSync(`${n}${e}`));return i?`${n}${i}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u,d=e._executableFile||`${this._name}-${e._name}`,h=this._executableDir||"";if(this._scriptPath){let e;try{e=s.realpathSync(this._scriptPath)}catch(p){e=this._scriptPath}h=r.resolve(r.dirname(e),h)}if(h){let t=l(h,d);if(!t&&!e._executableFile&&this._scriptPath){const n=r.basename(this._scriptPath,r.extname(this._scriptPath));n!==this._name&&(t=l(h,`${n}-${e._name}`))}d=t||d}o=a.includes(r.extname(d)),"win32"!==i.platform?o?(t.unshift(d),t=m(i.execArgv).concat(t),u=n.spawn(i.argv[0],t,{stdio:"inherit"})):u=n.spawn(d,t,{stdio:"inherit"}):(t.unshift(d),t=m(i.execArgv).concat(t),u=n.spawn(i.execPath,t,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(e=>{i.on(e,()=>{!1===u.killed&&null===u.exitCode&&u.kill(e)})});const g=this._exitCallback;u.on("close",e=>{e=e??1,g?g(new c(e,"commander.executeSubCommandAsync","(close)")):i.exit(e)}),u.on("error",t=>{if("ENOENT"===t.code){const t=h?`searched for local subcommand relative to directory '${h}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",n=`'${d}' does not exist\n - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${t}`;throw new Error(n)}if("EACCES"===t.code)throw new Error(`'${d}' not executable`);if(g){const e=new c(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,g(e)}else i.exit(1)}),this.runningCommand=u}_dispatchSubcommand(e,t,n){const r=this._findCommand(e);let s;return r||this.help({error:!0}),s=this._chainOrCallSubCommandHook(s,r,"preSubcommand"),s=this._chainOrCall(s,()=>{if(!r._executableHandler)return r._parseCommand(t,n);this._executeSubCommand(r,t.concat(n))}),s}_dispatchHelpCommand(e){e||this.help();const t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&null==this.args[t]&&this.missingArgument(e.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic||this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){const e=(e,t,n)=>{let r=t;if(null!==t&&e.parseArg){const s=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,s)}return r};this._checkNumberOfArguments();const t=[];this.registeredArguments.forEach((n,r)=>{let s=n.defaultValue;n.variadic?r<this.args.length?(s=this.args.slice(r),n.parseArg&&(s=s.reduce((t,r)=>e(n,r,t),n.defaultValue))):void 0===s&&(s=[]):r<this.args.length&&(s=this.args[r],n.parseArg&&(s=e(n,s,n.defaultValue))),t[r]=s}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&"function"==typeof e.then?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e;const r=[];return this._getCommandAndAncestors().reverse().filter(e=>void 0!==e._lifeCycleHooks[t]).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),"postAction"===t&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return void 0!==this._lifeCycleHooks[n]&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){const n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){let n;return r(),this._processArguments(),n=this._chainOrCallHooks(n,"preAction"),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(s,e,t)})),n=this._chainOrCallHooks(n,"postAction"),n}if(this.parent&&this.parent.listenerCount(s))r(),this._processArguments(),this.parent.emit(s,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&void 0===e.getOptionValue(t.attributeName())&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){const e=this.options.filter(e=>{const t=e.attributeName();return void 0!==this.getOptionValue(t)&&"default"!==this.getOptionValueSource(t)});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{const n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){const t=[],n=[];let r=t;const s=e.slice();function i(e){return e.length>1&&"-"===e[0]}let o=null;for(;s.length;){const e=s.shift();if("--"===e){r===n&&r.push(e),r.push(...s);break}if(!o||i(e)){if(o=null,i(e)){const t=this._findOption(e);if(t){if(t.required){const e=s.shift();void 0===e&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,e)}else if(t.optional){let e=null;s.length>0&&!i(s[0])&&(e=s.shift()),this.emit(`option:${t.name()}`,e)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(e.length>2&&"-"===e[0]&&"-"!==e[1]){const t=this._findOption(`-${e[1]}`);if(t){t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${t.name()}`,e.slice(2)):(this.emit(`option:${t.name()}`),s.unshift(`-${e.slice(2)}`));continue}}if(/^--[^=]+=/.test(e)){const t=e.indexOf("="),n=this._findOption(e.slice(0,t));if(n&&(n.required||n.optional)){this.emit(`option:${n.name()}`,e.slice(t+1));continue}}if(i(e)&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&0===t.length&&0===n.length){if(this._findCommand(e)){t.push(e),s.length>0&&n.push(...s);break}if(this._getHelpCommand()&&e===this._getHelpCommand().name()){t.push(e),s.length>0&&t.push(...s);break}if(this._defaultCommandName){n.push(e),s.length>0&&n.push(...s);break}}if(this._passThroughOptions){r.push(e),s.length>0&&r.push(...s);break}r.push(e)}else this.emit(`option:${o.name()}`,e)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){const e={},t=this.options.length;for(let n=0;n<t;n++){const t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));const n=t||{},r=n.exitCode||1,s=n.code||"commander.error";this._exit(r,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in i.env){const t=e.attributeName();(void 0===this.getOptionValue(t)||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,i.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){const e=new d(this.options),t=e=>void 0!==this.getOptionValue(e)&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter(n=>void 0!==n.implied&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],"implied")})})}missingArgument(e){const t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){const t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){const t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){const n=e=>{const t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),s=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(void 0===r.presetArg&&!1===n||void 0!==r.presetArg&&n===r.presetArg)?r:s||e},r=e=>{const t=n(e),r=t.attributeName();return"env"===this.getOptionValueSource(r)?`environment variable '${t.envVar}'`:`option '${t.flags}'`},s=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],r=this;do{const e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=h(e,n)}const n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;const t=this.registeredArguments.length,n=1===t?"":"s",r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){const e=this.args[0];let t="";if(this._showSuggestionAfterError){const n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=h(e,n)}const n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(void 0===e)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";const r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on("option:"+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,"commander.version",e)}),this}description(e,t){return void 0===e&&void 0===t?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return void 0===e?this._summary:(this._summary=e,this)}alias(e){if(void 0===e)return this._aliases[0];let t=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");const n=this.parent?._findCommand(e);if(n){const t=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return void 0===e?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(void 0===e){if(this._usage)return this._usage;const e=this.registeredArguments.map(e=>a(e));return[].concat(this.options.length||null!==this._helpOption?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?e:[]).join(" ")}return this._usage=e,this}name(e){return void 0===e?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=r.basename(e,r.extname(e)),this}executableDir(e){return void 0===e?this._executableDir:(this._executableDir=e,this)}helpInformation(e){const t=this.createHelp();return void 0===t.helpWidth&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){const t={error:!!(e=e||{}).error};let n;return n=t.error?e=>this._outputConfiguration.writeErr(e):e=>this._outputConfiguration.writeOut(e),t.write=e.write||n,t.command=this,t}outputHelp(e){let t;"function"==typeof e&&(t=e,e=void 0);const n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(e=>e.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let r=this.helpInformation(n);if(t&&(r=t(r),"string"!=typeof r&&!Buffer.isBuffer(r)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(r),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(e=>e.emit("afterAllHelp",n))}helpOption(e,t){return"boolean"==typeof e?(this._helpOption=e?this._helpOption??void 0:null,this):(e=e??"-h, --help",t=t??"display help for command",this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return void 0===this._helpOption&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let t=i.exitCode||0;0===t&&e&&"function"!=typeof e&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){const n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${n.join("', '")}'`);const r=`${e}Help`;return this.on(r,e=>{let n;n="function"==typeof t?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){const t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}}),Gt=/* @__PURE__ */_(e=>{var{Argument:t}=yt(),{Command:n}=vt(),{CommanderError:r,InvalidArgumentError:s}=ft(),{Help:i}=bt(),{Option:o}=It();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=i,e.CommanderError=r,e.InvalidArgumentError=s,e.InvalidOptionArgumentError=s}),At=/* @__PURE__ */L(Gt(),1),{program:St,createCommand:Zt,createArgument:Ct,createOption:Vt,CommanderError:Et,InvalidArgumentError:Xt,InvalidOptionArgumentError:Bt,Command:xt,Argument:Rt,Option:Wt,Help:Nt}=At.default,Jt=w(import.meta.url),kt=m.dirname(v(import.meta.url)),Ft=Jt(m.resolve(kt,"./native/loader.cjs")),{getDeveloperKey:_t,setDeveloperKey:Yt,validateManifest:Ht,packContent:Lt,unpackContent:Tt,getContentKey:Ot,setContentKey:Mt}=Ft;Object.freeze([""," ",".",".."," .",". "," ..",".. ","../","../foo","foo/../bar","foo/bar","foo\\bar","foo\0bar"]);function Kt(e){if("string"!=typeof e)throw new TypeError("Expected a string");if(!function(e){if("string"!=typeof e)return!1;const t=e.trim();return""!==t&&"."!==t&&".."!==t&&!e.includes("/")&&!e.includes("\\")&&!e.includes("\0")}(e))throw new Error(`Unsafe filename: ${JSON.stringify(e)}`)}var Ut=G.homedir(),zt=G.tmpdir(),{env:Dt}=r;function jt(e,{suffix:t="nodejs"}={}){return Kt(e),t&&(e+=`-${t}`),Kt(e),"darwin"===r.platform?(e=>{const t=m.join(Ut,"Library");return{data:m.join(t,"Application Support",e),config:m.join(t,"Preferences",e),cache:m.join(t,"Caches",e),log:m.join(t,"Logs",e),temp:m.join(zt,e)}})(e):"win32"===r.platform?(e=>{const t=Dt.APPDATA||m.join(Ut,"AppData","Roaming"),n=Dt.LOCALAPPDATA||m.join(Ut,"AppData","Local");return{data:m.join(n,e,"Data"),config:m.join(t,e,"Config"),cache:m.join(n,e,"Cache"),log:m.join(n,e,"Log"),temp:m.join(zt,e)}})(e):(e=>{const t=m.basename(Ut);return{data:m.join(Dt.XDG_DATA_HOME||m.join(Ut,".local","share"),e),config:m.join(Dt.XDG_CONFIG_HOME||m.join(Ut,".config"),e),cache:m.join(Dt.XDG_CACHE_HOME||m.join(Ut,".cache"),e),log:m.join(Dt.XDG_STATE_HOME||m.join(Ut,".local","state"),e),temp:m.join(zt,t,e)}})(e)}var Pt,Qt,$t=/* @__PURE__ */_(e=>{e.fromCallback=function(e){return Object.defineProperty(function(...t){if("function"!=typeof t[t.length-1])return new Promise((n,r)=>{t.push((e,t)=>null!=e?r(e):n(t)),e.apply(this,t)});e.apply(this,t)},"name",{value:e.name})},e.fromPromise=function(e){return Object.defineProperty(function(...t){const n=t[t.length-1];if("function"!=typeof n)return e.apply(this,t);t.pop(),e.apply(this,t).then(e=>n(null,e),n)},"name",{value:e.name})}}),qt=/* @__PURE__ */_((e,t)=>{var n=T("constants"),r=process.cwd,s=null,i=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return s||(s=r.call(process)),s};try{process.cwd()}catch(a){}if("function"==typeof process.chdir){var o=process.chdir;process.chdir=function(e){s=null,o.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,o)}t.exports=function(e){n.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,r,s){e.open(t,n.O_WRONLY|n.O_SYMLINK,r,function(t,n){t?s&&s(t):e.fchmod(n,r,function(t){e.close(n,function(e){s&&s(t||e)})})})},e.lchmodSync=function(t,r){var s,i=e.openSync(t,n.O_WRONLY|n.O_SYMLINK,r),o=!0;try{s=e.fchmodSync(i,r),o=!1}finally{if(o)try{e.closeSync(i)}catch(a){}else e.closeSync(i)}return s}}(e);e.lutimes||function(e){n.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,r,s,i){e.open(t,n.O_SYMLINK,function(t,n){t?i&&i(t):e.futimes(n,r,s,function(t){e.close(n,function(e){i&&i(t||e)})})})},e.lutimesSync=function(t,r,s){var i,o=e.openSync(t,n.O_SYMLINK),c=!0;try{i=e.futimesSync(o,r,s),c=!1}finally{if(c)try{e.closeSync(o)}catch(a){}else e.closeSync(o)}return i}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=s(e.chown),e.fchown=s(e.fchown),e.lchown=s(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=o(e.chownSync),e.fchownSync=o(e.fchownSync),e.lchownSync=o(e.lchownSync),e.chmodSync=r(e.chmodSync),e.fchmodSync=r(e.fchmodSync),e.lchmodSync=r(e.lchmodSync),e.stat=c(e.stat),e.fstat=c(e.fstat),e.lstat=c(e.lstat),e.statSync=l(e.statSync),e.fstatSync=l(e.fstatSync),e.lstatSync=l(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===i&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,s){var i=Date.now(),o=0;t(n,r,function a(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-i<6e4)return setTimeout(function(){e.stat(r,function(e,i){e&&"ENOENT"===e.code?t(n,r,a):s(c)})},o),void(o<100&&(o+=10));s&&s(c)})}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,s){return t.call(e,n,r,function(e){u(e)&&(e=null),s&&s.apply(this,arguments)})}:t}function r(t){return t?function(n,r){try{return t.call(e,n,r)}catch(a){if(!u(a))throw a}}:t}function s(t){return t?function(n,r,s,i){return t.call(e,n,r,s,function(e){u(e)&&(e=null),i&&i.apply(this,arguments)})}:t}function o(t){return t?function(n,r,s){try{return t.call(e,n,r,s)}catch(a){if(!u(a))throw a}}:t}function c(t){return t?function(n,r,s){function i(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),s&&s.apply(this,arguments)}return"function"==typeof r&&(s=r,r=null),r?t.call(e,n,r,i):t.call(e,n,i)}:t}function l(t){return t?function(n,r){var s=r?t.call(e,n,r):t.call(e,n);return s&&(s.uid<0&&(s.uid+=4294967296),s.gid<0&&(s.gid+=4294967296)),s}:t}function u(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,s,i,o,a){var c;if(a&&"function"==typeof a){var l=0;c=function(u,d,h){if(u&&"EAGAIN"===u.code&&l<10)return l++,t.call(e,n,r,s,i,o,c);a.apply(this,arguments)}}return t.call(e,n,r,s,i,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(d=e.readSync,function(t,n,r,s,i){for(var o=0;;)try{return d.call(e,t,n,r,s,i)}catch(a){if("EAGAIN"===a.code&&o<10){o++;continue}throw a}});var d}}),en=/* @__PURE__ */_((e,t)=>{var n=T("stream").Stream;t.exports=function(e){return{ReadStream:function t(r,s){if(!(this instanceof t))return new t(r,s);n.call(this);var i=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,s=s||{};for(var o=Object.keys(s),a=0,c=o.length;a<c;a++){var l=o[a];this[l]=s[l]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick(function(){i._read()});e.open(this.path,this.flags,this.mode,function(e,t){if(e)return i.emit("error",e),void(i.readable=!1);i.fd=t,i.emit("open",t),i._read()})},WriteStream:function t(r,s){if(!(this instanceof t))return new t(r,s);n.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var i=Object.keys(s),o=0,a=i.length;o<a;o++){var c=i[o];this[c]=s[c]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}}}),tn=/* @__PURE__ */_((e,t)=>{t.exports=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:n(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t};var n=Object.getPrototypeOf||function(e){return e.__proto__}}),nn=/* @__PURE__ */_((e,t)=>{var n,r,s=T("fs"),i=qt(),o=en(),a=tn(),c=T("util");function l(e,t){Object.defineProperty(e,n,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(n=Symbol.for("graceful-fs.queue"),r=Symbol.for("graceful-fs.previous")):(n="___graceful-fs.queue",r="___graceful-fs.previous");var u,d=function(){};function h(e){i(e),e.gracefulify=h,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,s,i){return t(n,r,function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof s&&s.apply(this,arguments):m([e,[n,r,s],t,i||Date.now(),Date.now()])})}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,s){"function"==typeof r&&(s=r,r=null);return function e(t,r,s,i,o){return n(t,r,s,function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof i&&i.apply(this,arguments):m([e,[t,r,s,i],n,o||Date.now(),Date.now()])})}(e,t,r,s)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,s){"function"==typeof n&&(s=n,n=null);return function e(t,n,s,i,o){return r(t,n,s,function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof i&&i.apply(this,arguments):m([e,[t,n,s,i],r,o||Date.now(),Date.now()])})}(e,t,n,s)});var s=e.copyFile;s&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,i,o){return s(t,n,r,function(s){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof i&&i.apply(this,arguments):m([e,[t,n,r,i],s,o||Date.now(),Date.now()])})}(e,t,n,r)});var a=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=c.test(process.version)?function(e,t,n,r){return a(e,s(e,t,n,r))}:function(e,t,n,r){return a(e,t,s(e,t,n,r))};return r(e,t,n);function s(e,t,n,s){return function(i,o){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?(o&&o.sort&&o.sort(),"function"==typeof n&&n.call(this,i,o)):m([r,[e,t,n],i,s||Date.now(),Date.now()])}}};var c=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var l=o(e);f=l.ReadStream,y=l.WriteStream}var u=e.ReadStream;u&&(f.prototype=Object.create(u.prototype),f.prototype.open=function(){var e=this;I(e.path,e.flags,e.mode,function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())})});var d=e.WriteStream;d&&(y.prototype=Object.create(d.prototype),y.prototype.open=function(){var e=this;I(e.path,e.flags,e.mode,function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))})}),Object.defineProperty(e,"ReadStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return y},set:function(e){y=e},enumerable:!0,configurable:!0});var g=f;Object.defineProperty(e,"FileReadStream",{get:function(){return g},set:function(e){g=e},enumerable:!0,configurable:!0});var p=y;function f(e,t){return this instanceof f?(u.apply(this,arguments),this):f.apply(Object.create(f.prototype),arguments)}function y(e,t){return this instanceof y?(d.apply(this,arguments),this):y.apply(Object.create(y.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return p},set:function(e){p=e},enumerable:!0,configurable:!0});var b=e.open;function I(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,s,i){return b(t,n,r,function(o,a){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof s&&s.apply(this,arguments):m([e,[t,n,r,s],o,i||Date.now(),Date.now()])})}(e,t,n,r)}return e.open=I,e}function m(e){d("ENQUEUE",e[0].name,e[1]),s[n].push(e),p()}function g(){for(var e=Date.now(),t=0;t<s[n].length;++t)s[n][t].length>2&&(s[n][t][3]=e,s[n][t][4]=e);p()}function p(){if(clearTimeout(u),u=void 0,0!==s[n].length){var e=s[n].shift(),t=e[0],r=e[1],i=e[2],o=e[3],a=e[4];if(void 0===o)d("RETRY",t.name,r),t.apply(null,r);else if(Date.now()-o>=6e4){d("TIMEOUT",t.name,r);var c=r.pop();"function"==typeof c&&c.call(null,i)}else{var l=Date.now()-a,h=Math.max(a-o,1);l>=Math.min(1.2*h,100)?(d("RETRY",t.name,r),t.apply(null,r.concat([o]))):s[n].push(e)}void 0===u&&(u=setTimeout(p,0))}}c.debuglog?d=c.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(d=function(){var e=c.format.apply(c,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),s[n]||(l(s,global[n]||[]),s.close=function(e){function t(t,n){return e.call(s,t,function(e){e||g(),"function"==typeof n&&n.apply(this,arguments)})}return Object.defineProperty(t,r,{value:e}),t}(s.close),s.closeSync=function(e){function t(t){e.apply(s,arguments),g()}return Object.defineProperty(t,r,{value:e}),t}(s.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){d(s[n]),T("assert").equal(s[n].length,0)})),global[n]||l(global,s[n]),t.exports=h(a(s)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!s.__patched&&(t.exports=h(s),s.__patched=!0)}),rn=/* @__PURE__ */_(e=>{var t=$t().fromCallback,n=nn(),r=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(e=>"function"==typeof n[e]);Object.assign(e,n),r.forEach(r=>{e[r]=t(n[r])}),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise(t=>n.exists(e,t))},e.read=function(e,t,r,s,i,o){return"function"==typeof o?n.read(e,t,r,s,i,o):new Promise((o,a)=>{n.read(e,t,r,s,i,(e,t,n)=>{if(e)return a(e);o({bytesRead:t,buffer:n})})})},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise((s,i)=>{n.write(e,t,...r,(e,t,n)=>{if(e)return i(e);s({bytesWritten:t,buffer:n})})})},e.readv=function(e,t,...r){return"function"==typeof r[r.length-1]?n.readv(e,t,...r):new Promise((s,i)=>{n.readv(e,t,...r,(e,t,n)=>{if(e)return i(e);s({bytesRead:t,buffers:n})})})},e.writev=function(e,t,...r){return"function"==typeof r[r.length-1]?n.writev(e,t,...r):new Promise((s,i)=>{n.writev(e,t,...r,(e,t,n)=>{if(e)return i(e);s({bytesWritten:t,buffers:n})})})},"function"==typeof n.realpath.native?e.realpath.native=t(n.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}),sn=/* @__PURE__ */_((e,t)=>{var n=T("path");t.exports.checkPath=function(e){if("win32"===process.platform&&/[<>:"|?*]/.test(e.replace(n.parse(e).root,""))){const t=/* @__PURE__ */new Error(`Path contains invalid characters: ${e}`);throw t.code="EINVAL",t}}}),on=/* @__PURE__ */_((e,t)=>{var n=rn(),{checkPath:r}=sn(),s=e=>"number"==typeof e?e:{mode:511,...e}.mode;t.exports.makeDir=async(e,t)=>(r(e),n.mkdir(e,{mode:s(t),recursive:!0})),t.exports.makeDirSync=(e,t)=>(r(e),n.mkdirSync(e,{mode:s(t),recursive:!0}))}),an=/* @__PURE__ */_((e,t)=>{var n=$t().fromPromise,{makeDir:r,makeDirSync:s}=on(),i=n(r);t.exports={mkdirs:i,mkdirsSync:s,mkdirp:i,mkdirpSync:s,ensureDir:i,ensureDirSync:s}}),cn=/* @__PURE__ */_((e,t)=>{var n=$t().fromPromise,r=rn();t.exports={pathExists:n(function(e){return r.access(e).then(()=>!0).catch(()=>!1)}),pathExistsSync:r.existsSync}}),ln=/* @__PURE__ */_((e,t)=>{var n=rn(),r=$t().fromPromise;t.exports={utimesMillis:r(async function(e,t,r){const s=await n.open(e,"r+");let i=null;try{await n.futimes(s,t,r)}finally{try{await n.close(s)}catch(o){i=o}}if(i)throw i}),utimesMillisSync:function(e,t,r){const s=n.openSync(e,"r+");return n.futimesSync(s,t,r),n.closeSync(s)}}}),un=/* @__PURE__ */_((e,t)=>{var n=rn(),r=T("path"),s=$t().fromPromise;function i(e,t){return void 0!==t.ino&&void 0!==t.dev&&t.ino===e.ino&&t.dev===e.dev}function o(e,t){const n=r.resolve(e).split(r.sep).filter(e=>e),s=r.resolve(t).split(r.sep).filter(e=>e);return n.every((e,t)=>s[t]===e)}function a(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}t.exports={checkPaths:s(async function(e,t,s,c){const{srcStat:l,destStat:u}=await function(e,t,r){const s=r.dereference?e=>n.stat(e,{bigint:!0}):e=>n.lstat(e,{bigint:!0});return Promise.all([s(e),s(t).catch(e=>{if("ENOENT"===e.code)return null;throw e})]).then(([e,t])=>({srcStat:e,destStat:t}))}(e,t,c);if(u){if(i(l,u)){const n=r.basename(e),i=r.basename(t);if("move"===s&&n!==i&&n.toLowerCase()===i.toLowerCase())return{srcStat:l,destStat:u,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(l.isDirectory()&&!u.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!l.isDirectory()&&u.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(l.isDirectory()&&o(e,t))throw new Error(a(e,t,s));return{srcStat:l,destStat:u}}),checkPathsSync:function(e,t,s,c){const{srcStat:l,destStat:u}=function(e,t,r){let s;const i=r.dereference?e=>n.statSync(e,{bigint:!0}):e=>n.lstatSync(e,{bigint:!0}),o=i(e);try{s=i(t)}catch(a){if("ENOENT"===a.code)return{srcStat:o,destStat:null};throw a}return{srcStat:o,destStat:s}}(e,t,c);if(u){if(i(l,u)){const n=r.basename(e),i=r.basename(t);if("move"===s&&n!==i&&n.toLowerCase()===i.toLowerCase())return{srcStat:l,destStat:u,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(l.isDirectory()&&!u.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!l.isDirectory()&&u.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(l.isDirectory()&&o(e,t))throw new Error(a(e,t,s));return{srcStat:l,destStat:u}},checkParentPaths:s(async function e(t,s,o,c){const l=r.resolve(r.dirname(t)),u=r.resolve(r.dirname(o));if(u===l||u===r.parse(u).root)return;let d;try{d=await n.stat(u,{bigint:!0})}catch(h){if("ENOENT"===h.code)return;throw h}if(i(s,d))throw new Error(a(t,o,c));return e(t,s,u,c)}),checkParentPathsSync:function e(t,s,o,c){const l=r.resolve(r.dirname(t)),u=r.resolve(r.dirname(o));if(u===l||u===r.parse(u).root)return;let d;try{d=n.statSync(u,{bigint:!0})}catch(h){if("ENOENT"===h.code)return;throw h}if(i(s,d))throw new Error(a(t,o,c));return e(t,s,u,c)},isSrcSubdir:o,areIdentical:i}}),dn=/* @__PURE__ */_((e,t)=>{t.exports={asyncIteratorConcurrentProcess:async function(e,t){const n=[];for await(const r of e)n.push(t(r).then(()=>null,e=>e??/* @__PURE__ */new Error("unknown error")));await Promise.all(n.map(e=>e.then(e=>{if(null!==e)throw e})))}}}),hn=/* @__PURE__ */_((e,t)=>{var n=rn(),r=T("path"),{mkdirs:s}=an(),{pathExists:i}=cn(),{utimesMillis:o}=ln(),a=un(),{asyncIteratorConcurrentProcess:c}=dn();async function l(e,t,n){return!n.filter||n.filter(e,t)}async function u(e,t,s,i){const o=await(i.dereference?n.stat:n.lstat)(t);if(o.isDirectory())return async function(e,t,s,i,o){t||await n.mkdir(i);await c(await n.opendir(s),async e=>{const t=r.join(s,e.name),n=r.join(i,e.name);if(await l(t,n,o)){const{destStat:e}=await a.checkPaths(t,n,"copy",o);await u(e,t,n,o)}}),t||await n.chmod(i,e.mode)}(o,e,t,s,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return async function(e,t,r,s,i){if(!t)return d(e,r,s,i);if(i.overwrite)return await n.unlink(s),d(e,r,s,i);if(i.errorOnExist)throw new Error(`'${s}' already exists`)}(o,e,t,s,i);if(o.isSymbolicLink())return async function(e,t,s,i){let o=await n.readlink(t);i.dereference&&(o=r.resolve(process.cwd(),o));if(!e)return n.symlink(o,s);let c=null;try{c=await n.readlink(s)}catch(l){if("EINVAL"===l.code||"UNKNOWN"===l.code)return n.symlink(o,s);throw l}i.dereference&&(c=r.resolve(process.cwd(),c));if(o!==c){if(a.isSrcSubdir(o,c))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${c}'.`);if(a.isSrcSubdir(c,o))throw new Error(`Cannot overwrite '${c}' with '${o}'.`)}return await n.unlink(s),n.symlink(o,s)}(e,t,s,i);if(o.isSocket())throw new Error(`Cannot copy a socket file: ${t}`);if(o.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${t}`);throw new Error(`Unknown file: ${t}`)}async function d(e,t,r,s){if(await n.copyFile(t,r),s.preserveTimestamps){128&e.mode||await function(e,t){return n.chmod(e,128|t)}(r,e.mode);const s=await n.stat(t);await o(r,s.atime,s.mtime)}return n.chmod(r,e.mode)}t.exports=async function(e,t,n={}){"function"==typeof n&&(n={filter:n}),n.clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001");const{srcStat:o,destStat:c}=await a.checkPaths(e,t,"copy",n);if(await a.checkParentPaths(e,o,t,"copy"),!(await l(e,t,n)))return;const d=r.dirname(t);await i(d)||await s(d),await u(c,e,t,n)}}),mn=/* @__PURE__ */_((e,t)=>{var n=nn(),r=T("path"),s=an().mkdirsSync,i=ln().utimesMillisSync,o=un();function a(e,t,s,i){const a=(i.dereference?n.statSync:n.lstatSync)(t);if(a.isDirectory())return function(e,t,r,s,i){return t?u(r,s,i):function(e,t,r,s){return n.mkdirSync(r),u(t,r,s),l(r,e)}(e.mode,r,s,i)}(a,e,t,s,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return function(e,t,r,s,i){return t?function(e,t,r,s){if(s.overwrite)return n.unlinkSync(r),c(e,t,r,s);if(s.errorOnExist)throw new Error(`'${r}' already exists`)}(e,r,s,i):c(e,r,s,i)}(a,e,t,s,i);if(a.isSymbolicLink())return function(e,t,s,i){let a=n.readlinkSync(t);i.dereference&&(a=r.resolve(process.cwd(),a));if(e){let e;try{e=n.readlinkSync(s)}catch(c){if("EINVAL"===c.code||"UNKNOWN"===c.code)return n.symlinkSync(a,s);throw c}if(i.dereference&&(e=r.resolve(process.cwd(),e)),a!==e){if(o.isSrcSubdir(a,e))throw new Error(`Cannot copy '${a}' to a subdirectory of itself, '${e}'.`);if(o.isSrcSubdir(e,a))throw new Error(`Cannot overwrite '${e}' with '${a}'.`)}return function(e,t){return n.unlinkSync(t),n.symlinkSync(e,t)}(a,s)}return n.symlinkSync(a,s)}(e,t,s,i);if(a.isSocket())throw new Error(`Cannot copy a socket file: ${t}`);if(a.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${t}`);throw new Error(`Unknown file: ${t}`)}function c(e,t,r,s){return n.copyFileSync(t,r),s.preserveTimestamps&&function(e,t,r){(function(e){return!(128&e)})(e)&&function(e,t){l(e,128|t)}(r,e);(function(e,t){const r=n.statSync(e);i(t,r.atime,r.mtime)})(t,r)}(e.mode,t,r),l(r,e.mode)}function l(e,t){return n.chmodSync(e,t)}function u(e,t,r){const s=n.opendirSync(e);try{let n;for(;null!==(n=s.readSync());)d(n.name,e,t,r)}finally{s.closeSync()}}function d(e,t,n,s){const i=r.join(t,e),c=r.join(n,e);if(s.filter&&!s.filter(i,c))return;const{destStat:l}=o.checkPathsSync(i,c,"copy",s);return a(l,i,c,s)}t.exports=function(e,t,i){"function"==typeof i&&(i={filter:i}),(i=i||{}).clobber=!("clobber"in i)||!!i.clobber,i.overwrite="overwrite"in i?!!i.overwrite:i.clobber,i.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:c,destStat:l}=o.checkPathsSync(e,t,"copy",i);if(o.checkParentPathsSync(e,c,t,"copy"),i.filter&&!i.filter(e,t))return;const u=r.dirname(t);return n.existsSync(u)||s(u),a(l,e,t,i)}}),gn=/* @__PURE__ */_((e,t)=>{var n=$t().fromPromise;t.exports={copy:n(hn()),copySync:mn()}}),pn=/* @__PURE__ */_((e,t)=>{var n=nn(),r=$t().fromCallback;t.exports={remove:r(function(e,t){n.rm(e,{recursive:!0,force:!0},t)}),removeSync:function(e){n.rmSync(e,{recursive:!0,force:!0})}}}),fn=/* @__PURE__ */_((e,t)=>{var n=$t().fromPromise,r=rn(),s=T("path"),i=an(),o=pn(),a=n(async function(e){let t;try{t=await r.readdir(e)}catch{return i.mkdirs(e)}return Promise.all(t.map(t=>o.remove(s.join(e,t))))});function c(e){let t;try{t=r.readdirSync(e)}catch{return i.mkdirsSync(e)}t.forEach(t=>{t=s.join(e,t),o.removeSync(t)})}t.exports={emptyDirSync:c,emptydirSync:c,emptyDir:a,emptydir:a}}),yn=/* @__PURE__ */_((e,t)=>{var n=$t().fromPromise,r=T("path"),s=rn(),i=an();t.exports={createFile:n(async function(e){let t;try{t=await s.stat(e)}catch{}if(t&&t.isFile())return;const n=r.dirname(e);let o=null;try{o=await s.stat(n)}catch(a){if("ENOENT"===a.code)return await i.mkdirs(n),void(await s.writeFile(e,""));throw a}o.isDirectory()?await s.writeFile(e,""):await s.readdir(n)}),createFileSync:function(e){let t;try{t=s.statSync(e)}catch{}if(t&&t.isFile())return;const n=r.dirname(e);try{s.statSync(n).isDirectory()||s.readdirSync(n)}catch(o){if(!o||"ENOENT"!==o.code)throw o;i.mkdirsSync(n)}s.writeFileSync(e,"")}}}),bn=/* @__PURE__ */_((e,t)=>{var n=$t().fromPromise,r=T("path"),s=rn(),i=an(),{pathExists:o}=cn(),{areIdentical:a}=un();t.exports={createLink:n(async function(e,t){let n,c;try{n=await s.lstat(t)}catch{}try{c=await s.lstat(e)}catch(u){throw u.message=u.message.replace("lstat","ensureLink"),u}if(n&&a(c,n))return;const l=r.dirname(t);await o(l)||await i.mkdirs(l),await s.link(e,t)}),createLinkSync:function(e,t){let n;try{n=s.lstatSync(t)}catch{}try{const t=s.lstatSync(e);if(n&&a(t,n))return}catch(c){throw c.message=c.message.replace("lstat","ensureLink"),c}const o=r.dirname(t);return s.existsSync(o)||i.mkdirsSync(o),s.linkSync(e,t)}}}),In=/* @__PURE__ */_((e,t)=>{var n=T("path"),r=rn(),{pathExists:s}=cn(),i=$t().fromPromise;t.exports={symlinkPaths:i(async function(e,t){if(n.isAbsolute(e)){try{await r.lstat(e)}catch(a){throw a.message=a.message.replace("lstat","ensureSymlink"),a}return{toCwd:e,toDst:e}}const i=n.dirname(t),o=n.join(i,e);if(await s(o))return{toCwd:o,toDst:e};try{await r.lstat(e)}catch(a){throw a.message=a.message.replace("lstat","ensureSymlink"),a}return{toCwd:e,toDst:n.relative(i,e)}}),symlinkPathsSync:function(e,t){if(n.isAbsolute(e)){if(!r.existsSync(e))throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}const s=n.dirname(t),i=n.join(s,e);if(r.existsSync(i))return{toCwd:i,toDst:e};if(!r.existsSync(e))throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:n.relative(s,e)}}}}),wn=/* @__PURE__ */_((e,t)=>{var n=rn(),r=$t().fromPromise;t.exports={symlinkType:r(async function(e,t){if(t)return t;let r;try{r=await n.lstat(e)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}),symlinkTypeSync:function(e,t){if(t)return t;let r;try{r=n.lstatSync(e)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}}}),vn=/* @__PURE__ */_((e,t)=>{var n=$t().fromPromise,r=T("path"),s=rn(),{mkdirs:i,mkdirsSync:o}=an(),{symlinkPaths:a,symlinkPathsSync:c}=In(),{symlinkType:l,symlinkTypeSync:u}=wn(),{pathExists:d}=cn(),{areIdentical:h}=un();t.exports={createSymlink:n(async function(e,t,n){let o;try{o=await s.lstat(t)}catch{}if(o&&o.isSymbolicLink()){let n;if(r.isAbsolute(e))n=await s.stat(e);else{const i=r.dirname(t),o=r.join(i,e);try{n=await s.stat(o)}catch{n=await s.stat(e)}}const i=await s.stat(t);if(h(n,i))return}const c=await a(e,t);e=c.toDst;const u=await l(c.toCwd,n),m=r.dirname(t);return await d(m)||await i(m),s.symlink(e,t,u)}),createSymlinkSync:function(e,t,n){let i;try{i=s.lstatSync(t)}catch{}if(i&&i.isSymbolicLink()){let n;if(r.isAbsolute(e))n=s.statSync(e);else{const i=r.dirname(t),o=r.join(i,e);try{n=s.statSync(o)}catch{n=s.statSync(e)}}const i=s.statSync(t);if(h(n,i))return}const a=c(e,t);e=a.toDst,n=u(a.toCwd,n);const l=r.dirname(t);return s.existsSync(l)||o(l),s.symlinkSync(e,t,n)}}}),Gn=/* @__PURE__ */_((e,t)=>{var{createFile:n,createFileSync:r}=yn(),{createLink:s,createLinkSync:i}=bn(),{createSymlink:o,createSymlinkSync:a}=vn();t.exports={createFile:n,createFileSync:r,ensureFile:n,ensureFileSync:r,createLink:s,createLinkSync:i,ensureLink:s,ensureLinkSync:i,createSymlink:o,createSymlinkSync:a,ensureSymlink:o,ensureSymlinkSync:a}}),An=/* @__PURE__ */_((e,t)=>{t.exports={stringify:function(e,{EOL:t="\n",finalEOL:n=!0,replacer:r=null,spaces:s}={}){const i=n?t:"";return JSON.stringify(e,r,s).replace(/\n/g,t)+i},stripBom:function(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}}}),Sn=/* @__PURE__ */_((e,t)=>{var n;try{n=nn()}catch(U){n=T("fs")}var r=$t(),{stringify:s,stripBom:i}=An();var o=r.fromPromise(async function(e,t={}){"string"==typeof t&&(t={encoding:t});const s=t.fs||n,o=!("throws"in t)||t.throws;let a,c=await r.fromCallback(s.readFile)(e,t);c=i(c);try{a=JSON.parse(c,t?t.reviver:null)}catch(l){if(o)throw l.message=`${e}: ${l.message}`,l;return null}return a});var a=r.fromPromise(async function(e,t,i={}){const o=i.fs||n,a=s(t,i);await r.fromCallback(o.writeFile)(e,a,i)});t.exports={readFile:o,readFileSync:function(e,t={}){"string"==typeof t&&(t={encoding:t});const r=t.fs||n,s=!("throws"in t)||t.throws;try{let n=r.readFileSync(e,t);return n=i(n),JSON.parse(n,t.reviver)}catch(o){if(s)throw o.message=`${e}: ${o.message}`,o;return null}},writeFile:a,writeFileSync:function(e,t,r={}){const i=r.fs||n,o=s(t,r);return i.writeFileSync(e,o,r)}}}),Zn=/* @__PURE__ */_((e,t)=>{var n=Sn();t.exports={readJson:n.readFile,readJsonSync:n.readFileSync,writeJson:n.writeFile,writeJsonSync:n.writeFileSync}}),Cn=/* @__PURE__ */_((e,t)=>{var n=$t().fromPromise,r=rn(),s=T("path"),i=an(),o=cn().pathExists;t.exports={outputFile:n(async function(e,t,n="utf-8"){const a=s.dirname(e);return await o(a)||await i.mkdirs(a),r.writeFile(e,t,n)}),outputFileSync:function(e,...t){const n=s.dirname(e);r.existsSync(n)||i.mkdirsSync(n),r.writeFileSync(e,...t)}}}),Vn=/* @__PURE__ */_((e,t)=>{var{stringify:n}=An(),{outputFile:r}=Cn();t.exports=async function(e,t,s={}){await r(e,n(t,s),s)}}),En=/* @__PURE__ */_((e,t)=>{var{stringify:n}=An(),{outputFileSync:r}=Cn();t.exports=function(e,t,s){r(e,n(t,s),s)}}),Xn=/* @__PURE__ */_((e,t)=>{var n=$t().fromPromise,r=Zn();r.outputJson=n(Vn()),r.outputJsonSync=En(),r.outputJSON=r.outputJson,r.outputJSONSync=r.outputJsonSync,r.writeJSON=r.writeJson,r.writeJSONSync=r.writeJsonSync,r.readJSON=r.readJson,r.readJSONSync=r.readJsonSync,t.exports=r}),Bn=/* @__PURE__ */_((e,t)=>{var n=rn(),r=T("path"),{copy:s}=gn(),{remove:i}=pn(),{mkdirp:o}=an(),{pathExists:a}=cn(),c=un();t.exports=async function(e,t,l={}){const u=l.overwrite||l.clobber||!1,{srcStat:d,isChangingCase:h=!1}=await c.checkPaths(e,t,"move",l);await c.checkParentPaths(e,d,t,"move");const m=r.dirname(t);return r.parse(m).root!==m&&await o(m),async function(e,t,r,o){if(!o)if(r)await i(t);else if(await a(t))throw new Error("dest already exists.");try{await n.rename(e,t)}catch(c){if("EXDEV"!==c.code)throw c;await async function(e,t,n){return await s(e,t,{overwrite:n,errorOnExist:!0,preserveTimestamps:!0}),i(e)}(e,t,r)}}(e,t,u,h)}}),xn=/* @__PURE__ */_((e,t)=>{var n=nn(),r=T("path"),s=gn().copySync,i=pn().removeSync,o=an().mkdirpSync,a=un();function c(e,t,r){try{n.renameSync(e,t)}catch(o){if("EXDEV"!==o.code)throw o;return function(e,t,n){return s(e,t,{overwrite:n,errorOnExist:!0,preserveTimestamps:!0}),i(e)}(e,t,r)}}t.exports=function(e,t,s){const l=(s=s||{}).overwrite||s.clobber||!1,{srcStat:u,isChangingCase:d=!1}=a.checkPathsSync(e,t,"move",s);return a.checkParentPathsSync(e,u,t,"move"),function(e){const t=r.dirname(e);return r.parse(t).root===t}(t)||o(r.dirname(t)),function(e,t,r,s){if(s)return c(e,t,r);if(r)return i(t),c(e,t,r);if(n.existsSync(t))throw new Error("dest already exists.");return c(e,t,r)}(e,t,l,d)}}),Rn=/* @__PURE__ */_((e,t)=>{var n=$t().fromPromise;t.exports={move:n(Bn()),moveSync:xn()}}),Wn=/* @__PURE__ */L(/* @__PURE__ */_((e,t)=>{t.exports={...rn(),...gn(),...fn(),...Gn(),...Xn(),...an(),...Rn(),...Cn(),...cn(),...pn()}})(),1),Nn=jt("com.fluxlay.core",{suffix:""}),Jn=class e{static filePath=m.join(Nn.data,"auth.json");static async saveSession(t){await Wn.default.ensureDir(Nn.data),await Wn.default.writeJson(e.filePath,t,{spaces:2}),await Wn.default.chmod(e.filePath,384)}static async getSession(){if(!(await Wn.default.pathExists(e.filePath)))return null;try{return await Wn.default.readJson(e.filePath)}catch(t){return null}}static async clearSession(){await Wn.default.pathExists(e.filePath)&&await Wn.default.remove(e.filePath)}static async getValidSession(){const t=await e.getSession();if(!t)return null;const n=t.access_token.split(".")[1];return 1e3*JSON.parse(Buffer.from(n,"base64").toString("utf8")).exp<Date.now()?(await e.clearSession(),null):t}};function kn(e,t){return null!==e&&"object"==typeof e&&"$typeName"in e&&"string"==typeof e.$typeName&&(void 0===t||t.typeName===e.$typeName)}function Fn(){let e=0,t=0;for(let r=0;r<28;r+=7){let n=this.buf[this.pos++];if(e|=(127&n)<<r,!(128&n))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(15&n)<<28,t=(112&n)>>4,!(128&n))return this.assertBounds(),[e,t];for(let r=3;r<=31;r+=7){let n=this.buf[this.pos++];if(t|=(127&n)<<r,!(128&n))return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function _n(e,t,n){for(let i=0;i<28;i+=7){const r=e>>>i,s=!(r>>>7==0&&0==t),o=255&(s?128|r:r);if(n.push(o),!s)return}const r=e>>>28&15|(7&t)<<4,s=!!(t>>3);if(n.push(255&(s?128|r:r)),s){for(let e=3;e<31;e+=7){const r=t>>>e,s=!(r>>>7==0),i=255&(s?128|r:r);if(n.push(i),!s)return}n.push(t>>>31&1)}}!function(e){e[e.Canceled=1]="Canceled",e[e.Unknown=2]="Unknown",e[e.InvalidArgument=3]="InvalidArgument",e[e.DeadlineExceeded=4]="DeadlineExceeded",e[e.NotFound=5]="NotFound",e[e.AlreadyExists=6]="AlreadyExists",e[e.PermissionDenied=7]="PermissionDenied",e[e.ResourceExhausted=8]="ResourceExhausted",e[e.FailedPrecondition=9]="FailedPrecondition",e[e.Aborted=10]="Aborted",e[e.OutOfRange=11]="OutOfRange",e[e.Unimplemented=12]="Unimplemented",e[e.Internal=13]="Internal",e[e.Unavailable=14]="Unavailable",e[e.DataLoss=15]="DataLoss",e[e.Unauthenticated=16]="Unauthenticated"}(Pt||(Pt={})),function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"}(Qt||(Qt={}));var Yn=4294967296;function Hn(e){const t="-"===e[0];t&&(e=e.slice(1));const n=1e6;let r=0,s=0;function i(t,i){const o=Number(e.slice(t,i));s*=n,r=r*n+o,r>=Yn&&(s+=r/Yn|0,r%=Yn)}return i(-24,-18),i(-18,-12),i(-12,-6),i(-6),t?On(r,s):Tn(r,s)}function Ln(e,t){if(({lo:e,hi:t}=function(e,t){return{lo:e>>>0,hi:t>>>0}}(e,t)),t<=2097151)return String(Yn*t+e);const n=16777215&(e>>>24|t<<8),r=t>>16&65535;let s=(16777215&e)+6777216*n+6710656*r,i=n+8147497*r,o=2*r;const a=1e7;return s>=a&&(i+=Math.floor(s/a),s%=a),i>=a&&(o+=Math.floor(i/a),i%=a),o.toString()+Mn(i)+Mn(s)}function Tn(e,t){return{lo:0|e,hi:0|t}}function On(e,t){return t=~t,e?e=1+~e:t+=1,Tn(e,t)}var Mn=e=>{const t=String(e);return"0000000".slice(t.length)+t};function Kn(e,t){if(e>=0){for(;e>127;)t.push(127&e|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(127&e|128),e>>=7;t.push(1)}}function Un(){let e=this.buf[this.pos++],t=127&e;if(!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<7,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<14,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<21,!(128&e))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(15&e)<<28;for(let n=5;128&e&&n<10;n++)e=this.buf[this.pos++];if(128&e)throw new Error("invalid varint");return this.assertBounds(),t>>>0}var zn=/* @__PURE__ */Dn();function Dn(){const e=/* @__PURE__ */new DataView(/* @__PURE__ */new ArrayBuffer(8));if("function"==typeof BigInt&&"function"==typeof e.getBigInt64&&"function"==typeof e.getBigUint64&&"function"==typeof e.setBigInt64&&"function"==typeof e.setBigUint64&&(globalThis.Deno||"object"!=typeof process||"object"!=typeof process.env||"1"!==process.env.BUF_BIGINT_DISABLE)){const t=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),r=BigInt("0"),s=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(e){const r="bigint"==typeof e?e:BigInt(e);if(r>n||r<t)throw new Error(`invalid int64: ${e}`);return r},uParse(e){const t="bigint"==typeof e?e:BigInt(e);if(t>s||t<r)throw new Error(`invalid uint64: ${e}`);return t},enc(t){return e.setBigInt64(0,this.parse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(t){return e.setBigInt64(0,this.uParse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec:(t,n)=>(e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigInt64(0,!0)),uDec:(t,n)=>(e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigUint64(0,!0))}}return{zero:"0",supported:!1,parse:e=>("string"!=typeof e&&(e=e.toString()),jn(e),e),uParse:e=>("string"!=typeof e&&(e=e.toString()),Pn(e),e),enc:e=>("string"!=typeof e&&(e=e.toString()),jn(e),Hn(e)),uEnc:e=>("string"!=typeof e&&(e=e.toString()),Pn(e),Hn(e)),dec:(e,t)=>function(e,t){let n=Tn(e,t);const r=2147483648&n.hi;r&&(n=On(n.lo,n.hi));const s=Ln(n.lo,n.hi);return r?"-"+s:s}(e,t),uDec:(e,t)=>Ln(e,t)}}function jn(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function Pn(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}function Qn(e,t){switch(e){case Qt.STRING:return"";case Qt.BOOL:return!1;case Qt.DOUBLE:case Qt.FLOAT:return 0;case Qt.INT64:case Qt.UINT64:case Qt.SFIXED64:case Qt.FIXED64:case Qt.SINT64:return t?"0":zn.zero;case Qt.BYTES:return new Uint8Array(0);default:return 0}}var $n=Symbol.for("reflect unsafe local");function qn(e,t){const n=e[t.localName].case;return void 0===n?n:t.fields.find(e=>e.localName===n)}function er(e,t){const n=t.localName;if(t.oneof)return e[t.oneof.localName].case===n;if(2!=t.presence)return void 0!==e[n]&&Object.prototype.hasOwnProperty.call(e,n);switch(t.fieldKind){case"list":return e[n].length>0;case"map":return Object.keys(e[n]).length>0;case"scalar":return!function(e,t){switch(e){case Qt.BOOL:return!1===t;case Qt.STRING:return""===t;case Qt.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return 0==t}}(t.scalar,e[n]);case"enum":return e[n]!==t.enum.values[0].number}throw new Error("message field with implicit presence")}function tr(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&void 0!==e[t]}function nr(e,t){if(t.oneof){const n=e[t.oneof.localName];return n.case===t.localName?n.value:void 0}return e[t.localName]}function rr(e,t,n){t.oneof?e[t.oneof.localName]={case:t.localName,value:n}:e[t.localName]=n}function sr(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function ir(e,t){var n,r,s,i;if(sr(e)&&$n in e&&"add"in e&&"field"in e&&"function"==typeof e.field){if(void 0!==t){const o=t,a=e.field();return o.listKind==a.listKind&&o.scalar===a.scalar&&(null===(n=o.message)||void 0===n?void 0:n.typeName)===(null===(r=a.message)||void 0===r?void 0:r.typeName)&&(null===(s=o.enum)||void 0===s?void 0:s.typeName)===(null===(i=a.enum)||void 0===i?void 0:i.typeName)}return!0}return!1}function or(e,t){var n,r,s,i;if(sr(e)&&$n in e&&"has"in e&&"field"in e&&"function"==typeof e.field){if(void 0!==t){const o=t,a=e.field();return o.mapKey===a.mapKey&&o.mapKind==a.mapKind&&o.scalar===a.scalar&&(null===(n=o.message)||void 0===n?void 0:n.typeName)===(null===(r=a.message)||void 0===r?void 0:r.typeName)&&(null===(s=o.enum)||void 0===s?void 0:s.typeName)===(null===(i=a.enum)||void 0===i?void 0:i.typeName)}return!0}return!1}function ar(e,t){return sr(e)&&$n in e&&"desc"in e&&sr(e.desc)&&"message"===e.desc.kind&&(void 0===t||e.desc.typeName==t.typeName)}function cr(e){const t=e.fields[0];return lr(e.typeName)&&void 0!==t&&"scalar"==t.fieldKind&&"value"==t.name&&1==t.number}function lr(e){return e.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(e.substring(16))}function ur(e,t){if(kn(t,e))return t;const n=function(e){let t;if(function(e){switch(e.file.edition){case 999:return!1;case 998:return!0;default:return e.fields.some(e=>2!=e.presence&&"message"!=e.fieldKind&&!e.oneof)}}(e)){const n=br.get(e);let r,s;if(n)({prototype:r,members:s}=n);else{r={},s=/* @__PURE__ */new Set;for(const t of e.members)"oneof"!=t.kind&&("scalar"!=t.fieldKind&&"enum"!=t.fieldKind||2!=t.presence&&(s.add(t),r[t.localName]=Ir(t)));br.set(e,{prototype:r,members:s})}t=Object.create(r),t.$typeName=e.typeName;for(const i of e.members)if(!s.has(i)){if("field"==i.kind){if("message"==i.fieldKind)continue;if(("scalar"==i.fieldKind||"enum"==i.fieldKind)&&2!=i.presence)continue}t[i.localName]=Ir(i)}}else{t={$typeName:e.typeName};for(const n of e.members)"oneof"!=n.kind&&2!=n.presence||(t[n.localName]=Ir(n))}return t}(e);return void 0!==t&&function(e,t,n){for(const r of e.members){let e,s=n[r.localName];if(null!=s){if("oneof"==r.kind){const t=qn(n,r);if(!t)continue;e=t,s=nr(n,t)}else e=r;switch(e.fieldKind){case"message":s=gr(e,s);break;case"scalar":s=dr(e,s);break;case"list":s=mr(e,s);break;case"map":s=hr(e,s)}rr(t,e,s)}}}(e,n,t),n}function dr(e,t){return e.scalar==Qt.BYTES?pr(t):t}function hr(e,t){if(sr(t)){if(e.scalar==Qt.BYTES)return fr(t,pr);if("message"==e.mapKind)return fr(t,t=>gr(e,t))}return t}function mr(e,t){if(Array.isArray(t)){if(e.scalar==Qt.BYTES)return t.map(pr);if("message"==e.listKind)return t.map(t=>gr(e,t))}return t}function gr(e,t){if("message"==e.fieldKind&&!e.oneof&&cr(e.message))return dr(e.message.fields[0],t);if(sr(t)){if("google.protobuf.Struct"==e.message.typeName&&"google.protobuf.Value"!==e.parent.typeName)return t;if(!kn(t,e.message))return ur(e.message,t)}return t}function pr(e){return Array.isArray(e)?new Uint8Array(e):e}function fr(e,t){const n={};for(const r of Object.entries(e))n[r[0]]=t(r[1]);return n}var yr=Symbol(),br=/* @__PURE__ */new WeakMap;function Ir(e){if("oneof"==e.kind)return{case:void 0};if("list"==e.fieldKind)return[];if("map"==e.fieldKind)return{};if("message"==e.fieldKind)return yr;const t=e.getDefaultValue();return void 0!==t?"scalar"==e.fieldKind&&e.longAsString?t.toString():t:"scalar"==e.fieldKind?Qn(e.scalar,e.longAsString):e.enum.values[0].number}var wr=["FieldValueInvalidError","FieldListRangeError","ForeignFieldError"],vr=class extends Error{constructor(e,t,n="FieldValueInvalidError"){super(t),this.name=n,this.field=()=>e}};var Gr,Ar=Symbol.for("@bufbuild/protobuf/text-encoding");function Sr(){if(null==globalThis[Ar]){const e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[Ar]={encodeUtf8:t=>e.encode(t),decodeUtf8:e=>t.decode(e),checkUtf8(e){try{return!0}catch(U){return!1}}}}return globalThis[Ar]}!function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"}(Gr||(Gr={}));var Zr=class{constructor(e=Sr().encodeUtf8){this.encodeUtf8=e,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let e=0;for(let r=0;r<this.chunks.length;r++)e+=this.chunks[r].length;let t=new Uint8Array(e),n=0;for(let r=0;r<this.chunks.length;r++)t.set(this.chunks[r],n),n+=this.chunks[r].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(Er(e);e>127;)this.buf.push(127&e|128),e>>>=7;return this.buf.push(e),this}int32(e){return Vr(e),Kn(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.encodeUtf8(e);return this.uint32(t.byteLength),this.raw(t)}float(e){!function(e){if("string"==typeof e){const t=e;if(e=Number(e),Number.isNaN(e)&&"NaN"!==t)throw new Error("invalid float32: "+t)}else if("number"!=typeof e)throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw new Error("invalid float32: "+e)}(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){Er(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){Vr(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return Vr(e),Kn(e=(e<<1^e>>31)>>>0,this.buf),this}sfixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=zn.enc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=zn.uEnc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}int64(e){let t=zn.enc(e);return _n(t.lo,t.hi,this.buf),this}sint64(e){const t=zn.enc(e),n=t.hi>>31;return _n(t.lo<<1^n,(t.hi<<1|t.lo>>>31)^n,this.buf),this}uint64(e){const t=zn.uEnc(e);return _n(t.lo,t.hi,this.buf),this}},Cr=class{constructor(e,t=Sr().decodeUtf8){this.decodeUtf8=t,this.varint64=Fn,this.uint32=Un,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),t=e>>>3,n=7&e;if(t<=0||n<0||n>5)throw new Error("illegal tag: field no "+t+" wire type "+n);return[t,n]}skip(e,t){let n=this.pos;switch(e){case Gr.Varint:for(;128&this.buf[this.pos++];);break;case Gr.Bit64:this.pos+=4;case Gr.Bit32:this.pos+=4;break;case Gr.LengthDelimited:let n=this.uint32();this.pos+=n;break;case Gr.StartGroup:for(;;){const[e,n]=this.tag();if(n===Gr.EndGroup){if(void 0!==t&&e!==t)throw new Error("invalid end group tag");break}this.skip(n,e)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){let e=this.uint32();return e>>>1^-(1&e)}int64(){return zn.dec(...this.varint64())}uint64(){return zn.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),n=-(1&e);return e=(e>>>1|(1&t)<<31)^n,t=t>>>1^n,zn.dec(e,t)}bool(){let[e,t]=this.varint64();return 0!==e||0!==t}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return zn.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return zn.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.decodeUtf8(this.bytes())}};function Vr(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw new Error("invalid int32: "+e)}function Er(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw new Error("invalid uint32: "+e)}function Xr(e,t){const n="list"==e.fieldKind?ir(t,e):"map"==e.fieldKind?or(t,e):xr(e,t);if(!0===n)return;let r;switch(e.fieldKind){case"list":r=`expected ${kr(e)}, got ${Nr(t)}`;break;case"map":r=`expected ${Fr(e)}, got ${Nr(t)}`;break;default:r=Wr(e,t,n)}return new vr(e,r)}function Br(e,t,n){const r=xr(e,n);if(!0!==r)return new vr(e,`list item #${t+1}: ${Wr(e,n,r)}`)}function xr(e,t){return void 0!==e.scalar?Rr(t,e.scalar):void 0!==e.enum?e.enum.open?Number.isInteger(t):e.enum.values.some(e=>e.number===t):ar(t,e.message)}function Rr(e,t){switch(t){case Qt.DOUBLE:return"number"==typeof e;case Qt.FLOAT:return"number"==typeof e&&(!(!Number.isNaN(e)&&Number.isFinite(e))||(!(e>34028234663852886e22||e<-34028234663852886e22)||`${e.toFixed()} out of range`));case Qt.INT32:case Qt.SFIXED32:case Qt.SINT32:return!("number"!=typeof e||!Number.isInteger(e))&&(!(e>2147483647||e<-2147483648)||`${e.toFixed()} out of range`);case Qt.FIXED32:case Qt.UINT32:return!("number"!=typeof e||!Number.isInteger(e))&&(!(e>4294967295||e<0)||`${e.toFixed()} out of range`);case Qt.BOOL:return"boolean"==typeof e;case Qt.STRING:return"string"==typeof e&&(Sr().checkUtf8(e)||"invalid UTF8");case Qt.BYTES:return e instanceof Uint8Array;case Qt.INT64:case Qt.SFIXED64:case Qt.SINT64:if("bigint"==typeof e||"number"==typeof e||"string"==typeof e&&e.length>0)try{return zn.parse(e),!0}catch(U){return`${e} out of range`}return!1;case Qt.FIXED64:case Qt.UINT64:if("bigint"==typeof e||"number"==typeof e||"string"==typeof e&&e.length>0)try{return zn.uParse(e),!0}catch(U){return`${e} out of range`}return!1}}function Wr(e,t,n){return n="string"==typeof n?`: ${n}`:`, got ${Nr(t)}`,void 0!==e.scalar?`expected ${function(e){switch(e){case Qt.STRING:return"string";case Qt.BOOL:return"boolean";case Qt.INT64:case Qt.SINT64:case Qt.SFIXED64:return"bigint (int64)";case Qt.UINT64:case Qt.FIXED64:return"bigint (uint64)";case Qt.BYTES:return"Uint8Array";case Qt.DOUBLE:return"number (float64)";case Qt.FLOAT:return"number (float32)";case Qt.FIXED32:case Qt.UINT32:return"number (uint32)";case Qt.INT32:case Qt.SFIXED32:case Qt.SINT32:return"number (int32)"}}(e.scalar)}`+n:void 0!==e.enum?`expected ${e.enum.toString()}`+n:`expected ${Jr(e.message)}`+n}function Nr(e){switch(typeof e){case"object":return null===e?"null":e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:ir(e)?kr(e.field()):or(e)?Fr(e.field()):ar(e)?Jr(e.desc):kn(e)?`message ${e.$typeName}`:"object";case"string":return e.length>30?"string":`"${e.split('"').join('\\"')}"`;case"boolean":case"number":return String(e);case"bigint":return String(e)+"n";default:return typeof e}}function Jr(e){return`ReflectMessage (${e.typeName})`}function kr(e){switch(e.listKind){case"message":return`ReflectList (${e.message.toString()})`;case"enum":return`ReflectList (${e.enum.toString()})`;case"scalar":return`ReflectList (${Qt[e.scalar]})`}}function Fr(e){switch(e.mapKind){case"message":return`ReflectMap (${Qt[e.mapKey]}, ${e.message.toString()})`;case"enum":return`ReflectMap (${Qt[e.mapKey]}, ${e.enum.toString()})`;case"scalar":return`ReflectMap (${Qt[e.mapKey]}, ${Qt[e.scalar]})`}}function _r(e,t,n=!0){return new Hr(e,t,n)}var Yr=/* @__PURE__ */new WeakMap,Hr=class{get sortedFields(){const e=Yr.get(this.desc);if(e)return e;const t=this.desc.fields.concat().sort((e,t)=>e.number-t.number);return Yr.set(this.desc,t),t}constructor(e,t,n=!0){this.lists=/* @__PURE__ */new Map,this.maps=/* @__PURE__ */new Map,this.check=n,this.desc=e,this.message=this[$n]=null!=t?t:ur(e),this.fields=e.fields,this.oneofs=e.oneofs,this.members=e.members}findNumber(e){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(e=>[e.number,e]))),this._fieldsByNumber.get(e)}oneofCase(e){return Lr(this.message,e),qn(this.message,e)}isSet(e){return Lr(this.message,e),er(this.message,e)}clear(e){Lr(this.message,e),function(e,t){const n=t.localName;if(t.oneof){const r=t.oneof.localName;e[r].case===n&&(e[r]={case:void 0})}else if(2!=t.presence)delete e[n];else switch(t.fieldKind){case"map":e[n]={};break;case"list":e[n]=[];break;case"enum":e[n]=t.enum.values[0].number;break;case"scalar":e[n]=Qn(t.scalar,t.longAsString)}}(this.message,e)}get(e){Lr(this.message,e);const t=nr(this.message,e);switch(e.fieldKind){case"list":let n=this.lists.get(e);return n&&n[$n]===t||this.lists.set(e,n=new Kr(e,t,this.check)),n;case"map":let r=this.maps.get(e);return r&&r[$n]===t||this.maps.set(e,r=new Ur(e,t,this.check)),r;case"message":return Dr(e,t,this.check);case"scalar":return void 0===t?Qn(e.scalar,!1):es(e,t);case"enum":return null!=t?t:e.enum.values[0].number}}set(e,t){if(Lr(this.message,e),this.check){const n=Xr(e,t);if(n)throw n}let n;n="message"==e.fieldKind?zr(e,t):or(t)||ir(t)?t[$n]:ts(e,t),rr(this.message,e,n)}getUnknown(){return this.message.$unknown}setUnknown(e){this.message.$unknown=e}};function Lr(e,t){if(t.parent.typeName!==e.$typeName)throw new vr(t,`cannot use ${t.toString()} with message ${e.$typeName}`,"ForeignFieldError")}var Tr,Or,Mr,Kr=class{field(){return this._field}get size(){return this._arr.length}constructor(e,t,n){this._field=e,this._arr=this[$n]=t,this.check=n}get(e){const t=this._arr[e];return void 0===t?void 0:Pr(this._field,t,this.check)}set(e,t){if(e<0||e>=this._arr.length)throw new vr(this._field,`list item #${e+1}: out of range`);if(this.check){const n=Br(this._field,e,t);if(n)throw n}this._arr[e]=jr(this._field,t)}add(e){if(this.check){const t=Br(this._field,this._arr.length,e);if(t)throw t}this._arr.push(jr(this._field,e))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const e of this._arr)yield Pr(this._field,e,this.check)}*entries(){for(let e=0;e<this._arr.length;e++)yield[e,Pr(this._field,this._arr[e],this.check)]}},Ur=class{constructor(e,t,n=!0){this.obj=this[$n]=null!=t?t:{},this.check=n,this._field=e}field(){return this._field}set(e,t){if(this.check){const n=function(e,t,n){const r=Rr(t,e.mapKey);if(!0!==r)return new vr(e,`invalid map key: ${Wr({scalar:e.mapKey},t,r)}`);const s=xr(e,n);return!0!==s?new vr(e,`map entry ${Nr(t)}: ${Wr(e,n,s)}`):void 0}(this._field,e,t);if(n)throw n}return this.obj[$r(e)]=function(e,t){return"message"==e.mapKind?zr(e,t):ts(e,t)}(this._field,t),this}delete(e){const t=$r(e),n=Object.prototype.hasOwnProperty.call(this.obj,t);return n&&delete this.obj[t],n}clear(){for(const e of Object.keys(this.obj))delete this.obj[e]}get(e){let t=this.obj[$r(e)];return void 0!==t&&(t=Qr(this._field,t,this.check)),t}has(e){return Object.prototype.hasOwnProperty.call(this.obj,$r(e))}*keys(){for(const e of Object.keys(this.obj))yield qr(e,this._field.mapKey)}*entries(){for(const e of Object.entries(this.obj))yield[qr(e[0],this._field.mapKey),Qr(this._field,e[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const e of Object.values(this.obj))yield Qr(this._field,e,this.check)}forEach(e,t){for(const n of this.entries())e.call(t,n[1],n[0],this)}};function zr(e,t){return ar(t)?lr(t.message.$typeName)&&!e.oneof&&"message"==e.fieldKind?t.message.value:"google.protobuf.Struct"==t.desc.typeName&&"google.protobuf.Value"!=e.parent.typeName?rs(t.message):t.message:t}function Dr(e,t,n){return void 0!==t&&(cr(e.message)&&!e.oneof&&"message"==e.fieldKind?t={$typeName:e.message.typeName,value:es(e.message.fields[0],t)}:"google.protobuf.Struct"==e.message.typeName&&"google.protobuf.Value"!=e.parent.typeName&&sr(t)&&(t=ns(t))),new Hr(e.message,t,n)}function jr(e,t){return"message"==e.listKind?zr(e,t):ts(e,t)}function Pr(e,t,n){return"message"==e.listKind?Dr(e,t,n):es(e,t)}function Qr(e,t,n){return"message"==e.mapKind?Dr(e,t,n):t}function $r(e){return"string"==typeof e||"number"==typeof e?e:String(e)}function qr(e,t){switch(t){case Qt.STRING:return e;case Qt.INT32:case Qt.FIXED32:case Qt.UINT32:case Qt.SFIXED32:case Qt.SINT32:{const t=Number.parseInt(e);if(Number.isFinite(t))return t;break}case Qt.BOOL:switch(e){case"true":return!0;case"false":return!1}break;case Qt.UINT64:case Qt.FIXED64:try{return zn.uParse(e)}catch(n){}break;default:try{return zn.parse(e)}catch(r){}}return e}function es(e,t){switch(e.scalar){case Qt.INT64:case Qt.SFIXED64:case Qt.SINT64:"longAsString"in e&&e.longAsString&&"string"==typeof t&&(t=zn.parse(t));break;case Qt.FIXED64:case Qt.UINT64:"longAsString"in e&&e.longAsString&&"string"==typeof t&&(t=zn.uParse(t))}return t}function ts(e,t){switch(e.scalar){case Qt.INT64:case Qt.SFIXED64:case Qt.SINT64:"longAsString"in e&&e.longAsString?t=String(t):"string"!=typeof t&&"number"!=typeof t||(t=zn.parse(t));break;case Qt.FIXED64:case Qt.UINT64:"longAsString"in e&&e.longAsString?t=String(t):"string"!=typeof t&&"number"!=typeof t||(t=zn.uParse(t))}return t}function ns(e){const t={$typeName:"google.protobuf.Struct",fields:{}};if(sr(e))for(const[n,r]of Object.entries(e))t.fields[n]=is(r);return t}function rs(e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=ss(r);return t}function ss(e){switch(e.kind.case){case"structValue":return rs(e.kind.value);case"listValue":return e.kind.value.values.map(ss);case"nullValue":case void 0:return null;default:return e.kind.value}}function is(e){const t={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof e){case"number":t.kind={case:"numberValue",value:e};break;case"string":t.kind={case:"stringValue",value:e};break;case"boolean":t.kind={case:"boolValue",value:e};break;case"object":if(null===e)t.kind={case:"nullValue",value:0};else if(Array.isArray(e)){const n={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(e))for(const t of e)n.values.push(is(t));t.kind={case:"listValue",value:n}}else t.kind={case:"structValue",value:ns(e)}}return t}function os(e){const t=function(){if(!Mr){Mr=[];const e=cs("std");for(let t=0;t<e.length;t++)Mr[e[t].charCodeAt(0)]=t;Mr["-".charCodeAt(0)]=e.indexOf("+"),Mr["_".charCodeAt(0)]=e.indexOf("/")}return Mr}();let n=3*e.length/4;"="==e[e.length-2]?n-=2:"="==e[e.length-1]&&(n-=1);let r,s=new Uint8Array(n),i=0,o=0,a=0;for(let c=0;c<e.length;c++){if(r=t[e.charCodeAt(c)],void 0===r)switch(e[c]){case"=":o=0;case"\n":case"\r":case"\t":case" ":continue;default:throw Error("invalid base64 string")}switch(o){case 0:a=r,o=1;break;case 1:s[i++]=a<<2|(48&r)>>4,a=r,o=2;break;case 2:s[i++]=(15&a)<<4|(60&r)>>2,a=r,o=3;break;case 3:s[i++]=(3&a)<<6|r,o=0}}if(1==o)throw Error("invalid base64 string");return s.subarray(0,i)}function as(e,t="std"){const n=cs(t),r="std"==t;let s,i="",o=0,a=0;for(let c=0;c<e.length;c++)switch(s=e[c],o){case 0:i+=n[s>>2],a=(3&s)<<4,o=1;break;case 1:i+=n[a|s>>4],a=(15&s)<<2,o=2;break;case 2:i+=n[a|s>>6],i+=n[63&s],o=0}return o&&(i+=n[a],r&&(i+="=",1==o&&(i+="="))),i}function cs(e){return Tr||(Tr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Or=Tr.slice(0,-2).concat("-","_")),"url"==e?Or:Tr}function ls(e){let t=!1;const n=[];for(let r=0;r<e.length;r++){let s=e.charAt(r);switch(s){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n.push(s),t=!1;break;default:t&&(t=!1,s=s.toUpperCase()),n.push(s)}}return n.join("")}function us(e){return e.replace(/[A-Z]/g,e=>"_"+e.toLowerCase())}var ds=new Set(["constructor","toString","toJSON","valueOf"]);function hs(e){return ds.has(e)?e+"$":e}function ms(e){for(const t of e.field)tr(t,"jsonName")||(t.jsonName=ls(t.name));e.nestedType.forEach(ms)}function gs(e,t){switch(e){case Qt.STRING:return t;case Qt.BYTES:{const n=function(e){const t=[],n={tail:e,c:"",next(){return 0!=this.tail.length&&(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(e){if(this.tail.length>=e){const t=this.tail.substring(0,e);return this.tail=this.tail.substring(e),t}return!1}};for(;n.next();)if("\\"===n.c){if(n.next())switch(n.c){case"\\":t.push(n.c.charCodeAt(0));break;case"b":t.push(8);break;case"f":t.push(12);break;case"n":t.push(10);break;case"r":t.push(13);break;case"t":t.push(9);break;case"v":t.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{const e=n.c,r=n.take(2);if(!1===r)return!1;const s=parseInt(e+r,8);if(Number.isNaN(s))return!1;t.push(s);break}case"x":{const e=n.c,r=n.take(2);if(!1===r)return!1;const s=parseInt(e+r,16);if(Number.isNaN(s))return!1;t.push(s);break}case"u":{const e=n.c,r=n.take(4);if(!1===r)return!1;const s=parseInt(e+r,16);if(Number.isNaN(s))return!1;const i=new Uint8Array(4);new DataView(i.buffer).setInt32(0,s,!0),t.push(i[0],i[1],i[2],i[3]);break}case"U":{const e=n.c,r=n.take(8);if(!1===r)return!1;const s=zn.uEnc(e+r),i=new Uint8Array(8),o=new DataView(i.buffer);o.setInt32(0,s.lo,!0),o.setInt32(4,s.hi,!0),t.push(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);break}}}else t.push(n.c.charCodeAt(0));return new Uint8Array(t)}(t);if(!1===n)throw new Error(`cannot parse ${Qt[e]} default value: ${t}`);return n}case Qt.INT64:case Qt.SFIXED64:case Qt.SINT64:return zn.parse(t);case Qt.UINT64:case Qt.FIXED64:return zn.uParse(t);case Qt.DOUBLE:case Qt.FLOAT:switch(t){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return NaN;default:return parseFloat(t)}case Qt.BOOL:return"true"===t;case Qt.INT32:case Qt.UINT32:case Qt.SINT32:case Qt.FIXED32:case Qt.SFIXED32:return parseInt(t,10)}}function*ps(e){switch(e.kind){case"file":for(const t of e.messages)yield t,yield*ps(t);yield*e.enums,yield*e.services,yield*e.extensions;break;case"message":for(const t of e.nestedMessages)yield t,yield*ps(t);yield*e.nestedEnums,yield*e.nestedExtensions}}function fs(...e){const t=function(){const e=/* @__PURE__ */new Map,t=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map;return{kind:"registry",types:e,extendees:t,[Symbol.iterator]:()=>e.values(),get files(){return n.values()},addFile(e,t,r){if(n.set(e.proto.name,e),!t)for(const n of ps(e))this.add(n);if(r)for(const n of e.dependencies)this.addFile(n,t,r)},add(n){if("extension"==n.kind){let e=t.get(n.extendee.typeName);e||t.set(n.extendee.typeName,e=/* @__PURE__ */new Map),e.set(n.number,n)}e.set(n.typeName,n)},get:t=>e.get(t),getFile:e=>n.get(e),getMessage(t){const n=e.get(t);return"message"==(null==n?void 0:n.kind)?n:void 0},getEnum(t){const n=e.get(t);return"enum"==(null==n?void 0:n.kind)?n:void 0},getExtension(t){const n=e.get(t);return"extension"==(null==n?void 0:n.kind)?n:void 0},getExtensionFor(e,n){var r;return null===(r=t.get(e.typeName))||void 0===r?void 0:r.get(n)},getService(t){const n=e.get(t);return"service"==(null==n?void 0:n.kind)?n:void 0}}}();if(!e.length)return t;if("$typeName"in e[0]&&"google.protobuf.FileDescriptorSet"==e[0].$typeName){for(const n of e[0].file)Js(n,t);return t}if("$typeName"in e[0]){const r=e[0],s=e[1],i=/* @__PURE__ */new Set;function o(e){const n=[];for(const r of e.dependency){if(null!=t.getFile(r))continue;if(i.has(r))continue;const o=s(r);if(!o)throw new Error(`Unable to resolve ${r}, imported by ${e.name}`);"kind"in o?t.addFile(o,!1,!0):(i.add(o.name),n.push(o))}return n.concat(...n.map(o))}for(const a of[r,...o(r)].reverse())Js(a,t)}else for(const c of e)for(const l of c.files)t.addFile(l);return t}var ys=998,bs=999,Is=9,ws=10,vs=11,Gs=12,As=14,Ss=3,Zs=2,Cs=1,Vs=0,Es=1,Xs=2,Bs=3,xs=1,Rs=2,Ws=1,Ns={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function Js(e,t){var n,r;const s={kind:"file",proto:e,deprecated:null!==(r=null===(n=e.options)||void 0===n?void 0:n.deprecated)&&void 0!==r&&r,edition:Os(e),name:e.name.replace(/\.proto$/,""),dependencies:Ms(e,t),enums:[],messages:[],extensions:[],services:[],toString:()=>`file ${e.name}`},i=/* @__PURE__ */new Map,o={get:e=>i.get(e),add(e){var t;Qs(!0===(null===(t=e.proto.options)||void 0===t?void 0:t.mapEntry)),i.set(e.typeName,e)}};for(const a of e.enumType)_s(a,s,void 0,t);for(const a of e.messageType)Ys(a,s,void 0,t,o);for(const a of e.service)Hs(a,s,t);ks(s,t);for(const a of i.values())Fs(a,t,o);for(const a of s.messages)Fs(a,t,o),ks(a,t);t.addFile(s,!0)}function ks(e,t){switch(e.kind){case"file":for(const n of e.proto.extension){const r=Ts(n,e,t);e.extensions.push(r),t.add(r)}break;case"message":for(const n of e.proto.extension){const r=Ts(n,e,t);e.nestedExtensions.push(r),t.add(r)}for(const n of e.nestedMessages)ks(n,t)}}function Fs(e,t,n){const r=e.proto.oneofDecl.map(t=>function(e,t){return{kind:"oneof",proto:e,deprecated:!1,parent:t,fields:[],name:e.name,localName:hs(ls(e.name)),toString(){return`oneof ${t.typeName}.${this.name}`}}}(t,e)),s=/* @__PURE__ */new Set;for(const i of e.proto.field){const o=zs(i,r),a=Ts(i,e,t,o,n);e.fields.push(a),e.field[a.localName]=a,void 0===o?e.members.push(a):(o.fields.push(a),s.has(o)||(s.add(o),e.members.push(o)))}for(const i of r.filter(e=>s.has(e)))e.oneofs.push(i);for(const i of e.nestedMessages)Fs(i,t,n)}function _s(e,t,n,r){var s,i,o,a,c;const l=function(e,t){const n=(r=e,(r.substring(0,1)+r.substring(1).replace(/[A-Z]/g,e=>"_"+e)).toLowerCase()+"_");var r;for(const s of t){if(!s.name.toLowerCase().startsWith(n))return;const e=s.name.substring(n.length);if(0==e.length)return;if(/^\d/.test(e))return}return n}(e.name,e.value),u={kind:"enum",proto:e,deprecated:null!==(i=null===(s=e.options)||void 0===s?void 0:s.deprecated)&&void 0!==i&&i,file:t,parent:n,open:!0,name:e.name,typeName:Ks(e,n,t),value:{},values:[],sharedPrefix:l,toString(){return`enum ${this.typeName}`}};u.open=function(e){var t;return Ws==Ps("enumType",{proto:e.proto,parent:null!==(t=e.parent)&&void 0!==t?t:e.file})}(u),r.add(u);for(const d of e.value){const e=d.name;u.values.push(u.value[d.number]={kind:"enum_value",proto:d,deprecated:null!==(a=null===(o=d.options)||void 0===o?void 0:o.deprecated)&&void 0!==a&&a,parent:u,name:e,localName:hs(null==l?e:e.substring(l.length)),number:d.number,toString:()=>`enum value ${u.typeName}.${e}`})}(null!==(c=null==n?void 0:n.nestedEnums)&&void 0!==c?c:t.enums).push(u)}function Ys(e,t,n,r,s){var i,o,a,c;const l={kind:"message",proto:e,deprecated:null!==(o=null===(i=e.options)||void 0===i?void 0:i.deprecated)&&void 0!==o&&o,file:t,parent:n,name:e.name,typeName:Ks(e,n,t),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};!0===(null===(a=e.options)||void 0===a?void 0:a.mapEntry)?s.add(l):((null!==(c=null==n?void 0:n.nestedMessages)&&void 0!==c?c:t.messages).push(l),r.add(l));for(const u of e.enumType)_s(u,t,l,r);for(const u of e.nestedType)Ys(u,t,l,r,s)}function Hs(e,t,n){var r,s;const i={kind:"service",proto:e,deprecated:null!==(s=null===(r=e.options)||void 0===r?void 0:r.deprecated)&&void 0!==s&&s,file:t,name:e.name,typeName:Ks(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};t.services.push(i),n.add(i);for(const o of e.method){const e=Ls(o,i,n);i.methods.push(e),i.method[e.localName]=e}}function Ls(e,t,n){var r,s,i,o;let a;a=e.clientStreaming&&e.serverStreaming?"bidi_streaming":e.clientStreaming?"client_streaming":e.serverStreaming?"server_streaming":"unary";const c=n.getMessage(Us(e.inputType)),l=n.getMessage(Us(e.outputType));Qs(c,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),Qs(l,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);const u=e.name;return{kind:"rpc",proto:e,deprecated:null!==(s=null===(r=e.options)||void 0===r?void 0:r.deprecated)&&void 0!==s&&s,parent:t,name:u,localName:hs(u.length?hs(u[0].toLowerCase()+u.substring(1)):u),methodKind:a,input:c,output:l,idempotency:null!==(o=null===(i=e.options)||void 0===i?void 0:i.idempotencyLevel)&&void 0!==o?o:Vs,toString:()=>`rpc ${t.typeName}.${u}`}}function Ts(e,t,n,r,s){var i,o,a;const c=void 0===s,l={kind:"field",proto:e,deprecated:null!==(o=null===(i=e.options)||void 0===i?void 0:i.deprecated)&&void 0!==o&&o,name:e.name,number:e.number,scalar:void 0,message:void 0,enum:void 0,presence:Ds(e,r,c,t),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(c){const r="file"==t.kind?t:t.file,s="file"==t.kind?void 0:t,i=Ks(e,s,r);l.kind="extension",l.file=r,l.parent=s,l.oneof=void 0,l.typeName=i,l.jsonName=`[${i}]`,l.toString=()=>`extension ${i}`;const o=n.getMessage(Us(e.extendee));Qs(o,`invalid FieldDescriptorProto: extendee ${e.extendee} not found`),l.extendee=o}else{const n=t;Qs("message"==n.kind),l.parent=n,l.oneof=r,l.localName=r?ls(e.name):hs(ls(e.name)),l.jsonName=e.jsonName,l.toString=()=>`field ${n.typeName}.${e.name}`}const u=e.label,d=e.type,h=null===(a=e.options)||void 0===a?void 0:a.jstype;if(u===Ss){const r=d==vs?null==s?void 0:s.get(Us(e.typeName)):void 0;if(r){l.fieldKind="map";const{key:e,value:t}=function(e){const t=e.fields.find(e=>1===e.number),n=e.fields.find(e=>2===e.number);return Qs(t&&"scalar"==t.fieldKind&&t.scalar!=Qt.BYTES&&t.scalar!=Qt.FLOAT&&t.scalar!=Qt.DOUBLE&&n&&"list"!=n.fieldKind&&"map"!=n.fieldKind),{key:t,value:n}}(r);return l.mapKey=e.scalar,l.mapKind=t.fieldKind,l.message=t.message,l.delimitedEncoding=!1,l.enum=t.enum,l.scalar=t.scalar,l}switch(l.fieldKind="list",d){case vs:case ws:l.listKind="message",l.message=n.getMessage(Us(e.typeName)),Qs(l.message),l.delimitedEncoding=js(e,t);break;case As:l.listKind="enum",l.enum=n.getEnum(Us(e.typeName)),Qs(l.enum);break;default:l.listKind="scalar",l.scalar=d,l.longAsString=h==Cs}return l.packed=function(e,t){if(e.label!=Ss)return!1;switch(e.type){case Is:case Gs:case ws:case vs:return!1}const n=e.options;return n&&tr(n,"packed")?n.packed:xs==Ps("repeatedFieldEncoding",{proto:e,parent:t})}(e,t),l}switch(d){case vs:case ws:l.fieldKind="message",l.message=n.getMessage(Us(e.typeName)),Qs(l.message,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),l.delimitedEncoding=js(e,t),l.getDefaultValue=()=>{};break;case As:{const t=n.getEnum(Us(e.typeName));Qs(void 0!==t,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),l.fieldKind="enum",l.enum=n.getEnum(Us(e.typeName)),l.getDefaultValue=()=>tr(e,"defaultValue")?function(e,t){const n=e.values.find(e=>e.name===t);if(!n)throw new Error(`cannot parse ${e} default value: ${t}`);return n.number}(t,e.defaultValue):void 0;break}default:l.fieldKind="scalar",l.scalar=d,l.longAsString=h==Cs,l.getDefaultValue=()=>tr(e,"defaultValue")?gs(d,e.defaultValue):void 0}return l}function Os(e){switch(e.syntax){case"":case"proto2":return ys;case"proto3":return bs;case"editions":if(e.edition in Ns)return e.edition;throw new Error(`${e.name}: unsupported edition`);default:throw new Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}function Ms(e,t){return e.dependency.map(n=>{const r=t.getFile(n);if(!r)throw new Error(`Cannot find ${n}, imported by ${e.name}`);return r})}function Ks(e,t,n){let r;return r=t?`${t.typeName}.${e.name}`:n.proto.package.length>0?`${n.proto.package}.${e.name}`:`${e.name}`,r}function Us(e){return e.startsWith(".")?e.substring(1):e}function zs(e,t){if(!tr(e,"oneofIndex"))return;if(e.proto3Optional)return;const n=t[e.oneofIndex];return Qs(n,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),n}function Ds(e,t,n,r){if(e.label==Zs)return Bs;if(e.label==Ss)return Xs;if(t||e.proto3Optional)return Es;if(n)return Es;const s=Ps("fieldPresence",{proto:e,parent:r});return s!=Xs||e.type!=vs&&e.type!=ws?s:Es}function js(e,t){return e.type==ws||Rs==Ps("messageEncoding",{proto:e,parent:t})}function Ps(e,t){var n,r;const s=null===(n=t.proto.options)||void 0===n?void 0:n.features;if(s){const t=s[e];if(0!=t)return t}if("kind"in t){if("message"==t.kind)return Ps(e,null!==(r=t.parent)&&void 0!==r?r:t.file);const n=Ns[t.edition];if(!n)throw new Error(`feature default for edition ${t.edition} not found`);return n[e]}return Ps(e,t.parent)}function Qs(e,t){if(!e)throw new Error(t)}function $s(e){const t=function(e){const t=Object.create({syntax:"",edition:0});return Object.assign(t,Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},e),{messageType:e.messageType.map(qs),enumType:e.enumType.map(ni)}))}(e);return t.messageType.forEach(ms),fs(t,()=>{}).getFile(t.name)}function qs(e){var t,n,r,s,i,o,a,c;const l=Object.create({visibility:0});return Object.assign(l,{$typeName:"google.protobuf.DescriptorProto",name:e.name,field:null!==(n=null===(t=e.field)||void 0===t?void 0:t.map(ei))&&void 0!==n?n:[],extension:[],nestedType:null!==(s=null===(r=e.nestedType)||void 0===r?void 0:r.map(qs))&&void 0!==s?s:[],enumType:null!==(o=null===(i=e.enumType)||void 0===i?void 0:i.map(ni))&&void 0!==o?o:[],extensionRange:null!==(c=null===(a=e.extensionRange)||void 0===a?void 0:a.map(e=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},e)))&&void 0!==c?c:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function ei(e){const t=Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1});return Object.assign(t,Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},e),{options:e.options?ti(e.options):void 0}))}function ti(e){var t,n,r;const s=Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0});return Object.assign(s,Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},e),{targets:null!==(t=e.targets)&&void 0!==t?t:[],editionDefaults:null!==(r=null===(n=e.editionDefaults)||void 0===n?void 0:n.map(e=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},e)))&&void 0!==r?r:[],uninterpretedOption:[]}))}function ni(e){const t=Object.create({visibility:0});return Object.assign(t,{$typeName:"google.protobuf.EnumDescriptorProto",name:e.name,reservedName:[],reservedRange:[],value:e.value.map(e=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},e))})}function ri(e,t,...n){return n.reduce((e,t)=>e.nestedMessages[t],e.messages[t])}var si,ii,oi,ai,ci,li,ui,di,hi,mi,gi,pi,fi,yi,bi,Ii,wi,vi,Gi,Ai,Si=/* @__PURE__ */$s({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"option_dependency",number:15,type:9,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3},{name:"visibility",number:11,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3},{name:"visibility",number:6,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false"},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false",options:{deprecated:!0}},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.OptionTargetType"},{name:"edition_defaults",number:20,type:11,label:3,typeName:".google.protobuf.FieldOptions.EditionDefault"},{name:"features",number:21,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"feature_support",number:22,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],nestedType:[{name:"EditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"value",number:2,type:9,label:1}]},{name:"FeatureSupport",field:[{name:"edition_introduced",number:1,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"edition_deprecated",number:2,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"deprecation_warning",number:3,type:9,label:1},{name:"edition_removed",number:4,type:14,label:1,typeName:".google.protobuf.Edition"}]}],enumType:[{name:"CType",value:[{name:"STRING",number:0},{name:"CORD",number:1},{name:"STRING_PIECE",number:2}]},{name:"JSType",value:[{name:"JS_NORMAL",number:0},{name:"JS_STRING",number:1},{name:"JS_NUMBER",number:2}]},{name:"OptionRetention",value:[{name:"RETENTION_UNKNOWN",number:0},{name:"RETENTION_RUNTIME",number:1},{name:"RETENTION_SOURCE",number:2}]},{name:"OptionTargetType",value:[{name:"TARGET_TYPE_UNKNOWN",number:0},{name:"TARGET_TYPE_FILE",number:1},{name:"TARGET_TYPE_EXTENSION_RANGE",number:2},{name:"TARGET_TYPE_MESSAGE",number:3},{name:"TARGET_TYPE_FIELD",number:4},{name:"TARGET_TYPE_ONEOF",number:5},{name:"TARGET_TYPE_ENUM",number:6},{name:"TARGET_TYPE_ENUM_ENTRY",number:7},{name:"TARGET_TYPE_SERVICE",number:8},{name:"TARGET_TYPE_METHOD",number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"OneofOptions",field:[{name:"features",number:1,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumOptions",field:[{name:"allow_alias",number:2,type:8,label:1},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"deprecated_legacy_json_field_conflicts",number:6,type:8,label:1,options:{deprecated:!0}},{name:"features",number:7,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumValueOptions",field:[{name:"deprecated",number:1,type:8,label:1,defaultValue:"false"},{name:"features",number:2,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"debug_redact",number:3,type:8,label:1,defaultValue:"false"},{name:"feature_support",number:4,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"ServiceOptions",field:[{name:"features",number:34,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"MethodOptions",field:[{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"idempotency_level",number:34,type:14,label:1,typeName:".google.protobuf.MethodOptions.IdempotencyLevel",defaultValue:"IDEMPOTENCY_UNKNOWN"},{name:"features",number:35,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"IdempotencyLevel",value:[{name:"IDEMPOTENCY_UNKNOWN",number:0},{name:"NO_SIDE_EFFECTS",number:1},{name:"IDEMPOTENT",number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"UninterpretedOption",field:[{name:"name",number:2,type:11,label:3,typeName:".google.protobuf.UninterpretedOption.NamePart"},{name:"identifier_value",number:3,type:9,label:1},{name:"positive_int_value",number:4,type:4,label:1},{name:"negative_int_value",number:5,type:3,label:1},{name:"double_value",number:6,type:1,label:1},{name:"string_value",number:7,type:12,label:1},{name:"aggregate_value",number:8,type:9,label:1}],nestedType:[{name:"NamePart",field:[{name:"name_part",number:1,type:9,label:2},{name:"is_extension",number:2,type:8,label:2}]}]},{name:"FeatureSet",field:[{name:"field_presence",number:1,type:14,label:1,typeName:".google.protobuf.FeatureSet.FieldPresence",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPLICIT",edition:900},{value:"IMPLICIT",edition:999},{value:"EXPLICIT",edition:1e3}]}},{name:"enum_type",number:2,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnumType",options:{retention:1,targets:[6,1],editionDefaults:[{value:"CLOSED",edition:900},{value:"OPEN",edition:999}]}},{name:"repeated_field_encoding",number:3,type:14,label:1,typeName:".google.protobuf.FeatureSet.RepeatedFieldEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPANDED",edition:900},{value:"PACKED",edition:999}]}},{name:"utf8_validation",number:4,type:14,label:1,typeName:".google.protobuf.FeatureSet.Utf8Validation",options:{retention:1,targets:[4,1],editionDefaults:[{value:"NONE",edition:900},{value:"VERIFY",edition:999}]}},{name:"message_encoding",number:5,type:14,label:1,typeName:".google.protobuf.FeatureSet.MessageEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"LENGTH_PREFIXED",edition:900}]}},{name:"json_format",number:6,type:14,label:1,typeName:".google.protobuf.FeatureSet.JsonFormat",options:{retention:1,targets:[3,6,1],editionDefaults:[{value:"LEGACY_BEST_EFFORT",edition:900},{value:"ALLOW",edition:999}]}},{name:"enforce_naming_style",number:7,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnforceNamingStyle",options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:"STYLE_LEGACY",edition:900},{value:"STYLE2024",edition:1001}]}},{name:"default_symbol_visibility",number:8,type:14,label:1,typeName:".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility",options:{retention:2,targets:[1],editionDefaults:[{value:"EXPORT_ALL",edition:900},{value:"EXPORT_TOP_LEVEL",edition:1001}]}}],nestedType:[{name:"VisibilityFeature",enumType:[{name:"DefaultSymbolVisibility",value:[{name:"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",number:0},{name:"EXPORT_ALL",number:1},{name:"EXPORT_TOP_LEVEL",number:2},{name:"LOCAL_ALL",number:3},{name:"STRICT",number:4}]}]}],enumType:[{name:"FieldPresence",value:[{name:"FIELD_PRESENCE_UNKNOWN",number:0},{name:"EXPLICIT",number:1},{name:"IMPLICIT",number:2},{name:"LEGACY_REQUIRED",number:3}]},{name:"EnumType",value:[{name:"ENUM_TYPE_UNKNOWN",number:0},{name:"OPEN",number:1},{name:"CLOSED",number:2}]},{name:"RepeatedFieldEncoding",value:[{name:"REPEATED_FIELD_ENCODING_UNKNOWN",number:0},{name:"PACKED",number:1},{name:"EXPANDED",number:2}]},{name:"Utf8Validation",value:[{name:"UTF8_VALIDATION_UNKNOWN",number:0},{name:"VERIFY",number:2},{name:"NONE",number:3}]},{name:"MessageEncoding",value:[{name:"MESSAGE_ENCODING_UNKNOWN",number:0},{name:"LENGTH_PREFIXED",number:1},{name:"DELIMITED",number:2}]},{name:"JsonFormat",value:[{name:"JSON_FORMAT_UNKNOWN",number:0},{name:"ALLOW",number:1},{name:"LEGACY_BEST_EFFORT",number:2}]},{name:"EnforceNamingStyle",value:[{name:"ENFORCE_NAMING_STYLE_UNKNOWN",number:0},{name:"STYLE2024",number:1},{name:"STYLE_LEGACY",number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:"FeatureSetDefaults",field:[{name:"defaults",number:1,type:11,label:3,typeName:".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"},{name:"minimum_edition",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"maximum_edition",number:5,type:14,label:1,typeName:".google.protobuf.Edition"}],nestedType:[{name:"FeatureSetEditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"overridable_features",number:4,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"fixed_features",number:5,type:11,label:1,typeName:".google.protobuf.FeatureSet"}]}]},{name:"SourceCodeInfo",field:[{name:"location",number:1,type:11,label:3,typeName:".google.protobuf.SourceCodeInfo.Location"}],nestedType:[{name:"Location",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"span",number:2,type:5,label:3,options:{packed:!0}},{name:"leading_comments",number:3,type:9,label:1},{name:"trailing_comments",number:4,type:9,label:1},{name:"leading_detached_comments",number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:"GeneratedCodeInfo",field:[{name:"annotation",number:1,type:11,label:3,typeName:".google.protobuf.GeneratedCodeInfo.Annotation"}],nestedType:[{name:"Annotation",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"source_file",number:2,type:9,label:1},{name:"begin",number:3,type:5,label:1},{name:"end",number:4,type:5,label:1},{name:"semantic",number:5,type:14,label:1,typeName:".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"}],enumType:[{name:"Semantic",value:[{name:"NONE",number:0},{name:"SET",number:1},{name:"ALIAS",number:2}]}]}]}],enumType:[{name:"Edition",value:[{name:"EDITION_UNKNOWN",number:0},{name:"EDITION_LEGACY",number:900},{name:"EDITION_PROTO2",number:998},{name:"EDITION_PROTO3",number:999},{name:"EDITION_2023",number:1e3},{name:"EDITION_2024",number:1001},{name:"EDITION_UNSTABLE",number:9999},{name:"EDITION_1_TEST_ONLY",number:1},{name:"EDITION_2_TEST_ONLY",number:2},{name:"EDITION_99997_TEST_ONLY",number:99997},{name:"EDITION_99998_TEST_ONLY",number:99998},{name:"EDITION_99999_TEST_ONLY",number:99999},{name:"EDITION_MAX",number:2147483647}]},{name:"SymbolVisibility",value:[{name:"VISIBILITY_UNSET",number:0},{name:"VISIBILITY_LOCAL",number:1},{name:"VISIBILITY_EXPORT",number:2}]}]}),Zi=/* @__PURE__ */ri(Si,1);!function(e){e[e.DECLARATION=0]="DECLARATION",e[e.UNVERIFIED=1]="UNVERIFIED"}(si||(si={})),function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.GROUP=10]="GROUP",e[e.MESSAGE=11]="MESSAGE",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.ENUM=14]="ENUM",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"}(ii||(ii={})),function(e){e[e.OPTIONAL=1]="OPTIONAL",e[e.REPEATED=3]="REPEATED",e[e.REQUIRED=2]="REQUIRED"}(oi||(oi={})),function(e){e[e.SPEED=1]="SPEED",e[e.CODE_SIZE=2]="CODE_SIZE",e[e.LITE_RUNTIME=3]="LITE_RUNTIME"}(ai||(ai={})),function(e){e[e.STRING=0]="STRING",e[e.CORD=1]="CORD",e[e.STRING_PIECE=2]="STRING_PIECE"}(ci||(ci={})),function(e){e[e.JS_NORMAL=0]="JS_NORMAL",e[e.JS_STRING=1]="JS_STRING",e[e.JS_NUMBER=2]="JS_NUMBER"}(li||(li={})),function(e){e[e.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",e[e.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",e[e.RETENTION_SOURCE=2]="RETENTION_SOURCE"}(ui||(ui={})),function(e){e[e.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",e[e.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",e[e.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",e[e.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",e[e.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",e[e.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",e[e.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",e[e.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",e[e.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",e[e.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"}(di||(di={})),function(e){e[e.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",e[e.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",e[e.IDEMPOTENT=2]="IDEMPOTENT"}(hi||(hi={})),function(e){e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0]="DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",e[e.EXPORT_ALL=1]="EXPORT_ALL",e[e.EXPORT_TOP_LEVEL=2]="EXPORT_TOP_LEVEL",e[e.LOCAL_ALL=3]="LOCAL_ALL",e[e.STRICT=4]="STRICT"}(mi||(mi={})),function(e){e[e.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",e[e.EXPLICIT=1]="EXPLICIT",e[e.IMPLICIT=2]="IMPLICIT",e[e.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"}(gi||(gi={})),function(e){e[e.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",e[e.OPEN=1]="OPEN",e[e.CLOSED=2]="CLOSED"}(pi||(pi={})),function(e){e[e.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",e[e.PACKED=1]="PACKED",e[e.EXPANDED=2]="EXPANDED"}(fi||(fi={})),function(e){e[e.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",e[e.VERIFY=2]="VERIFY",e[e.NONE=3]="NONE"}(yi||(yi={})),function(e){e[e.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",e[e.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",e[e.DELIMITED=2]="DELIMITED"}(bi||(bi={})),function(e){e[e.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",e[e.ALLOW=1]="ALLOW",e[e.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"}(Ii||(Ii={})),function(e){e[e.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",e[e.STYLE2024=1]="STYLE2024",e[e.STYLE_LEGACY=2]="STYLE_LEGACY"}(wi||(wi={})),function(e){e[e.NONE=0]="NONE",e[e.SET=1]="SET",e[e.ALIAS=2]="ALIAS"}(vi||(vi={})),function(e){e[e.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",e[e.EDITION_LEGACY=900]="EDITION_LEGACY",e[e.EDITION_PROTO2=998]="EDITION_PROTO2",e[e.EDITION_PROTO3=999]="EDITION_PROTO3",e[e.EDITION_2023=1e3]="EDITION_2023",e[e.EDITION_2024=1001]="EDITION_2024",e[e.EDITION_UNSTABLE=9999]="EDITION_UNSTABLE",e[e.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",e[e.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",e[e.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",e[e.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",e[e.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",e[e.EDITION_MAX=2147483647]="EDITION_MAX"}(Gi||(Gi={})),function(e){e[e.VISIBILITY_UNSET=0]="VISIBILITY_UNSET",e[e.VISIBILITY_LOCAL=1]="VISIBILITY_LOCAL",e[e.VISIBILITY_EXPORT=2]="VISIBILITY_EXPORT"}(Ai||(Ai={}));var Ci={readUnknownFields:!0};function Vi(e,t,n){const r=_r(e,void 0,!1);return Ei(r,new Cr(t),function(e){return e?Object.assign(Object.assign({},Ci),e):Ci}(n),!1,t.byteLength),r.message}function Ei(e,t,n,r,s){var i;const o=r?t.len:t.pos+s;let a,c;const l=null!==(i=e.getUnknown())&&void 0!==i?i:[];for(;t.pos<o&&([a,c]=t.tag(),!r||c!=Gr.EndGroup);){const r=e.findNumber(a);if(!r){const e=t.skip(c,a);n.readUnknownFields&&l.push({no:a,wireType:c,data:e});continue}Xi(e,t,r,c,n)}if(r&&(c!=Gr.EndGroup||a!==s))throw new Error("invalid end group tag");l.length>0&&e.setUnknown(l)}function Xi(e,t,n,r,s){var i;switch(n.fieldKind){case"scalar":e.set(n,xi(t,n.scalar));break;case"enum":const o=xi(t,Qt.INT32);if(n.enum.open)e.set(n,o);else if(n.enum.values.some(e=>e.number===o))e.set(n,o);else if(s.readUnknownFields){const t=[];Kn(o,t);const s=null!==(i=e.getUnknown())&&void 0!==i?i:[];s.push({no:n.number,wireType:r,data:new Uint8Array(t)}),e.setUnknown(s)}break;case"message":e.set(n,Bi(t,s,n,e.get(n)));break;case"list":!function(e,t,n,r){var s;const i=n.field();if("message"===i.listKind)return void n.add(Bi(e,r,i));const o=null!==(s=i.scalar)&&void 0!==s?s:Qt.INT32;if(t!=Gr.LengthDelimited||o==Qt.STRING||o==Qt.BYTES)return void n.add(xi(e,o));const a=e.uint32()+e.pos;for(;e.pos<a;)n.add(xi(e,o))}(t,r,e.get(n),s);break;case"map":!function(e,t,n){const r=t.field();let s,i;const o=e.uint32(),a=e.pos+o;for(;e.pos<a;){const[t]=e.tag();switch(t){case 1:s=xi(e,r.mapKey);break;case 2:switch(r.mapKind){case"scalar":i=xi(e,r.scalar);break;case"enum":i=e.int32();break;case"message":i=Bi(e,n,r)}}}void 0===s&&(s=Qn(r.mapKey,!1));if(void 0===i)switch(r.mapKind){case"scalar":i=Qn(r.scalar,!1);break;case"enum":i=r.enum.values[0].number;break;case"message":i=_r(r.message,void 0,!1)}t.set(s,i)}(t,e.get(n),s)}}function Bi(e,t,n,r){const s=n.delimitedEncoding,i=null!=r?r:_r(n.message,void 0,!1);return Ei(i,e,t,s,s?n.number:e.uint32()),i}function xi(e,t){switch(t){case Qt.STRING:return e.string();case Qt.BOOL:return e.bool();case Qt.DOUBLE:return e.double();case Qt.FLOAT:return e.float();case Qt.INT32:return e.int32();case Qt.INT64:return e.int64();case Qt.UINT64:return e.uint64();case Qt.FIXED64:return e.fixed64();case Qt.BYTES:return e.bytes();case Qt.FIXED32:return e.fixed32();case Qt.SFIXED32:return e.sfixed32();case Qt.SFIXED64:return e.sfixed64();case Qt.SINT64:return e.sint64();case Qt.UINT32:return e.uint32();case Qt.SINT32:return e.sint32()}}function Ri(e,t){var n;const r=Vi(Zi,os(e));return r.messageType.forEach(ms),r.dependency=null!==(n=null==t?void 0:t.map(e=>e.proto.name))&&void 0!==n?n:[],fs(r,e=>null==t?void 0:t.find(t=>t.proto.name===e)).getFile(r.name)}var Wi=/* @__PURE__ */Ri("Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJvdG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MYAiABKAVChQEKE2NvbS5nb29nbGUucHJvdG9idWZCDlRpbWVzdGFtcFByb3RvUAFaMmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3RpbWVzdGFtcHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),Ni=/* @__PURE__ */Ri("Ch5nb29nbGUvcHJvdG9idWYvZHVyYXRpb24ucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIqCghEdXJhdGlvbhIPCgdzZWNvbmRzGAEgASgDEg0KBW5hbm9zGAIgASgFQoMBChNjb20uZ29vZ2xlLnByb3RvYnVmQg1EdXJhdGlvblByb3RvUAFaMWdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2R1cmF0aW9ucGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw"),Ji=/* @__PURE__ */ri(/* @__PURE__ */Ri("Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),0),ki={writeUnknownFields:!0};function Fi(e,t,n){return _i(new Zr,function(e){return e?Object.assign(Object.assign({},ki),e):ki}(n),_r(e,t)).finish()}function _i(e,t,n){var r;for(const s of n.sortedFields)if(n.isSet(s))Yi(e,t,n,s);else if(3==s.presence)throw new Error(`cannot encode ${s} to binary: required field not set`);if(t.writeUnknownFields)for(const{no:s,wireType:i,data:o}of null!==(r=n.getUnknown())&&void 0!==r?r:[])e.tag(s,i).raw(o);return e}function Yi(e,t,n,r){var s;switch(r.fieldKind){case"scalar":case"enum":Hi(e,n.desc.typeName,r.name,null!==(s=r.scalar)&&void 0!==s?s:Qt.INT32,r.number,n.get(r));break;case"list":!function(e,t,n,r){var s;if("message"==n.listKind){for(const s of r)Li(e,t,n,s);return}const i=null!==(s=n.scalar)&&void 0!==s?s:Qt.INT32;if(n.packed){if(!r.size)return;e.tag(n.number,Gr.LengthDelimited).fork();for(const t of r)Oi(e,n.parent.typeName,n.name,i,t);return void e.join()}for(const o of r)Hi(e,n.parent.typeName,n.name,i,n.number,o)}(e,t,r,n.get(r));break;case"message":Li(e,t,r,n.get(r));break;case"map":for(const[s,i]of n.get(r))Ti(e,t,r,s,i)}}function Hi(e,t,n,r,s,i){Oi(e.tag(s,function(e){switch(e){case Qt.BYTES:case Qt.STRING:return Gr.LengthDelimited;case Qt.DOUBLE:case Qt.FIXED64:case Qt.SFIXED64:return Gr.Bit64;case Qt.FIXED32:case Qt.SFIXED32:case Qt.FLOAT:return Gr.Bit32;default:return Gr.Varint}}(r)),t,n,r,i)}function Li(e,t,n,r){n.delimitedEncoding?_i(e.tag(n.number,Gr.StartGroup),t,r).tag(n.number,Gr.EndGroup):_i(e.tag(n.number,Gr.LengthDelimited).fork(),t,r).join()}function Ti(e,t,n,r,s){var i;switch(e.tag(n.number,Gr.LengthDelimited).fork(),Hi(e,n.parent.typeName,n.name,n.mapKey,1,r),n.mapKind){case"scalar":case"enum":Hi(e,n.parent.typeName,n.name,null!==(i=n.scalar)&&void 0!==i?i:Qt.INT32,2,s);break;case"message":_i(e.tag(2,Gr.LengthDelimited).fork(),t,s).join()}e.join()}function Oi(e,t,n,r,s){try{switch(r){case Qt.STRING:e.string(s);break;case Qt.BOOL:e.bool(s);break;case Qt.DOUBLE:e.double(s);break;case Qt.FLOAT:e.float(s);break;case Qt.INT32:e.int32(s);break;case Qt.INT64:e.int64(s);break;case Qt.UINT64:e.uint64(s);break;case Qt.FIXED64:e.fixed64(s);break;case Qt.BYTES:e.bytes(s);break;case Qt.FIXED32:e.fixed32(s);break;case Qt.SFIXED32:e.sfixed32(s);break;case Qt.SFIXED64:e.sfixed64(s);break;case Qt.SINT64:e.sint64(s);break;case Qt.UINT32:e.uint32(s);break;case Qt.SINT32:e.sint32(s)}}catch(i){if(i instanceof Error)throw new Error(`cannot encode field ${t}.${n} to binary: ${i.message}`);throw i}}function Mi(e,t){if(""===e.typeUrl)return;const n="message"==t.kind?t:t.getMessage(Ki(e.typeUrl));return n&&function(e,t){return""!==e.typeUrl&&("string"==typeof t?t:t.typeName)===Ki(e.typeUrl)}(e,n)?Vi(n,e.value):void 0}function Ki(e){const t=e.lastIndexOf("/"),n=t>=0?e.substring(t+1):e;if(!n.length)throw new Error(`invalid type url: ${e}`);return n}var Ui,zi=/* @__PURE__ */Ri("CiBnb29nbGUvcHJvdG9idWYvZmllbGRfbWFzay5wcm90bxIPZ29vZ2xlLnByb3RvYnVmIhoKCUZpZWxkTWFzaxINCgVwYXRocxgBIAMoCUKFAQoTY29tLmdvb2dsZS5wcm90b2J1ZkIORmllbGRNYXNrUHJvdG9QAVoyZ29vZ2xlLmdvbGFuZy5vcmcvcHJvdG9idWYvdHlwZXMva25vd24vZmllbGRtYXNrcGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw"),Di=/* @__PURE__ */Ri("Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9idWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9idWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToCOAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJvdG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoMc3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8KDHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFaL2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),ji=/* @__PURE__ */ri(Di,0),Pi=/* @__PURE__ */ri(Di,1),Qi=/* @__PURE__ */ri(Di,2);function $i(e,t){to(t,e);const n=function(e,t){if(void 0===e)return[];if("enum"===t.fieldKind||"scalar"===t.fieldKind){for(let n=e.length-1;n>=0;--n)if(e[n].no==t.number)return[e[n]];return[]}return e.filter(e=>e.no===t.number)}(e.$unknown,t),[r,s,i]=eo(t);for(const o of n)Xi(r,new Cr(o.data),s,o.wireType,{readUnknownFields:!0});return i()}function qi(e,t,n){var r;to(t,e);const s=(null!==(r=e.$unknown)&&void 0!==r?r:[]).filter(e=>e.no!==t.number),[i,o]=eo(t,n),a=new Zr;Yi(a,{writeUnknownFields:!0},i,o);const c=new Cr(a.finish());for(;c.pos<c.len;){const[e,t]=c.tag(),n=c.skip(t,e);s.push({no:e,wireType:t,data:n})}e.$unknown=s}function eo(e,t){const n=e.typeName,r=Object.assign(Object.assign({},e),{kind:"field",parent:e.extendee,localName:n}),s=Object.assign(Object.assign({},e.extendee),{fields:[r],members:[r],oneofs:[]}),i=ur(s,void 0!==t?{[n]:t}:void 0);return[_r(s,i),r,()=>{const t=i[n];if(void 0===t){const t=e.message;return cr(t)?Qn(t.fields[0].scalar,t.fields[0].longAsString):ur(t)}return t}]}function to(e,t){if(e.extendee.typeName!=t.$typeName)throw new Error(`extension ${e.typeName} can only be applied to message ${e.extendee.typeName}`)}!function(e){e[e.NULL_VALUE=0]="NULL_VALUE"}(Ui||(Ui={}));var no={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function ro(e,t,n){return so(_r(e,t),function(e){return e?Object.assign(Object.assign({},no),e):no}(n))}function so(e,t){var n;const r=function(e,t){if(!e.desc.typeName.startsWith("google.protobuf."))return;switch(e.desc.typeName){case"google.protobuf.Any":return function(e,t){if(""===e.typeUrl)return{};const{registry:n}=t;let r,s;n&&(r=Mi(e,n),r&&(s=n.getMessage(r.$typeName)));if(!s||!r)throw new Error(`cannot encode message ${e.$typeName} to JSON: "${e.typeUrl}" is not in the type registry`);let i=so(_r(s,r),t);(s.typeName.startsWith("google.protobuf.")||null===i||Array.isArray(i)||"object"!=typeof i)&&(i={value:i});return i["@type"]=e.typeUrl,i}(e.message,t);case"google.protobuf.Timestamp":return function(e){const t=1e3*Number(e.seconds);if(t<Date.parse("0001-01-01T00:00:00Z")||t>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot encode message ${e.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(e.nanos<0)throw new Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be negative`);if(e.nanos>999999999)throw new Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be greater than 99999999`);let n="Z";if(e.nanos>0){const t=(e.nanos+1e9).toString().substring(1);n="000000"===t.substring(3)?"."+t.substring(0,3)+"Z":"000"===t.substring(6)?"."+t.substring(0,6)+"Z":"."+t+"Z"}return new Date(t).toISOString().replace(".000Z",n)}(e.message);case"google.protobuf.Duration":return function(e){const t=Number(e.seconds),n=e.nanos;if(t>315576e6||t<-315576e6)throw new Error(`cannot encode message ${e.$typeName} to JSON: value out of range`);if(t>0&&n<0||t<0&&n>0)throw new Error(`cannot encode message ${e.$typeName} to JSON: nanos sign must match seconds sign`);let r=e.seconds.toString();if(0!==n){let e=Math.abs(n).toString();e="0".repeat(9-e.length)+e,"000000"===e.substring(3)?e=e.substring(0,3):"000"===e.substring(6)&&(e=e.substring(0,6)),r+="."+e,n<0&&0==t&&(r="-"+r)}return r+"s"}(e.message);case"google.protobuf.FieldMask":return(n=e.message).paths.map(e=>{if(us(ls(e))!==e)throw new Error(`cannot encode message ${n.$typeName} to JSON: lowerCamelCase of path name "${e}" is irreversible`);return ls(e)}).join(",");case"google.protobuf.Struct":return lo(e.message);case"google.protobuf.Value":return uo(e.message);case"google.protobuf.ListValue":return ho(e.message);default:if(cr(e.desc)){const t=e.desc.fields[0];return ao(t,e.get(t))}return}var n}(e,t);if(void 0!==r)return r;const s={};for(const i of e.sortedFields){if(!e.isSet(i)){if(3==i.presence)throw new Error(`cannot encode ${i} to JSON: required field not set`);if(!t.alwaysEmitImplicit||2!==i.presence)continue}const n=io(i,e.get(i),t);void 0!==n&&(s[co(i,t)]=n)}if(t.registry){const r=/* @__PURE__ */new Set;for(const{no:i}of null!==(n=e.getUnknown())&&void 0!==n?n:[])if(!r.has(i)){r.add(i);const n=t.registry.getExtensionFor(e.desc,i);if(!n)continue;const[o,a]=eo(n,$i(e.message,n)),c=io(a,o.get(a),t);void 0!==c&&(s[n.jsonName]=c)}}return s}function io(e,t,n){switch(e.fieldKind){case"scalar":return ao(e,t);case"message":return so(t,n);case"enum":return oo(e.enum,t,n.enumAsInteger);case"list":return function(e,t){const n=e.field(),r=[];switch(n.listKind){case"scalar":for(const t of e)r.push(ao(n,t));break;case"enum":for(const s of e)r.push(oo(n.enum,s,t.enumAsInteger));break;case"message":for(const n of e)r.push(so(n,t))}return t.alwaysEmitImplicit||r.length>0?r:void 0}(t,n);case"map":return function(e,t){const n=e.field(),r={};switch(n.mapKind){case"scalar":for(const[t,s]of e)r[t]=ao(n,s);break;case"message":for(const[n,s]of e)r[n]=so(s,t);break;case"enum":for(const[s,i]of e)r[s]=oo(n.enum,i,t.enumAsInteger)}return t.alwaysEmitImplicit||e.size>0?r:void 0}(t,n)}}function oo(e,t,n){var r;if("number"!=typeof t)throw new Error(`cannot encode ${e} to JSON: expected number, got ${Nr(t)}`);if("google.protobuf.NullValue"==e.typeName)return null;if(n)return t;const s=e.value[t];return null!==(r=null==s?void 0:s.name)&&void 0!==r?r:t}function ao(e,t){var n,r,s,i,o,a;switch(e.scalar){case Qt.INT32:case Qt.SFIXED32:case Qt.SINT32:case Qt.FIXED32:case Qt.UINT32:if("number"!=typeof t)throw new Error(`cannot encode ${e} to JSON: ${null===(n=Xr(e,t))||void 0===n?void 0:n.message}`);return t;case Qt.FLOAT:case Qt.DOUBLE:if("number"!=typeof t)throw new Error(`cannot encode ${e} to JSON: ${null===(r=Xr(e,t))||void 0===r?void 0:r.message}`);return Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t;case Qt.STRING:if("string"!=typeof t)throw new Error(`cannot encode ${e} to JSON: ${null===(s=Xr(e,t))||void 0===s?void 0:s.message}`);return t;case Qt.BOOL:if("boolean"!=typeof t)throw new Error(`cannot encode ${e} to JSON: ${null===(i=Xr(e,t))||void 0===i?void 0:i.message}`);return t;case Qt.UINT64:case Qt.FIXED64:case Qt.INT64:case Qt.SFIXED64:case Qt.SINT64:if("bigint"!=typeof t&&"string"!=typeof t)throw new Error(`cannot encode ${e} to JSON: ${null===(o=Xr(e,t))||void 0===o?void 0:o.message}`);return t.toString();case Qt.BYTES:if(t instanceof Uint8Array)return as(t);throw new Error(`cannot encode ${e} to JSON: ${null===(a=Xr(e,t))||void 0===a?void 0:a.message}`)}}function co(e,t){return t.useProtoFieldName?e.name:e.jsonName}function lo(e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=uo(r);return t}function uo(e){switch(e.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(e.kind.value))throw new Error(`${e.$typeName} cannot be NaN or Infinity`);return e.kind.value;case"boolValue":case"stringValue":return e.kind.value;case"structValue":return lo(e.kind.value);case"listValue":return ho(e.kind.value);default:throw new Error(`${e.$typeName} must have a value`)}}function ho(e){return e.values.map(uo)}var mo={ignoreUnknownFields:!1};function go(e,t,n){return function(e,t,n){const r=_r(e);try{yo(r,t,function(e){return e?Object.assign(Object.assign({},mo),e):mo}(n))}catch(i){if((s=i)instanceof Error&&wr.includes(s.name)&&"field"in s&&"function"==typeof s.field)throw new Error(`cannot decode ${i.field()} from JSON: ${i.message}`,{cause:i});throw i}var s;return r.message}(e,function(e,t){try{return JSON.parse(e)}catch(n){const e=n instanceof Error?n.message:String(n);throw new Error(`cannot decode message ${t} from JSON: ${e}`,{cause:n})}}(t,e.typeName),n)}var po=/* @__PURE__ */new WeakMap;function fo(e,t){var n;if(!po.has(e)){const t=/* @__PURE__ */new Map;for(const n of e.fields)t.set(n.name,n).set(n.jsonName,n);po.set(e,t)}return null===(n=po.get(e))||void 0===n?void 0:n.get(t)}function yo(e,t,n){var r;if(function(e,t,n){if(!e.desc.typeName.startsWith("google.protobuf."))return!1;switch(e.desc.typeName){case"google.protobuf.Any":return function(e,t,n){var r;if(null===t||Array.isArray(t)||"object"!=typeof t)throw new Error(`cannot decode message ${e.$typeName} from JSON: expected object but got ${Nr(t)}`);if(0==Object.keys(t).length)return;const s=t["@type"];if("string"!=typeof s||""==s)throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is empty`);const i=s.includes("/")?s.substring(s.lastIndexOf("/")+1):s;if(!i.length)throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is invalid`);const o=null===(r=n.registry)||void 0===r?void 0:r.getMessage(i);if(!o)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${s} is not in the type registry`);const a=_r(o);if(i.startsWith("google.protobuf.")&&Object.prototype.hasOwnProperty.call(t,"value")){yo(a,t.value,n)}else{const e=Object.assign({},t);delete e["@type"],yo(a,e,n)}!function(e,t,n){let r=!1;n||(n=ur(Ji),r=!0),n.value=Fi(e,t),n.typeUrl=function(e){return`type.googleapis.com/${e}`}(t.$typeName)}(a.desc,a.message,e)}(e.message,t,n),!0;case"google.protobuf.Timestamp":return function(e,t){if("string"!=typeof t)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${Nr(t)}`);const n=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!n)throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);const r=Date.parse(n[1]+"-"+n[2]+"-"+n[3]+"T"+n[4]+":"+n[5]+":"+n[6]+(n[8]?n[8]:"Z"));if(Number.isNaN(r))throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);if(r<Date.parse("0001-01-01T00:00:00Z")||r>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot decode message ${e.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);e.seconds=zn.parse(r/1e3),e.nanos=0,n[7]&&(e.nanos=parseInt("1"+n[7]+"0".repeat(9-n[7].length))-1e9)}(e.message,t),!0;case"google.protobuf.Duration":return function(e,t){if("string"!=typeof t)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${Nr(t)}`);const n=t.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(null===n)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${Nr(t)}`);const r=Number(n[1]);if(r>315576e6||r<-315576e6)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${Nr(t)}`);if(e.seconds=zn.parse(r),"string"!=typeof n[2])return;const s=n[2]+"0".repeat(9-n[2].length);e.nanos=parseInt(s),(r<0||Object.is(r,-0))&&(e.nanos=-e.nanos)}(e.message,t),!0;case"google.protobuf.FieldMask":return function(e,t){if("string"!=typeof t)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${Nr(t)}`);if(""===t)return;e.paths=t.split(",").map(t=>{if(t.includes("_"))throw new Error(`cannot decode message ${e.$typeName} from JSON: path names must be lowerCamelCase`);return us(t)})}(e.message,t),!0;case"google.protobuf.Struct":return Vo(e.message,t),!0;case"google.protobuf.Value":return Eo(e.message,t),!0;case"google.protobuf.ListValue":return Xo(e.message,t),!0;default:if(cr(e.desc)){const n=e.desc.fields[0];return null===t?e.clear(n):e.set(n,So(n,t)),!0}return!1}}(e,t,n))return;if(null==t||Array.isArray(t)||"object"!=typeof t)throw new Error(`cannot decode ${e.desc} from JSON: ${Nr(t)}`);const s=/* @__PURE__ */new Map;for(const[i,o]of Object.entries(t)){const t=fo(e.desc,i);if(t){if(t.oneof){if(null===o&&"scalar"==t.fieldKind)continue;const e=s.get(t.oneof);if(void 0!==e)throw new vr(t.oneof,`oneof set multiple times by ${e.name} and ${t.name}`);s.set(t.oneof,t)}bo(e,t,o,n)}else{let t;if(i.startsWith("[")&&i.endsWith("]")&&(t=null===(r=n.registry)||void 0===r?void 0:r.getExtension(i.substring(1,i.length-1)))&&t.extendee.typeName===e.desc.typeName){const[r,s,i]=eo(t);bo(r,s,o,n),qi(e.message,t,i())}if(!t&&!n.ignoreUnknownFields)throw new Error(`cannot decode ${e.desc} from JSON: key "${i}" is unknown`)}}}function bo(e,t,n,r){switch(t.fieldKind){case"scalar":!function(e,t,n){null===n?e.clear(t):e.set(t,So(t,n))}(e,t,n);break;case"enum":!function(e,t,n,r){if(wo(t,n))return void e.clear(t);const s=Ao(t.enum,n,r.ignoreUnknownFields);s!==Go&&e.set(t,s)}(e,t,n,r);break;case"message":!function(e,t,n,r){if(wo(t,n))return void e.clear(t);const s=e.isSet(t)?e.get(t):_r(t.message);yo(s,n,r),e.set(t,s)}(e,t,n,r);break;case"list":!function(e,t,n){if(null===t)return;const r=e.field();if(!Array.isArray(t))throw new vr(r,"expected Array, got "+Nr(t));for(const s of t){const t=Io(r,s,n);t!==Go&&e.add(t)}}(e.get(t),n,r);break;case"map":!function(e,t,n){if(null===t)return;const r=e.field();if("object"!=typeof t||Array.isArray(t))throw new vr(r,"expected object, got "+Nr(t));for(const[s,i]of Object.entries(t)){const t=Zo(r.mapKey,s),o=Io(r,i,n);o!==Go&&e.set(t,o)}}(e.get(t),n,r)}}function Io(e,t,n){if(e.scalar&&null!==t)return So(e,t);if(e.message&&!wo(e,t)){const r=_r(e.message);return yo(r,t,n),r}if(e.enum&&!wo(e,t))return Ao(e.enum,t,n.ignoreUnknownFields);throw new vr(e,("list"===e.fieldKind?"list item":"map value")+" must not be null")}function wo(e,t){var n,r;return null===t&&"google.protobuf.Value"!=(null===(n=e.message)||void 0===n?void 0:n.typeName)&&"google.protobuf.NullValue"!=(null===(r=e.enum)||void 0===r?void 0:r.typeName)}var vo,Go=Symbol();function Ao(e,t,n){if(null===t)return e.values[0].number;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":const r=e.values.find(e=>e.name===t);if(void 0!==r)return r.number;if(n)return Go}throw new Error(`cannot decode ${e} from JSON: ${Nr(t)}`)}function So(e,t){switch(e.scalar){case Qt.DOUBLE:case Qt.FLOAT:if("NaN"===t)return NaN;if("Infinity"===t)return Number.POSITIVE_INFINITY;if("-Infinity"===t)return Number.NEGATIVE_INFINITY;if("number"==typeof t){if(Number.isNaN(t))throw new vr(e,"unexpected NaN number");if(!Number.isFinite(t))throw new vr(e,"unexpected infinite number");break}if("string"==typeof t){if(""===t)break;if(t.trim().length!==t.length)break;const e=Number(t);if(!Number.isFinite(e))break;return e}break;case Qt.INT32:case Qt.FIXED32:case Qt.SFIXED32:case Qt.SINT32:case Qt.UINT32:return Co(t);case Qt.BYTES:if("string"==typeof t){if(""===t)return new Uint8Array(0);try{return os(t)}catch(n){throw new vr(e,n instanceof Error?n.message:String(n))}}}return t}function Zo(e,t){switch(e){case Qt.BOOL:switch(t){case"true":return!0;case"false":return!1}return t;case Qt.INT32:case Qt.FIXED32:case Qt.UINT32:case Qt.SFIXED32:case Qt.SINT32:return Co(t);default:return t}}function Co(e){if("string"==typeof e){if(""===e)return e;if(e.trim().length!==e.length)return e;const t=Number(e);return Number.isNaN(t)?e:t}return e}function Vo(e,t){if("object"!=typeof t||null==t||Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${Nr(t)}`);for(const[n,r]of Object.entries(t)){const t=ur(Pi);Eo(t,r),e.fields[n]=t}}function Eo(e,t){switch(typeof t){case"number":e.kind={case:"numberValue",value:t};break;case"string":e.kind={case:"stringValue",value:t};break;case"boolean":e.kind={case:"boolValue",value:t};break;case"object":if(null===t)e.kind={case:"nullValue",value:Ui.NULL_VALUE};else if(Array.isArray(t)){const n=ur(Qi);Xo(n,t),e.kind={case:"listValue",value:n}}else{const n=ur(ji);Vo(n,t),e.kind={case:"structValue",value:n}}break;default:throw new Error(`cannot decode message ${e.$typeName} from JSON ${Nr(t)}`)}return e}function Xo(e,t){if(!Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${Nr(t)}`);for(const n of t){const t=ur(Pi);Eo(t,n),e.values.push(t)}}function Bo(e){const t=Pt[e];return"string"!=typeof t?e.toString():t[0].toLowerCase()+t.substring(1).replace(/[A-Z]/g,e=>"_"+e.toLowerCase())}var xo=class e extends Error{constructor(e,t=Pt.Unknown,n,r,s){super(function(e,t){return e.length?`[${Bo(t)}] ${e}`:`[${Bo(t)}]`}(e,t)),this.name="ConnectError",Object.setPrototypeOf(this,new.target.prototype),this.rawMessage=e,this.code=t,this.metadata=new Headers(null!=n?n:{}),this.details=null!=r?r:[],this.cause=s}static from(t,n=Pt.Unknown){return t instanceof e?t:t instanceof Error?"AbortError"==t.name||"TimeoutError"==t.name?new e(t.message,Pt.Canceled):new e(t.message,n,void 0,void 0,t):new e(String(t),n,void 0,void 0,t)}static[Symbol.hasInstance](t){return t instanceof Error&&(Object.getPrototypeOf(t)===e.prototype||"ConnectError"===t.name&&"code"in t&&"number"==typeof t.code&&"metadata"in t&&"details"in t&&Array.isArray(t.details)&&"rawMessage"in t&&"string"==typeof t.rawMessage&&"cause"in t)}findDetails(e){const t="message"===e.kind?{getMessage:t=>t===e.typeName?e:void 0}:e,n=[];for(const r of this.details){if("desc"in r){t.getMessage(r.desc.typeName)&&n.push(ur(r.desc,r.value));continue}const e=t.getMessage(r.type);if(e)try{n.push(Vi(e,r.value))}catch(U){}}return n}};function Ro(...e){const t=new Headers;for(const n of e)n.forEach((e,n)=>{t.append(n,e)});return t}var Wo=4294967295,No=Wo;function Jo(e,t,n=!1){if(t>e){let r=`message size is larger than configured readMaxBytes ${e}`;throw n&&(r=`message size ${t} is larger than configured readMaxBytes ${e}`),new xo(r,Pt.ResourceExhausted)}}var ko=class{constructor(e){this.readMaxBytes=e,this.header=new Uint8Array(5),this.headerView=new DataView(this.header.buffer),this.buf=[]}get byteLength(){return this.buf.reduce((e,t)=>e+t.byteLength,0)}decode(e){this.buf.push(e);const t=[];for(;;){let e=this.pop();if(!e)break;t.push(e)}return t}pop(){if((this.env||(this.env=this.head(),this.env))&&this.cons(this.env.data)){const e=this.env;return this.env=void 0,e}}head(){if(!this.cons(this.header))return;const e=this.headerView.getUint8(0),t=this.headerView.getUint32(1);return Jo(this.readMaxBytes,t,!0),{flags:e,data:new Uint8Array(t)}}cons(e){const t=e.byteLength;if(this.byteLength<t)return!1;let n=0;for(;n<t;){const r=this.buf.shift();r.byteLength>t-n?(e.set(r.subarray(0,t-n),n),this.buf.unshift(r.subarray(t-n)),n+=t-n):(e.set(r,n),n+=r.byteLength)}return!0}};async function Fo(e,t,n){let{flags:r,data:s}=e;if(!(1&~r))throw new xo("invalid envelope, already compressed",Pt.Internal);return t&&s.byteLength>=n&&(s=await t.compress(s),r|=1),{data:s,flags:r}}async function _o(e,t,n){let{flags:r,data:s}=e;if(!(1&~r)){if(!t)throw new xo("received compressed envelope, but do not know how to decompress",Pt.Internal);s=await t.decompress(s,n),r^=1}return{data:s,flags:r}}function Yo(e,t){const n=new Uint8Array(t.length+5);n.set(t,5);const r=new DataView(n.buffer,n.byteOffset,n.byteLength);return r.setUint8(0,e),r.setUint32(1,t.length),n}var Ho=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,s){(function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)})(r,s,(t=e[n](t)).done,t.value)})}}},Lo=function(e){return this instanceof Lo?(this.v=e,this):new Lo(e)},To=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,s=n.apply(e,t||[]),i=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",function(e){return function(t){return Promise.resolve(t).then(e,l)}}),r[Symbol.asyncIterator]=function(){return this},r;function o(e,t){s[e]&&(r[e]=function(t){return new Promise(function(n,r){i.push([e,t,n,r])>1||a(e,t)})},t&&(r[e]=t(r[e])))}function a(e,t){try{(n=s[e](t)).value instanceof Lo?Promise.resolve(n.value.v).then(c,l):u(i[0][2],n)}catch(r){u(i[0][3],r)}var n}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}},Oo=function(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,s){t[r]=e[r]?function(t){return(n=!n)?{value:Lo(e[r](t)),done:!1}:s?s(t):t}:s}};function Mo(e,t){return async n=>await async function(e,t,n){var r,s,i,o,a,c,l,u;const[d,h]=function(e){if(null==e)return[!1,0];const t="string"==typeof e?parseInt(e,10):e;return!Number.isSafeInteger(t)||t<0?[!1,t]:[!0,t]}(n);if(d){h>t&&Jo(t,h,!0);const n=new Uint8Array(h);let a=0;try{for(var m,g=!0,p=Ho(e);!(r=(m=await p.next()).done);g=!0){o=m.value,g=!1;const e=o;if(a+e.byteLength>h)throw new xo(`protocol error: promised ${h} bytes, received ${a+e.byteLength}`,Pt.InvalidArgument);n.set(e,a),a+=e.byteLength}}catch(A){s={error:A}}finally{try{g||r||!(i=p.return)||await i.call(p)}finally{if(s)throw s.error}}if(a<h)throw new xo(`protocol error: promised ${h} bytes, received ${a}`,Pt.InvalidArgument);return n}const f=[];let y=0;try{for(var b,I=!0,w=Ho(e);!(a=(b=await w.next()).done);I=!0){u=b.value,I=!1;const e=u;y+=e.byteLength,Jo(t,y),f.push(e)}}catch(S){c={error:S}}finally{try{I||a||!(l=w.return)||await l.call(w)}finally{if(c)throw c.error}}const v=new Uint8Array(y);let G=0;for(let Z=f.shift();Z;Z=f.shift())v.set(Z,G),G+=Z.byteLength;return v}(n,e,t)}function Ko(e,...t){return To(this,arguments,function*(){var n;const[r,s]=function(e){let t;"function"!=typeof e[e.length-1]&&(t=e.pop());return[e,t]}(t);let i;const o=e[Symbol.asyncIterator]();let a={[Symbol.asyncIterator]:()=>o};!0===(null==s?void 0:s.propagateDownStreamError)&&(a=i=Qo(a));for(const e of r)a=e(a);const c=a[Symbol.asyncIterator]();try{for(;;){const e=yield Lo(c.next());if(!0===e.done)break;if(i)try{yield yield Lo(e.value)}catch(l){throw yield Lo(i.abort(l)),l}else yield yield Lo(e.value)}}finally{!0===(null==s?void 0:s.propagateDownStreamError)&&(null===(n=o.return)||void 0===n||n.call(o).catch(()=>{}))}})}function Uo(e,t,n){return void 0===t||void 0===n?function(t){return To(this,arguments,function*(){var n,r,s,i;try{for(var o,a=!0,c=Ho(t);!(n=(o=yield Lo(c.next())).done);a=!0){i=o.value,a=!1;const t=i;yield yield Lo({flags:0,data:e.serialize(t)})}}catch(l){r={error:l}}finally{try{a||n||!(s=c.return)||(yield Lo(s.call(c)))}finally{if(r)throw r.error}}})}:function(r){return To(this,arguments,function*(){var s,i,o,a;try{for(var c,l=!0,u=Ho(r);!(s=(c=yield Lo(u.next())).done);l=!0){a=c.value,l=!1;const r=a;let s,i=0;r.end?(i|=t,s=n.serialize(r.value)):s=e.serialize(r.value),yield yield Lo({flags:i,data:s})}}catch(d){i={error:d}}finally{try{l||s||!(o=u.return)||(yield Lo(o.call(u)))}finally{if(i)throw i.error}}})}}function zo(e,t,n){return n&&void 0!==t?function(r){return To(this,arguments,function*(){var s,i,o,a;try{for(var c,l=!0,u=Ho(r);!(s=(c=yield Lo(u.next())).done);l=!0){a=c.value,l=!1;const{flags:r,data:s}=a;(r&t)===t?yield yield Lo({value:n.parse(s),end:!0}):yield yield Lo({value:e.parse(s),end:!1})}}catch(d){i={error:d}}finally{try{l||s||!(o=u.return)||(yield Lo(o.call(u)))}finally{if(i)throw i.error}}})}:function(r){return To(this,arguments,function*(){var s,i,o,a;try{for(var c,l=!0,u=Ho(r);!(s=(c=yield Lo(u.next())).done);l=!0){a=c.value,l=!1;const{flags:r,data:s}=a;if(void 0===t||(r&t)!==t)yield yield Lo(e.parse(s));else if(null===n)throw new xo("unexpected end flag",Pt.InvalidArgument)}}catch(d){i={error:d}}finally{try{l||s||!(o=u.return)||(yield Lo(o.call(u)))}finally{if(i)throw i.error}}})}}function Do(e,t){return function(n){return To(this,arguments,function*(){var r,s,i,o;try{for(var a,c=!0,l=Ho(n);!(r=(a=yield Lo(l.next())).done);c=!0)o=a.value,c=!1,yield yield Lo(yield Lo(Fo(o,e,t)))}catch(u){s={error:u}}finally{try{c||r||!(i=l.return)||(yield Lo(i.call(l)))}finally{if(s)throw s.error}}})}}function jo(e,t){return function(n){return To(this,arguments,function*(){var r,s,i,o;try{for(var a,c=!0,l=Ho(n);!(r=(a=yield Lo(l.next())).done);c=!0)o=a.value,c=!1,yield yield Lo(yield Lo(_o(o,e,t)))}catch(u){s={error:u}}finally{try{c||r||!(i=l.return)||(yield Lo(i.call(l)))}finally{if(s)throw s.error}}})}}function Po(e){return function(t){return To(this,arguments,function*(){var n,r,s,i;const o=function(e){return new ko(e)}(e);try{for(var a,c=!0,l=Ho(t);!(n=(a=yield Lo(l.next())).done);c=!0){i=a.value,c=!1;const e=i;for(const t of o.decode(e))yield yield Lo(t)}}catch(u){r={error:u}}finally{try{c||n||!(s=l.return)||(yield Lo(s.call(l)))}finally{if(r)throw r.error}}if(o.byteLength>0)throw new xo("protocol error: incomplete envelope",Pt.InvalidArgument)})}}function Qo(e){const t=e[Symbol.asyncIterator]();if(void 0===t.throw)throw new Error("AsyncIterable does not implement throw");const n=t;let r,s,i={next:()=>(s=n.next().finally(()=>{s=void 0}),s),throw:e=>n.throw(e)};void 0!==t.return&&(i=Object.assign(Object.assign({},i),{return:e=>n.return(e)}));let o=!1;return{abort(e){if(r)return r.state;const t=()=>n.throw(e).then(e=>!0===e.done?"completed":"caught",()=>"rethrown");return s?(r={reason:e,state:s.then(t,t)},r.state):(r={reason:e,state:t()},r.state)},[Symbol.asyncIterator](){if(o)throw new Error("AsyncIterable cannot be re-used");return o=!0,i}}}function $o(e){return To(this,arguments,function*(){yield Lo(yield*Oo(Ho(e)))})}var qo=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,s){(function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)})(r,s,(t=e[n](t)).done,t.value)})}}},ea=function(e){return this instanceof ea?(this.v=e,this):new ea(e)},ta=function(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,s){t[r]=e[r]?function(t){return(n=!n)?{value:ea(e[r](t)),done:!1}:s?s(t):t}:s}},na=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,s=n.apply(e,t||[]),i=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",function(e){return function(t){return Promise.resolve(t).then(e,l)}}),r[Symbol.asyncIterator]=function(){return this},r;function o(e,t){s[e]&&(r[e]=function(t){return new Promise(function(n,r){i.push([e,t,n,r])>1||a(e,t)})},t&&(r[e]=t(r[e])))}function a(e,t){try{(n=s[e](t)).value instanceof ea?Promise.resolve(n.value.v).then(c,l):u(i[0][2],n)}catch(r){u(i[0][3],r)}var n}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}};function ra(e,t){return function(e,t){const n={};for(const r of e.methods){const e=t(r);null!=e&&(n[r.localName]=e)}return n}(e,e=>{switch(e.methodKind){case"unary":return function(e,t){return async(n,r)=>{var s,i;const o=await e.unary(t,null==r?void 0:r.signal,null==r?void 0:r.timeoutMs,null==r?void 0:r.headers,n,null==r?void 0:r.contextValues);return null===(s=null==r?void 0:r.onHeader)||void 0===s||s.call(r,o.header),null===(i=null==r?void 0:r.onTrailer)||void 0===i||i.call(r,o.trailer),o.message}}(t,e);case"server_streaming":return function(e,t){return(n,r)=>sa(e.stream(t,null==r?void 0:r.signal,null==r?void 0:r.timeoutMs,null==r?void 0:r.headers,$o([n]),null==r?void 0:r.contextValues),r)}(t,e);case"client_streaming":return function(e,t){return async(n,r)=>{var s,i,o,a,c,l;const u=await e.stream(t,null==r?void 0:r.signal,null==r?void 0:r.timeoutMs,null==r?void 0:r.headers,n,null==r?void 0:r.contextValues);let d;null===(c=null==r?void 0:r.onHeader)||void 0===c||c.call(r,u.header);let h=0;try{for(var m,g=!0,p=qo(u.message);!(s=(m=await p.next()).done);g=!0)a=m.value,g=!1,d=a,h++}catch(f){i={error:f}}finally{try{g||s||!(o=p.return)||await o.call(p)}finally{if(i)throw i.error}}if(!d)throw new xo("protocol error: missing response message",Pt.Unimplemented);if(h>1)throw new xo("protocol error: received extra messages for client streaming method",Pt.Unimplemented);return null===(l=null==r?void 0:r.onTrailer)||void 0===l||l.call(r,u.trailer),d}}(t,e);case"bidi_streaming":return function(e,t){return(n,r)=>sa(e.stream(t,null==r?void 0:r.signal,null==r?void 0:r.timeoutMs,null==r?void 0:r.headers,n,null==r?void 0:r.contextValues),r)}(t,e);default:return null}})}function sa(e,t){const n=function(){return na(this,arguments,function*(){var n,r;const s=yield ea(e);null===(n=null==t?void 0:t.onHeader)||void 0===n||n.call(t,s.header),yield ea(yield*ta(qo(s.message))),null===(r=null==t?void 0:t.onTrailer)||void 0===r||r.call(t,s.trailer)})}()[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({next:()=>n.next()})}}function ia(e){if(!e.aborted)return;if(void 0!==e.reason)return e.reason;const t=/* @__PURE__ */new Error("This operation was aborted");return t.name="AbortError",t}function oa(){return{get(e){return e.id in this?this[e.id]:e.defaultValue},set(e,t){return this[e.id]=t,this},delete(e){return delete this[e.id],this}}}function aa(e,t,...n){if(n.length>0)throw new Error;return e.services[t]}function ca(e,t){return e.toString().replace(/\/?$/,`/${t.parent.typeName}/${t.name}`)}function la(e,t){return ur(e,t)}function ua(e,t){function n(t){return!0===t.done?t:{done:t.done,value:la(e,t.value)}}return{[Symbol.asyncIterator](){const e=t[Symbol.asyncIterator](),r={next:()=>e.next().then(n)};return void 0!==e.throw&&(r.throw=t=>e.throw(t).then(n)),void 0!==e.return&&(r.return=t=>e.return(t).then(n)),r}}}function da(e,t){if(!t)return e;for(const n of t.concat().reverse())e=n(e);return e}function ha(e,t,n,r){const s=ma(ga(e.input,t),r),i=ma(pa(e.input,n),r),o=ma(ga(e.output,t),r),a=ma(pa(e.output,n),r);return{getI:e=>e?s:i,getO:e=>e?o:a}}function ma(e,t){return{serialize(n){const r=e.serialize(n);return function(e,t){if(t>e)throw new xo(`message size ${t} is larger than configured writeMaxBytes ${e}`,Pt.ResourceExhausted)}(t.writeMaxBytes,r.byteLength),r},parse:n=>(Jo(t.readMaxBytes,n.byteLength,!0),e.parse(n))}}function ga(e,t){return{parse(n){try{return Vi(e,n,t)}catch(r){throw new xo(`parse binary: ${r instanceof Error?r.message:String(r)}`,Pt.Internal)}},serialize(n){try{return Fi(e,n,t)}catch(r){throw new xo(`serialize binary: ${r instanceof Error?r.message:String(r)}`,Pt.Internal)}}}}function pa(e,t){var n,r;const s=null!==(n=null==t?void 0:t.textEncoder)&&void 0!==n?n:new TextEncoder,i=null!==(r=null==t?void 0:t.textDecoder)&&void 0!==r?r:new TextDecoder,o=function(e){var t;const n=Object.assign({},e);return null!==(t=n.ignoreUnknownFields)&&void 0!==t||(n.ignoreUnknownFields=!0),n}(t);return{parse(t){try{return go(e,i.decode(t),o)}catch(n){throw xo.from(n,Pt.InvalidArgument)}},serialize(t){try{const n=function(e,t,n){var r;const s=ro(e,t,n);return JSON.stringify(s,null,null!==(r=null==n?void 0:n.prettySpaces)&&void 0!==r?r:0)}(e,t,o);return s.encode(n)}catch(n){throw xo.from(n,Pt.Internal)}}}}var fa=/^application\/(connect\+)?(?:(json)(?:; ?charset=utf-?8)?|(proto))$/i;var ya=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n};function ba(e,t,n){var r;if(t&&new Headers(t).forEach((e,t)=>n.metadata.append(t,e)),"object"!=typeof e||null==e||Array.isArray(e))throw n;let s=n.code;"code"in e&&"string"==typeof e.code&&(s=null!==(r=function(e){if(!vo){vo={};for(const e of Object.values(Pt))"string"!=typeof e&&(vo[Bo(e)]=e)}return vo[e]}(e.code))&&void 0!==r?r:s);const i=e.message;if(null!=i&&"string"!=typeof i)throw n;const o=new xo(null!=i?i:"",s,t);if("details"in e&&Array.isArray(e.details))for(const c of e.details){if(null===c||"object"!=typeof c||Array.isArray(c)||"string"!=typeof c.type||"string"!=typeof c.value)throw n;try{o.details.push({type:c.type,value:os(c.value),debug:c.debug})}catch(a){throw n}}return o}function Ia(e,t,n){const r={};void 0!==t&&(r.error=function(e,t){const n={code:Bo(e.code)};return e.rawMessage.length>0&&(n.message=e.rawMessage),e.details.length>0&&(n.details=e.details.map(e=>{if("desc"in e){const r=ur(e.desc,e.value),s={type:e.desc.typeName,value:Fi(e.desc,r)};try{s.debug=ro(e.desc,r,t)}catch(n){}return s}return e}).map(e=>{var{value:t}=e,n=ya(e,["value"]);return Object.assign(Object.assign({},n),{value:as(t,"std_raw")})})),n}(t,n),e=Ro(e,t.metadata));let s=!1;const i={};return e.forEach((e,t)=>{s=!0,i[t]=[e]}),s&&(r.metadata=i),r}function wa(e){const t=new TextEncoder;return{serialize(n){try{const r=Ia(n.metadata,n.error,e),s=JSON.stringify(r);return t.encode(s)}catch(r){throw new xo(`failed to serialize EndStreamResponse: ${r instanceof Error?r.message:String(r)}`,Pt.Internal)}},parse(e){try{return function(e){const t=new xo("invalid end stream",Pt.Unknown);let n;try{n=JSON.parse("string"==typeof e?e:(new TextDecoder).decode(e))}catch(s){throw t}if("object"!=typeof n||null==n||Array.isArray(n))throw t;const r=new Headers;if("metadata"in n){if("object"!=typeof n.metadata||null==n.metadata||Array.isArray(n.metadata))throw t;for(const[e,s]of Object.entries(n.metadata)){if(!Array.isArray(s)||s.some(e=>"string"!=typeof e))throw t;for(const t of s)r.append(e,t)}}return{metadata:r,error:"error"in n&&null!=n.error?ba(n.error,r,t):void 0}}(e)}catch(t){throw new xo(`failed to parse EndStreamResponse: ${t instanceof Error?t.message:String(t)}`,Pt.InvalidArgument)}}}}var va="Content-Type",Ga="Content-Length",Aa="Content-Encoding",Sa="Connect-Content-Encoding",Za="Accept-Encoding",Ca="Connect-Protocol-Version";function Va(e,t,n,r,s,i,o){const a=function(e,t,n,r,s){const i=new Headers(null!=r?r:{});return void 0!==n&&i.set("Connect-Timeout-Ms",`${n}`),i.set(va,"unary"==e?t?"application/proto":"application/json":t?"application/connect+proto":"application/connect+json"),i.set(Ca,"1"),!i.has("User-Agent")&&s&&i.set("User-Agent","connect-es/2.1.1"),i}(e,t,n,r,o);if(null!=i){const t="unary"==e?Aa:Sa;a.set(t,i.name)}if(s.length>0){const t="unary"==e?Za:"Connect-Accept-Encoding";a.set(t,s.map(e=>e.name).join(","))}return a}function Ea(e,t,n,r){const s=r.get(va),i=function(e){const t=null==e?void 0:e.match(fa);if(t)return{stream:!!t[1],binary:!!t[3]}}(s);if(200!==n){const t=new xo(`HTTP ${n}`,function(e){switch(e){case 400:return Pt.Internal;case 401:return Pt.Unauthenticated;case 403:return Pt.PermissionDenied;case 404:return Pt.Unimplemented;case 429:case 502:case 503:case 504:return Pt.Unavailable;default:return Pt.Unknown}}(n),r);if("unary"==e&&i&&!i.binary)return{isUnaryError:!0,unaryError:t};throw t}const o=t,a="unary"!==e;if((null==i?void 0:i.binary)!==o||i.stream!==a)throw new xo(`unsupported content type ${s}`,void 0===i?Pt.Unknown:Pt.Internal,r);return{isUnaryError:!1}}function Xa(e,t,n,r,s){let i;const o=s.get("unary"==e?Aa:Sa);if(null!=o&&"identity"!==o.toLowerCase()&&(i=t.find(e=>e.name===o),!i))throw new xo(`unsupported response encoding "${o}"`,Pt.Internal,s);return Object.assign({compression:i},Ea(e,n,r,s))}function Ba(e,t,n){let r="?connect=v1";const s=e.header.get(va);0===(null==s?void 0:s.indexOf("application/"))&&(r+="&encoding="+encodeURIComponent(s.slice(12)));const i=e.header.get(Aa);null!==i&&"identity"!==i&&(r+="&compression="+encodeURIComponent(i),n=!0),n&&(r+="&base64=1"),r+="&message="+function(e,t){return t?as(e,"url"):encodeURIComponent((new TextDecoder).decode(e))}(t,n);const o=e.url+r,a=new Headers(e.header);for(const c of[Ca,va,Ga,Aa,Za])a.delete(c);return Object.assign(Object.assign({},e),{requestMethod:"GET",url:o,header:a})}function xa(e){const{signal:t,cleanup:n}=function(e){const t=new AbortController,n=()=>{t.abort(new xo("the operation timed out",Pt.DeadlineExceeded))};let r;return void 0!==e&&(e<=0?n():r=setTimeout(n,e)),{signal:t.signal,cleanup:()=>clearTimeout(r)}}(e.timeoutMs),r=function(...e){const t=new AbortController,n=e.filter(e=>void 0!==e).concat(t.signal);for(const s of n){if(s.aborted){r.apply(s);break}s.addEventListener("abort",r)}function r(){t.signal.aborted||t.abort(ia(this));for(const e of n)e.removeEventListener("abort",r)}return t}(e.signal,t);return[r.signal,function(e){const s=xo.from(t.aborted?ia(t):e);return r.abort(s),n(),Promise.reject(s)},function(){n(),r.abort()}]}var Ra,Wa=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,s){(function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)})(r,s,(t=e[n](t)).done,t.value)})}}},Na=function(e){return this instanceof Na?(this.v=e,this):new Na(e)},Ja=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,s=n.apply(e,t||[]),i=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",function(e){return function(t){return Promise.resolve(t).then(e,l)}}),r[Symbol.asyncIterator]=function(){return this},r;function o(e,t){s[e]&&(r[e]=function(t){return new Promise(function(n,r){i.push([e,t,n,r])>1||a(e,t)})},t&&(r[e]=t(r[e])))}function a(e,t){try{(n=s[e](t)).value instanceof Na?Promise.resolve(n.value.v).then(c,l):u(i[0][2],n)}catch(r){u(i[0][3],r)}var n}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}};function ka(e){return{async unary(t,n,r,s,i,o){const a=ha(t,e.binaryOptions,e.jsonOptions,e);return r=void 0===r?e.defaultTimeoutMs:r<=0?void 0:r,await function(e){const t=da(e.next,e.interceptors),[n,r,s]=xa(e);return t(Object.assign(Object.assign({},e.req),{message:la(e.req.method.input,e.req.message),signal:n})).then(e=>(s(),e),r)}({interceptors:e.interceptors,signal:n,timeoutMs:r,req:{stream:!1,service:t.parent,method:t,requestMethod:"POST",url:ca(e.baseUrl,t),header:Va(t.methodKind,e.useBinaryFormat,r,s,e.acceptCompression,e.sendCompression,!0),contextValues:null!=o?o:oa(),message:i},next:async n=>{let r=a.getI(e.useBinaryFormat).serialize(n.message);e.sendCompression&&r.byteLength>e.compressMinBytes?(r=await e.sendCompression.compress(r),n.header.set(Aa,e.sendCompression.name)):n.header.delete(Aa);let s;!0===e.useHttpGet&&t.idempotency===hi.NO_SIDE_EFFECTS?n=Ba(n,r,e.useBinaryFormat):s=$o([r]);const i=await e.httpClient({url:n.url,method:n.requestMethod,header:n.header,signal:n.signal,body:s}),{compression:o,isUnaryError:c,unaryError:l}=Xa(t.methodKind,e.acceptCompression,e.useBinaryFormat,i.status,i.header),[u,d]=function(e){const t=new Headers,n=new Headers;return e.forEach((e,r)=>{r.toLowerCase().startsWith("trailer-")?n.append(r.substring(8),e):t.append(r,e)}),[t,n]}(i.header);let h=await function(e,...t){const[n,r,s]=function(e){let t;return"function"!=typeof e[e.length-1]&&(t=e.pop()),[e,e.pop(),t]}(t);let i,o=e;return!0===(null==s?void 0:s.propagateDownStreamError)&&(o=i=Qo(o)),o=Ko(o,...n,{propagateDownStreamError:!1}),r(o).catch(e=>i?i.abort(e).then(()=>Promise.reject(e)):Promise.reject(e))}(i.body,Mo(e.readMaxBytes,i.header.get(Ga)),{propagateDownStreamError:!1});if(o&&(h=await o.decompress(h,e.readMaxBytes)),c)throw function(e,t,n){let r;try{r=JSON.parse((new TextDecoder).decode(e))}catch(s){throw n}return ba(r,t,n)}(h,Ro(u,d),l);return{stream:!1,service:t.parent,method:t,header:u,message:a.getO(e.useBinaryFormat).parse(h),trailer:d}}})},async stream(t,n,r,s,i,o){const a=ha(t,e.binaryOptions,e.jsonOptions,e),c=wa(e.jsonOptions);return r=void 0===r?e.defaultTimeoutMs:r<=0?void 0:r,function(e){const t=da(e.next,e.interceptors),[n,r,s]=xa(e),i=Object.assign(Object.assign({},e.req),{message:ua(e.req.method.input,e.req.message),signal:n});let o=!1;return n.addEventListener("abort",function(){var t,n;const r=e.req.message[Symbol.asyncIterator]();o||null===(t=r.throw)||void 0===t||t.call(r,this.reason).catch(()=>{}),null===(n=r.return)||void 0===n||n.call(r).catch(()=>{})}),t(i).then(e=>Object.assign(Object.assign({},e),{message:{[Symbol.asyncIterator](){const t=e.message[Symbol.asyncIterator]();return{next:()=>t.next().then(e=>(1==e.done&&(o=!0,s()),e),r)}}}}),r)}({interceptors:e.interceptors,signal:n,timeoutMs:r,req:{stream:!0,service:t.parent,method:t,requestMethod:"POST",url:ca(e.baseUrl,t),header:Va(t.methodKind,e.useBinaryFormat,r,s,e.acceptCompression,e.sendCompression,!0),contextValues:null!=o?o:oa(),message:i},next:async n=>{const r=await e.httpClient({url:n.url,method:"POST",header:n.header,signal:n.signal,body:Ko(n.message,Uo(a.getI(e.useBinaryFormat)),Do(e.sendCompression,e.compressMinBytes),function(e){return To(this,arguments,function*(){var t,n,r,s;try{for(var i,o=!0,a=Ho(e);!(t=(i=yield Lo(a.next())).done);o=!0){s=i.value,o=!1;const{flags:e,data:t}=s;yield yield Lo(Yo(e,t))}}catch(c){n={error:c}}finally{try{o||t||!(r=a.return)||(yield Lo(r.call(a)))}finally{if(n)throw n.error}}})},{propagateDownStreamError:!0})}),{compression:s}=Xa(t.methodKind,e.acceptCompression,e.useBinaryFormat,r.status,r.header),i=Object.assign(Object.assign({},n),{header:r.header,trailer:new Headers,message:Ko(r.body,Po(e.readMaxBytes),jo(null!=s?s:null,e.readMaxBytes),zo(a.getO(e.useBinaryFormat),2,c),function(e){return Ja(this,arguments,function*(){var t,n,s,o;let a=!1;try{for(var c,l=!0,u=Wa(e);!(t=(c=yield Na(u.next())).done);l=!0){o=c.value,l=!1;const e=o;if(e.end){if(a)throw new xo("protocol error: received extra EndStreamResponse",Pt.InvalidArgument);if(a=!0,e.value.error){const t=e.value.error;throw r.header.forEach((e,n)=>{t.metadata.append(n,e)}),t}e.value.metadata.forEach((e,t)=>i.trailer.set(t,e))}else{if(a)throw new xo("protocol error: received extra message after EndStreamResponse",Pt.InvalidArgument);yield yield Na(e.value)}}}catch(d){n={error:d}}finally{try{l||t||!(s=u.return)||(yield Na(s.call(u)))}finally{if(n)throw n.error}}if(!a)throw new xo("protocol error: missing EndStreamResponse",Pt.InvalidArgument)})},{propagateDownStreamError:!0})});return i}})}}}function Fa(e){let t=Pt.Internal;const n=_a(e).map(Ya);n.some(e=>"ERR_STREAM_WRITE_AFTER_END"==e.code)||n.some(e=>"ERR_STREAM_DESTROYED"==e.code||"ERR_HTTP2_INVALID_STREAM"==e.code||"ECONNRESET"==e.code)?t=Pt.Aborted:n.some(e=>"ETIMEDOUT"==e.code||"ENOTFOUND"==e.code||"EAI_AGAIN"==e.code||"ECONNREFUSED"==e.code)&&(t=Pt.Unavailable);const r=xo.from(e,t);return r!==e&&(r.cause=e),r}function _a(e){const t=[];for(;e instanceof Error&&!t.includes(e)&&(t.push(e),"cause"in e);)e=e.cause;return t}function Ya(e){const t={};return e instanceof Error&&("code"in e&&"string"==typeof e.code&&(t.code=e.code),"syscall"in e&&"string"==typeof e.syscall&&(t.syscall=e.syscall)),t}!function(e){e[e.PROTOCOL_ERROR=1]="PROTOCOL_ERROR",e[e.INTERNAL_ERROR=2]="INTERNAL_ERROR",e[e.FLOW_CONTROL_ERROR=3]="FLOW_CONTROL_ERROR",e[e.SETTINGS_TIMEOUT=4]="SETTINGS_TIMEOUT",e[e.STREAM_CLOSED=5]="STREAM_CLOSED",e[e.FRAME_SIZE_ERROR=6]="FRAME_SIZE_ERROR",e[e.REFUSED_STREAM=7]="REFUSED_STREAM",e[e.CANCEL=8]="CANCEL",e[e.COMPRESSION_ERROR=9]="COMPRESSION_ERROR",e[e.CONNECT_ERROR=10]="CONNECT_ERROR",e[e.ENHANCE_YOUR_CALM=11]="ENHANCE_YOUR_CALM",e[e.INADEQUATE_SECURITY=12]="INADEQUATE_SECURITY",e[e.HTTP_1_1_REQUIRED=13]="HTTP_1_1_REQUIRED"}(Ra||(Ra={}));var Ha=e(A.gzip),La=e(A.gunzip),Ta=e(A.brotliCompress),Oa=e(A.brotliDecompress),Ma={name:"gzip",compress:e=>Ua(Ha(e,{})),decompress:(e,t)=>0==e.length?Promise.resolve(new Uint8Array(0)):Ua(za(La(e,{maxOutputLength:t}),t))},Ka={name:"br",compress:e=>Ua(Ta(e,{})),decompress:(e,t)=>0==e.length?Promise.resolve(new Uint8Array(0)):Ua(za(Oa(e,{maxOutputLength:t}),t))};function Ua(e){return e.then(e=>e.buffer instanceof ArrayBuffer?e:new Uint8Array(e))}function za(e,t){return e.catch(e=>{var n;const r=Ya(e);let s=Pt.Internal,i="decompression failed";switch(r.code){case"ERR_BUFFER_TOO_LARGE":s=Pt.ResourceExhausted,i=`message is larger than configured readMaxBytes ${t} after decompression`;break;case"Z_DATA_ERROR":case"ERR_PADDING_2":s=Pt.InvalidArgument;break;default:(null===(n=r.code)||void 0===n?void 0:n.startsWith("ERR__ERROR_FORMAT_"))&&(s=Pt.InvalidArgument)}return Promise.reject(new xo(i,s,void 0,void 0,e))})}function Da(e){const t=new Headers;for(const[n,r]of Object.entries(e))if(!n.startsWith(":")&&void 0!==r)if("string"==typeof r)t.append(n,r);else if("number"==typeof r)t.append(n,String(r));else for(const e of r)t.append(n,e);return t}function ja(e,t){if(void 0===e&&void 0===t)return;const n=Object.create(null);if(void 0!==t)if(Array.isArray(t))for(let r=0;r+1<t.length;r+=2){const e=t[r],s=t[r+1];Array.isArray(n[e])?n[e].push(s):"string"==typeof n[e]?n[e]=[n[e],s]:n[e]=s}else for(const[r,s]of Object.entries(t))Array.isArray(s)?n[r]=s.concat():void 0!==s&&(n[r]=s);if(void 0!==e)if(Array.isArray(e))for(const[r,s]of e)Pa(n,r,s);else if("forEach"in e)"function"==typeof e.forEach&&e.forEach((e,t)=>{Pa(n,t,e)});else for(const[r,s]of Object.entries(e))Pa(n,r,s);return n}function Pa(e,t,n){const r=e[t=t.toLowerCase()];Array.isArray(r)?r.push(n):e[t]=void 0===r?n:[r.toString(),n]}var Qa=class{state(){return"ready"==this.s.t?void 0!==this.verifying?"verifying":this.s.streamCount()>0?"open":"idle":this.s.t}error(){if("error"==this.s.t)return this.s.reason}constructor(e,t,n){var r,s,i,o;this.s={t:"closed"},this.shuttingDown=[],this.authority=new URL(e).origin,this.http2SessionOptions=n,this.options={pingIntervalMs:null!==(r=null==t?void 0:t.pingIntervalMs)&&void 0!==r?r:Number.POSITIVE_INFINITY,pingTimeoutMs:null!==(s=null==t?void 0:t.pingTimeoutMs)&&void 0!==s?s:15e3,pingIdleConnection:null!==(i=null==t?void 0:t.pingIdleConnection)&&void 0!==i&&i,idleConnectionTimeoutMs:null!==(o=null==t?void 0:t.idleConnectionTimeoutMs)&&void 0!==o?o:9e5}}async connect(){try{return(await this.gotoReady()).streamCount()>0?"open":"idle"}catch(e){return"error"}}async request(e,t,n,r){for(;;){const i=await this.gotoReady();try{const s=i.conn.request(Object.assign(Object.assign({},n),{":method":e,":path":t}),r);return i.registerRequest(s),s}catch(s){if(i.conn.closed||i.conn.destroyed)continue;throw s}}}notifyResponseByteRead(e){"ready"==this.s.t&&this.s.responseByteRead(e);for(const t of this.shuttingDown)t.responseByteRead(e)}abort(e){var t,n,r;const s=null!=e?e:new xo("connection aborted",Pt.Canceled);null===(n=(t=this.s).abort)||void 0===n||n.call(t,s);for(const i of this.shuttingDown)null===(r=i.abort)||void 0===r||r.call(i,s);this.setState($a(s))}async gotoReady(){for("ready"==this.s.t?this.s.isShuttingDown()||this.s.conn.closed||this.s.conn.destroyed?this.setState(qa(this.authority,this.http2SessionOptions)):this.s.requiresVerify()&&await this.verify(this.s):"closed"!=this.s.t&&"error"!=this.s.t||this.setState(qa(this.authority,this.http2SessionOptions));"ready"!==this.s.t;){if("error"===this.s.t)throw this.s.reason;"connecting"===this.s.t&&await this.s.conn}return this.s}setState(e){var t,n;if(null===(n=(t=this.s).onExitState)||void 0===n||n.call(t),"ready"==this.s.t&&this.s.isShuttingDown()){const e=this.s;this.shuttingDown.push(e),e.onClose=e.onError=()=>{const t=this.shuttingDown.indexOf(e);-1!==t&&this.shuttingDown.splice(t,1)}}switch(e.t){case"connecting":e.conn.then(e=>{this.setState(function(e,t){(function(e){if(e.connecting)throw new xo("expected open session, but it is connecting",Pt.Internal);if(e.destroyed)throw new xo("expected open session, but it is destroyed",Pt.Internal);if(e.closed)throw new xo("expected open session, but it is closed",Pt.Internal)})(e),e.unref();let n,r,s,i=Date.now(),o=0,a=!1,c=!1;p();const l={t:"ready",conn:e,streamCount:()=>o,requiresVerify:()=>Date.now()-i>t.pingIntervalMs,isShuttingDown:()=>a,onClose:void 0,onError:void 0,registerRequest(t){o++,1==o&&(e.ref(),u(),g()),t.once("response",()=>{i=Date.now(),u()}),t.once("close",()=>{o--,0==o&&(e.unref(),u(),p())})},responseByteRead(t){t.session===e&&(e.closed||e.destroyed||o<=0||(i=Date.now(),u()))},verify:()=>(e.ref(),new Promise(t=>{const n=()=>{t(!1)};m(()=>{0==o&&e.unref(),e.off("error",n),t(!0)}),e.once("error",n)})),abort(t){e.destroyed||(e.once("error",()=>{}),e.destroy(t,C.constants.NGHTTP2_CANCEL))},onExitState(){l.isShuttingDown()||(w(),this.onError=void 0,this.onClose=void 0)}};function u(){d(),(o>0||t.pingIdleConnection)&&(n=ec(h,t.pingIntervalMs))}function d(){clearTimeout(n),clearTimeout(r)}function h(){m(u)}function m(n){clearTimeout(r),r=ec(()=>{e.destroy(new xo("PING timed out",Pt.Unavailable),C.constants.NGHTTP2_CANCEL)},t.pingTimeoutMs),e.ping((s,o)=>{clearTimeout(r),null===s&&(o>t.pingTimeoutMs?e.destroy(new xo("PING timed out",Pt.Unavailable),C.constants.NGHTTP2_CANCEL):(i=Date.now(),n()))})}function g(){clearTimeout(s)}function p(){s=ec(f,t.idleConnectionTimeoutMs)}function f(){e.close(),b()}function y(n,r,s){if(n===C.constants.NGHTTP2_NO_ERROR&&0===o)return void e.destroy(new xo("received GOAWAY without any open streams",Pt.Canceled),C.constants.NGHTTP2_NO_ERROR);a=!0;const i=Buffer.from("too_many_pings","ascii");(null==s?void 0:s.equals(i))&&(t.pingIntervalMs=2*t.pingIntervalMs,c=!0)}function b(){var e;w(),null===(e=l.onClose)||void 0===e||e.call(l)}function I(e){var t,n;if(w(),c){const e=new xo(`http/2 connection closed with error code ENHANCE_YOUR_CALM (0x${C.constants.NGHTTP2_ENHANCE_YOUR_CALM.toString(16)}), too_many_pings, doubled the interval`,Pt.ResourceExhausted);null===(t=l.onError)||void 0===t||t.call(l,e)}else null===(n=l.onError)||void 0===n||n.call(l,Fa(e))}function w(){d(),g(),e.off("error",I),e.off("close",b),e.off("goaway",y)}return e.on("error",I),e.on("close",b),e.on("goaway",y),l}(e,this.options))},e=>{this.setState($a(e))});break;case"ready":e.onClose=()=>this.setState({t:"closed"}),e.onError=e=>this.setState($a(e))}this.s=e}verify(e){return void 0!==this.verifying||(this.verifying=e.verify().then(e=>{e||this.setState(qa(this.authority,this.http2SessionOptions))},e=>{this.setState($a(e))}).finally(()=>{this.verifying=void 0})),this.verifying}};function $a(e){return e instanceof xo&&xo.from(e).code==Pt.Canceled?{t:"closed"}:function(e){return{t:"error",reason:e}}(e)}function qa(e,t){let n,r;const s=new Promise((e,t)=>{n=e,r=t}),i=C.connect(e,t);function o(){null==n||n(i),c()}function a(e){null==r||r(Fa(e)),c()}function c(){i.off("connect",o),i.off("error",a)}return i.on("connect",o),i.on("error",a),{t:"connecting",conn:s,abort(e){i.destroyed||i.destroy(void 0,C.constants.NGHTTP2_CANCEL),null==r||r(e)},onExitState(){c()}}}function ec(e,t){if(!(t>2147483647))return setTimeout(e,t).unref()}function tc(e){var t,n,r;return"1.1"==e.httpVersion?(n=e.nodeOptions,async function(e){const t=oc(e.signal);return new Promise((r,s)=>{t.onError(e=>{s(e)}),function(e,t,n,r){let s;s=new URL(t).protocol.startsWith("https")?Z.request(t,n):S.request(t,n),e.onError(e=>s.destroy(e)),s.flushHeaders(),s.on("error",e.error),s.on("socket",function(e){function t(){e.off("connect",t),r(s)}"open"===e.readyState?r(s):e.on("connect",t)})}(t,e.url,Object.assign(Object.assign({},n),{headers:ja(e.header,null==n?void 0:n.headers),method:e.method}),n=>{ic(e,n,t),n.on("response",e=>{var n;e.on("error",t.error),t.onError(t=>e.destroy(t));const s=new Headers;r({status:null!==(n=e.statusCode)&&void 0!==n?n:0,header:Da(e.headers),body:nc(t,e,s),trailer:s})})})})}):(r=null!==(t=e.sessionProvider)&&void 0!==t?t:e=>new Qa(e),function(e){const t=oc(e.signal),n=r(e.url);return new Promise((r,s)=>{t.onError(e=>{s(e)}),function(e,t,n,r,s,i,o){const a=new URL(n);if(a.origin!==t.authority){const n=`cannot make a request to ${a.origin}: the http2 session is connected to ${t.authority}`;return void e.error(new xo(n,Pt.Internal))}t.request(r,a.pathname+a.search,s,{}).then(t=>{e.onError(e=>{if(t.closed)return;const n=e.code==Pt.Canceled?Ra.CANCEL:Ra.INTERNAL_ERROR;return new Promise(e=>t.close(n,e))}),t.on("error",function(n){t.writableEnded&&_a(n).map(Ya).some(e=>"ERR_STREAM_WRITE_AFTER_END"==e.code)||e.error(n)}),t.on("close",function(){const n=function(e){switch(e){case Ra.PROTOCOL_ERROR:case Ra.INTERNAL_ERROR:case Ra.FLOW_CONTROL_ERROR:case Ra.SETTINGS_TIMEOUT:case Ra.FRAME_SIZE_ERROR:case Ra.COMPRESSION_ERROR:case Ra.CONNECT_ERROR:return new xo(`http/2 stream closed with error code ${Ra[e]} (0x${e.toString(16)})`,Pt.Internal);case Ra.REFUSED_STREAM:return new xo(`http/2 stream closed with error code ${Ra[e]} (0x${e.toString(16)})`,Pt.Unavailable);case Ra.CANCEL:return new xo(`http/2 stream closed with error code ${Ra[e]} (0x${e.toString(16)})`,Pt.Canceled);case Ra.ENHANCE_YOUR_CALM:return new xo(`http/2 stream closed with error code ${Ra[e]} (0x${e.toString(16)})`,Pt.ResourceExhausted);case Ra.INADEQUATE_SECURITY:case Ra.HTTP_1_1_REQUIRED:return new xo(`http/2 stream closed with error code ${Ra[e]} (0x${e.toString(16)})`,Pt.PermissionDenied)}}(t.rstCode);n&&e.error(n)}),o(t)},t=>{e.error(t)})}(t,n,e.url,e.method,ja(e.header),0,s=>{ic(e,s,t),s.on("response",e=>{var i;r({status:null!==(i=e[":status"])&&void 0!==i?i:0,header:Da(e),body:sc(t,s,n),trailer:rc(s)})})})})})}function nc(e,t,n){const r=t[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({async next(){const s=await e.race(r.next());return!0===s.done&&(Da(t.trailers).forEach((e,t)=>{n.set(t,e)}),e.close()),s},throw(t){throw e.error(t),t}})}}function rc(e){const t=new Headers;return e.on("trailers",e=>{Da(e).forEach((e,n)=>{t.set(n,e)})}),t}function sc(e,t,n){const r=t[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({async next(){const s=await e.race(r.next());return!0===s.done&&e.close(),null==n||n.notifyResponseByteRead(t),s},throw(t){throw e.error(t),t}})}}async function ic(e,t,n){if(void 0===e.body)return void(await new Promise(e=>t.end(e)));const r=e.body[Symbol.asyncIterator]();return new Promise(e=>{!function s(){if(n.isClosed())return;r.next().then(i=>{!0!==i.done?t.write(i.value,"binary",e=>{null!=e?(void 0!==r.throw&&r.throw(Fa(e)).catch(()=>{}),t.writableEnded&&_a(e).map(Ya).some(e=>"ERR_STREAM_WRITE_AFTER_END"==e.code)||n.error(e)):s()}):t.end(e)},e=>{n.error(e)})}()})}function oc(e){let t,n,r=!1,s=[];const i={error(e){if(!r){r=!0,n=e instanceof xo?e:Fa(e),null==t||t(n);for(const e of s)e(n);o()}},close(){r||(r=!0,t&&t(new xo("sentinel completed early",Pt.Internal)),o())},isClosed:()=>r,onError(e){r?void 0!==n&&e(n):s.push(e)},race(e){let s;const i=new Promise((e,n)=>{s=e,t=n});return e.then(e=>{null==s||s(e)},e=>{null==t||t(e)}),r&&(null==t||t(null!=n?n:new xo("sentinel completed early",Pt.Internal))),i}};function o(){e&&e.removeEventListener("abort",a),s=[],t=void 0}function a(){i.error(ia(this))}return e&&(e.addEventListener("abort",a),e.aborted&&i.error(ia(e))),i}function ac(e){var t,n,r,s;let i;if("2"==e.httpVersion){let t;t=e.sessionManager?e.sessionManager:new Qa(e.baseUrl,{pingIntervalMs:e.pingIntervalMs,pingIdleConnection:e.pingIdleConnection,pingTimeoutMs:e.pingTimeoutMs,idleConnectionTimeoutMs:e.idleConnectionTimeoutMs},e.nodeOptions),i=tc({httpVersion:"2",sessionProvider:()=>t})}else i=tc({httpVersion:"1.1",nodeOptions:e.nodeOptions});return Object.assign(Object.assign(Object.assign({},e),{httpClient:i,useBinaryFormat:null===(t=e.useBinaryFormat)||void 0===t||t,interceptors:null!==(n=e.interceptors)&&void 0!==n?n:[],sendCompression:null!==(r=e.sendCompression)&&void 0!==r?r:null,acceptCompression:null!==(s=e.acceptCompression)&&void 0!==s?s:[Ma,Ka]}),function(e,t,n){if(null!=t||(t=No),null!=e||(e=Wo),null!=n||(n=1024),t<1||t>No)throw new xo(`writeMaxBytes ${t} must be >= 1 and <= 4294967295`,Pt.Internal);if(e<1||e>Wo)throw new xo(`readMaxBytes ${e} must be >= 1 and <= 4294967295`,Pt.Internal);return{readMaxBytes:e,writeMaxBytes:t,compressMinBytes:n}}(e.readMaxBytes,e.writeMaxBytes,e.compressMinBytes))}function cc(e){return ka(ac(e))}var lc,uc,dc=/* @__PURE__ */Ri("ChpmbHV4bGF5L2F1dGgvdjEvYXV0aC5wcm90bxIPZmx1e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bHV4bGF5L2F1dGgvdjE7YXV0aHYxogIDRkFYqgIPRmx1eGxheS5BdXRoLlYxygIPRmx1eGxheVxBdXRoXFYx4gIbRmx1eGxheVxBdXRoXFYxXEdQQk1ldGFkYXRh6gIRRmx1eGxheTo6QXV0aDo6VjFiBnByb3RvMw"),hc=/* @__PURE__ */function(e){return e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.AUTHORIZATION_PENDING=1]="AUTHORIZATION_PENDING",e[e.APPROVED=2]="APPROVED",e[e.EXPIRED=3]="EXPIRED",e[e.DENIED=4]="DENIED",e}({}),mc=/* @__PURE__ */Ri("CiJmbHV4bGF5L2NoZWNrb3V0L3YxL2NoZWNrb3V0LnByb3RvEhNmbHV4bGF5LmNoZWNrb3V0LnYxIkQKGkNyZWF0ZVBheW1lbnRJbnRlbnRSZXF1ZXN0EhQKDHdhbGxwYXBlcl9pZBgBIAEoCRIQCghjdXJyZW5jeRgCIAEoCSI0ChtDcmVhdGVQYXltZW50SW50ZW50UmVzcG9uc2USFQoNY2xpZW50X3NlY3JldBgBIAEoCULdAQoXY29tLmZsdXhsYXkuY2hlY2tvdXQudjFCDUNoZWNrb3V0UHJvdG9QAVpFZ2l0aHViLmNvbS9rZW4xMDkvZmx1eGxheS1wcm90by9nZW4vZ28vZmx1eGxheS9jaGVja291dC92MTtjaGVja291dHYxogIDRkNYqgITRmx1eGxheS5DaGVja291dC5WMcoCE0ZsdXhsYXlcQ2hlY2tvdXRcVjHiAh9GbHV4bGF5XENoZWNrb3V0XFYxXEdQQk1ldGFkYXRh6gIVRmx1eGxheTo6Q2hlY2tvdXQ6OlYxYgZwcm90bzM"),gc=/* @__PURE__ */Ri("ChtidWYvdmFsaWRhdGUvdmFsaWRhdGUucHJvdG8SDGJ1Zi52YWxpZGF0ZSI3CgRSdWxlEgoKAmlkGAEgASgJEg8KB21lc3NhZ2UYAiABKAkSEgoKZXhwcmVzc2lvbhgDIAEoCSKGAQoMTWVzc2FnZVJ1bGVzEhYKDmN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1eGxheS1wcm90by9nZW4vZ28vZmx1eGxheS93YWxscGFwZXIvdjE7d2FsbHBhcGVydjGiAgNGV1iqAhRGbHV4bGF5LldhbGxwYXBlci5WMcoCFEZsdXhsYXlcV2FsbHBhcGVyXFYx4gIgRmx1eGxheVxXYWxscGFwZXJcVjFcR1BCTWV0YWRhdGHqAhZGbHV4bGF5OjpXYWxscGFwZXI6OlYxYgZwcm90bzM",[gc,bc,Wi])]),wc=/* @__PURE__ */aa(Ic,1),vc=/* @__PURE__ */aa(Ic,5),Gc="https://api.fluxlay.com",Ac=cc({baseUrl:Gc,httpVersion:"1.1"}),Sc=cc({baseUrl:Gc,httpVersion:"1.1",interceptors:[e=>async t=>{const n=await Jn.getValidSession();return n?.access_token&&t.header.set("Authorization",`Bearer ${n.access_token}`),e(t)}]}),Zc=ra(wc,Ac),Cc=ra(vc,Sc),Vc=class{static async saveDeveloperKey(e){Yt(e)}static async getDeveloperKey(){try{return await _t()||null}catch(e){return console.error(`[KeyStore] Error getting developer key: ${e}`),null}}};function Ec(){let e=Date.now();return{name:"fluxlay-dev-server",configureServer(t){t.watcher.on("change",()=>{e=Date.now()}),t.middlewares.use("/version",(t,n)=>{n.setHeader("Content-Type","application/json"),n.setHeader("Access-Control-Allow-Origin","*"),n.end(JSON.stringify({version:e}))})}}}async function Xc(e){const t=m.resolve(process.cwd(),e),n=m.join(t,"fluxlay.yaml");l.existsSync(n)||(Fe.error(pt.red("fluxlay.yaml is required in the project root.")),process.exit(1));try{Ht(l.readFileSync(n,"utf-8"))}catch(u){Fe.error(`Manifest Validation Error: ${u.message}`),process.exit(1)}const r=await Bc(3e3),s=Ke();s.start(pt.yellow(`Starting server on port ${r}...`)),await(await I({root:t,configFile:m.resolve(t,"vite.config.ts"),plugins:[Ec()],server:{port:r,strictPort:!0,cors:!0,host:"127.0.0.1"},logLevel:"error"})).listen(),s.stop(`${pt.green("✔")} Server started on port ${r}.`);const i=`http://127.0.0.1:${r}`;Fe.info(`Wallpaper server running at ${pt.underline.cyan(i)}`);const o=jt("com.fluxlay.core",{suffix:""}).data,a=m.join(o,"dev.json"),c=()=>{if(l.existsSync(a))try{l.unlinkSync(a)}catch(u){}};l.existsSync(o)||l.mkdirSync(o,{recursive:!0}),l.writeFileSync(a,JSON.stringify({url:i,root:t},null,2)),process.on("SIGINT",()=>{c(),process.exit()}),process.on("SIGTERM",()=>{c(),process.exit()}),process.on("exit",c),Oe(`Root: ${pt.gray(t)}\nWatching for changes...`,"Dev Server Active")}async function Bc(e){return new Promise((t,n)=>{const r=V.createServer();r.unref(),r.on("error",r=>{"EADDRINUSE"===r.code?t(Bc(e+1)):n(r)}),r.listen(e,()=>{r.close(()=>t(e))})})}function xc(){return void 0===lc&&(lc=function(){try{return l.statSync("/.dockerenv"),!0}catch{return!1}}()||function(){try{return l.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}()),lc}function Rc(){return void 0===uc&&(uc=(()=>{try{return l.statSync("/run/.containerenv"),!0}catch{return!1}})()||xc()),uc}var Wc=()=>{if("linux"!==r.platform)return!1;if(G.release().toLowerCase().includes("microsoft"))return!Rc();try{if(l.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft"))return!Rc()}catch{}return!(!l.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")&&!l.existsSync("/run/WSL"))&&!Rc()},Nc=r.env.__IS_WSL_TEST__?Wc:Wc(),Jc=e(f.execFile),kc=()=>`${r.env.SYSTEMROOT||r.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,Fc=async(e,t={})=>{const{powerShellPath:n,...r}=t,s=Fc.encodeCommand(e);return Jc(n??kc(),[...Fc.argumentsPrefix,s],{encoding:"utf8",...r})};Fc.argumentsPrefix=["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"],Fc.encodeCommand=e=>B.from(e,"utf16le").toString("base64"),Fc.escapeArgument=e=>`'${String(e).replaceAll("'","''")}'`;var _c,Yc=e(f.execFile),Hc=(()=>{const e="/mnt/";let t;return async function(){if(t)return t;const n="/etc/wsl.conf";let r=!1;try{await E.access(n,X.F_OK),r=!0}catch{}if(!r)return e;const s=function(e){for(const t of e.split("\n")){if(/^\s*#/.test(t))continue;const e=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(t);if(e)return e.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,"")}}(await E.readFile(n,{encoding:"utf8"}));return void 0===s?e:(t=s,t=t.endsWith("/")?t:`${t}/`,t)}})(),Lc=Nc?async()=>`${await Hc()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:kc;function Tc(e,t,n){const r=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){const e=n();return r(e),e},set(e){r(e)}}),e}var Oc=e(y);var Mc=e(y);async function Kc(e){return async function(e,{humanReadableOutput:t=!0,signal:n}={}){if("darwin"!==r.platform)throw new Error("macOS only");const s=t?[]:["-ss"],i={};n&&(i.signal=n);const{stdout:o}=await Mc("osascript",["-e",e,s],i);return o.trim()}(`tell application "Finder" to set app_path to application file id "${e}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var Uc=e(y),zc={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},Dc=new Map(Object.entries(zc)),jc=class extends Error{};var Pc=e(y);async function Qc(){if("darwin"===r.platform){const e=await async function(){if("darwin"!==r.platform)throw new Error("macOS only");const{stdout:e}=await Oc("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),t=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e)?.groups.id??"com.apple.Safari";return"com.apple.safari"===t?"com.apple.Safari":t}();return{name:await Kc(e),id:e}}if("linux"===r.platform){const{stdout:t}=await Pc("xdg-mime",["query","default","x-scheme-handler/http"]),n=t.trim();return{name:(e=n.replace(/.desktop$/,"").replace("-"," "),e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())),id:n}}var e;if("win32"===r.platform)return async function(e=Uc){const{stdout:t}=await e("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),n=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(t);if(!n)throw new jc(`Cannot find Windows browser in stdout: ${JSON.stringify(t)}`);const{id:r}=n.groups,s=r.lastIndexOf("."),i=r.lastIndexOf("-"),o=-1===s?void 0:r.slice(0,s),a=-1===i?void 0:r.slice(0,i);return zc[r]??zc[o]??zc[a]??{name:r,id:r}}();throw new Error("Only macOS, Linux, and Windows are supported")}var $c=Boolean(r.env.SSH_CONNECTION||r.env.SSH_CLIENT||r.env.SSH_TTY),qc=Symbol("fallbackAttempt"),el=import.meta.url?m.dirname(v(import.meta.url)):"",tl=m.join(el,"xdg-open"),{platform:nl,arch:rl}=r,sl=async(e,t)=>{if(0===e.length)return;const n=[];for(const s of e)try{return await t(s)}catch(r){n.push(r)}throw new AggregateError(n,"Failed to open in all supported apps")},il=async e=>{const t=!0===(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e})[qc];if(delete e[qc],Array.isArray(e.app))return sl(e.app,t=>il({...e,app:t,[qc]:!0}));let n,{name:s,arguments:i=[]}=e.app??{};if(i=[...i],Array.isArray(s))return sl(s,t=>il({...e,app:{name:t,arguments:i},[qc]:!0}));if("browser"===s||"browserPrivate"===s){const t={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge","com.apple.safari":"safari"},n={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"};let r;if(Nc){const e=await(async()=>{const e=await Lc(),{stdout:t}=await Fc(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{powerShellPath:e});return t.trim()})();r=Dc.get(e)??{}}else r=await Qc();if(r.id in t){const o=t[r.id.toLowerCase()];if("browserPrivate"===s){if("safari"===o)throw new Error("Safari doesn't support opening in private mode via command line");i.push(n[o])}return il({...e,app:{name:cl[o],arguments:i}})}throw new Error(`${r.name} is not supported as a default browser`)}const o=[],a={};let c=!1;if(!Nc||Rc()||$c||s||(c=await(async()=>(_c??=(async()=>{try{const e=await Lc();return await E.access(e,X.X_OK),!0}catch{return!1}})(),_c))()),"darwin"===nl)n="open",e.wait&&o.push("--wait-apps"),e.background&&o.push("--background"),e.newInstance&&o.push("--new"),s&&o.push("-a",s);else if("win32"===nl||c){n=await Lc(),o.push(...Fc.argumentsPrefix),Nc||(a.windowsVerbatimArguments=!0),Nc&&e.target&&(e.target=await(async e=>{if(/^[a-z]+:\/\//i.test(e))return e;try{const{stdout:t}=await Yc("wslpath",["-aw",e],{encoding:"utf8"});return t.trim()}catch{return e}})(e.target));const t=["$ProgressPreference = 'SilentlyContinue';","Start"];e.wait&&t.push("-Wait"),s?(t.push(Fc.escapeArgument(s)),e.target&&i.push(e.target)):e.target&&t.push(Fc.escapeArgument(e.target)),i.length>0&&(i=i.map(e=>Fc.escapeArgument(e)),t.push("-ArgumentList",i.join(","))),e.target=Fc.encodeCommand(t.join(" ")),e.wait||(a.stdio="ignore")}else{if(s)n=s;else{const e=!el||"/"===el;let t=!1;try{await E.access(tl,X.X_OK),t=!0}catch{}n=r.versions.electron??("android"===nl||e||!t)?"xdg-open":tl}i.length>0&&o.push(...i),e.wait||(a.stdio="ignore",a.detached=!0)}"darwin"===nl&&i.length>0&&o.push("--args",...i),e.target&&o.push(e.target);const l=f.spawn(n,o,a);return e.wait?new Promise((t,n)=>{l.once("error",n),l.once("close",r=>{e.allowNonzeroExitCode||0===r?t(l):n(/* @__PURE__ */new Error(`Exited with code ${r}`))})}):t?new Promise((e,t)=>{l.once("error",t),l.once("spawn",()=>{l.once("close",n=>{l.off("error",t),0===n?(l.unref(),e(l)):t(/* @__PURE__ */new Error(`Exited with code ${n}`))})})}):(l.unref(),new Promise((e,t)=>{l.once("error",t),l.once("spawn",()=>{l.off("error",t),e(l)})}))};function ol(e){if("string"==typeof e||Array.isArray(e))return e;const{[rl]:t}=e;if(!t)throw new Error(`${rl} is not supported`);return t}function al({[nl]:e},{wsl:t}={}){if(t&&Nc)return ol(t);if(!e)throw new Error(`${nl} is not supported`);return ol(e)}var cl={browser:"browser",browserPrivate:"browserPrivate"};Tc(cl,"chrome",()=>al({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium","chromium-browser"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}})),Tc(cl,"brave",()=>al({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}})),Tc(cl,"firefox",()=>al({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"})),Tc(cl,"edge",()=>al({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"})),Tc(cl,"safari",()=>al({darwin:"Safari"}));var ll=async()=>{const e=Ke();try{const{deviceCode:t,userCode:n,verificationUri:r,interval:s}=await Zc.createDeviceCode({});Fe.message(`ブラウザで以下を開いてください: ${pt.underline.cyan(r)}`),Fe.message(`認証コード: ${pt.bold.yellow(n)}`),await((e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a `target`");return il({...t,target:e})})(`${r}?user_code=${encodeURIComponent(n)}`),e.start(pt.yellow("認証を待っています..."));const i=await async function(e,t){const n=Date.now()+9e5;for(;Date.now()<n;){await new Promise(e=>setTimeout(e,1e3*t));const n=await Zc.pollDeviceToken({deviceCode:e});if(n.status===hc.APPROVED&&n.session)return n.session;if(n.status===hc.EXPIRED||n.status===hc.DENIED)return null}return null}(t,s||5);i||(e.stop(pt.red("認証がタイムアウトまたはキャンセルされました")),process.exit(1)),await Jn.saveSession({access_token:i.accessToken,refresh_token:i.refreshToken,token_type:i.tokenType||"bearer",expires_at:Number(i.expiresAt),expires_in:3600,user:{email:i.email,id:"",aud:"",role:"",email_confirmed_at:"",phone:"",confirmed_at:"",last_sign_in_at:"",app_metadata:{},user_metadata:{},created_at:"",updated_at:"",is_anonymous:!1}}),e.stop(`${pt.green("✔")} ${pt.cyan(i.email)} としてログインしました`)}catch(t){e.stop(pt.red("認証に失敗しました")),Fe.error(t instanceof Error?t.message:String(t)),process.exit(1)}};function ul(e){return null==e}var dl={isNothing:ul,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:ul(e)?[]:[e]},repeat:function(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r},isNegativeZero:function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},extend:function(e,t){var n,r,s,i;if(t)for(n=0,r=(i=Object.keys(t)).length;n<r;n+=1)e[s=i[n]]=t[s];return e}};function hl(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+="\n\n"+e.mark.snippet),r+" "+n):r}function ml(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=hl(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=/* @__PURE__ */(new Error).stack||""}ml.prototype=Object.create(Error.prototype),ml.prototype.constructor=ml,ml.prototype.toString=function(e){return this.name+": "+hl(this,e)};var gl=ml;function pl(e,t,n,r,s){var i="",o="",a=Math.floor(s/2)-1;return r-t>a&&(t=r-a+(i=" ... ").length),n-r>a&&(n=r+a-(o=" ...").length),{str:i+e.slice(t,n).replace(/\t/g,"→")+o,pos:r-t+i.length}}function fl(e,t){return dl.repeat(" ",t-e.length)+e}var yl=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,r=/\r?\n|\r|\0/g,s=[0],i=[],o=-1;n=r.exec(e.buffer);)i.push(n.index),s.push(n.index+n[0].length),e.position<=n.index&&o<0&&(o=s.length-2);o<0&&(o=s.length-1);var a,c,l="",u=Math.min(e.line+t.linesAfter,i.length).toString().length,d=t.maxLength-(t.indent+u+3);for(a=1;a<=t.linesBefore&&!(o-a<0);a++)c=pl(e.buffer,s[o-a],i[o-a],e.position-(s[o]-s[o-a]),d),l=dl.repeat(" ",t.indent)+fl((e.line-a+1).toString(),u)+" | "+c.str+"\n"+l;for(c=pl(e.buffer,s[o],i[o],e.position,d),l+=dl.repeat(" ",t.indent)+fl((e.line+1).toString(),u)+" | "+c.str+"\n",l+=dl.repeat("-",t.indent+u+3+c.pos)+"^\n",a=1;a<=t.linesAfter&&!(o+a>=i.length);a++)c=pl(e.buffer,s[o+a],i[o+a],e.position-(s[o]-s[o+a]),d),l+=dl.repeat(" ",t.indent)+fl((e.line+a+1).toString(),u)+" | "+c.str+"\n";return l.replace(/\n$/,"")},bl=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Il=["scalar","sequence","mapping"];var wl=function(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===bl.indexOf(t))throw new gl('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}(t.styleAliases||null),-1===Il.indexOf(this.kind))throw new gl('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function vl(e,t){var n=[];return e[t].forEach(function(e){var t=n.length;n.forEach(function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)}),n[t]=e}),n}function Gl(e){return this.extend(e)}Gl.prototype.extend=function(e){var t=[],n=[];if(e instanceof wl)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new gl("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach(function(e){if(!(e instanceof wl))throw new gl("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new gl("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new gl("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(e){if(!(e instanceof wl))throw new gl("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(Gl.prototype);return r.implicit=(this.implicit||[]).concat(t),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=vl(r,"implicit"),r.compiledExplicit=vl(r,"explicit"),r.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}(r.compiledImplicit,r.compiledExplicit),r};var Al=Gl,Sl=new wl("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}}),Zl=new wl("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}}),Cl=new wl("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}}),Vl=new Al({explicit:[Sl,Zl,Cl]});var El=new wl("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});var Xl=new wl("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Bl(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function xl(e){return 48<=e&&e<=55}function Rl(e){return 48<=e&&e<=57}var Wl=new wl("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n=e.length,r=0,s=!1;if(!n)return!1;if("-"!==(t=e[r])&&"+"!==t||(t=e[++r]),"0"===t){if(r+1===n)return!0;if("b"===(t=e[++r])){for(r++;r<n;r++)if("_"!==(t=e[r])){if("0"!==t&&"1"!==t)return!1;s=!0}return s&&"_"!==t}if("x"===t){for(r++;r<n;r++)if("_"!==(t=e[r])){if(!Bl(e.charCodeAt(r)))return!1;s=!0}return s&&"_"!==t}if("o"===t){for(r++;r<n;r++)if("_"!==(t=e[r])){if(!xl(e.charCodeAt(r)))return!1;s=!0}return s&&"_"!==t}}if("_"===t)return!1;for(;r<n;r++)if("_"!==(t=e[r])){if(!Rl(e.charCodeAt(r)))return!1;s=!0}return!(!s||"_"===t)},construct:function(e){var t,n=e,r=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(t=n[0])&&"+"!==t||("-"===t&&(r=-1),t=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===t){if("b"===n[1])return r*parseInt(n.slice(2),2);if("x"===n[1])return r*parseInt(n.slice(2),16);if("o"===n[1])return r*parseInt(n.slice(2),8)}return r*parseInt(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!dl.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Nl=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var Jl=/^[-+]?[0-9]+e/;var kl=new wl("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!Nl.test(e)||"_"===e[e.length-1])},construct:function(e){var t=e.replace(/_/g,"").toLowerCase(),n="-"===t[0]?-1:1;return"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||dl.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(dl.isNegativeZero(e))return"-0.0";return n=e.toString(10),Jl.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),Fl=Vl.extend({implicit:[El,Xl,Wl,kl]}),_l=Fl,Yl=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Hl=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var Ll=new wl("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==Yl.exec(e)||null!==Hl.exec(e))},construct:function(e){var t,n,r,s,i,o,a,c,l=0,u=null;if(null===(t=Yl.exec(e))&&(t=Hl.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,s=+t[3],!t[4])return new Date(Date.UTC(n,r,s));if(i=+t[4],o=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),c=new Date(Date.UTC(n,r,s,i,o,a,l)),u&&c.setTime(c.getTime()-u),c},instanceOf:Date,represent:function(e){return e.toISOString()}});var Tl=new wl("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),Ol="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var Ml=new wl("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,s=e.length,i=Ol;for(n=0;n<s;n++)if(!((t=i.indexOf(e.charAt(n)))>64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,r=e.replace(/[\r\n=]/g,""),s=r.length,i=Ol,o=0,a=[];for(t=0;t<s;t++)t%4==0&&t&&(a.push(o>>16&255),a.push(o>>8&255),a.push(255&o)),o=o<<6|i.indexOf(r.charAt(t));return 0===(n=s%4*6)?(a.push(o>>16&255),a.push(o>>8&255),a.push(255&o)):18===n?(a.push(o>>10&255),a.push(o>>2&255)):12===n&&a.push(o>>4&255),new Uint8Array(a)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,r="",s=0,i=e.length,o=Ol;for(t=0;t<i;t++)t%3==0&&t&&(r+=o[s>>18&63],r+=o[s>>12&63],r+=o[s>>6&63],r+=o[63&s]),s=(s<<8)+e[t];return 0===(n=i%3)?(r+=o[s>>18&63],r+=o[s>>12&63],r+=o[s>>6&63],r+=o[63&s]):2===n?(r+=o[s>>10&63],r+=o[s>>4&63],r+=o[s<<2&63],r+=o[64]):1===n&&(r+=o[s>>2&63],r+=o[s<<4&63],r+=o[64],r+=o[64]),r}}),Kl=Object.prototype.hasOwnProperty,Ul=Object.prototype.toString;var zl=new wl("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,s,i,o=[],a=e;for(t=0,n=a.length;t<n;t+=1){if(r=a[t],i=!1,"[object Object]"!==Ul.call(r))return!1;for(s in r)if(Kl.call(r,s)){if(i)return!1;i=!0}if(!i)return!1;if(-1!==o.indexOf(s))return!1;o.push(s)}return!0},construct:function(e){return null!==e?e:[]}}),Dl=Object.prototype.toString;var jl=new wl("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,s,i,o=e;for(i=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],"[object Object]"!==Dl.call(r))return!1;if(1!==(s=Object.keys(r)).length)return!1;i[t]=[s[0],r[s[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,r,s,i,o=e;for(i=new Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],s=Object.keys(r),i[t]=[s[0],r[s[0]]];return i}}),Pl=Object.prototype.hasOwnProperty;var Ql=new wl("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(Pl.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}}),$l=_l.extend({implicit:[Ll,Tl],explicit:[Ml,zl,jl,Ql]}),ql=Object.prototype.hasOwnProperty,eu=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,tu=/[\x85\u2028\u2029]/,nu=/[,\[\]\{\}]/,ru=/^(?:!|!!|![a-z\-]+!)$/i,su=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function iu(e){return Object.prototype.toString.call(e)}function ou(e){return 10===e||13===e}function au(e){return 9===e||32===e}function cu(e){return 9===e||32===e||10===e||13===e}function lu(e){return 44===e||91===e||93===e||123===e||125===e}function uu(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function du(e){return 120===e?2:117===e?4:85===e?8:0}function hu(e){return 48<=e&&e<=57?e-48:-1}function mu(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function gu(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}function pu(e,t,n){"__proto__"===t?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}for(var fu=new Array(256),yu=new Array(256),bu=0;bu<256;bu++)fu[bu]=mu(bu)?1:0,yu[bu]=mu(bu);function Iu(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||$l,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function wu(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=yl(n),new gl(t,n)}function vu(e,t){throw wu(e,t)}function Gu(e,t){e.onWarning&&e.onWarning.call(null,wu(e,t))}var Au={YAML:function(e,t,n){var r,s,i;null!==e.version&&vu(e,"duplication of %YAML directive"),1!==n.length&&vu(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&vu(e,"ill-formed argument of the YAML directive"),s=parseInt(r[1],10),i=parseInt(r[2],10),1!==s&&vu(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=i<2,1!==i&&2!==i&&Gu(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,s;2!==n.length&&vu(e,"TAG directive accepts exactly two arguments"),r=n[0],s=n[1],ru.test(r)||vu(e,"ill-formed tag handle (first argument) of the TAG directive"),ql.call(e.tagMap,r)&&vu(e,'there is a previously declared suffix for "'+r+'" tag handle'),su.test(s)||vu(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch(i){vu(e,"tag prefix is malformed: "+s)}e.tagMap[r]=s}};function Su(e,t,n,r){var s,i,o,a;if(t<n){if(a=e.input.slice(t,n),r)for(s=0,i=a.length;s<i;s+=1)9===(o=a.charCodeAt(s))||32<=o&&o<=1114111||vu(e,"expected valid JSON character");else eu.test(a)&&vu(e,"the stream contains non-printable characters");e.result+=a}}function Zu(e,t,n,r){var s,i,o,a;for(dl.isObject(n)||vu(e,"cannot merge mappings; the provided source object is unacceptable"),o=0,a=(s=Object.keys(n)).length;o<a;o+=1)i=s[o],ql.call(t,i)||(pu(t,i,n[i]),r[i]=!0)}function Cu(e,t,n,r,s,i,o,a,c){var l,u;if(Array.isArray(s))for(l=0,u=(s=Array.prototype.slice.call(s)).length;l<u;l+=1)Array.isArray(s[l])&&vu(e,"nested arrays are not supported inside keys"),"object"==typeof s&&"[object Object]"===iu(s[l])&&(s[l]="[object Object]");if("object"==typeof s&&"[object Object]"===iu(s)&&(s="[object Object]"),s=String(s),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(i))for(l=0,u=i.length;l<u;l+=1)Zu(e,t,i[l],n);else Zu(e,t,i,n);else e.json||ql.call(n,s)||!ql.call(t,s)||(e.line=o||e.line,e.lineStart=a||e.lineStart,e.position=c||e.position,vu(e,"duplicated mapping key")),pu(t,s,i),delete n[s];return t}function Vu(e){var t=e.input.charCodeAt(e.position);10===t?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):vu(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Eu(e,t,n){for(var r=0,s=e.input.charCodeAt(e.position);0!==s;){for(;au(s);)9===s&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),s=e.input.charCodeAt(++e.position);if(t&&35===s)do{s=e.input.charCodeAt(++e.position)}while(10!==s&&13!==s&&0!==s);if(!ou(s))break;for(Vu(e),s=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===s;)e.lineIndent++,s=e.input.charCodeAt(++e.position)}return-1!==n&&0!==r&&e.lineIndent<n&&Gu(e,"deficient indentation"),r}function Xu(e){var t=e.position,n=e.input.charCodeAt(t);return!(45!==n&&46!==n||n!==e.input.charCodeAt(t+1)||n!==e.input.charCodeAt(t+2)||(t+=3,0!==(n=e.input.charCodeAt(t))&&!cu(n)))}function Bu(e,t){1===t?e.result+=" ":t>1&&(e.result+=dl.repeat("\n",t-1))}function xu(e,t){var n,r,s=e.tag,i=e.anchor,o=[],a=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),r=e.input.charCodeAt(e.position);0!==r&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,vu(e,"tab characters must not be used in indentation")),45===r)&&cu(e.input.charCodeAt(e.position+1));)if(a=!0,e.position++,Eu(e,!0,-1)&&e.lineIndent<=t)o.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,Nu(e,t,3,!1,!0),o.push(e.result),Eu(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)vu(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!a&&(e.tag=s,e.anchor=i,e.kind="sequence",e.result=o,!0)}function Ru(e){var t,n,r,s=!1,i=!1,o=e.input.charCodeAt(e.position);if(33!==o)return!1;if(null!==e.tag&&vu(e,"duplication of a tag property"),60===(o=e.input.charCodeAt(++e.position))?(s=!0,o=e.input.charCodeAt(++e.position)):33===o?(i=!0,n="!!",o=e.input.charCodeAt(++e.position)):n="!",t=e.position,s){do{o=e.input.charCodeAt(++e.position)}while(0!==o&&62!==o);e.position<e.length?(r=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):vu(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==o&&!cu(o);)33===o&&(i?vu(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),ru.test(n)||vu(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),nu.test(r)&&vu(e,"tag suffix cannot contain flow indicator characters")}r&&!su.test(r)&&vu(e,"tag name cannot contain such characters: "+r);try{r=decodeURIComponent(r)}catch(a){vu(e,"tag name is malformed: "+r)}return s?e.tag=r:ql.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:vu(e,'undeclared tag handle "'+n+'"'),!0}function Wu(e){var t,n=e.input.charCodeAt(e.position);if(38!==n)return!1;for(null!==e.anchor&&vu(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!cu(n)&&!lu(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&vu(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Nu(e,t,n,r,s){var i,o,a,c,l,u,d,h,m,g=1,p=!1,f=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=o=a=4===n||3===n,r&&Eu(e,!0,-1)&&(p=!0,e.lineIndent>t?g=1:e.lineIndent===t?g=0:e.lineIndent<t&&(g=-1)),1===g)for(;Ru(e)||Wu(e);)Eu(e,!0,-1)?(p=!0,a=i,e.lineIndent>t?g=1:e.lineIndent===t?g=0:e.lineIndent<t&&(g=-1)):a=!1;if(a&&(a=p||s),1!==g&&4!==n||(h=1===n||2===n?t:t+1,m=e.position-e.lineStart,1===g?a&&(xu(e,m)||function(e,t,n){var r,s,i,o,a,c,l,u=e.tag,d=e.anchor,h={},m=Object.create(null),g=null,p=null,f=null,y=!1,b=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=h),l=e.input.charCodeAt(e.position);0!==l;){if(y||-1===e.firstTabInLine||(e.position=e.firstTabInLine,vu(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),i=e.line,63!==l&&58!==l||!cu(r)){if(o=e.line,a=e.lineStart,c=e.position,!Nu(e,n,2,!1,!0))break;if(e.line===i){for(l=e.input.charCodeAt(e.position);au(l);)l=e.input.charCodeAt(++e.position);if(58===l)cu(l=e.input.charCodeAt(++e.position))||vu(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(Cu(e,h,m,g,p,null,o,a,c),g=p=f=null),b=!0,y=!1,s=!1,g=e.tag,p=e.result;else{if(!b)return e.tag=u,e.anchor=d,!0;vu(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!b)return e.tag=u,e.anchor=d,!0;vu(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===l?(y&&(Cu(e,h,m,g,p,null,o,a,c),g=p=f=null),b=!0,y=!0,s=!0):y?(y=!1,s=!0):vu(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,l=r;if((e.line===i||e.lineIndent>t)&&(y&&(o=e.line,a=e.lineStart,c=e.position),Nu(e,t,4,!0,s)&&(y?p=e.result:f=e.result),y||(Cu(e,h,m,g,p,f,o,a,c),g=p=f=null),Eu(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>t)&&0!==l)vu(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&Cu(e,h,m,g,p,null,o,a,c),b&&(e.tag=u,e.anchor=d,e.kind="mapping",e.result=h),b}(e,m,h))||function(e,t){var n,r,s,i,o,a,c,l,u,d,h,m=!0,g=e.tag,p=e.anchor,f=Object.create(null),y=e.input.charCodeAt(e.position);if(91===y)o=93,l=!1,i=[];else{if(123!==y)return!1;o=125,l=!0,i={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=i),y=e.input.charCodeAt(++e.position);0!==y;){if(Eu(e,!0,t),(y=e.input.charCodeAt(e.position))===o)return e.position++,e.tag=g,e.anchor=p,e.kind=l?"mapping":"sequence",e.result=i,!0;m?44===y&&vu(e,"expected the node content, but found ','"):vu(e,"missed comma between flow collection entries"),h=null,a=c=!1,63===y&&cu(e.input.charCodeAt(e.position+1))&&(a=c=!0,e.position++,Eu(e,!0,t)),n=e.line,r=e.lineStart,s=e.position,Nu(e,t,1,!1,!0),d=e.tag,u=e.result,Eu(e,!0,t),y=e.input.charCodeAt(e.position),!c&&e.line!==n||58!==y||(a=!0,y=e.input.charCodeAt(++e.position),Eu(e,!0,t),Nu(e,t,1,!1,!0),h=e.result),l?Cu(e,i,f,d,u,h,n,r,s):a?i.push(Cu(e,null,f,d,u,h,n,r,s)):i.push(u),Eu(e,!0,t),44===(y=e.input.charCodeAt(e.position))?(m=!0,y=e.input.charCodeAt(++e.position)):m=!1}vu(e,"unexpected end of the stream within a flow collection")}(e,h)?f=!0:(o&&function(e,t){var n,r,s,i=1,o=!1,a=!1,c=t,l=0,u=!1,d=e.input.charCodeAt(e.position);if(124===d)r=!1;else{if(62!==d)return!1;r=!0}for(e.kind="scalar",e.result="";0!==d;)if(43===(d=e.input.charCodeAt(++e.position))||45===d)1===i?i=43===d?3:2:vu(e,"repeat of a chomping mode identifier");else{if(!((s=hu(d))>=0))break;0===s?vu(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?vu(e,"repeat of an indentation width identifier"):(c=t+s-1,a=!0)}if(au(d)){do{d=e.input.charCodeAt(++e.position)}while(au(d));if(35===d)do{d=e.input.charCodeAt(++e.position)}while(!ou(d)&&0!==d)}for(;0!==d;){for(Vu(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!a||e.lineIndent<c)&&32===d;)e.lineIndent++,d=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>c&&(c=e.lineIndent),ou(d))l++;else{if(e.lineIndent<c){3===i?e.result+=dl.repeat("\n",o?1+l:l):1===i&&o&&(e.result+="\n");break}for(r?au(d)?(u=!0,e.result+=dl.repeat("\n",o?1+l:l)):u?(u=!1,e.result+=dl.repeat("\n",l+1)):0===l?o&&(e.result+=" "):e.result+=dl.repeat("\n",l):e.result+=dl.repeat("\n",o?1+l:l),o=!0,a=!0,l=0,n=e.position;!ou(d)&&0!==d;)d=e.input.charCodeAt(++e.position);Su(e,n,e.position,!1)}}return!0}(e,h)||function(e,t){var n,r,s=e.input.charCodeAt(e.position);if(39!==s)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(s=e.input.charCodeAt(e.position));)if(39===s){if(Su(e,n,e.position,!0),39!==(s=e.input.charCodeAt(++e.position)))return!0;n=e.position,e.position++,r=e.position}else ou(s)?(Su(e,n,r,!0),Bu(e,Eu(e,!1,t)),n=r=e.position):e.position===e.lineStart&&Xu(e)?vu(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);vu(e,"unexpected end of the stream within a single quoted scalar")}(e,h)||function(e,t){var n,r,s,i,o,a=e.input.charCodeAt(e.position);if(34!==a)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(a=e.input.charCodeAt(e.position));){if(34===a)return Su(e,n,e.position,!0),e.position++,!0;if(92===a){if(Su(e,n,e.position,!0),ou(a=e.input.charCodeAt(++e.position)))Eu(e,!1,t);else if(a<256&&fu[a])e.result+=yu[a],e.position++;else if((o=du(a))>0){for(s=o,i=0;s>0;s--)(o=uu(a=e.input.charCodeAt(++e.position)))>=0?i=(i<<4)+o:vu(e,"expected hexadecimal character");e.result+=gu(i),e.position++}else vu(e,"unknown escape sequence");n=r=e.position}else ou(a)?(Su(e,n,r,!0),Bu(e,Eu(e,!1,t)),n=r=e.position):e.position===e.lineStart&&Xu(e)?vu(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}vu(e,"unexpected end of the stream within a double quoted scalar")}(e,h)?f=!0:!function(e){var t,n,r=e.input.charCodeAt(e.position);if(42!==r)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!cu(r)&&!lu(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&vu(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),ql.call(e.anchorMap,n)||vu(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],Eu(e,!0,-1),!0}(e)?function(e,t,n){var r,s,i,o,a,c,l,u=e.kind,d=e.result,h=e.input.charCodeAt(e.position);if(cu(h)||lu(h)||35===h||38===h||42===h||33===h||124===h||62===h||39===h||34===h||37===h||64===h||96===h)return!1;if((63===h||45===h)&&(cu(r=e.input.charCodeAt(e.position+1))||n&&lu(r)))return!1;for(e.kind="scalar",e.result="",s=i=e.position,o=!1;0!==h;){if(58===h){if(cu(r=e.input.charCodeAt(e.position+1))||n&&lu(r))break}else if(35===h){if(cu(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&Xu(e)||n&&lu(h))break;if(ou(h)){if(a=e.line,c=e.lineStart,l=e.lineIndent,Eu(e,!1,-1),e.lineIndent>=t){o=!0,h=e.input.charCodeAt(e.position);continue}e.position=i,e.line=a,e.lineStart=c,e.lineIndent=l;break}}o&&(Su(e,s,i,!1),Bu(e,e.line-a),s=i=e.position,o=!1),au(h)||(i=e.position+1),h=e.input.charCodeAt(++e.position)}return Su(e,s,i,!1),!!e.result||(e.kind=u,e.result=d,!1)}(e,h,1===n)&&(f=!0,null===e.tag&&(e.tag="?")):(f=!0,null===e.tag&&null===e.anchor||vu(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===g&&(f=a&&xu(e,m))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&vu(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),c=0,l=e.implicitTypes.length;c<l;c+=1)if((d=e.implicitTypes[c]).resolve(e.result)){e.result=d.construct(e.result),e.tag=d.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else if("!"!==e.tag){if(ql.call(e.typeMap[e.kind||"fallback"],e.tag))d=e.typeMap[e.kind||"fallback"][e.tag];else for(d=null,c=0,l=(u=e.typeMap.multi[e.kind||"fallback"]).length;c<l;c+=1)if(e.tag.slice(0,u[c].tag.length)===u[c].tag){d=u[c];break}d||vu(e,"unknown tag !<"+e.tag+">"),null!==e.result&&d.kind!==e.kind&&vu(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result,e.tag)?(e.result=d.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):vu(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||f}function Ju(e){var t,n,r,s,i=e.position,o=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(s=e.input.charCodeAt(e.position))&&(Eu(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==s));){for(o=!0,s=e.input.charCodeAt(++e.position),t=e.position;0!==s&&!cu(s);)s=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&vu(e,"directive name must not be less than one character in length");0!==s;){for(;au(s);)s=e.input.charCodeAt(++e.position);if(35===s){do{s=e.input.charCodeAt(++e.position)}while(0!==s&&!ou(s));break}if(ou(s))break;for(t=e.position;0!==s&&!cu(s);)s=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==s&&Vu(e),ql.call(Au,n)?Au[n](e,n,r):Gu(e,'unknown document directive "'+n+'"')}Eu(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,Eu(e,!0,-1)):o&&vu(e,"directives end mark is expected"),Nu(e,e.lineIndent-1,4,!1,!0),Eu(e,!0,-1),e.checkLineBreaks&&tu.test(e.input.slice(i,e.position))&&Gu(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Xu(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,Eu(e,!0,-1)):e.position<e.length-1&&vu(e,"end of the stream or a document separator is expected")}function ku(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new Iu(e,t),r=e.indexOf("\0");for(-1!==r&&(n.position=r,vu(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Ju(n);return n.documents}var Fu=function(e,t,n){null!==t&&"object"==typeof t&&void 0===n&&(n=t,t=null);var r=ku(e,n);if("function"!=typeof t)return r;for(var s=0,i=r.length;s<i;s+=1)t(r[s])},_u=function(e,t){var n=ku(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new gl("expected a single document in the stream, but found more")}},Yu=Object.prototype.toString,Hu=Object.prototype.hasOwnProperty,Lu=65279,Tu={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},Ou=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Mu=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Ku(e){var t,n,r=e.toString(16).toUpperCase();if(e<=255)t="x",n=2;else if(e<=65535)t="u",n=4;else{if(!(e<=4294967295))throw new gl("code point within a string may not be greater than 0xFFFFFFFF");t="U",n=8}return"\\"+t+dl.repeat("0",n-r.length)+r}function Uu(e){this.schema=e.schema||$l,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=dl.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,r,s,i,o,a,c;if(null===t)return{};for(n={},s=0,i=(r=Object.keys(t)).length;s<i;s+=1)o=r[s],a=String(t[o]),"!!"===o.slice(0,2)&&(o="tag:yaml.org,2002:"+o.slice(2)),(c=e.compiledTypeMap.fallback[o])&&Hu.call(c.styleAliases,a)&&(a=c.styleAliases[a]),n[o]=a;return n}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType='"'===e.quotingType?2:1,this.forceQuotes=e.forceQuotes||!1,this.replacer="function"==typeof e.replacer?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function zu(e,t){for(var n,r=dl.repeat(" ",t),s=0,i=-1,o="",a=e.length;s<a;)-1===(i=e.indexOf("\n",s))?(n=e.slice(s),s=a):(n=e.slice(s,i+1),s=i+1),n.length&&"\n"!==n&&(o+=r),o+=n;return o}function Du(e,t){return"\n"+dl.repeat(" ",e.indent*t)}function ju(e){return 32===e||9===e}function Pu(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&e!==Lu||65536<=e&&e<=1114111}function Qu(e){return Pu(e)&&e!==Lu&&13!==e&&10!==e}function $u(e,t,n){var r=Qu(e),s=r&&!ju(e);return(n?r:r&&44!==e&&91!==e&&93!==e&&123!==e&&125!==e)&&35!==e&&!(58===t&&!s)||Qu(t)&&!ju(t)&&35===e||58===t&&s}function qu(e,t){var n,r=e.charCodeAt(t);return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1))>=56320&&n<=57343?1024*(r-55296)+n-56320+65536:r}function ed(e){return/^\n* /.test(e)}function td(e,t,n,r,s,i,o,a){var c,l,u=0,d=null,h=!1,m=!1,g=-1!==r,p=-1,f=Pu(l=qu(e,0))&&l!==Lu&&!ju(l)&&45!==l&&63!==l&&58!==l&&44!==l&&91!==l&&93!==l&&123!==l&&125!==l&&35!==l&&38!==l&&42!==l&&33!==l&&124!==l&&61!==l&&62!==l&&39!==l&&34!==l&&37!==l&&64!==l&&96!==l&&function(e){return!ju(e)&&58!==e}(qu(e,e.length-1));if(t||o)for(c=0;c<e.length;u>=65536?c+=2:c++){if(!Pu(u=qu(e,c)))return 5;f=f&&$u(u,d,a),d=u}else{for(c=0;c<e.length;u>=65536?c+=2:c++){if(10===(u=qu(e,c)))h=!0,g&&(m=m||c-p-1>r&&" "!==e[p+1],p=c);else if(!Pu(u))return 5;f=f&&$u(u,d,a),d=u}m=m||g&&c-p-1>r&&" "!==e[p+1]}return h||m?n>9&&ed(e)?5:o?2===i?5:2:m?4:3:!f||o||s(e)?2===i?5:2:1}function nd(e,t,n,r,s){e.dump=function(){if(0===t.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==Ou.indexOf(t)||Mu.test(t)))return 2===e.quotingType?'"'+t+'"':"'"+t+"'";var i=e.indent*Math.max(1,n),o=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),a=r||e.flowLevel>-1&&n>=e.flowLevel;switch(td(t,a,e.indent,o,function(t){return function(e,t){var n,r;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)},e.quotingType,e.forceQuotes&&!r,s)){case 1:return t;case 2:return"'"+t.replace(/'/g,"''")+"'";case 3:return"|"+rd(t,e.indent)+sd(zu(t,i));case 4:return">"+rd(t,e.indent)+sd(zu(function(e,t){var n,r,s=/(\n+)([^\n]*)/g,i=(a=e.indexOf("\n"),a=-1!==a?a:e.length,s.lastIndex=a,id(e.slice(0,a),t)),o="\n"===e[0]||" "===e[0];var a;for(;r=s.exec(e);){var c=r[1],l=r[2];n=" "===l[0],i+=c+(o||n||""===l?"":"\n")+id(l,t),o=n}return i}(t,o),i));case 5:return'"'+function(e){for(var t,n="",r=0,s=0;s<e.length;r>=65536?s+=2:s++)r=qu(e,s),!(t=Tu[r])&&Pu(r)?(n+=e[s],r>=65536&&(n+=e[s+1])):n+=t||Ku(r);return n}(t)+'"';default:throw new gl("impossible error: invalid scalar style")}}()}function rd(e,t){var n=ed(e)?String(t):"",r="\n"===e[e.length-1];return n+(!r||"\n"!==e[e.length-2]&&"\n"!==e?r?"":"-":"+")+"\n"}function sd(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function id(e,t){if(""===e||" "===e[0])return e;for(var n,r,s=/ [^ ]/g,i=0,o=0,a=0,c="";n=s.exec(e);)(a=n.index)-i>t&&(r=o>i?o:a,c+="\n"+e.slice(i,r),i=r+1),o=a;return c+="\n",e.length-i>t&&o>i?c+=e.slice(i,o)+"\n"+e.slice(o+1):c+=e.slice(i),c.slice(1)}function od(e,t,n,r){var s,i,o,a="",c=e.tag;for(s=0,i=n.length;s<i;s+=1)o=n[s],e.replacer&&(o=e.replacer.call(n,String(s),o)),(cd(e,t+1,o,!0,!0,!1,!0)||void 0===o&&cd(e,t+1,null,!0,!0,!1,!0))&&(r&&""===a||(a+=Du(e,t)),e.dump&&10===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=c,e.dump=a||"[]"}function ad(e,t,n){var r,s,i,o,a,c=n?e.explicitTypes:e.implicitTypes;for(s=0,i=c.length;s<i;s+=1)if(((o=c[s]).instanceOf||o.predicate)&&(!o.instanceOf||"object"==typeof t&&t instanceof o.instanceOf)&&(!o.predicate||o.predicate(t))){if(n?o.multi&&o.representName?e.tag=o.representName(t):e.tag=o.tag:e.tag="?",o.represent){if(a=e.styleMap[o.tag]||o.defaultStyle,"[object Function]"===Yu.call(o.represent))r=o.represent(t,a);else{if(!Hu.call(o.represent,a))throw new gl("!<"+o.tag+'> tag resolver accepts not "'+a+'" style');r=o.represent[a](t,a)}e.dump=r}return!0}return!1}function cd(e,t,n,r,s,i,o){e.tag=null,e.dump=n,ad(e,n,!1)||ad(e,n,!0);var a,c=Yu.call(e.dump),l=r;r&&(r=e.flowLevel<0||e.flowLevel>t);var u,d,h="[object Object]"===c||"[object Array]"===c;if(h&&(d=-1!==(u=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||d||2!==e.indent&&t>0)&&(s=!1),d&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(h&&d&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),"[object Object]"===c)r&&0!==Object.keys(e.dump).length?(!function(e,t,n,r){var s,i,o,a,c,l,u="",d=e.tag,h=Object.keys(n);if(!0===e.sortKeys)h.sort();else if("function"==typeof e.sortKeys)h.sort(e.sortKeys);else if(e.sortKeys)throw new gl("sortKeys must be a boolean or a function");for(s=0,i=h.length;s<i;s+=1)l="",r&&""===u||(l+=Du(e,t)),a=n[o=h[s]],e.replacer&&(a=e.replacer.call(n,o,a)),cd(e,t+1,o,!0,!0,!0)&&((c=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&10===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,c&&(l+=Du(e,t)),cd(e,t+1,a,!0,c)&&(e.dump&&10===e.dump.charCodeAt(0)?l+=":":l+=": ",u+=l+=e.dump));e.tag=d,e.dump=u||"{}"}(e,t,e.dump,s),d&&(e.dump="&ref_"+u+e.dump)):(!function(e,t,n){var r,s,i,o,a,c="",l=e.tag,u=Object.keys(n);for(r=0,s=u.length;r<s;r+=1)a="",""!==c&&(a+=", "),e.condenseFlow&&(a+='"'),o=n[i=u[r]],e.replacer&&(o=e.replacer.call(n,i,o)),cd(e,t,i,!1,!1)&&(e.dump.length>1024&&(a+="? "),a+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),cd(e,t,o,!1,!1)&&(c+=a+=e.dump));e.tag=l,e.dump="{"+c+"}"}(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if("[object Array]"===c)r&&0!==e.dump.length?(e.noArrayIndent&&!o&&t>0?od(e,t-1,e.dump,s):od(e,t,e.dump,s),d&&(e.dump="&ref_"+u+e.dump)):(!function(e,t,n){var r,s,i,o="",a=e.tag;for(r=0,s=n.length;r<s;r+=1)i=n[r],e.replacer&&(i=e.replacer.call(n,String(r),i)),(cd(e,t,i,!1,!1)||void 0===i&&cd(e,t,null,!1,!1))&&(""!==o&&(o+=","+(e.condenseFlow?"":" ")),o+=e.dump);e.tag=a,e.dump="["+o+"]"}(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else{if("[object String]"!==c){if("[object Undefined]"===c)return!1;if(e.skipInvalid)return!1;throw new gl("unacceptable kind of an object to dump "+c)}"?"!==e.tag&&nd(e,e.dump,t,i,l)}null!==e.tag&&"?"!==e.tag&&(a=encodeURI("!"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,"%21"),a="!"===e.tag[0]?"!"+a:"tag:yaml.org,2002:"===a.slice(0,18)?"!!"+a.slice(18):"!<"+a+">",e.dump=a+" "+e.dump)}return!0}function ld(e,t){var n,r,s=[],i=[];for(ud(e,s,i),n=0,r=i.length;n<r;n+=1)t.duplicates.push(s[i[n]]);t.usedDuplicates=new Array(r)}function ud(e,t,n){var r,s,i;if(null!==e&&"object"==typeof e)if(-1!==(s=t.indexOf(e)))-1===n.indexOf(s)&&n.push(s);else if(t.push(e),Array.isArray(e))for(s=0,i=e.length;s<i;s+=1)ud(e[s],t,n);else for(s=0,i=(r=Object.keys(e)).length;s<i;s+=1)ud(e[r[s]],t,n)}function dd(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var hd={Type:wl,Schema:Al,FAILSAFE_SCHEMA:Vl,JSON_SCHEMA:Fl,CORE_SCHEMA:_l,DEFAULT_SCHEMA:$l,load:_u,loadAll:Fu,dump:function(e,t){var n=new Uu(t=t||{});n.noRefs||ld(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),cd(n,0,r,!0,!0)?n.dump+"\n":""},YAMLException:gl,types:{binary:Ml,float:kl,map:Cl,null:El,pairs:jl,set:Ql,timestamp:Ll,bool:Xl,int:Wl,merge:Tl,omap:zl,seq:Zl,str:Sl},safeLoad:dd("safeLoad","load"),safeLoadAll:dd("safeLoadAll","loadAll"),safeDump:dd("safeDump","dump")};function md(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}function gd(e,t,n,r){return new(n||(n=Promise))(function(s,i){function o(e){try{c(r.next(e))}catch(t){i(t)}}function a(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}c((r=r.apply(e,t||[])).next())})}var pd,fd=class extends Error{constructor(e,t="FunctionsError",n){super(e),this.name=t,this.context=n}},yd=class extends fd{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}},bd=class extends fd{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}},Id=class extends fd{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};!function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"}(pd||(pd={}));var wd=class{constructor(e,{headers:t={},customFetch:n,region:r=pd.Any}={}){this.url=e,this.headers=t,this.region=r,this.fetch=(e=>e?(...t)=>e(...t):(...e)=>fetch(...e))(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return gd(this,arguments,void 0,function*(e,t={}){var n;let r,s;try{const{headers:i,method:o,body:a,signal:c,timeout:l}=t;let u={},{region:d}=t;d||(d=this.region);const h=new URL(`${this.url}/${e}`);let m;d&&"any"!==d&&(u["x-region"]=d,h.searchParams.set("forceFunctionRegion",d)),a&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)?"undefined"!=typeof Blob&&a instanceof Blob||a instanceof ArrayBuffer?(u["Content-Type"]="application/octet-stream",m=a):"string"==typeof a?(u["Content-Type"]="text/plain",m=a):"undefined"!=typeof FormData&&a instanceof FormData?m=a:(u["Content-Type"]="application/json",m=JSON.stringify(a)):m=!a||"string"==typeof a||"undefined"!=typeof Blob&&a instanceof Blob||a instanceof ArrayBuffer||"undefined"!=typeof FormData&&a instanceof FormData?a:JSON.stringify(a);let g=c;l&&(s=new AbortController,r=setTimeout(()=>s.abort(),l),c?(g=s.signal,c.addEventListener("abort",()=>s.abort())):g=s.signal);const p=yield this.fetch(h.toString(),{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},u),this.headers),i),body:m,signal:g}).catch(e=>{throw new yd(e)}),f=p.headers.get("x-relay-error");if(f&&"true"===f)throw new bd(p);if(!p.ok)throw new Id(p);let y,b=(null!==(n=p.headers.get("Content-Type"))&&void 0!==n?n:"text/plain").split(";")[0].trim();return y="application/json"===b?yield p.json():"application/octet-stream"===b||"application/pdf"===b?yield p.blob():"text/event-stream"===b?p:"multipart/form-data"===b?yield p.formData():yield p.text(),{data:y,error:null,response:p}}catch(i){return{data:null,error:i,response:i instanceof Id||i instanceof bd?i.context:void 0}}finally{r&&clearTimeout(r)}})}},vd=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},Gd=class{constructor(e){var t,n,r;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=null!==(t=e.shouldThrowOnError)&&void 0!==t&&t,this.signal=e.signal,this.isMaybeSingle=null!==(n=e.isMaybeSingle)&&void 0!==n&&n,this.urlLengthLimit=null!==(r=e.urlLengthLimit)&&void 0!==r?r:8e3,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var n=this;void 0===this.schema||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),"GET"!==this.method&&"HEAD"!==this.method&&this.headers.set("Content-Type","application/json");let r=(0,this.fetch)(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async e=>{let t=null,r=null,s=null,i=e.status,o=e.statusText;if(e.ok){var a,c;if("HEAD"!==n.method){var l;const t=await e.text();""===t||(r="text/csv"===n.headers.get("Accept")||n.headers.get("Accept")&&(null===(l=n.headers.get("Accept"))||void 0===l?void 0:l.includes("application/vnd.pgrst.plan+text"))?t:JSON.parse(t))}const u=null===(a=n.headers.get("Prefer"))||void 0===a?void 0:a.match(/count=(exact|planned|estimated)/),d=null===(c=e.headers.get("content-range"))||void 0===c?void 0:c.split("/");u&&d&&d.length>1&&(s=parseInt(d[1])),n.isMaybeSingle&&"GET"===n.method&&Array.isArray(r)&&(r.length>1?(t={code:"PGRST116",details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},r=null,s=null,i=406,o="Not Acceptable"):r=1===r.length?r[0]:null)}else{var u;const s=await e.text();try{t=JSON.parse(s),Array.isArray(t)&&404===e.status&&(r=[],t=null,i=200,o="OK")}catch(d){404===e.status&&""===s?(i=204,o="No Content"):t={message:s}}if(t&&n.isMaybeSingle&&(null==t||null===(u=t.details)||void 0===u?void 0:u.includes("0 rows"))&&(t=null,i=200,o="OK"),t&&n.shouldThrowOnError)throw new vd(t)}return{error:t,data:r,count:s,status:i,statusText:o}});return this.shouldThrowOnError||(r=r.catch(e=>{var t;let n="",r="",s="";const i=null==e?void 0:e.cause;if(i){var o,a,c,l;const t=null!==(o=null==i?void 0:i.message)&&void 0!==o?o:"",r=null!==(a=null==i?void 0:i.code)&&void 0!==a?a:"";n=`${null!==(c=null==e?void 0:e.name)&&void 0!==c?c:"FetchError"}: ${null==e?void 0:e.message}`,n+=`\n\nCaused by: ${null!==(l=null==i?void 0:i.name)&&void 0!==l?l:"Error"}: ${t}`,r&&(n+=` (${r})`),(null==i?void 0:i.stack)&&(n+=`\n${i.stack}`)}else{var u;n=null!==(u=null==e?void 0:e.stack)&&void 0!==u?u:""}const d=this.url.toString().length;return"AbortError"===(null==e?void 0:e.name)||"ABORT_ERR"===(null==e?void 0:e.code)?(s="",r="Request was aborted (timeout or manual cancellation)",d>this.urlLengthLimit&&(r+=`. Note: Your request URL is ${d} 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.`)):"HeadersOverflowError"!==(null==i?void 0:i.name)&&"UND_ERR_HEADERS_OVERFLOW"!==(null==i?void 0:i.code)||(s="",r="HTTP headers exceeded server limits (typically 16KB)",d>this.urlLengthLimit&&(r+=`. Your request URL is ${d} 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.`)),{error:{message:`${null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"FetchError"}: ${null==e?void 0:e.message}`,details:n,hint:r,code:s},data:null,count:null,status:0,statusText:""}})),r.then(e,t)}returns(){return this}overrideTypes(){return this}},Ad=class extends Gd{select(e){let t=!1;const n=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!t?"":('"'===e&&(t=!t),e)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:s=r}={}){const i=s?`${s}.order`:"order",o=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${void 0===n?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){const r=void 0===n?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){const s=void 0===r?"offset":`${r}.offset`,i=void 0===r?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(i,""+(t-e+1)),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return"GET"===this.method?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),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:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:s=!1,format:i="text"}={}){var o;const a=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"buffers":null,s?"wal":null].filter(Boolean).join("|"),c=null!==(o=this.headers.get("Accept"))&&void 0!==o?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${c}"; options=${a};`),this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}},Sd=/* @__PURE__ */new RegExp("[,()]"),Zd=class extends Ad{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const n=Array.from(new Set(t)).map(e=>"string"==typeof e&&Sd.test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){const n=Array.from(new Set(t)).map(e=>"string"==typeof e&&Sd.test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return"string"==typeof t?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:n,type:r}={}){let s="";"plain"===r?s="pl":"phrase"===r?s="ph":"websearch"===r&&(s="w");const i=void 0===n?"":`(${n})`;return this.url.searchParams.append(e,`${s}fts${i}.${t}`),this}match(e){return Object.entries(e).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},Cd=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:s=8e3}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=s}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:n=!1,count:r}=null!=t?t:{},s=n?"HEAD":"GET";let i=!1;const o=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!i?"":('"'===e&&(i=!i),e)).join(""),{url:a,headers:c}=this.cloneRequestState();return a.searchParams.set("select",o),r&&c.append("Prefer",`count=${r}`),new Zd({method:s,url:a,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}insert(e,{count:t,defaultToNull:n=!0}={}){var r;const{url:s,headers:i}=this.cloneRequestState();if(t&&i.append("Prefer",`count=${t}`),n||i.append("Prefer","missing=default"),Array.isArray(e)){const t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){const e=[...new Set(t)].map(e=>`"${e}"`);s.searchParams.set("columns",e.join(","))}}return new Zd({method:"POST",url:s,headers:i,schema:this.schema,body:e,fetch:null!==(r=this.fetch)&&void 0!==r?r:fetch,urlLengthLimit:this.urlLengthLimit})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:s=!0}={}){var i;const{url:o,headers:a}=this.cloneRequestState();if(a.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),void 0!==t&&o.searchParams.set("on_conflict",t),r&&a.append("Prefer",`count=${r}`),s||a.append("Prefer","missing=default"),Array.isArray(e)){const t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){const e=[...new Set(t)].map(e=>`"${e}"`);o.searchParams.set("columns",e.join(","))}}return new Zd({method:"POST",url:o,headers:a,schema:this.schema,body:e,fetch:null!==(i=this.fetch)&&void 0!==i?i:fetch,urlLengthLimit:this.urlLengthLimit})}update(e,{count:t}={}){var n;const{url:r,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new Zd({method:"PATCH",url:r,headers:s,schema:this.schema,body:e,fetch:null!==(n=this.fetch)&&void 0!==n?n:fetch,urlLengthLimit:this.urlLengthLimit})}delete({count:e}={}){var t;const{url:n,headers:r}=this.cloneRequestState();return e&&r.append("Prefer",`count=${e}`),new Zd({method:"DELETE",url:n,headers:r,schema:this.schema,fetch:null!==(t=this.fetch)&&void 0!==t?t:fetch,urlLengthLimit:this.urlLengthLimit})}};function Vd(e){return(Vd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ed(e){var t=function(e,t){if("object"!=Vd(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Vd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Vd(t)?t:t+""}function Xd(e,t,n){return(t=Ed(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bd(Object(n),!0).forEach(function(t){Xd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Rd,Wd,Nd,Jd,kd,Fd=class e{constructor(e,{headers:t={},schema:n,fetch:r,timeout:s,urlLengthLimit:i=8e3}={}){this.url=e,this.headers=new Headers(t),this.schemaName=n,this.urlLengthLimit=i;const o=null!=r?r:globalThis.fetch;this.fetch=void 0!==s&&s>0?(e,t)=>{const n=new AbortController,r=setTimeout(()=>n.abort(),s),i=null==t?void 0:t.signal;if(i){if(i.aborted)return clearTimeout(r),o(e,t);const s=()=>{clearTimeout(r),n.abort()};return i.addEventListener("abort",s,{once:!0}),o(e,xd(xd({},t),{},{signal:n.signal})).finally(()=>{clearTimeout(r),i.removeEventListener("abort",s)})}return o(e,xd(xd({},t),{},{signal:n.signal})).finally(()=>clearTimeout(r))}:o}from(e){if(!e||"string"!=typeof e||""===e.trim())throw new Error("Invalid relation name: relation must be a non-empty string.");return new Cd(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}rpc(e,t={},{head:n=!1,get:r=!1,count:s}={}){var i;let o;const a=new URL(`${this.url}/rpc/${e}`);let c;const l=e=>null!==e&&"object"==typeof e&&(!Array.isArray(e)||e.some(l)),u=n&&Object.values(t).some(l);u?(o="POST",c=t):n||r?(o=n?"HEAD":"GET",Object.entries(t).filter(([e,t])=>void 0!==t).map(([e,t])=>[e,Array.isArray(t)?`{${t.join(",")}}`:`${t}`]).forEach(([e,t])=>{a.searchParams.append(e,t)})):(o="POST",c=t);const d=new Headers(this.headers);return u?d.set("Prefer",s?`count=${s},return=minimal`:"return=minimal"):s&&d.set("Prefer",`count=${s}`),new Zd({method:o,url:a,headers:d,schema:this.schemaName,body:c,fetch:null!==(i=this.fetch)&&void 0!==i?i:fetch,urlLengthLimit:this.urlLengthLimit})}},_d=class{constructor(){}static detectEnvironment(){var e;if("undefined"!=typeof WebSocket)return{type:"native",constructor:WebSocket};if("undefined"!=typeof globalThis&&void 0!==globalThis.WebSocket)return{type:"native",constructor:globalThis.WebSocket};if("undefined"!=typeof global&&void 0!==global.WebSocket)return{type:"native",constructor:global.WebSocket};if("undefined"!=typeof globalThis&&void 0!==globalThis.WebSocketPair&&void 0===globalThis.WebSocket)return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if("undefined"!=typeof globalThis&&globalThis.EdgeRuntime||"undefined"!=typeof navigator&&(null===(e=navigator.userAgent)||void 0===e?void 0:e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const t=globalThis.process;if(t){const e=t.versions;if(e&&e.node){const t=e.node,n=parseInt(t.replace(/^v/,"").split(".")[0]);return n>=22?void 0!==globalThis.WebSocket?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${n} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${n} detected without native WebSocket support.`,workaround:'For Node.js < 22, install "ws" package and provide it via the transport option:\nimport ws from "ws"\nnew RealtimeClient(url, { transport: ws })'}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let t=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(t+=`\n\nSuggested solution: ${e.workaround}`),new Error(t)}static createWebSocket(e,t){return new(this.getWebSocketConstructor())(e,t)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return"native"===e.type||"ws"===e.type}catch(e){return!1}}},Yd="2.0.0",Hd=Yd,Ld=1e4;!function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"}(Rd||(Rd={})),function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"}(Wd||(Wd={})),function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"}(Nd||(Nd={})),function(e){e.websocket="websocket"}(Jd||(Jd={})),function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"}(kd||(kd={}));var Td,Od=class{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=null!=e?e:[]}encode(e,t){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&"string"==typeof e.payload.event)return t(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){var t;return this._isArrayBuffer(null===(t=e.payload)||void 0===t?void 0:t.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var t,n;const r=null!==(n=null===(t=e.payload)||void 0===t?void 0:t.payload)&&void 0!==n?n:/* @__PURE__ */new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,r)}_encodeJsonUserBroadcastPush(e){var t,n;const r=null!==(n=null===(t=e.payload)||void 0===t?void 0:t.payload)&&void 0!==n?n:{},s=(new TextEncoder).encode(JSON.stringify(r)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,s)}_encodeUserBroadcastPush(e,t,n){var r,s;const i=e.topic,o=null!==(r=e.ref)&&void 0!==r?r:"",a=null!==(s=e.join_ref)&&void 0!==s?s:"",c=e.payload.event,l=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},u=0===Object.keys(l).length?"":JSON.stringify(l);if(a.length>255)throw new Error(`joinRef length ${a.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`ref length ${o.length} exceeds maximum of 255`);if(i.length>255)throw new Error(`topic length ${i.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`userEvent length ${c.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`metadata length ${u.length} exceeds maximum of 255`);const d=this.USER_BROADCAST_PUSH_META_LENGTH+a.length+o.length+i.length+c.length+u.length,h=new ArrayBuffer(this.HEADER_LENGTH+d);let m=new DataView(h),g=0;m.setUint8(g++,this.KINDS.userBroadcastPush),m.setUint8(g++,a.length),m.setUint8(g++,o.length),m.setUint8(g++,i.length),m.setUint8(g++,c.length),m.setUint8(g++,u.length),m.setUint8(g++,t),Array.from(a,e=>m.setUint8(g++,e.charCodeAt(0))),Array.from(o,e=>m.setUint8(g++,e.charCodeAt(0))),Array.from(i,e=>m.setUint8(g++,e.charCodeAt(0))),Array.from(c,e=>m.setUint8(g++,e.charCodeAt(0))),Array.from(u,e=>m.setUint8(g++,e.charCodeAt(0)));var p=new Uint8Array(h.byteLength+n.byteLength);return p.set(new Uint8Array(h),0),p.set(new Uint8Array(n),h.byteLength),p.buffer}decode(e,t){if(this._isArrayBuffer(e))return t(this._binaryDecode(e));if("string"==typeof e){const[n,r,s,i,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:s,event:i,payload:o})}return t({})}_binaryDecode(e){const t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;if(n===this.KINDS.userBroadcast)return this._decodeUserBroadcast(e,t,r)}_decodeUserBroadcast(e,t,n){const r=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),o=t.getUint8(4);let a=this.HEADER_LENGTH+4;const c=n.decode(e.slice(a,a+r));a+=r;const l=n.decode(e.slice(a,a+s));a+=s;const u=n.decode(e.slice(a,a+i));a+=i;const d=e.slice(a,e.byteLength),h=o===this.JSON_ENCODING?JSON.parse(n.decode(d)):d,m={type:this.BROADCAST_EVENT,event:l,payload:h};return i>0&&(m.meta=JSON.parse(u)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:m}}_isArrayBuffer(e){var t;return e instanceof ArrayBuffer||"ArrayBuffer"===(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)}_pick(e,t){return e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(([e])=>t.includes(e))):{}}},Md=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=t}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}};!function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"}(Td||(Td={}));var Kd,Ud=(e,t,n={})=>{var r;const s=null!==(r=n.skipTypes)&&void 0!==r?r:[];return t?Object.keys(t).reduce((n,r)=>(n[r]=zd(r,e,t,s),n),{}):{}},zd=(e,t,n,r)=>{const s=t.find(t=>t.name===e),i=null==s?void 0:s.type,o=n[e];return i&&!r.includes(i)?Dd(i,o):jd(o)},Dd=(e,t)=>{if("_"===e.charAt(0))return qd(t,e.slice(1,e.length));switch(e){case Td.bool:return Pd(t);case Td.float4:case Td.float8:case Td.int2:case Td.int4:case Td.int8:case Td.numeric:case Td.oid:return Qd(t);case Td.json:case Td.jsonb:return $d(t);case Td.timestamp:return eh(t);case Td.abstime:case Td.date:case Td.daterange:case Td.int4range:case Td.int8range:case Td.money:case Td.reltime:case Td.text:case Td.time:case Td.timestamptz:case Td.timetz:case Td.tsrange:case Td.tstzrange:default:return jd(t)}},jd=e=>e,Pd=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},Qd=e=>{if("string"==typeof e){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},$d=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e}return e},qd=(e,t)=>{if("string"!=typeof e)return e;const n=e.length-1,r=e[n];if("{"===e[0]&&"}"===r){let r;const s=e.slice(1,n);try{r=JSON.parse("["+s+"]")}catch(U){r=s?s.split(","):[]}return r.map(e=>Dd(t,e))}return e},eh=e=>"string"==typeof e?e.replace(" ","T"):e,th=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),""===t.pathname||"/"===t.pathname?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href},nh=class{constructor(e,t,n={},r=1e4){this.channel=e,this.event=t,this.payload=n,this.timeout=r,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var n;return this._hasReceived(e)&&t(null===(n=this.receivedResp)||void 0===n?void 0:n.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);this.channel._on(this.refEvent,{},e=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=e,this._matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,t){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:t})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:t}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}};!function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"}(Kd||(Kd={}));var rh,sh,ih,oh=class e{constructor(t,n){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(null==n?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},t=>{const{onJoin:n,onLeave:r,onSync:s}=this.caller;this.joinRef=this.channel._joinRef(),this.state=e.syncState(this.state,t,n,r),this.pendingDiffs.forEach(t=>{this.state=e.syncDiff(this.state,t,n,r)}),this.pendingDiffs=[],s()}),this.channel._on(r.diff,{},t=>{const{onJoin:n,onLeave:r,onSync:s}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(t):(this.state=e.syncDiff(this.state,t,n,r),s())}),this.onJoin((e,t,n)=>{this.channel._trigger("presence",{event:"join",key:e,currentPresences:t,newPresences:n})}),this.onLeave((e,t,n)=>{this.channel._trigger("presence",{event:"leave",key:e,currentPresences:t,leftPresences:n})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,n,r){const s=this.cloneDeep(e),i=this.transformState(t),o={},a={};return this.map(s,(e,t)=>{i[e]||(a[e]=t)}),this.map(i,(e,t)=>{const n=s[e];if(n){const r=t.map(e=>e.presence_ref),s=n.map(e=>e.presence_ref),i=t.filter(e=>s.indexOf(e.presence_ref)<0),c=n.filter(e=>r.indexOf(e.presence_ref)<0);i.length>0&&(o[e]=i),c.length>0&&(a[e]=c)}else o[e]=t}),this.syncDiff(s,{joins:o,leaves:a},n,r)}static syncDiff(e,t,n,r){const{joins:s,leaves:i}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return n||(n=()=>{}),r||(r=()=>{}),this.map(s,(t,r)=>{var s;const i=null!==(s=e[t])&&void 0!==s?s:[];if(e[t]=this.cloneDeep(r),i.length>0){const n=e[t].map(e=>e.presence_ref),r=i.filter(e=>n.indexOf(e.presence_ref)<0);e[t].unshift(...r)}n(t,i,r)}),this.map(i,(t,n)=>{let s=e[t];if(!s)return;const i=n.map(e=>e.presence_ref);s=s.filter(e=>i.indexOf(e.presence_ref)<0),e[t]=s,r(t,s,n),0===s.length&&delete e[t]}),e}static map(e,t){return Object.getOwnPropertyNames(e).map(n=>t(n,e[n]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((t,n)=>{const r=e[n];return t[n]="metas"in r?r.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e)):r,t},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}};!function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"}(rh||(rh={})),function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"}(sh||(sh={})),function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"}(ih||(ih={}));var ah=class e{constructor(e,t={config:{}},n){var r,s;if(this.topic=e,this.params=t,this.socket=n,this.bindings={},this.state=Wd.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config),this.timeout=this.socket.timeout,this.joinPush=new nh(this,Nd.join,this.params,this.timeout),this.rejoinTimer=new Md(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Wd.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Wd.closed,this.socket._remove(this)}),this._onError(e=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,e),this.state=Wd.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Wd.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",e=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,e),this.state=Wd.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Nd.reply,{},(e,t)=>{this._trigger(this._replyEventName(t),e)}),this.presence=new oh(this),this.broadcastEndpointURL=th(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(null===(s=null===(r=this.params.config)||void 0===r?void 0:r.broadcast)||void 0===s?void 0:s.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,n=this.timeout){var r,s,i;if(this.socket.isConnected()||this.socket.connect(),this.state==Wd.closed){const{config:{broadcast:o,presence:a,private:c}}=this.params,l=null!==(s=null===(r=this.bindings.postgres_changes)||void 0===r?void 0:r.map(e=>e.filter))&&void 0!==s?s:[],u=!!this.bindings[sh.PRESENCE]&&this.bindings[sh.PRESENCE].length>0||!0===(null===(i=this.params.config.presence)||void 0===i?void 0:i.enabled),d={},h={broadcast:o,presence:Object.assign(Object.assign({},a),{enabled:u}),postgres_changes:l,private:c};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(e=>null==t?void 0:t(ih.CHANNEL_ERROR,e)),this._onClose(()=>null==t?void 0:t(ih.CLOSED)),this.updateJoinPayload(Object.assign({config:h},d)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:n})=>{var r;if(this.socket._isManualToken()||this.socket.setAuth(),void 0!==n){const s=this.bindings.postgres_changes,i=null!==(r=null==s?void 0:s.length)&&void 0!==r?r:0,o=[];for(let r=0;r<i;r++){const i=s[r],{filter:{event:a,schema:c,table:l,filter:u}}=i,d=n&&n[r];if(!(d&&d.event===a&&e.isFilterValueEqual(d.schema,c)&&e.isFilterValueEqual(d.table,l)&&e.isFilterValueEqual(d.filter,u)))return this.unsubscribe(),this.state=Wd.errored,void(null==t||t(ih.CHANNEL_ERROR,/* @__PURE__ */new Error("mismatch between server and client bindings for postgres changes")));o.push(Object.assign(Object.assign({},i),{id:d.id}))}return this.bindings.postgres_changes=o,void(t&&t(ih.SUBSCRIBED))}null==t||t(ih.SUBSCRIBED)}).receive("error",e=>{this.state=Wd.errored,null==t||t(ih.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(e).join(", ")||"error")))}).receive("timeout",()=>{null==t||t(ih.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,n){return this.state===Wd.joined&&e===sh.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(e,t,n)}async httpSend(e,t,n={}){var r;if(null==t)return Promise.reject("Payload is required for httpSend()");const s={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(s.Authorization=`Bearer ${this.socket.accessTokenValue}`);const i={method:"POST",headers:s,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:t,private:this.private}]})},o=await this._fetchWithTimeout(this.broadcastEndpointURL,i,null!==(r=n.timeout)&&void 0!==r?r:this.timeout);if(202===o.status)return{success:!0};let a=o.statusText;try{const e=await o.json();a=e.error||e.message||a}catch(c){}return Promise.reject(new Error(a))}async send(e,t={}){var n,r;if(this._canPush()||"broadcast"!==e.type)return new Promise(n=>{var r,s,i;const o=this._push(e.type,e,t.timeout||this.timeout);"broadcast"!==e.type||(null===(i=null===(s=null===(r=this.params)||void 0===r?void 0:r.config)||void 0===s?void 0:s.broadcast)||void 0===i?void 0:i.ack)||n("ok"),o.receive("ok",()=>n("ok")),o.receive("error",()=>n("error")),o.receive("timeout",()=>n("timed out"))});{console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:o}=e,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const e=await this._fetchWithTimeout(this.broadcastEndpointURL,c,null!==(n=t.timeout)&&void 0!==n?n:this.timeout);return await(null===(r=e.body)||void 0===r?void 0:r.cancel()),e.ok?"ok":"error"}catch(s){return"AbortError"===s.name?"timed out":"error"}}}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=Wd.leaving;const t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Nd.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(r=>{n=new nh(this,Nd.leave,{},e),n.receive("ok",()=>{t(),r("ok")}).receive("timeout",()=>{t(),r("timed out")}).receive("error",()=>{r("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{null==n||n.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Wd.closed,this.bindings={}}async _fetchWithTimeout(e,t,n){const r=new AbortController,s=setTimeout(()=>r.abort(),n),i=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(s),i}_push(e,t,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let r=new nh(this,e,t,n);return this._canPush()?r.send():this._addToPushBuffer(r),r}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>100){const e=this.pushBuffer.shift();e&&(e.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${e.event}`,e.payload))}}_onMessage(e,t,n){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,n){var r,s;const i=e.toLocaleLowerCase(),{close:o,error:a,leave:c,join:l}=Nd;if(n&&[o,a,c,l].indexOf(i)>=0&&n!==this._joinRef())return;let u=this._onMessage(i,t,n);if(t&&!u)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(i)?null===(r=this.bindings.postgres_changes)||void 0===r||r.filter(e=>{var t,n,r;return"*"===(null===(t=e.filter)||void 0===t?void 0:t.event)||(null===(r=null===(n=e.filter)||void 0===n?void 0:n.event)||void 0===r?void 0:r.toLocaleLowerCase())===i}).map(e=>e.callback(u,n)):null===(s=this.bindings[i])||void 0===s||s.filter(e=>{var n,r,s,o,a,c;if(["broadcast","presence","postgres_changes"].includes(i)){if("id"in e){const i=e.id,o=null===(n=e.filter)||void 0===n?void 0:n.event;return i&&(null===(r=t.ids)||void 0===r?void 0:r.includes(i))&&("*"===o||(null==o?void 0:o.toLocaleLowerCase())===(null===(s=t.data)||void 0===s?void 0:s.type.toLocaleLowerCase()))}{const n=null===(a=null===(o=null==e?void 0:e.filter)||void 0===o?void 0:o.event)||void 0===a?void 0:a.toLocaleLowerCase();return"*"===n||n===(null===(c=null==t?void 0:t.event)||void 0===c?void 0:c.toLocaleLowerCase())}}return e.type.toLocaleLowerCase()===i}).map(e=>{if("object"==typeof u&&"ids"in u){const e=u.data,{schema:t,table:n,commit_timestamp:r,type:s,errors:i}=e,o={schema:t,table:n,commit_timestamp:r,eventType:s,new:{},old:{},errors:i};u=Object.assign(Object.assign({},o),this._getPayloadRecords(e))}e.callback(u,n)})}_isClosed(){return this.state===Wd.closed}_isJoined(){return this.state===Wd.joined}_isJoining(){return this.state===Wd.joining}_isLeaving(){return this.state===Wd.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,t,n){const r=e.toLocaleLowerCase(),s={type:r,filter:t,callback:n};return this.bindings[r]?this.bindings[r].push(s):this.bindings[r]=[s],this}_off(t,n){const r=t.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(t=>{var s;return!((null===(s=t.type)||void 0===s?void 0:s.toLocaleLowerCase())===r&&e.isEqual(t.filter,n))})),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}static isFilterValueEqual(e,t){return(null!=e?e:void 0)===(null!=t?t:void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(Nd.close,{},e)}_onError(e){this._on(Nd.error,{},t=>e(t))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Wd.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const t={new:{},old:{}};return"INSERT"!==e.type&&"UPDATE"!==e.type||(t.new=Ud(e.columns,e.record)),"UPDATE"!==e.type&&"DELETE"!==e.type||(t.old=Ud(e.columns,e.old_record)),t}},ch=()=>{},lh=25e3,uh=10,dh=100,hh=[1e3,2e3,5e3,1e4],mh=class{constructor(e,t){var n;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Ld,this.transport=null,this.heartbeatIntervalMs=lh,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=ch,this.ref=0,this.reconnectTimer=null,this.vsn=Hd,this.logger=ch,this.conn=null,this.sendBuffer=[],this.serializer=new Od,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),!(null===(n=null==t?void 0:t.params)||void 0===n?void 0:n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=t.params.apikey,this.endPoint=`${e}/${Jd.websocket}`,this.httpEndpoint=th(e),this._initializeOptions(t),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(null==t?void 0:t.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||null!==this.conn&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=_d.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const t=e.message;if(t.includes("Node.js"))throw new Error(`${t}\n\nTo use Realtime in Node.js, you need to provide a WebSocket implementation:\n\nOption 1: Use Node.js 22+ which has native WebSocket support\nOption 2: Install and provide the "ws" package:\n\n npm install ws\n\n import ws from "ws"\n const client = new RealtimeClient(url, {\n ...options,\n transport: ws\n })`);throw new Error(`WebSocket not available: ${t}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(e,t){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},"function"==typeof this.conn.close&&(e?this.conn.close(e,null!=t?t:""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const t=await e.unsubscribe();return 0===this.channels.length&&this.disconnect(),t}async removeAllChannels(){const e=await Promise.all(this.channels.map(e=>e.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,t,n){this.logger(e,t,n)}connectionState(){switch(this.conn&&this.conn.readyState){case Rd.connecting:return kd.Connecting;case Rd.open:return kd.Open;case Rd.closing:return kd.Closing;default:return kd.Closed}}isConnected(){return this.connectionState()===kd.Open}isConnecting(){return"connecting"===this._connectionState}isDisconnecting(){return"disconnecting"===this._connectionState}channel(e,t={config:{}}){const n=`realtime:${e}`,r=this.getChannels().find(e=>e.topic===n);if(r)return r;{const n=new ah(`realtime:${e}`,t,this);return this.channels.push(n),n}}push(e){const{topic:t,event:n,payload:r,ref:s}=e,i=()=>{this.encode(e,e=>{var t;null===(t=this.conn)||void 0===t||t.send(e)})};this.log("push",`${t} ${n} (${s})`,r),this.isConnected()?i():this.sendBuffer.push(i)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(t){this.log("error","error in heartbeat callback",t)}return this._wasManualDisconnect=!1,null===(e=this.conn)||void 0===e||e.close(1e3,"heartbeat timeout"),void setTimeout(()=>{var e;this.isConnected()||null===(e=this.reconnectTimer)||void 0===e||e.scheduleTimeout()},dh)}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(t){this.log("error","error in heartbeat callback",t)}this._setAuthSafely("heartbeat")}else try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t._isJoined()||t._isJoining()));t&&(this.log("transport",`leaving duplicate topic "${e}"`),t.unsubscribe())}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,e=>{if("phoenix"===e.topic&&"phx_reply"===e.event&&e.ref&&e.ref===this.pendingHeartbeatRef){const t=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback("ok"===e.payload.status?"ok":"error",t)}catch(a){this.log("error","error in heartbeat callback",a)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:t,event:n,payload:r,ref:s}=e,i=s?`(${s})`:"",o=r.status||"";this.log("receive",`${o} ${t} ${n} ${i}`.trim(),r),this.channels.filter(e=>e._isMember(t)).forEach(e=>e._trigger(n,r,s)),this._triggerStateCallbacks("message",e)})}_clearTimer(e){var t;"heartbeat"===e&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):"reconnect"===e&&(null===(t=this.reconnectTimer)||void 0===t||t.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e),this.conn.readyState===Rd.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===Rd.open||this.conn.readyState===Rd.connecting)try{this.conn.close()}catch(e){this.log("error","Error closing connection",e)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.accessTokenValue&&(this.channels.forEach(e=>{e.updateJoinPayload({access_token:this.accessTokenValue})}),this.sendBuffer=[],this.channels.forEach(e=>{e._isJoining()&&(e.joinPush.sent=!1,e.joinPush.send())})),this.flushSendBuffer()}).catch(e=>{this.log("error","error waiting for auth on connect",e),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=e=>{this.log("worker","worker error",e.message),this._terminateWorker()},this.workerRef.onmessage=e=>{"keepAlive"===e.data.event&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(e){var t;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||null===(t=this.reconnectTimer)||void 0===t||t.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e);try{this.heartbeatCallback("error")}catch(t){this.log("error","error in heartbeat callback",t)}}_triggerChanError(){this.channels.forEach(e=>e._trigger(Nd.error))}_appendParams(e,t){return 0===Object.keys(t).length?e:`${e}${e.match(/\?/)?"&":"?"}${new URLSearchParams(t)}`}_workerObjectUrl(e){let t;if(e)t=e;else{const e=new Blob(['\n addEventListener("message", (e) => {\n if (e.data.event === "start") {\n setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);\n }\n });'],{type:"application/javascript"});t=URL.createObjectURL(e)}return t}_setConnectionState(e,t=!1){this._connectionState=e,"connecting"===e?this._wasManualDisconnect=!1:"disconnecting"===e&&(this._wasManualDisconnect=t)}async _performAuth(e=null){let t,n=!1;if(e)t=e,n=!0;else if(this.accessToken)try{t=await this.accessToken()}catch(r){this.log("error","Error fetching access token from callback",r),t=this.accessTokenValue}else t=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(e=>{const n={access_token:t,version:"realtime-js/2.99.2"};t&&e.updateJoinPayload(n),e.joinedOnce&&e._isJoined()&&e._push(Nd.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(t=>{this.log("error",`Error setting auth in ${e}`,t)})}_triggerStateCallbacks(e,t){try{this.stateChangeCallbacks[e].forEach(n=>{try{n(t)}catch(r){this.log("error",`error in ${e} callback`,r)}})}catch(n){this.log("error",`error triggering ${e} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new Md(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},uh)},this.reconnectAfterMs)}_initializeOptions(e){var t,n,r,s,i,o,a,c,l,u,d,h;switch(this.transport=null!==(t=null==e?void 0:e.transport)&&void 0!==t?t:null,this.timeout=null!==(n=null==e?void 0:e.timeout)&&void 0!==n?n:Ld,this.heartbeatIntervalMs=null!==(r=null==e?void 0:e.heartbeatIntervalMs)&&void 0!==r?r:lh,this.worker=null!==(s=null==e?void 0:e.worker)&&void 0!==s&&s,this.accessToken=null!==(i=null==e?void 0:e.accessToken)&&void 0!==i?i:null,this.heartbeatCallback=null!==(o=null==e?void 0:e.heartbeatCallback)&&void 0!==o?o:ch,this.vsn=null!==(a=null==e?void 0:e.vsn)&&void 0!==a?a:Hd,(null==e?void 0:e.params)&&(this.params=e.params),(null==e?void 0:e.logger)&&(this.logger=e.logger),((null==e?void 0:e.logLevel)||(null==e?void 0:e.log_level))&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=null!==(c=null==e?void 0:e.reconnectAfterMs)&&void 0!==c?c:e=>hh[e-1]||1e4,this.vsn){case"1.0.0":this.encode=null!==(l=null==e?void 0:e.encode)&&void 0!==l?l:(e,t)=>t(JSON.stringify(e)),this.decode=null!==(u=null==e?void 0:e.decode)&&void 0!==u?u:(e,t)=>t(JSON.parse(e));break;case Yd:this.encode=null!==(d=null==e?void 0:e.encode)&&void 0!==d?d:this.serializer.encode.bind(this.serializer),this.decode=null!==(h=null==e?void 0:e.decode)&&void 0!==h?h:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if("undefined"!=typeof window&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=null==e?void 0:e.workerUrl}}},gh=class extends Error{constructor(e,t){super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown="CommitStateUnknownException"===t.icebergType||[500,502,504].includes(t.status)&&!0===t.icebergType?.includes("CommitState")}isNotFound(){return 404===this.status}isConflict(){return 409===this.status}isAuthenticationTimeout(){return 419===this.status}};function ph(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:s,body:i,headers:o}){const a=function(e,t,n){const r=new URL(t,e);if(n)for(const[s,i]of Object.entries(n))void 0!==i&&r.searchParams.set(s,i);return r.toString()}(e.baseUrl,r,s),c=await async function(e){return e&&"none"!==e.type?"bearer"===e.type?{Authorization:`Bearer ${e.token}`}:"header"===e.type?{[e.name]:e.value}:"custom"===e.type?await e.getHeaders():{}:{}}(e.auth),l=await t(a,{method:n,headers:{...i?{"Content-Type":"application/json"}:{},...c,...o},body:i?JSON.stringify(i):void 0}),u=await l.text(),d=(l.headers.get("content-type")||"").includes("application/json"),h=d&&u?JSON.parse(u):u;if(!l.ok){const e=d?h:void 0,t=e?.error;throw new gh(t?.message??`Request failed with status ${l.status}`,{status:l.status,icebergType:t?.type,icebergCode:t?.code,details:e})}return{status:l.status,headers:l.headers,data:h}}}}function fh(e){return e.join("")}var yh=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:fh(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(e=>({namespace:e}))}async createNamespace(e,t){const n={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${fh(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${fh(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${fh(e.namespace)}`}),!0}catch(t){if(t instanceof gh&&404===t.status)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof gh&&409===n.status)return;throw n}}};function bh(e){return e.join("")}var Ih=class{constructor(e,t="",n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${bh(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${bh(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${bh(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${bh(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${bh(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${bh(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof gh&&404===n.status)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof gh&&409===n.status)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},wh=class{constructor(e){let t="v1";e.catalogName&&(t+=`/${e.catalogName}`),this.client=ph({baseUrl:e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(","),this.namespaceOps=new yh(this.client,t),this.tableOps=new Ih(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},vh=class extends Error{constructor(e,t="storage",n,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name="vectors"===t?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}};function Gh(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}var Ah=class extends vh{constructor(e,t,n,r="storage"){super(e,r,t,n),this.name="vectors"===r?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},Sh=class extends vh{constructor(e,t,n="storage"){super(e,n),this.name="vectors"===n?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}},Zh=e=>{if(Array.isArray(e))return e.map(e=>Zh(e));if("function"==typeof e||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([e,n])=>{const r=e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(/[-_]/g,""));t[r]=Zh(n)}),t};function Ch(e){return(Ch="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vh(e){var t=function(e,t){if("object"!=Ch(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ch(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ch(t)?t:t+""}function Eh(e,t,n){return(t=Vh(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Bh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xh(Object(n),!0).forEach(function(t){Eh(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xh(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var xh=e=>{var t;return e.msg||e.message||e.error_description||("string"==typeof e.error?e.error:null===(t=e.error)||void 0===t?void 0:t.message)||JSON.stringify(e)},Rh=(e,t,n,r)=>{const s={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"!==e&&"HEAD"!==e&&r?((e=>{if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)})(r)?(s.headers=Bh({"Content-Type":"application/json"},null==t?void 0:t.headers),s.body=JSON.stringify(r)):s.body=r,(null==t?void 0:t.duplex)&&(s.duplex=t.duplex),Bh(Bh({},s),n)):Bh(Bh({},s),n)};async function Wh(e,t,n,r,s,i,o){return new Promise((a,c)=>{e(n,Rh(t,r,s,i)).then(e=>{if(!e.ok)throw e;if(null==r?void 0:r.noResolveJson)return e;if("vectors"===o){const t=e.headers.get("content-type");if("0"===e.headers.get("content-length")||204===e.status)return{};if(!t||!t.includes("application/json"))return{}}return e.json()}).then(e=>a(e)).catch(e=>(async(e,t,n,r)=>{if(e&&"object"==typeof e&&"status"in e&&"ok"in e&&"number"==typeof e.status){const n=e,s=n.status||500;if("function"==typeof n.json)n.json().then(e=>{const n=(null==e?void 0:e.statusCode)||(null==e?void 0:e.code)||s+"";t(new Ah(xh(e),s,n,r))}).catch(()=>{if("vectors"===r){const e=s+"";t(new Ah(n.statusText||`HTTP ${s} error`,s,e,r))}else{const e=s+"";t(new Ah(n.statusText||`HTTP ${s} error`,s,e,r))}});else{const e=s+"";t(new Ah(n.statusText||`HTTP ${s} error`,s,e,r))}}else t(new Sh(xh(e),e,r))})(e,c,0,o))})}function Nh(e="storage"){return{get:async(t,n,r,s)=>Wh(t,"GET",n,r,s,void 0,e),post:async(t,n,r,s,i)=>Wh(t,"POST",n,s,i,r,e),put:async(t,n,r,s,i)=>Wh(t,"PUT",n,s,i,r,e),head:async(t,n,r,s)=>Wh(t,"HEAD",n,Bh(Bh({},r),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,n,r,s,i)=>Wh(t,"DELETE",n,s,i,r,e)}}var Jh,{get:kh,post:Fh,put:_h,head:Yh,remove:Hh}=Nh("storage"),Lh=Nh("vectors"),Th=class{constructor(e,t={},n,r="storage"){var s;this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.fetch=(s=n)?(...e)=>s(...e):(...e)=>fetch(...e),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Bh(Bh({},this.headers),{},{[e]:t}),this}async handleOperation(e){try{return{data:await e(),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(Gh(t))return{data:null,error:t};throw t}}},Oh=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){try{return{data:(await this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(Gh(e))return{data:null,error:e};throw e}}};Jh=Symbol.toStringTag;var Mh=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Jh]="BlobDownloadBuilder",this.promise=null}asStream(){return new Oh(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){try{return{data:await(await this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(Gh(e))return{data:null,error:e};throw e}}},Kh={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Uh={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},zh=class extends Th{constructor(e,t={},n,r){super(e,t,r,"storage"),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var s=this;return s.handleOperation(async()=>{let i;const o=Bh(Bh({},Uh),r);let a=Bh(Bh({},s.headers),"POST"===e&&{"x-upsert":String(o.upsert)});const c=o.metadata;"undefined"!=typeof Blob&&n instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",s.encodeMetadata(c)),i.append("",n)):"undefined"!=typeof FormData&&n instanceof FormData?(i=n,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),c&&!i.has("metadata")&&i.append("metadata",s.encodeMetadata(c))):(i=n,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,c&&(a["x-metadata"]=s.toBase64(s.encodeMetadata(c))),("undefined"!=typeof ReadableStream&&i instanceof ReadableStream||i&&"object"==typeof i&&"pipe"in i&&"function"==typeof i.pipe)&&!o.duplex&&(o.duplex="half")),(null==r?void 0:r.headers)&&(a=Bh(Bh({},a),r.headers));const l=s._removeEmptyFolders(t),u=s._getFinalPath(l),d=await("PUT"==e?_h:Fh)(s.fetch,`${s.url}/object/${u}`,i,Bh({headers:a},(null==o?void 0:o.duplex)?{duplex:o.duplex}:{}));return{path:l,id:d.Id,fullPath:d.Key}})}async upload(e,t,n){return this.uploadOrUpdate("POST",e,t,n)}async uploadToSignedUrl(e,t,n,r){var s=this;const i=s._removeEmptyFolders(e),o=s._getFinalPath(i),a=new URL(s.url+`/object/upload/sign/${o}`);return a.searchParams.set("token",t),s.handleOperation(async()=>{let e;const t=Bh({upsert:Uh.upsert},r),o=Bh(Bh({},s.headers),{"x-upsert":String(t.upsert)});return"undefined"!=typeof Blob&&n instanceof Blob?(e=new FormData,e.append("cacheControl",t.cacheControl),e.append("",n)):"undefined"!=typeof FormData&&n instanceof FormData?(e=n,e.append("cacheControl",t.cacheControl)):(e=n,o["cache-control"]=`max-age=${t.cacheControl}`,o["content-type"]=t.contentType),{path:i,fullPath:(await _h(s.fetch,a.toString(),e,{headers:o})).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e);const s=Bh({},n.headers);(null==t?void 0:t.upsert)&&(s["x-upsert"]="true");const i=await Fh(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:s}),o=new URL(n.url+i.url),a=o.searchParams.get("token");if(!a)throw new vh("No token returned by API");return{signedUrl:o.toString(),path:e,token:a}})}async update(e,t,n){return this.uploadOrUpdate("PUT",e,t,n)}async move(e,t,n){var r=this;return r.handleOperation(async()=>await Fh(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:null==n?void 0:n.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await Fh(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:null==n?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let s=r._getFinalPath(e);const i="object"==typeof(null==n?void 0:n.transform)&&null!==n.transform&&Object.keys(n.transform).length>0;let o=await Fh(r.fetch,`${r.url}/object/sign/${s}`,Bh({expiresIn:t},i?{transform:n.transform}:{}),{headers:r.headers});const a=(null==n?void 0:n.download)?`&download=${!0===n.download?"":n.download}`:"",c=i&&o.signedURL.includes("/object/sign/")?o.signedURL.replace("/object/sign/","/render/image/sign/"):o.signedURL;return{signedUrl:encodeURI(`${r.url}${c}${a}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{const s=await Fh(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),i=(null==n?void 0:n.download)?`&download=${!0===n.download?"":n.download}`:"";return s.map(e=>Bh(Bh({},e),{},{signedUrl:e.signedURL?encodeURI(`${r.url}${e.signedURL}${i}`):null}))})}download(e,t,n){const r=void 0!==(null==t?void 0:t.transform)?"render/image/authenticated":"object",s=this.transformOptsToQueryString((null==t?void 0:t.transform)||{}),i=s?`?${s}`:"",o=this._getFinalPath(e);return new Mh(()=>kh(this.fetch,`${this.url}/${r}/${o}${i}`,{headers:this.headers,noResolveJson:!0},n),this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);return t.handleOperation(async()=>Zh(await kh(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await Yh(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(s){if(t.shouldThrowOnError)throw s;if(Gh(s)){var r;const e=s instanceof Ah?s.status:s instanceof Sh?null===(r=s.originalError)||void 0===r?void 0:r.status:void 0;if(void 0!==e&&[400,404].includes(e))return{data:!1,error:s}}throw s}}getPublicUrl(e,t){const n=this._getFinalPath(e),r=[],s=(null==t?void 0:t.download)?`download=${!0===t.download?"":t.download}`:"";""!==s&&r.push(s);const i=void 0!==(null==t?void 0:t.transform)?"render/image":"object",o=this.transformOptsToQueryString((null==t?void 0:t.transform)||{});""!==o&&r.push(o);let a=r.join("&");return""!==a&&(a=`?${a}`),{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${n}${a}`)}}}async remove(e){var t=this;return t.handleOperation(async()=>await Hh(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,n){var r=this;return r.handleOperation(async()=>{const s=Bh(Bh(Bh({},Kh),t),{},{prefix:e||""});return await Fh(r.fetch,`${r.url}/object/list/${r.bucketId}`,s,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{const r=Bh({},e);return await Fh(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return"undefined"!=typeof Buffer?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}},Dh={"X-Client-Info":"storage-js/2.99.2"},jh=class extends Th{constructor(e,t={},n,r){const s=new URL(e);(null==r?void 0:r.useNewHostname)&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));super(s.href.replace(/\/$/,""),Bh(Bh({},Dh),t),n,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=t.listBucketOptionsToQueryString(e);return await kh(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await kh(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await Fh(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await _h(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Fh(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Hh(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},Ph=class extends Th{constructor(e,t={},n){super(e.replace(/\/$/,""),Bh(Bh({},Dh),t),n,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Fh(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=new URLSearchParams;void 0!==(null==e?void 0:e.limit)&&n.set("limit",e.limit.toString()),void 0!==(null==e?void 0:e.offset)&&n.set("offset",e.offset.toString()),(null==e?void 0:e.sortColumn)&&n.set("sortColumn",e.sortColumn),(null==e?void 0:e.sortOrder)&&n.set("sortOrder",e.sortOrder),(null==e?void 0:e.search)&&n.set("search",e.search);const r=n.toString(),s=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await kh(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Hh(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!(e=>!(!e||"string"!=typeof e)&&!(0===e.length||e.length>100)&&e.trim()===e&&!e.includes("/")&&!e.includes("\\")&&/^[\w!.\*'() &$@=;:+,?-]+$/.test(e))(e))throw new vh("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new wh({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(e,t){const n=e[t];return"function"!=typeof n?n:async(...t)=>{try{return{data:await n.apply(e,t),error:null}}catch(s){if(r)throw s;return{data:null,error:s}}}}})}},Qh=class extends Th{constructor(e,t={},n){super(e.replace(/\/$/,""),Bh(Bh({},Dh),{},{"Content-Type":"application/json"},t),n,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await Lh.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await Lh.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Lh.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await Lh.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},$h=class extends Th{constructor(e,t={},n){super(e.replace(/\/$/,""),Bh(Bh({},Dh),{},{"Content-Type":"application/json"},t),n,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Lh.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Lh.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(void 0!==e.segmentCount){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(void 0!==e.segmentIndex&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error("segmentIndex must be between 0 and "+(e.segmentCount-1))}return t.handleOperation(async()=>await Lh.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Lh.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Lh.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},qh=class extends Th{constructor(e,t={},n){super(e.replace(/\/$/,""),Bh(Bh({},Dh),{},{"Content-Type":"application/json"},t),n,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Lh.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Lh.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Lh.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Lh.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},em=class extends qh{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new tm(this.url,this.headers,e,this.fetch)}async createBucket(e){return(()=>super.createBucket)().call(this,e)}async getBucket(e){return(()=>super.getBucket)().call(this,e)}async listBuckets(e={}){return(()=>super.listBuckets)().call(this,e)}async deleteBucket(e){return(()=>super.deleteBucket)().call(this,e)}},tm=class extends Qh{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){return(()=>super.createIndex)().call(this,Bh(Bh({},e),{},{vectorBucketName:this.vectorBucketName}))}async listIndexes(e={}){return(()=>super.listIndexes)().call(this,Bh(Bh({},e),{},{vectorBucketName:this.vectorBucketName}))}async getIndex(e){return(()=>super.getIndex)().call(this,this.vectorBucketName,e)}async deleteIndex(e){return(()=>super.deleteIndex)().call(this,this.vectorBucketName,e)}index(e){return new nm(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},nm=class extends $h{constructor(e,t,n,r,s){super(e,t,s),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=this;return(()=>super.putVectors)().call(t,Bh(Bh({},e),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async getVectors(e){var t=this;return(()=>super.getVectors)().call(t,Bh(Bh({},e),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async listVectors(e={}){var t=this;return(()=>super.listVectors)().call(t,Bh(Bh({},e),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async queryVectors(e){var t=this;return(()=>super.queryVectors)().call(t,Bh(Bh({},e),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async deleteVectors(e){var t=this;return(()=>super.deleteVectors)().call(t,Bh(Bh({},e),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}},rm=class extends jh{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new zh(this.url,this.headers,e,this.fetch)}get vectors(){return new em(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new Ph(this.url+"/iceberg",this.headers,this.fetch)}},sm="2.99.2",im=3e4,om=9e4,am={"X-Client-Info":`gotrue-js/${sm}`},cm="X-Supabase-Api-Version",lm={timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"},um=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,dm=class extends Error{constructor(e,t,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=n}};function hm(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}var mm=class extends dm{constructor(e,t,n){super(e,t,n),this.name="AuthApiError",this.status=t,this.code=n}};var gm=class extends dm{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}},pm=class extends dm{constructor(e,t,n,r){super(e,n,r),this.name=t,this.status=n}},fm=class extends pm{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};function ym(e){return hm(e)&&"AuthSessionMissingError"===e.name}var bm=class extends pm{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}},Im=class extends pm{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}},wm=class extends pm{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};var vm=class extends pm{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}},Gm=class extends pm{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}},Am=class extends pm{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}};function Sm(e){return hm(e)&&"AuthRetryableFetchError"===e.name}var Zm=class extends pm{constructor(e,t,n){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=n}},Cm=class extends pm{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}},Vm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Em=" \t\n\r=".split(""),Xm=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<Em.length;t+=1)e[Em[t].charCodeAt(0)]=-2;for(let t=0;t<Vm.length;t+=1)e[Vm[t].charCodeAt(0)]=t;return e})();function Bm(e,t,n){if(null!==e)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;)n(Vm[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6;else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;)n(Vm[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6}function xm(e,t,n){const r=Xm[e];if(!(r>-1)){if(-2===r)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8}function Rm(e){const t=[],n=e=>{t.push(String.fromCodePoint(e))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=e=>{!function(e,t,n){if(0===t.utf8seq){if(e<=127)return void n(e);for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(2===t.utf8seq)t.codepoint=31&e;else if(3===t.utf8seq)t.codepoint=15&e;else{if(4!==t.utf8seq)throw new Error("Invalid UTF-8 sequence");t.codepoint=7&e}t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|63&e,t.utf8seq-=1,0===t.utf8seq&&n(t.codepoint)}}(e,r,n)};for(let o=0;o<e.length;o+=1)xm(e.charCodeAt(o),s,i);return t.join("")}function Wm(e,t){if(!(e<=127)){if(e<=2047)return t(192|e>>6),void t(128|63&e);if(e<=65535)return t(224|e>>12),t(128|e>>6&63),void t(128|63&e);if(e<=1114111)return t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),void t(128|63&e);throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}t(e)}function Nm(e){const t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};for(let s=0;s<e.length;s+=1)xm(e.charCodeAt(s),n,r);return new Uint8Array(t)}function Jm(e){const t=[];return function(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const t=1024*(r-55296)&65535;r=65536+(e.charCodeAt(n+1)-56320&65535|t),n+=1}Wm(r,t)}}(e,e=>t.push(e)),new Uint8Array(t)}function km(e){const t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};return e.forEach(e=>Bm(e,n,r)),Bm(null,n,r),t.join("")}var Fm=()=>"undefined"!=typeof window&&"undefined"!=typeof document,_m={tested:!1,writable:!1},Ym=()=>{if(!Fm())return!1;try{if("object"!=typeof globalThis.localStorage)return!1}catch(t){return!1}if(_m.tested)return _m.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),_m.tested=!0,_m.writable=!0}catch(t){_m.tested=!0,_m.writable=!1}return _m.writable};var Hm=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),Lm=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},Tm=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch(r){return n}},Om=async(e,t)=>{await e.removeItem(t)},Mm=class e{constructor(){this.promise=new e.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}};function Km(e){const t=e.split(".");if(3!==t.length)throw new Cm("Invalid JWT structure");for(let n=0;n<t.length;n++)if(!um.test(t[n]))throw new Cm("JWT not in base64url format");return{header:JSON.parse(Rm(t[0])),payload:JSON.parse(Rm(t[1])),signature:Nm(t[2]),raw:{header:t[0],payload:t[1]}}}function Um(e){return("0"+e.toString(16)).substr(-2)}async function zm(e){if("undefined"==typeof crypto||void 0===crypto.subtle||"undefined"==typeof TextEncoder)return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const t=await async function(e){const t=(new TextEncoder).encode(e),n=await crypto.subtle.digest("SHA-256",t),r=new Uint8Array(n);return Array.from(r).map(e=>String.fromCharCode(e)).join("")}(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Dm(e,t,n=!1){const r=function(){const e=new Uint32Array(56);if("undefined"==typeof crypto){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",t=66;let n="";for(let r=0;r<56;r++)n+=e.charAt(Math.floor(Math.random()*t));return n}return crypto.getRandomValues(e),Array.from(e,Um).join("")}();let s=r;n&&(s+="/PASSWORD_RECOVERY"),await Lm(e,`${t}-code-verifier`,s);const i=await zm(r);return[i,r===i?"plain":"s256"]}Mm.promiseConstructor=Promise;var jm=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;var Pm=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Qm(e){if(!Pm.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function $m(){return new Proxy({},{get:(e,t)=>{if("__isUserNotAvailableProxy"===t)return!0;if("symbol"==typeof t){const e=t.toString();if("Symbol(Symbol.toPrimitive)"===e||"Symbol(Symbol.toStringTag)"===e||"Symbol(util.inspect.custom)"===e)return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function qm(e){return JSON.parse(JSON.stringify(e))}var eg=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),tg=[502,503,504];async function ng(e){var t,n;if(!("object"==typeof(n=e)&&null!==n&&"status"in n&&"ok"in n&&"json"in n&&"function"==typeof n.json))throw new Am(eg(e),0);if(tg.includes(e.status))throw new Am(eg(e),e.status);let r,s;try{r=await e.json()}catch(o){throw new gm(eg(o),o)}const i=function(e){const t=e.headers.get(cm);if(!t)return null;if(!t.match(jm))return null;try{/* @__PURE__ */
3
+ return new Date(`${t}T00:00:00.0Z`)}catch(o){return null}}(e);if(i&&i.getTime()>=lm.timestamp&&"object"==typeof r&&r&&"string"==typeof r.code?s=r.code:"object"==typeof r&&r&&"string"==typeof r.error_code&&(s=r.error_code),s){if("weak_password"===s)throw new Zm(eg(r),e.status,(null===(t=r.weak_password)||void 0===t?void 0:t.reasons)||[]);if("session_not_found"===s)throw new fm}else if("object"==typeof r&&r&&"object"==typeof r.weak_password&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((e,t)=>e&&"string"==typeof t,!0))throw new Zm(eg(r),e.status,r.weak_password.reasons);throw new mm(eg(r),e.status||500,s)}async function rg(e,t,n,r){var s;const i=Object.assign({},null==r?void 0:r.headers);i["X-Supabase-Api-Version"]||(i[cm]=lm.name),(null==r?void 0:r.jwt)&&(i.Authorization=`Bearer ${r.jwt}`);const o=null!==(s=null==r?void 0:r.query)&&void 0!==s?s:{};(null==r?void 0:r.redirectTo)&&(o.redirect_to=r.redirectTo);const a=await async function(e,t,n,r,s,i){const o=((e,t,n,r)=>{const s={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},null==t?void 0:t.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),n))})(t,r,s,i);let a;try{a=await e(n,Object.assign({},o))}catch(c){throw console.error(c),new Am(eg(c),0)}a.ok||await ng(a);if(null==r?void 0:r.noResolveJson)return a;try{return await a.json()}catch(c){await ng(c)}}(e,t,n+(Object.keys(o).length?"?"+new URLSearchParams(o).toString():""),{headers:i,noResolveJson:null==r?void 0:r.noResolveJson},{},null==r?void 0:r.body);return(null==r?void 0:r.xform)?null==r?void 0:r.xform(a):{data:Object.assign({},a),error:null}}function sg(e){var t;let n=null;var r;(function(e){return e.access_token&&e.refresh_token&&e.expires_in})(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=(r=e.expires_in,Math.round(Date.now()/1e3)+r)));return{data:{session:n,user:null!==(t=e.user)&&void 0!==t?t:e},error:null}}function ig(e){const t=sg(e);return!t.error&&e.weak_password&&"object"==typeof e.weak_password&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&"string"==typeof e.weak_password.message&&e.weak_password.reasons.reduce((e,t)=>e&&"string"==typeof t,!0)&&(t.data.weak_password=e.weak_password),t}function og(e){var t;return{data:{user:null!==(t=e.user)&&void 0!==t?t:e},error:null}}function ag(e){return{data:e,error:null}}function cg(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i}=e,o=md(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]);return{data:{properties:{action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i},user:Object.assign({},o)},error:null}}function lg(e){return e}var ug=["global","local","others"],dg=class{constructor({url:e="",headers:t={},fetch:n}){this.url=e,this.headers=t,this.fetch=Hm(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)}}async signOut(e,t=ug[0]){if(ug.indexOf(t)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${ug.join(", ")}`);try{return await rg(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(hm(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,t={}){try{return await rg(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:og})}catch(n){if(hm(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:t}=e,n=md(e,["options"]),r=Object.assign(Object.assign({},n),t);return"newEmail"in n&&(r.new_email=null==n?void 0:n.newEmail,delete r.newEmail),await rg(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:r,headers:this.headers,xform:cg,redirectTo:null==t?void 0:t.redirectTo})}catch(t){if(hm(t))return{data:{properties:null,user:null},error:t};throw t}}async createUser(e){try{return await rg(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:og})}catch(t){if(hm(t))return{data:{user:null},error:t};throw t}}async listUsers(e){var t,n,r,s,i,o,a;try{const c={nextPage:null,lastPage:0,total:0},l=await rg(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:null!==(n=null===(t=null==e?void 0:e.page)||void 0===t?void 0:t.toString())&&void 0!==n?n:"",per_page:null!==(s=null===(r=null==e?void 0:e.perPage)||void 0===r?void 0:r.toString())&&void 0!==s?s:""},xform:lg});if(l.error)throw l.error;const u=await l.json(),d=null!==(i=l.headers.get("x-total-count"))&&void 0!==i?i:0,h=null!==(a=null===(o=l.headers.get("link"))||void 0===o?void 0:o.split(","))&&void 0!==a?a:[];return h.length>0&&(h.forEach(e=>{const t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),n=JSON.parse(e.split(";")[1].split("=")[1]);c[`${n}Page`]=t}),c.total=parseInt(d)),{data:Object.assign(Object.assign({},u),c),error:null}}catch(c){if(hm(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){Qm(e);try{return await rg(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:og})}catch(t){if(hm(t))return{data:{user:null},error:t};throw t}}async updateUserById(e,t){Qm(e);try{return await rg(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:og})}catch(n){if(hm(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,t=!1){Qm(e);try{return await rg(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:og})}catch(n){if(hm(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){Qm(e.userId);try{const{data:t,error:n}=await rg(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:n}}catch(t){if(hm(t))return{data:null,error:t};throw t}}async _deleteFactor(e){Qm(e.userId),Qm(e.id);try{return{data:await rg(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(t){if(hm(t))return{data:null,error:t};throw t}}async _listOAuthClients(e){var t,n,r,s,i,o,a;try{const c={nextPage:null,lastPage:0,total:0},l=await rg(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:null!==(n=null===(t=null==e?void 0:e.page)||void 0===t?void 0:t.toString())&&void 0!==n?n:"",per_page:null!==(s=null===(r=null==e?void 0:e.perPage)||void 0===r?void 0:r.toString())&&void 0!==s?s:""},xform:lg});if(l.error)throw l.error;const u=await l.json(),d=null!==(i=l.headers.get("x-total-count"))&&void 0!==i?i:0,h=null!==(a=null===(o=l.headers.get("link"))||void 0===o?void 0:o.split(","))&&void 0!==a?a:[];return h.length>0&&(h.forEach(e=>{const t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),n=JSON.parse(e.split(";")[1].split("=")[1]);c[`${n}Page`]=t}),c.total=parseInt(d)),{data:Object.assign(Object.assign({},u),c),error:null}}catch(c){if(hm(c))return{data:{clients:[]},error:c};throw c}}async _createOAuthClient(e){try{return await rg(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(t){if(hm(t))return{data:null,error:t};throw t}}async _getOAuthClient(e){try{return await rg(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(t){if(hm(t))return{data:null,error:t};throw t}}async _updateOAuthClient(e,t){try{return await rg(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(n){if(hm(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{return await rg(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(t){if(hm(t))return{data:null,error:t};throw t}}async _regenerateOAuthClientSecret(e){try{return await rg(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(t){if(hm(t))return{data:null,error:t};throw t}}async _listCustomProviders(e){try{const t={};return(null==e?void 0:e.type)&&(t.type=e.type),await rg(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:e=>{var t;return{data:{providers:null!==(t=null==e?void 0:e.providers)&&void 0!==t?t:[]},error:null}}})}catch(t){if(hm(t))return{data:{providers:[]},error:t};throw t}}async _createCustomProvider(e){try{return await rg(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(t){if(hm(t))return{data:null,error:t};throw t}}async _getCustomProvider(e){try{return await rg(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(t){if(hm(t))return{data:null,error:t};throw t}}async _updateCustomProvider(e,t){try{return await rg(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(n){if(hm(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(e){try{return await rg(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(t){if(hm(t))return{data:null,error:t};throw t}}};function hg(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}var mg=!!(globalThis&&Ym()&&globalThis.localStorage&&"true"===globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")),gg=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}},pg=class extends gg{};async function fg(e,t,n){mg&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;t>0&&setTimeout(()=>{r.abort(),mg&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,0===t?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async r=>{if(!r){if(0===t)throw mg&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new pg(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(mg)try{const e=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(e,null," "))}catch(s){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",s)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await n()}mg&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,r.name);try{return await n()}finally{mg&&console.log("@supabase/gotrue-js: navigatorLock: released",e,r.name)}})}catch(s){if("AbortError"===(null==s?void 0:s.name)&&t>0)return mg&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async t=>{if(!t)return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await n();mg&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,t.name);try{return await n()}finally{mg&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,t.name)}}));throw s}}function yg(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function bg(e){const t=(new TextEncoder).encode(e);return"0x"+Array.from(t,e=>e.toString(16).padStart(2,"0")).join("")}var Ig=class extends Error{constructor({message:e,code:t,cause:n,name:r}){var s;super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=null!==(s=null!=r?r:n instanceof Error?n.name:void 0)&&void 0!==s?s:"Unknown Error",this.code=t}},wg=class extends Ig{constructor(e,t){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t,message:e}),this.name="WebAuthnUnknownError",this.originalError=t}};function vg({error:e,options:t}){var n,r,s;const{publicKey:i}=t;if(!i)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new Ig({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("ConstraintError"===e.name){if(!0===(null===(n=i.authenticatorSelection)||void 0===n?void 0:n.requireResidentKey))return new Ig({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if("conditional"===t.mediation&&"required"===(null===(r=i.authenticatorSelection)||void 0===r?void 0:r.userVerification))return new Ig({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if("required"===(null===(s=i.authenticatorSelection)||void 0===s?void 0:s.userVerification))return new Ig({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if("InvalidStateError"===e.name)return new Ig({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if("NotAllowedError"===e.name)return new Ig({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if("NotSupportedError"===e.name)return 0===i.pubKeyCredParams.filter(e=>"public-key"===e.type).length?new Ig({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Ig({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if("SecurityError"===e.name){const t=window.location.hostname;if(!Eg(t))return new Ig({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(i.rp.id!==t)return new Ig({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("TypeError"===e.name){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new Ig({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if("UnknownError"===e.name)return new Ig({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Ig({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function Gg({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new Ig({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if("NotAllowedError"===e.name)return new Ig({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if("SecurityError"===e.name){const t=window.location.hostname;if(!Eg(t))return new Ig({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(n.rpId!==t)return new Ig({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("UnknownError"===e.name)return new Ig({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Ig({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}var Ag=new class{createNewAbortSignal(){if(this.controller){const e=/* @__PURE__ */new Error("Cancelling existing WebAuthn API call for new one");e.name="AbortError",this.controller.abort(e)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=/* @__PURE__ */new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}};function Sg(e){if(!e)throw new Error("Credential creation options are required");if("undefined"!=typeof PublicKeyCredential&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseCreationOptionsFromJSON)return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:n,excludeCredentials:r}=e,s=md(e,["challenge","user","excludeCredentials"]),i=Nm(t).buffer,o=Object.assign(Object.assign({},n),{id:Nm(n.id).buffer}),a=Object.assign(Object.assign({},s),{challenge:i,user:o});if(r&&r.length>0){a.excludeCredentials=new Array(r.length);for(let e=0;e<r.length;e++){const t=r[e];a.excludeCredentials[e]=Object.assign(Object.assign({},t),{id:Nm(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return a}function Zg(e){if(!e)throw new Error("Credential request options are required");if("undefined"!=typeof PublicKeyCredential&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseRequestOptionsFromJSON)return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:n}=e,r=md(e,["challenge","allowCredentials"]),s=Nm(t).buffer,i=Object.assign(Object.assign({},r),{challenge:s});if(n&&n.length>0){i.allowCredentials=new Array(n.length);for(let e=0;e<n.length;e++){const t=n[e];i.allowCredentials[e]=Object.assign(Object.assign({},t),{id:Nm(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return i}function Cg(e){var t;if("toJSON"in e&&"function"==typeof e.toJSON)return e.toJSON();const n=e;return{id:e.id,rawId:e.id,response:{attestationObject:km(new Uint8Array(e.response.attestationObject)),clientDataJSON:km(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:null!==(t=n.authenticatorAttachment)&&void 0!==t?t:void 0}}function Vg(e){var t;if("toJSON"in e&&"function"==typeof e.toJSON)return e.toJSON();const n=e,r=e.getClientExtensionResults(),s=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:km(new Uint8Array(s.authenticatorData)),clientDataJSON:km(new Uint8Array(s.clientDataJSON)),signature:km(new Uint8Array(s.signature)),userHandle:s.userHandle?km(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:null!==(t=n.authenticatorAttachment)&&void 0!==t?t:void 0}}function Eg(e){return"localhost"===e||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function Xg(){var e,t;return!!(Fm()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&"function"==typeof(null===(e=null===navigator||void 0===navigator?void 0:navigator.credentials)||void 0===e?void 0:e.create)&&"function"==typeof(null===(t=null===navigator||void 0===navigator?void 0:navigator.credentials)||void 0===t?void 0:t.get))}var Bg={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},xg={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Rg(...e){const t=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),n=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),r={};for(const s of e)if(s)for(const e in s){const i=s[e];if(void 0!==i)if(Array.isArray(i))r[e]=i;else if(n(i))r[e]=i;else if(t(i)){const n=r[e];t(n)?r[e]=Rg(n,i):r[e]=Rg(i)}else r[e]=i}return r}function Wg(e,t){return Rg(Bg,e,t||{})}var Ng=class{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:t,friendlyName:n,signal:r},s){var i;try{const{data:o,error:a}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!o)return{data:null,error:a};const c=null!=r?r:Ag.createNewAbortSignal();if("create"===o.webauthn.type){const{user:e}=o.webauthn.credential_options.publicKey;if(!e.name){const t=n;if(t)e.name=`${e.id}:${t}`;else{const t=(await this.client.getUser()).data.user,n=(null===(i=null==t?void 0:t.user_metadata)||void 0===i?void 0:i.name)||(null==t?void 0:t.email)||(null==t?void 0:t.id)||"User";e.name=`${e.id}:${n}`}}e.displayName||(e.displayName=e.name)}switch(o.webauthn.type){case"create":{const{data:t,error:n}=await async function(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new wg("Browser returned unexpected credential type",t)}:{data:null,error:new wg("Empty credential response",t)}}catch(t){return{data:null,error:vg({error:t,options:e})}}}({publicKey:Wg(o.webauthn.credential_options.publicKey,null==s?void 0:s.create),signal:c});return t?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:t}},error:null}:{data:null,error:n}}case"request":{const t=function(e,t){return Rg(xg,e,t||{})}(o.webauthn.credential_options.publicKey,null==s?void 0:s.request),{data:n,error:r}=await async function(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new wg("Browser returned unexpected credential type",t)}:{data:null,error:new wg("Empty credential response",t)}}catch(t){return{data:null,error:Gg({error:t,options:e})}}}(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:t,signal:c}));return n?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:n}},error:null}:{data:null,error:r}}}}catch(o){return hm(o)?{data:null,error:o}:{data:null,error:new gm("Unexpected error in challenge",o)}}}async _verify({challengeId:e,factorId:t,webauthn:n}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:t=("undefined"!=typeof window?window.location.hostname:void 0),rpOrigins:n=("undefined"!=typeof window?[window.location.origin]:void 0),signal:r}={}},s){if(!t)return{data:null,error:new dm("rpId is required for WebAuthn authentication")};try{if(!Xg())return{data:null,error:new gm("Browser does not support WebAuthn",null)};const{data:i,error:o}=await this.challenge({factorId:e,webauthn:{rpId:t,rpOrigins:n},signal:r},{request:s});if(!i)return{data:null,error:o};const{webauthn:a}=i;return this._verify({factorId:e,challengeId:i.challengeId,webauthn:{type:a.type,rpId:t,rpOrigins:n,credential_response:a.credential_response}})}catch(i){return hm(i)?{data:null,error:i}:{data:null,error:new gm("Unexpected error in authenticate",i)}}}async _register({friendlyName:e,webauthn:{rpId:t=("undefined"!=typeof window?window.location.hostname:void 0),rpOrigins:n=("undefined"!=typeof window?[window.location.origin]:void 0),signal:r}={}},s){if(!t)return{data:null,error:new dm("rpId is required for WebAuthn registration")};try{if(!Xg())return{data:null,error:new gm("Browser does not support WebAuthn",null)};const{data:i,error:o}=await this._enroll({friendlyName:e});if(!i)return await this.client.mfa.listFactors().then(t=>{var n;return null===(n=t.data)||void 0===n?void 0:n.all.find(t=>"webauthn"===t.factor_type&&t.friendly_name===e&&"unverified"!==t.status)}).then(e=>e?this.client.mfa.unenroll({factorId:null==e?void 0:e.id}):void 0),{data:null,error:o};const{data:a,error:c}=await this._challenge({factorId:i.id,friendlyName:i.friendly_name,webauthn:{rpId:t,rpOrigins:n},signal:r},{create:s});return a?this._verify({factorId:i.id,challengeId:a.challengeId,webauthn:{rpId:t,rpOrigins:n,type:a.webauthn.type,credential_response:a.webauthn.credential_response}}):{data:null,error:c}}catch(i){return hm(i)?{data:null,error:i}:{data:null,error:new gm("Unexpected error in register",i)}}}};!function(){if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch(e){"undefined"!=typeof self&&(self.globalThis=self)}}();var Jg={url:"http://localhost:9999",storageKey:"supabase.auth.token",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:am,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function kg(e,t,n){return await n()}var Fg={},_g=class e{get jwks(){var e,t;return null!==(t=null===(e=Fg[this.storageKey])||void 0===e?void 0:e.jwks)&&void 0!==t?t:{keys:[]}}set jwks(e){Fg[this.storageKey]=Object.assign(Object.assign({},Fg[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,t;return null!==(t=null===(e=Fg[this.storageKey])||void 0===e?void 0:e.cachedAt)&&void 0!==t?t:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Fg[this.storageKey]=Object.assign(Object.assign({},Fg[this.storageKey]),{cachedAt:e})}constructor(t){var n,r,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=/* @__PURE__ */new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const i=Object.assign(Object.assign({},Jg),t);if(this.storageKey=i.storageKey,this.instanceID=null!==(n=e.nextInstanceID[this.storageKey])&&void 0!==n?n:0,e.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,"function"==typeof i.debug&&(this.logger=i.debug),this.instanceID>0&&Fm()){const e=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(e),this.logDebugMessages&&console.trace(e)}if(this.persistSession=i.persistSession,this.autoRefreshToken=i.autoRefreshToken,this.admin=new dg({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=Hm(i.fetch),this.lock=i.lock||kg,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,this.lockAcquireTimeout=i.lockAcquireTimeout,i.lock?this.lock=i.lock:this.persistSession&&Fm()&&(null===(r=null===globalThis||void 0===globalThis?void 0:globalThis.navigator)||void 0===r?void 0:r.locks)?this.lock=fg:this.lock=kg,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new Ng(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(i.storage?this.storage=i.storage:Ym()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=hg(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=hg(this.memoryStorage)),Fm()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}null===(s=this.broadcastChannel)||void 0===s||s.addEventListener("message",async e=>{this._debug("received broadcast notification from other tab or client",e);try{await this._notifyAllSubscribers(e.data.event,e.data.session,!1)}catch(t){this._debug("#broadcastChannel","error",t)}})}i.skipAutoInitialize||this.initialize().catch(e=>{this._debug("#initialize()","error",e)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${sm}) ${/* @__PURE__ */(new Date).toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise||(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))()),await this.initializePromise}async _initialize(){var e;try{let t={},n="none";if(Fm()&&(t=function(e){const t={},n=new URL(e);if(n.hash&&"#"===n.hash[0])try{new URLSearchParams(n.hash.substring(1)).forEach((e,n)=>{t[n]=e})}catch(r){}return n.searchParams.forEach((e,n)=>{t[n]=e}),t}(window.location.href),this._isImplicitGrantCallback(t)?n="implicit":await this._isPKCECallback(t)&&(n="pkce")),Fm()&&this.detectSessionInUrl&&"none"!==n){const{data:r,error:s}=await this._getSessionFromURL(t,n);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),function(e){return hm(e)&&"AuthImplicitGrantRedirectError"===e.name}(s)){const t=null===(e=s.details)||void 0===e?void 0:e.code;if("identity_already_exists"===t||"identity_not_found"===t||"single_identity_not_deletable"===t)return{error:s}}return{error:s}}const{session:i,redirectType:o}=r;return this._debug("#_initialize()","detected session in URL",i,"redirect type",o),await this._saveSession(i),setTimeout(async()=>{"recovery"===o?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(t){return hm(t)?this._returnResult({error:t}):this._returnResult({error:new gm("Unexpected error during initialization",t)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,n,r;try{const{data:s,error:i}=await rg(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:null!==(n=null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.data)&&void 0!==n?n:{},gotrue_meta_security:{captcha_token:null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.captchaToken}},xform:sg});if(i||!s)return this._returnResult({data:{user:null,session:null},error:i});const o=s.session,a=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",o)),this._returnResult({data:{user:a,session:o},error:null})}catch(s){if(hm(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signUp(e){var t,n,r;try{let s;if("email"in e){const{email:n,password:r,options:i}=e;let o=null,a=null;"pkce"===this.flowType&&([o,a]=await Dm(this.storage,this.storageKey)),s=await rg(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:null==i?void 0:i.emailRedirectTo,body:{email:n,password:r,data:null!==(t=null==i?void 0:i.data)&&void 0!==t?t:{},gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken},code_challenge:o,code_challenge_method:a},xform:sg})}else{if(!("phone"in e))throw new Im("You must provide either an email or phone number and a password");{const{phone:t,password:i,options:o}=e;s=await rg(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:t,password:i,data:null!==(n=null==o?void 0:o.data)&&void 0!==n?n:{},channel:null!==(r=null==o?void 0:o.channel)&&void 0!==r?r:"sms",gotrue_meta_security:{captcha_token:null==o?void 0:o.captchaToken}},xform:sg})}}const{data:i,error:o}=s;if(o||!i)return await Om(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:o});const a=i.session,c=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",a)),this._returnResult({data:{user:c,session:a},error:null})}catch(s){if(await Om(this.storage,`${this.storageKey}-code-verifier`),hm(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithPassword(e){try{let t;if("email"in e){const{email:n,password:r,options:s}=e;t=await rg(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:r,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},xform:ig})}else{if(!("phone"in e))throw new Im("You must provide either an email or phone number and a password");{const{phone:n,password:r,options:s}=e;t=await rg(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:r,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},xform:ig})}}const{data:n,error:r}=t;if(r)return this._returnResult({data:{user:null,session:null},error:r});if(!n||!n.session||!n.user){const e=new bm;return this._returnResult({data:{user:null,session:null},error:e})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:r})}catch(t){if(hm(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async signInWithOAuth(e){var t,n,r,s;return await this._handleProviderSignIn(e.provider,{redirectTo:null===(t=e.options)||void 0===t?void 0:t.redirectTo,scopes:null===(n=e.options)||void 0===n?void 0:n.scopes,queryParams:null===(r=e.options)||void 0===r?void 0:r.queryParams,skipBrowserRedirect:null===(s=e.options)||void 0===s?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:t}=e;switch(t){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){var t,n,r,s,i,o,a,c,l,u,d;let h,m;if("message"in e)h=e.message,m=e.signature;else{const{chain:u,wallet:d,statement:p,options:f}=e;let y;if(Fm())if("object"==typeof d)y=d;else{const e=window;if(!("ethereum"in e)||"object"!=typeof e.ethereum||!("request"in e.ethereum)||"function"!=typeof e.ethereum.request)throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.");y=e.ethereum}else{if("object"!=typeof d||!(null==f?void 0:f.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");y=d}const b=new URL(null!==(t=null==f?void 0:f.url)&&void 0!==t?t:window.location.href),I=await y.request({method:"eth_requestAccounts"}).then(e=>e).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!I||0===I.length)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const w=yg(I[0]);let v=null===(n=null==f?void 0:f.signInWithEthereum)||void 0===n?void 0:n.chainId;v||(g=await y.request({method:"eth_chainId"}),v=parseInt(g,16)),h=function(e){var t;const{chainId:n,domain:r,expirationTime:s,issuedAt:i=/* @__PURE__ */new Date,nonce:o,notBefore:a,requestId:c,resources:l,scheme:u,uri:d,version:h}=e;if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if("1"!==h)throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${h}`);if(null===(t=e.statement)||void 0===t?void 0:t.includes("\n"))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`);const m=`${u?`${u}://${r}`:r} wants you to sign in with your Ethereum account:\n${yg(e.address)}\n\n${e.statement?`${e.statement}\n`:""}`;let g=`URI: ${d}\nVersion: ${h}\nChain ID: ${n}${o?`\nNonce: ${o}`:""}\nIssued At: ${i.toISOString()}`;if(s&&(g+=`\nExpiration Time: ${s.toISOString()}`),a&&(g+=`\nNot Before: ${a.toISOString()}`),c&&(g+=`\nRequest ID: ${c}`),l){let e="\nResources:";for(const t of l){if(!t||"string"!=typeof t)throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${t}`);e+=`\n- ${t}`}g+=e}return`${m}\n${g}`}({domain:b.host,address:w,statement:p,uri:b.href,version:"1",chainId:v,nonce:null===(r=null==f?void 0:f.signInWithEthereum)||void 0===r?void 0:r.nonce,issuedAt:null!==(i=null===(s=null==f?void 0:f.signInWithEthereum)||void 0===s?void 0:s.issuedAt)&&void 0!==i?i:/* @__PURE__ */new Date,expirationTime:null===(o=null==f?void 0:f.signInWithEthereum)||void 0===o?void 0:o.expirationTime,notBefore:null===(a=null==f?void 0:f.signInWithEthereum)||void 0===a?void 0:a.notBefore,requestId:null===(c=null==f?void 0:f.signInWithEthereum)||void 0===c?void 0:c.requestId,resources:null===(l=null==f?void 0:f.signInWithEthereum)||void 0===l?void 0:l.resources}),m=await y.request({method:"personal_sign",params:[bg(h),w]})}var g;try{const{data:t,error:n}=await rg(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:h,signature:m},(null===(u=e.options)||void 0===u?void 0:u.captchaToken)?{gotrue_meta_security:{captcha_token:null===(d=e.options)||void 0===d?void 0:d.captchaToken}}:null),xform:sg});if(n)throw n;if(!t||!t.session||!t.user){const e=new bm;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:n})}catch(p){if(hm(p))return this._returnResult({data:{user:null,session:null},error:p});throw p}}async signInWithSolana(e){var t,n,r,s,i,o,a,c,l,u,d,h;let m,g;if("message"in e)m=e.message,g=e.signature;else{const{chain:d,wallet:h,statement:p,options:f}=e;let y;if(Fm())if("object"==typeof h)y=h;else{const e=window;if(!("solana"in e)||"object"!=typeof e.solana||!("signIn"in e.solana&&"function"==typeof e.solana.signIn||"signMessage"in e.solana&&"function"==typeof e.solana.signMessage))throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.");y=e.solana}else{if("object"!=typeof h||!(null==f?void 0:f.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");y=h}const b=new URL(null!==(t=null==f?void 0:f.url)&&void 0!==t?t:window.location.href);if("signIn"in y&&y.signIn){const e=await y.signIn(Object.assign(Object.assign(Object.assign({issuedAt:/* @__PURE__ */(new Date).toISOString()},null==f?void 0:f.signInWithSolana),{version:"1",domain:b.host,uri:b.href}),p?{statement:p}:null));let t;if(Array.isArray(e)&&e[0]&&"object"==typeof e[0])t=e[0];else{if(!(e&&"object"==typeof e&&"signedMessage"in e&&"signature"in e))throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");t=e}if(!("signedMessage"in t&&"signature"in t&&("string"==typeof t.signedMessage||t.signedMessage instanceof Uint8Array)&&t.signature instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields");m="string"==typeof t.signedMessage?t.signedMessage:(new TextDecoder).decode(t.signedMessage),g=t.signature}else{if(!("signMessage"in y&&"function"==typeof y.signMessage&&"publicKey"in y&&"object"==typeof y&&y.publicKey&&"toBase58"in y.publicKey&&"function"==typeof y.publicKey.toBase58))throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");m=[`${b.host} wants you to sign in with your Solana account:`,y.publicKey.toBase58(),...p?["",p,""]:[""],"Version: 1",`URI: ${b.href}`,`Issued At: ${null!==(r=null===(n=null==f?void 0:f.signInWithSolana)||void 0===n?void 0:n.issuedAt)&&void 0!==r?r:/* @__PURE__ */(new Date).toISOString()}`,...(null===(s=null==f?void 0:f.signInWithSolana)||void 0===s?void 0:s.notBefore)?[`Not Before: ${f.signInWithSolana.notBefore}`]:[],...(null===(i=null==f?void 0:f.signInWithSolana)||void 0===i?void 0:i.expirationTime)?[`Expiration Time: ${f.signInWithSolana.expirationTime}`]:[],...(null===(o=null==f?void 0:f.signInWithSolana)||void 0===o?void 0:o.chainId)?[`Chain ID: ${f.signInWithSolana.chainId}`]:[],...(null===(a=null==f?void 0:f.signInWithSolana)||void 0===a?void 0:a.nonce)?[`Nonce: ${f.signInWithSolana.nonce}`]:[],...(null===(c=null==f?void 0:f.signInWithSolana)||void 0===c?void 0:c.requestId)?[`Request ID: ${f.signInWithSolana.requestId}`]:[],...(null===(u=null===(l=null==f?void 0:f.signInWithSolana)||void 0===l?void 0:l.resources)||void 0===u?void 0:u.length)?["Resources",...f.signInWithSolana.resources.map(e=>`- ${e}`)]:[]].join("\n");const e=await y.signMessage((new TextEncoder).encode(m),"utf8");if(!(e&&e instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=e}}try{const{data:t,error:n}=await rg(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:m,signature:km(g)},(null===(d=e.options)||void 0===d?void 0:d.captchaToken)?{gotrue_meta_security:{captcha_token:null===(h=e.options)||void 0===h?void 0:h.captchaToken}}:null),xform:sg});if(n)throw n;if(!t||!t.session||!t.user){const e=new bm;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:n})}catch(p){if(hm(p))return this._returnResult({data:{user:null,session:null},error:p});throw p}}async _exchangeCodeForSession(e){const t=await Tm(this.storage,`${this.storageKey}-code-verifier`),[n,r]=(null!=t?t:"").split("/");try{if(!n&&"pkce"===this.flowType)throw new Gm;const{data:t,error:s}=await rg(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:sg});if(await Om(this.storage,`${this.storageKey}-code-verifier`),s)throw s;if(!t||!t.session||!t.user){const e=new bm;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign(Object.assign({},t),{redirectType:null!=r?r:null}),error:s})}catch(s){if(await Om(this.storage,`${this.storageKey}-code-verifier`),hm(s))return this._returnResult({data:{user:null,session:null,redirectType:null},error:s});throw s}}async signInWithIdToken(e){try{const{options:t,provider:n,token:r,access_token:s,nonce:i}=e,{data:o,error:a}=await rg(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:r,access_token:s,nonce:i,gotrue_meta_security:{captcha_token:null==t?void 0:t.captchaToken}},xform:sg});if(a)return this._returnResult({data:{user:null,session:null},error:a});if(!o||!o.session||!o.user){const e=new bm;return this._returnResult({data:{user:null,session:null},error:e})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),this._returnResult({data:o,error:a})}catch(t){if(hm(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async signInWithOtp(e){var t,n,r,s,i;try{if("email"in e){const{email:r,options:s}=e;let i=null,o=null;"pkce"===this.flowType&&([i,o]=await Dm(this.storage,this.storageKey));const{error:a}=await rg(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:r,data:null!==(t=null==s?void 0:s.data)&&void 0!==t?t:{},create_user:null===(n=null==s?void 0:s.shouldCreateUser)||void 0===n||n,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken},code_challenge:i,code_challenge_method:o},redirectTo:null==s?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}if("phone"in e){const{phone:t,options:n}=e,{data:o,error:a}=await rg(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:null!==(r=null==n?void 0:n.data)&&void 0!==r?r:{},create_user:null===(s=null==n?void 0:n.shouldCreateUser)||void 0===s||s,gotrue_meta_security:{captcha_token:null==n?void 0:n.captchaToken},channel:null!==(i=null==n?void 0:n.channel)&&void 0!==i?i:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:null==o?void 0:o.message_id},error:a})}throw new Im("You must provide either an email or phone number.")}catch(o){if(await Om(this.storage,`${this.storageKey}-code-verifier`),hm(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async verifyOtp(e){var t,n;try{let r,s;"options"in e&&(r=null===(t=e.options)||void 0===t?void 0:t.redirectTo,s=null===(n=e.options)||void 0===n?void 0:n.captchaToken);const{data:i,error:o}=await rg(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:r,xform:sg});if(o)throw o;if(!i)/* @__PURE__ */throw new Error("An error occurred on token verification.");const a=i.session,c=i.user;return(null==a?void 0:a.access_token)&&(await this._saveSession(a),await this._notifyAllSubscribers("recovery"==e.type?"PASSWORD_RECOVERY":"SIGNED_IN",a)),this._returnResult({data:{user:c,session:a},error:null})}catch(r){if(hm(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithSSO(e){var t,n,r,s,i;try{let o=null,a=null;"pkce"===this.flowType&&([o,a]=await Dm(this.storage,this.storageKey));const c=await rg(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:null!==(n=null===(t=e.options)||void 0===t?void 0:t.redirectTo)&&void 0!==n?n:void 0}),(null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.captchaToken)?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:a}),headers:this.headers,xform:ag});return(null===(s=c.data)||void 0===s?void 0:s.url)&&Fm()&&!(null===(i=e.options)||void 0===i?void 0:i.skipBrowserRedirect)&&window.location.assign(c.data.url),this._returnResult(c)}catch(o){if(await Om(this.storage,`${this.storageKey}-code-verifier`),hm(o))return this._returnResult({data:null,error:o});throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:t},error:n}=e;if(n)throw n;if(!t)throw new fm;const{error:r}=await rg(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:r})})}catch(e){if(hm(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const t=`${this.url}/resend`;if("email"in e){const{email:n,type:r,options:s}=e,{error:i}=await rg(this.fetch,"POST",t,{headers:this.headers,body:{email:n,type:r,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},redirectTo:null==s?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:i})}if("phone"in e){const{phone:n,type:r,options:s}=e,{data:i,error:o}=await rg(this.fetch,"POST",t,{headers:this.headers,body:{phone:n,type:r,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:null==i?void 0:i.message_id},error:o})}throw new Im("You must provide either an email or phone number and a type")}catch(t){if(hm(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await n}catch(e){}})()),n}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const e=t();for(this.pendingInLock.push((async()=>{try{await e}catch(t){}})()),await e;this.pendingInLock.length;){const e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{return await e(await this.__loadSession())}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",/* @__PURE__ */(new Error).stack);try{let e=null;const t=await Tm(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),null!==t&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const n=!!e.expires_at&&1e3*e.expires_at-Date.now()<om;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){const t=await Tm(this.userStorage,this.storageKey+"-user");(null==t?void 0:t.user)?e.user=t.user:e.user=$m()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const t={value:this.suppressGetSessionWarning};e.user=function(e,t){return new Proxy(e,{get:(e,n,r)=>{if("__isInsecureUserWarningProxy"===n)return!0;if("symbol"==typeof n){const t=n.toString();if("Symbol(Symbol.toPrimitive)"===t||"Symbol(Symbol.toStringTag)"===t||"Symbol(util.inspect.custom)"===t||"Symbol(nodejs.util.inspect.custom)"===t)return Reflect.get(e,n,r)}return t.value||"string"!=typeof n||(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(e,n,r)}})}(e.user,t),t.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:r,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{session:null},error:s}):this._returnResult({data:{session:r},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;const t=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{return e?await rg(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:og}):await this._useSession(async e=>{var t,n,r;const{data:s,error:i}=e;if(i)throw i;return(null===(t=s.session)||void 0===t?void 0:t.access_token)||this.hasCustomAuthorizationHeader?await rg(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:null!==(r=null===(n=s.session)||void 0===n?void 0:n.access_token)&&void 0!==r?r:void 0,xform:og}):{data:{user:null},error:new fm}})}catch(t){if(hm(t))return ym(t)&&(await this._removeSession(),await Om(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:t});throw t}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async n=>{const{data:r,error:s}=n;if(s)throw s;if(!r.session)throw new fm;const i=r.session;let o=null,a=null;"pkce"===this.flowType&&null!=e.email&&([o,a]=await Dm(this.storage,this.storageKey));const{data:c,error:l}=await rg(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:null==t?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:a}),jwt:i.access_token,xform:og});if(l)throw l;return i.user=c.user,await this._saveSession(i),await this._notifyAllSubscribers("USER_UPDATED",i),this._returnResult({data:{user:i.user},error:null})})}catch(n){if(await Om(this.storage,`${this.storageKey}-code-verifier`),hm(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new fm;const t=Date.now()/1e3;let n=t,r=!0,s=null;const{payload:i}=Km(e.access_token);if(i.exp&&(n=i.exp,r=n<=t),r){const{data:t,error:n}=await this._callRefreshToken(e.refresh_token);if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!t)return{data:{user:null,session:null},error:null};s=t}else{const{data:r,error:i}=await this._getUser(e.access_token);if(i)return this._returnResult({data:{user:null,session:null},error:i});s={access_token:e.access_token,refresh_token:e.refresh_token,user:r.user,token_type:"bearer",expires_in:n-t,expires_at:n},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(t){if(hm(t))return this._returnResult({data:{session:null,user:null},error:t});throw t}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var n;if(!e){const{data:r,error:s}=t;if(s)throw s;e=null!==(n=r.session)&&void 0!==n?n:void 0}if(!(null==e?void 0:e.refresh_token))throw new fm;const{data:r,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):r?this._returnResult({data:{user:r.user,session:r},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(t){if(hm(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async _getSessionFromURL(e,t){try{if(!Fm())throw new wm("No browser detected.");if(e.error||e.error_description||e.error_code)throw new wm(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(t){case"implicit":if("pkce"===this.flowType)throw new vm("Not a valid PKCE flow url.");break;case"pkce":if("implicit"===this.flowType)throw new wm("Not a valid implicit grant flow url.")}if("pkce"===t){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new vm("No code detected.");const{data:t,error:n}=await this._exchangeCodeForSession(e.code);if(n)throw n;const r=new URL(window.location.href);return r.searchParams.delete("code"),window.history.replaceState(window.history.state,"",r.toString()),{data:{session:t.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:r,access_token:s,refresh_token:i,expires_in:o,expires_at:a,token_type:c}=e;if(!(s&&o&&i&&c))throw new wm("No session defined in URL");const l=Math.round(Date.now()/1e3),u=parseInt(o);let d=l+u;a&&(d=parseInt(a));const h=d-l;1e3*h<=3e4&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${h}s, should have been closer to ${u}s`);const m=d-u;l-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,d,l):l-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,d,l);const{data:g,error:p}=await this._getUser(s);if(p)throw p;const f={provider_token:n,provider_refresh_token:r,access_token:s,expires_in:u,expires_at:d,refresh_token:i,token_type:c,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:f,redirectType:e.type},error:null})}catch(n){if(hm(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(e){return"function"==typeof this.detectSessionInUrl?this.detectSessionInUrl(new URL(window.location.href),e):Boolean(e.access_token||e.error_description)}async _isPKCECallback(e){const t=await Tm(this.storage,`${this.storageKey}-code-verifier`);return!(!e.code||!t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var n;const{data:r,error:s}=t;if(s&&!ym(s))return this._returnResult({error:s});const i=null===(n=r.session)||void 0===n?void 0:n.access_token;if(i){const{error:t}=await this.admin.signOut(i,e);if(t&&(!function(e){return hm(e)&&"AuthApiError"===e.name}(t)||404!==t.status&&401!==t.status&&403!==t.status)&&!ym(t))return this._returnResult({error:t})}return"others"!==e&&(await this._removeSession(),await Om(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const t=Symbol("auth-callback"),n={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,n),(async()=>{await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async t=>{var n,r;try{const{data:{session:r},error:s}=t;if(s)throw s;await(null===(n=this.stateChangeEmitters.get(e))||void 0===n?void 0:n.callback("INITIAL_SESSION",r)),this._debug("INITIAL_SESSION","callback id",e,"session",r)}catch(s){await(null===(r=this.stateChangeEmitters.get(e))||void 0===r?void 0:r.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",s),console.error(s)}})}async resetPasswordForEmail(e,t={}){let n=null,r=null;"pkce"===this.flowType&&([n,r]=await Dm(this.storage,this.storageKey,!0));try{return await rg(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(s){if(await Om(this.storage,`${this.storageKey}-code-verifier`),hm(s))return this._returnResult({data:null,error:s});throw s}}async getUserIdentities(){var e;try{const{data:t,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:null!==(e=t.user.identities)&&void 0!==e?e:[]},error:null})}catch(t){if(hm(t))return this._returnResult({data:null,error:t});throw t}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var t;try{const{data:n,error:r}=await this._useSession(async t=>{var n,r,s,i,o;const{data:a,error:c}=t;if(c)throw c;const l=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:null===(n=e.options)||void 0===n?void 0:n.redirectTo,scopes:null===(r=e.options)||void 0===r?void 0:r.scopes,queryParams:null===(s=e.options)||void 0===s?void 0:s.queryParams,skipBrowserRedirect:!0});return await rg(this.fetch,"GET",l,{headers:this.headers,jwt:null!==(o=null===(i=a.session)||void 0===i?void 0:i.access_token)&&void 0!==o?o:void 0})});if(r)throw r;return Fm()&&!(null===(t=e.options)||void 0===t?void 0:t.skipBrowserRedirect)&&window.location.assign(null==n?void 0:n.url),this._returnResult({data:{provider:e.provider,url:null==n?void 0:n.url},error:null})}catch(n){if(hm(n))return this._returnResult({data:{provider:e.provider,url:null},error:n});throw n}}async linkIdentityIdToken(e){return await this._useSession(async t=>{var n;try{const{error:r,data:{session:s}}=t;if(r)throw r;const{options:i,provider:o,token:a,access_token:c,nonce:l}=e,{data:u,error:d}=await rg(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:null!==(n=null==s?void 0:s.access_token)&&void 0!==n?n:void 0,body:{provider:o,id_token:a,access_token:c,nonce:l,link_identity:!0,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:sg});return d?this._returnResult({data:{user:null,session:null},error:d}):u&&u.session&&u.user?(u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("USER_UPDATED",u.session)),this._returnResult({data:u,error:d})):this._returnResult({data:{user:null,session:null},error:new bm})}catch(r){if(await Om(this.storage,`${this.storageKey}-code-verifier`),hm(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{var n,r;const{data:s,error:i}=t;if(i)throw i;return await rg(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:null!==(r=null===(n=s.session)||void 0===n?void 0:n.access_token)&&void 0!==r?r:void 0})})}catch(t){if(hm(t))return this._returnResult({data:null,error:t});throw t}}async _refreshAccessToken(e){const t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{const s=Date.now();return await(n=async n=>(n>0&&await async function(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}(200*Math.pow(2,n-1)),this._debug(t,"refreshing attempt",n),await rg(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:sg})),r=(e,t)=>{const n=200*Math.pow(2,e);return t&&Sm(t)&&Date.now()+n-s<3e4},new Promise((e,t)=>{(async()=>{for(let i=0;i<1/0;i++)try{const t=await n(i);if(!r(i,null,t))return void e(t)}catch(s){if(!r(i,s))return void t(s)}})()}))}catch(s){if(this._debug(t,"error",s),hm(s))return this._returnResult({data:{session:null,user:null},error:s});throw s}finally{this._debug(t,"end")}var n,r}_isValidSession(e){return"object"==typeof e&&null!==e&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){const n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",n),Fm()&&!t.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e,t;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const s=await Tm(this.storage,this.storageKey);if(s&&this.userStorage){let t=await Tm(this.userStorage,this.storageKey+"-user");this.storage.isServer||!Object.is(this.storage,this.userStorage)||t||(t={user:s.user},await Lm(this.userStorage,this.storageKey+"-user",t)),s.user=null!==(e=null==t?void 0:t.user)&&void 0!==e?e:$m()}else if(s&&!s.user&&!s.user){const e=await Tm(this.storage,this.storageKey+"-user");e&&(null==e?void 0:e.user)?(s.user=e.user,await Om(this.storage,this.storageKey+"-user"),await Lm(this.storage,this.storageKey,s)):s.user=$m()}if(this._debug(n,"session from storage",s),!this._isValidSession(s))return this._debug(n,"session is not valid"),void(null!==s&&await this._removeSession());const i=1e3*(null!==(t=s.expires_at)&&void 0!==t?t:1/0)-Date.now()<om;if(this._debug(n,`session has${i?"":" not"} expired with margin of 90000s`),i){if(this.autoRefreshToken&&s.refresh_token){const{error:e}=await this._callRefreshToken(s.refresh_token);e&&(console.error(e),Sm(e)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",e),await this._removeSession()))}}else if(s.user&&!0===s.user.__isUserNotAvailableProxy)try{const{data:e,error:t}=await this._getUser(s.access_token);!t&&(null==e?void 0:e.user)?(s.user=e.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(r){console.error("Error getting user data:",r),this._debug(n,"error getting user data, skipping SIGNED_IN notification",r)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){return this._debug(n,"error",s),void console.error(s)}finally{this._debug(n,"end")}}async _callRefreshToken(e){var t,n;if(!e)throw new fm;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const r=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{this.refreshingDeferred=new Mm;const{data:t,error:n}=await this._refreshAccessToken(e);if(n)throw n;if(!t.session)throw new fm;await this._saveSession(t.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",t.session);const r={data:t.session,error:null};return this.refreshingDeferred.resolve(r),r}catch(s){if(this._debug(r,"error",s),hm(s)){const e={data:null,error:s};return Sm(s)||await this._removeSession(),null===(t=this.refreshingDeferred)||void 0===t||t.resolve(e),e}throw null===(n=this.refreshingDeferred)||void 0===n||n.reject(s),s}finally{this.refreshingDeferred=null,this._debug(r,"end")}}async _notifyAllSubscribers(e,t,n=!0){const r=`#_notifyAllSubscribers(${e})`;this._debug(r,"begin",t,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:t});const r=[],s=Array.from(this.stateChangeEmitters.values()).map(async n=>{try{await n.callback(e,t)}catch(s){r.push(s)}});if(await Promise.all(s),r.length>0){for(let e=0;e<r.length;e+=1)console.error(r[e]);throw r[0]}}finally{this._debug(r,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await Om(this.storage,`${this.storageKey}-code-verifier`);const t=Object.assign({},e),n=t.user&&!0===t.user.__isUserNotAvailableProxy;if(this.userStorage){!n&&t.user&&await Lm(this.userStorage,this.storageKey+"-user",{user:t.user});const e=Object.assign({},t);delete e.user;const r=qm(e);await Lm(this.storage,this.storageKey,r)}else{const e=qm(t);await Lm(this.storage,this.storageKey,e)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Om(this.storage,this.storageKey),await Om(this.storage,this.storageKey+"-code-verifier"),await Om(this.storage,this.storageKey+"-user"),this.userStorage&&await Om(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Fm()&&(null===window||void 0===window?void 0:window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(t){console.error("removing visibilitychange callback failed",t)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),im);this.autoRefreshTicker=e,e&&"object"==typeof e&&"function"==typeof e.unref?e.unref():"undefined"!=typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(e);const t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&"object"==typeof t&&"function"==typeof t.unref?t.unref():"undefined"!=typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async e=>{const{data:{session:n}}=e;if(!n||!n.refresh_token||!n.expires_at)return void this._debug("#_autoRefreshTokenTick()","no session");const r=Math.floor((1e3*n.expires_at-t)/im);this._debug("#_autoRefreshTokenTick()",`access token expires in ${r} ticks, a tick lasts 30000ms, refresh threshold is 3 ticks`),r<=3&&await this._callRefreshToken(n.refresh_token)})}catch(e){console.error("Auto refresh tick failed with error. This is likely a transient error.",e)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(!(e.isAcquireTimeout||e instanceof gg))throw e;this._debug("auto refresh token tick lock not available")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Fm()||!(null===window||void 0===window?void 0:window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},null===window||void 0===window||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),"visible"===document.visibilityState?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{"visible"===document.visibilityState?await this._recoverAndRefresh():this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting")}))):"hidden"===document.visibilityState&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,n){const r=[`provider=${encodeURIComponent(t)}`];if((null==n?void 0:n.redirectTo)&&r.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),(null==n?void 0:n.scopes)&&r.push(`scopes=${encodeURIComponent(n.scopes)}`),"pkce"===this.flowType){const[e,t]=await Dm(this.storage,this.storageKey),n=new URLSearchParams({code_challenge:`${encodeURIComponent(e)}`,code_challenge_method:`${encodeURIComponent(t)}`});r.push(n.toString())}if(null==n?void 0:n.queryParams){const e=new URLSearchParams(n.queryParams);r.push(e.toString())}return(null==n?void 0:n.skipBrowserRedirect)&&r.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${r.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var n;const{data:r,error:s}=t;return s?this._returnResult({data:null,error:s}):await rg(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:null===(n=null==r?void 0:r.session)||void 0===n?void 0:n.access_token})})}catch(t){if(hm(t))return this._returnResult({data:null,error:t});throw t}}async _enroll(e){try{return await this._useSession(async t=>{var n,r;const{data:s,error:i}=t;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},"phone"===e.factorType?{phone:e.phone}:"totp"===e.factorType?{issuer:e.issuer}:{}),{data:a,error:c}=await rg(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:null===(n=null==s?void 0:s.session)||void 0===n?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):("totp"===e.factorType&&"totp"===a.type&&(null===(r=null==a?void 0:a.totp)||void 0===r?void 0:r.qr_code)&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),this._returnResult({data:a,error:null}))})}catch(t){if(hm(t))return this._returnResult({data:null,error:t});throw t}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{var n;const{data:r,error:s}=t;if(s)return this._returnResult({data:null,error:s});const i=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:"create"===e.webauthn.type?Cg(e.webauthn.credential_response):Vg(e.webauthn.credential_response)})}:{code:e.code}),{data:o,error:a}=await rg(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:i,headers:this.headers,jwt:null===(n=null==r?void 0:r.session)||void 0===n?void 0:n.access_token});return a?this._returnResult({data:null,error:a}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),this._returnResult({data:o,error:a}))})}catch(t){if(hm(t))return this._returnResult({data:null,error:t});throw t}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{var n;const{data:r,error:s}=t;if(s)return this._returnResult({data:null,error:s});const i=await rg(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:null===(n=null==r?void 0:r.session)||void 0===n?void 0:n.access_token});if(i.error)return i;const{data:o}=i;if("webauthn"!==o.type)return{data:o,error:null};switch(o.webauthn.type){case"create":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:Sg(o.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:Zg(o.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(t){if(hm(t))return this._returnResult({data:null,error:t});throw t}})}async _challengeAndVerify(e){const{data:t,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){var e;const{data:{user:t},error:n}=await this.getUser();if(n)return{data:null,error:n};const r={all:[],phone:[],totp:[],webauthn:[]};for(const s of null!==(e=null==t?void 0:t.factors)&&void 0!==e?e:[])r.all.push(s),"verified"===s.status&&r[s.factor_type].push(s);return{data:r,error:null}}async _getAuthenticatorAssuranceLevel(e){var t,n,r,s;if(e)try{const{payload:r}=Km(e);let s=null;r.aal&&(s=r.aal);let i=s;const{data:{user:o},error:a}=await this.getUser(e);if(a)return this._returnResult({data:null,error:a});(null!==(n=null===(t=null==o?void 0:o.factors)||void 0===t?void 0:t.filter(e=>"verified"===e.status))&&void 0!==n?n:[]).length>0&&(i="aal2");return{data:{currentLevel:s,nextLevel:i,currentAuthenticationMethods:r.amr||[]},error:null}}catch(u){if(hm(u))return this._returnResult({data:null,error:u});throw u}const{data:{session:i},error:o}=await this.getSession();if(o)return this._returnResult({data:null,error:o});if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:a}=Km(i.access_token);let c=null;a.aal&&(c=a.aal);let l=c;(null!==(s=null===(r=i.user.factors)||void 0===r?void 0:r.filter(e=>"verified"===e.status))&&void 0!==s?s:[]).length>0&&(l="aal2");return{data:{currentLevel:c,nextLevel:l,currentAuthenticationMethods:a.amr||[]},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await rg(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new fm})})}catch(t){if(hm(t))return this._returnResult({data:null,error:t});throw t}}async _approveAuthorization(e,t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!r)return this._returnResult({data:null,error:new fm});const i=await rg(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:"approve"},xform:e=>({data:e,error:null})});return i.data&&i.data.redirect_url&&Fm()&&!(null==t?void 0:t.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(n){if(hm(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(e,t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!r)return this._returnResult({data:null,error:new fm});const i=await rg(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:"deny"},xform:e=>({data:e,error:null})});return i.data&&i.data.redirect_url&&Fm()&&!(null==t?void 0:t.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(n){if(hm(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:t},error:n}=e;return n?this._returnResult({data:null,error:n}):t?await rg(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new fm})})}catch(e){if(hm(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?(await rg(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new fm})})}catch(t){if(hm(t))return this._returnResult({data:null,error:t});throw t}}async fetchJwk(e,t={keys:[]}){let n=t.keys.find(t=>t.kid===e);if(n)return n;const r=Date.now();if(n=this.jwks.keys.find(t=>t.kid===e),n&&this.jwks_cached_at+6e5>r)return n;const{data:s,error:i}=await rg(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(i)throw i;return s.keys&&0!==s.keys.length?(this.jwks=s,this.jwks_cached_at=r,n=s.keys.find(t=>t.kid===e),n||null):null}async getClaims(e,t={}){try{let n=e;if(!n){const{data:e,error:t}=await this.getSession();if(t||!e.session)return this._returnResult({data:null,error:t});n=e.session.access_token}const{header:r,payload:s,signature:i,raw:{header:o,payload:a}}=Km(n);(null==t?void 0:t.allowExpired)||function(e){if(!e)throw new Error("Missing exp claim");if(e<=Math.floor(Date.now()/1e3))throw new Error("JWT has expired")}(s.exp);const c=r.alg&&!r.alg.startsWith("HS")&&r.kid&&"crypto"in globalThis&&"subtle"in globalThis.crypto?await this.fetchJwk(r.kid,(null==t?void 0:t.keys)?{keys:t.keys}:null==t?void 0:t.jwks):null;if(!c){const{error:e}=await this.getUser(n);if(e)throw e;return{data:{claims:s,header:r,signature:i},error:null}}const l=function(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}(r.alg),u=await crypto.subtle.importKey("jwk",c,l,!0,["verify"]);if(!(await crypto.subtle.verify(l,u,i,Jm(`${o}.${a}`))))throw new Cm("Invalid JWT signature");return{data:{claims:s,header:r,signature:i},error:null}}catch(n){if(hm(n))return this._returnResult({data:null,error:n});throw n}}};_g.nextInstanceID={};var Yg=_g,Hg={headers:{"X-Client-Info":`supabase-js-${"undefined"!=typeof Deno?"deno":"undefined"!=typeof document?"web":"undefined"!=typeof navigator&&"ReactNative"===navigator.product?"react-native":"node"}/2.99.2`}},Lg={schema:"public"},Tg={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Og={};function Mg(e){return(Mg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Kg(e){var t=function(e,t){if("object"!=Mg(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Mg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Mg(t)?t:t+""}function Ug(e,t,n){return(t=Kg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Dg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zg(Object(n),!0).forEach(function(t){Ug(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var jg=(e,t,n)=>{const r=(e=>e?(...t)=>e(...t):(...e)=>fetch(...e))(n),s=Headers;return async(n,i)=>{var o;const a=null!==(o=await t())&&void 0!==o?o:e;let c=new s(null==i?void 0:i.headers);return c.has("apikey")||c.set("apikey",e),c.has("Authorization")||c.set("Authorization",`Bearer ${a}`),r(n,Dg(Dg({},i),{},{headers:c}))}};var Pg=class extends Yg{constructor(e){super(e)}},Qg=class{constructor(e,t,n){var r,s;this.supabaseUrl=e,this.supabaseKey=t;const i=function(e){const t=null==e?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL((n=t).endsWith("/")?n:n+"/")}catch(r){throw Error("Invalid supabaseUrl: Provided URL is malformed.")}var n}(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",i),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",i),this.storageUrl=new URL("storage/v1",i),this.functionsUrl=new URL("functions/v1",i);const o=`sb-${i.hostname.split(".")[0]}-auth-token`,a=function(e,t){var n,r;const{db:s,auth:i,realtime:o,global:a}=e,{db:c,auth:l,realtime:u,global:d}=t,h={db:Dg(Dg({},c),s),auth:Dg(Dg({},l),i),realtime:Dg(Dg({},u),o),storage:{},global:Dg(Dg(Dg({},d),a),{},{headers:Dg(Dg({},null!==(n=null==d?void 0:d.headers)&&void 0!==n?n:{}),null!==(r=null==a?void 0:a.headers)&&void 0!==r?r:{})}),accessToken:async()=>""};return e.accessToken?h.accessToken=e.accessToken:delete h.accessToken,h}(null!=n?n:{},{db:Lg,realtime:Og,auth:Dg(Dg({},Tg),{},{storageKey:o}),global:Hg});var c;(this.storageKey=null!==(r=a.auth.storageKey)&&void 0!==r?r:"",this.headers=null!==(s=a.global.headers)&&void 0!==s?s:{},a.accessToken)?(this.accessToken=a.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(t)} is not possible`)}})):this.auth=this._initSupabaseAuthClient(null!==(c=a.auth)&&void 0!==c?c:{},this.headers,a.global.fetch);this.fetch=jg(t,this._getAccessToken.bind(this),a.global.fetch),this.realtime=this._initRealtimeClient(Dg({headers:this.headers,accessToken:this._getAccessToken.bind(this)},a.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(e=>this.realtime.setAuth(e)).catch(e=>console.warn("Failed to set initial Realtime auth token:",e)),this.rest=new Fd(new URL("rest/v1",i).href,{headers:this.headers,schema:a.db.schema,fetch:this.fetch,timeout:a.db.timeout,urlLengthLimit:a.db.urlLengthLimit}),this.storage=new rm(this.storageUrl.href,this.headers,this.fetch,null==n?void 0:n.storage),a.accessToken||this._listenForAuthEvents()}get functions(){return new wd(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e,t,n=this;if(n.accessToken)return await n.accessToken();const{data:r}=await n.auth.getSession();return null!==(e=null===(t=r.session)||void 0===t?void 0:t.access_token)&&void 0!==e?e:n.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,storageKey:i,flowType:o,lock:a,debug:c,throwOnError:l},u,d){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Pg({url:this.authUrl.href,headers:Dg(Dg({},h),u),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,flowType:o,lock:a,debug:c,throwOnError:l,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(e=>"authorization"===e.toLowerCase())})}_initRealtimeClient(e){return new mh(this.realtimeUrl.href,Dg(Dg({},e),{},{params:Dg(Dg({},{apikey:this.supabaseKey}),null==e?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",null==t?void 0:t.access_token)})}_handleTokenChanged(e,t,n){"TOKEN_REFRESHED"!==e&&"SIGNED_IN"!==e||this.changedAccessToken===n?"SIGNED_OUT"===e&&(this.realtime.setAuth(),"STORAGE"==t&&this.auth.signOut(),this.changedAccessToken=void 0):(this.changedAccessToken=n,this.realtime.setAuth(n))}};(function(){if("undefined"!=typeof window)return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(null==t)return!1;const n=t.match(/^v(\d+)\./);return!!n&&parseInt(n[1],10)<=18})()&&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 $g,qg,ep,tp,np,rp,sp,ip,op,ap,cp,lp,up,dp,hp,mp,gp,pp,fp,yp=/* @__PURE__ */Y({browser:()=>mp,default:()=>gp,description:()=>ep,devDependencies:()=>dp,engines:()=>hp,exports:()=>rp,funding:()=>ap,homepage:()=>op,keywords:()=>cp,license:()=>up,main:()=>tp,name:()=>$g,readmeFilename:()=>lp,repository:()=>ip,scripts:()=>sp,types:()=>np,version:()=>qg}),bp=(pp=()=>{gp={name:$g="dotenv",version:qg="17.3.1",description:ep="Loads environment variables from .env file",main:tp="lib/main.js",types:np="lib/main.d.ts",exports:rp={".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:sp={"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run tests/**/*.js --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run tests/**/*.js --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:ip={type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:op="https://github.com/motdotla/dotenv#readme",funding:ap="https://dotenvx.com",keywords:cp=["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:lp="README.md",license:up="BSD-2-Clause",devDependencies:dp={"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:hp={node:">=12"},browser:mp={fs:!1}}},()=>(pp&&(fp=pp(pp=0)),fp)),Ip=/* @__PURE__ */_((e,t)=>{var n,r=T("fs"),s=T("path"),i=T("os"),o=T("crypto"),a=(bp(),(n=yp,F.call(n,"module.exports")?n["module.exports"]:H(W({},"__esModule",{value:!0}),n)).default).version,c=["🔐 encrypt with Dotenvx: https://dotenvx.com","🔐 prevent committing .env to code: https://dotenvx.com/precommit","🔐 prevent building .env in docker: https://dotenvx.com/prebuild","🤖 agentic secret storage: https://dotenvx.com/as2","⚡️ secrets for agents: https://dotenvx.com/as2","🛡️ auth for agents: https://vestauth.com","🛠️ run anywhere with `dotenvx run -- yourcommand`","⚙️ specify custom .env file path with { path: '/custom/path/.env' }","⚙️ enable debug logging with { debug: true }","⚙️ override existing env vars with { override: true }","⚙️ suppress all logs with { quiet: true }","⚙️ write to custom object with { processEnv: myObject }","⚙️ load multiple .env files with { path: ['.env.local', '.env'] }"];function l(e){return"string"==typeof e?!["false","0","no","off",""].includes(e.toLowerCase()):Boolean(e)}function u(e){return process.stdout.isTTY?`${e}`:e}var d=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;function h(e){console.log(`[dotenv@${a}][DEBUG] ${e}`)}function m(e){console.log(`[dotenv@${a}] ${e}`)}function g(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function p(e,t){let n;try{n=new URL(t)}catch(a){if("ERR_INVALID_URL"===a.code){const e=/* @__PURE__ */new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw e.code="INVALID_DOTENV_KEY",e}throw a}const r=n.password;if(!r){const e=/* @__PURE__ */new Error("INVALID_DOTENV_KEY: Missing key part");throw e.code="INVALID_DOTENV_KEY",e}const s=n.searchParams.get("environment");if(!s){const e=/* @__PURE__ */new Error("INVALID_DOTENV_KEY: Missing environment part");throw e.code="INVALID_DOTENV_KEY",e}const i=`DOTENV_VAULT_${s.toUpperCase()}`,o=e.parsed[i];if(!o){const e=/* @__PURE__ */new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${i} in your .env.vault file.`);throw e.code="NOT_FOUND_DOTENV_ENVIRONMENT",e}return{ciphertext:o,key:r}}function f(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(const n of e.path)r.existsSync(n)&&(t=n.endsWith(".vault")?n:`${n}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=s.resolve(process.cwd(),".env.vault");return r.existsSync(t)?t:null}function y(e){return"~"===e[0]?s.join(i.homedir(),e.slice(1)):e}var b={configDotenv:function(e){const t=s.resolve(process.cwd(),".env");let n="utf8",i=process.env;e&&null!=e.processEnv&&(i=e.processEnv);let o=l(i.DOTENV_CONFIG_DEBUG||e&&e.debug),a=l(i.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?n=e.encoding:o&&h("No encoding is specified. UTF-8 is used by default");let d,g=[t];if(e&&e.path)if(Array.isArray(e.path)){g=[];for(const t of e.path)g.push(y(t))}else g=[y(e.path)];const p={};for(const s of g)try{const t=b.parse(r.readFileSync(s,{encoding:n}));b.populate(p,t,e)}catch(I){o&&h(`Failed to load ${s} ${I.message}`),d=I}const f=b.populate(i,p,e);if(o=l(i.DOTENV_CONFIG_DEBUG||o),a=l(i.DOTENV_CONFIG_QUIET||a),o||!a){const e=Object.keys(f).length,t=[];for(const n of g)try{const e=s.relative(process.cwd(),n);t.push(e)}catch(I){o&&h(`Failed to load ${n} ${I.message}`),d=I}m(`injecting env (${e}) from ${t.join(",")} ${u(`-- tip: ${c[Math.floor(Math.random()*c.length)]}`)}`)}return d?{parsed:p,error:d}:{parsed:p}},_configVault:function(e){const t=l(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),n=l(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);!t&&n||m("Loading env from encrypted .env.vault");const r=b._parseVault(e);let s=process.env;return e&&null!=e.processEnv&&(s=e.processEnv),b.populate(s,r,e),{parsed:r}},_parseVault:function(e){const t=f(e=e||{});e.path=t;const n=b.configDotenv(e);if(!n.parsed){const e=/* @__PURE__ */new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw e.code="MISSING_DATA",e}const r=g(e).split(","),s=r.length;let i;for(let a=0;a<s;a++)try{const e=p(n,r[a].trim());i=b.decrypt(e.ciphertext,e.key);break}catch(o){if(a+1>=s)throw o}return b.parse(i)},config:function(e){if(0===g(e).length)return b.configDotenv(e);const t=f(e);return t?b._configVault(e):(n=`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`,console.error(`[dotenv@${a}][WARN] ${n}`),b.configDotenv(e));var n},decrypt:function(e,t){const n=Buffer.from(t.slice(-64),"hex");let r=Buffer.from(e,"base64");const s=r.subarray(0,12),i=r.subarray(-16);r=r.subarray(12,-16);try{const e=o.createDecipheriv("aes-256-gcm",n,s);return e.setAuthTag(i),`${e.update(r)}${e.final()}`}catch(a){const e=a instanceof RangeError,t="Invalid key length"===a.message,n="Unsupported state or unable to authenticate data"===a.message;if(e||t){const e=/* @__PURE__ */new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw e.code="INVALID_DOTENV_KEY",e}if(n){const e=/* @__PURE__ */new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw e.code="DECRYPTION_FAILED",e}throw a}},parse:function(e){const t={};let n,r=e.toString();for(r=r.replace(/\r\n?/gm,"\n");null!=(n=d.exec(r));){const e=n[1];let r=n[2]||"";r=r.trim();const s=r[0];r=r.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),'"'===s&&(r=r.replace(/\\n/g,"\n"),r=r.replace(/\\r/g,"\r")),t[e]=r}return t},populate:function(e,t,n={}){const r=Boolean(n&&n.debug),s=Boolean(n&&n.override),i={};if("object"!=typeof t){const e=/* @__PURE__ */new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw e.code="OBJECT_REQUIRED",e}for(const o of Object.keys(t))Object.prototype.hasOwnProperty.call(e,o)?(!0===s&&(e[o]=t[o],i[o]=t[o]),r&&h(!0===s?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):(e[o]=t[o],i[o]=t[o]);return i}};t.exports.configDotenv=b.configDotenv,t.exports._configVault=b._configVault,t.exports._parseVault=b._parseVault,t.exports.config=b.config,t.exports.decrypt=b.decrypt,t.exports.parse=b.parse,t.exports.populate=b.populate,t.exports=b}),wp=/* @__PURE__ */_((e,t)=>{var n={};null!=process.env.DOTENV_CONFIG_ENCODING&&(n.encoding=process.env.DOTENV_CONFIG_ENCODING),null!=process.env.DOTENV_CONFIG_PATH&&(n.path=process.env.DOTENV_CONFIG_PATH),null!=process.env.DOTENV_CONFIG_QUIET&&(n.quiet=process.env.DOTENV_CONFIG_QUIET),null!=process.env.DOTENV_CONFIG_DEBUG&&(n.debug=process.env.DOTENV_CONFIG_DEBUG),null!=process.env.DOTENV_CONFIG_OVERRIDE&&(n.override=process.env.DOTENV_CONFIG_OVERRIDE),null!=process.env.DOTENV_CONFIG_DOTENV_KEY&&(n.DOTENV_KEY=process.env.DOTENV_CONFIG_DOTENV_KEY),t.exports=n}),vp=/* @__PURE__ */_((e,t)=>{var n=/^dotenv_config_(encoding|path|quiet|debug|override|DOTENV_KEY)=(.+)$/;t.exports=function(e){const t=e.reduce(function(e,t){const r=t.match(n);return r&&(e[r[1]]=r[2]),e},{});return"quiet"in t||(t.quiet="true"),t}});Ip().config(Object.assign({},wp(),vp()(process.argv)));var Gp=async()=>{const e=await Jn.getValidSession(),t=new Qg("https://bfyrfypcnrfqiqtnhksg.supabase.co","sb_publishable_UE64XbixbCKCdNP20YLmqg_S1_Zchd6",{auth:{persistSession:!1,autoRefreshToken:!1,detectSessionInUrl:!1}});if(e){const{error:n}=await t.auth.setSession({access_token:e.access_token,refresh_token:e.refresh_token});n&&console.error("[Fluxlay] Error setting session:",n.message)}return t},Ap=new xt;Ap.name("fluxlay").description("Fluxlay CLI for building and managing wallpapers").version("0.1.0"),Ap.command("login").description("Login to Supabase").action(async()=>{Ye(pt.bgCyan.black.bold(" Fluxlay CLI "));try{await ll(),He(pt.green("Login process completed."))}catch(e){_e(pt.red(`Login failed: ${e}`)),process.exit(1)}}),Ap.command("logout").description("Logout from Supabase").action(async()=>{Ye(pt.bgCyan.black.bold(" Fluxlay CLI "));try{await(async()=>{await Jn.clearSession(),Fe.success(pt.green("Logged out successfully."))})(),He(pt.green("Logged out successfully."))}catch(e){_e(pt.red(`Logout failed: ${e}`)),process.exit(1)}}),Ap.command("whoami").description("Show current logged in user").action(async()=>{Ye(pt.bgCyan.black.bold(" Fluxlay CLI "));try{await(async()=>{const{data:{user:e},error:t}=await(await Gp()).auth.getUser();if(t||!e)return t&&Fe.error(`Auth error: ${t.message}`),void Fe.warn("Not logged in.");Fe.info(`Logged in as: ${pt.green(e.email??"unknown")}`)})(),He(pt.green("Done."))}catch(e){_e(pt.red(`Failed to get user info: ${e}`)),process.exit(1)}}),Ap.command("build").description("Build a Fluxlay wallpaper").argument("[dir]","Directory to build",".").option("-o, --output <name>","Output filename","wallpaper.fluxlay").action(async(e,t)=>{Ye(pt.bgCyan.black.bold(" Fluxlay CLI "));try{await async function(e,t){await Jn.getSession()||(Fe.error(pt.red("You must be logged in to build. Run `fluxlay login`.")),process.exit(1));const n=m.resolve(process.cwd(),e),r=m.join(n,"fluxlay.yaml");l.existsSync(r)||(Fe.error(pt.red("fluxlay.yaml is required in the project root.")),process.exit(1));const s=Ke();s.start(pt.yellow("Validating manifest..."));try{Ht(l.readFileSync(r,"utf-8")),s.stop(`${pt.green("✔")} Manifest validated.`)}catch(c){s.stop(pt.red("Manifest validation failed")),Fe.error(c.message),process.exit(1)}const i=m.join(n,"dist"),o=m.resolve(n,t.output);s.start(`Building component in ${pt.cyan(n)}...`);try{await b({root:n,configFile:m.resolve(n,"vite.config.ts"),build:{outDir:"dist"},logLevel:"error"}),s.stop(`${pt.green("✔")} Component built.`)}catch(c){s.stop(pt.red("Build failed")),Fe.error(c.message),process.exit(1)}let a;s.start(pt.yellow("Fetching developer key..."));try{const e=await Vc.getDeveloperKey();if(e)a=Buffer.from(e).toString("hex"),s.stop(`${pt.green("✔")} Using cached developer key.`);else{const{developerKey:e}=await Cc.getDeveloperKey({});a=Buffer.from(e).toString("hex"),await Vc.saveDeveloperKey(e),s.stop(`${pt.green("✔")} Developer key fetched from API.`)}}catch(c){s.stop(pt.red("Failed to fetch developer key")),Fe.error(c.message),process.exit(1)}s.start(pt.yellow("Packaging with DRM..."));try{await Lt(i,o,a,0),s.stop(`${pt.green("✔")} Packaging completed.`)}catch(c){s.stop(pt.red("Packaging failed")),Fe.error(c.message),process.exit(1)}Oe(`Output: ${pt.underline.cyan(o)}`,"Success!")}(e,t),He(pt.green("Build completed."))}catch(n){_e(pt.red(`Build failed: ${n}`)),process.exit(1)}}),Ap.command("publish").description("Publish a Fluxlay wallpaper to the store").argument("[dir]","Directory to publish",".").action(async e=>{Ye(pt.bgCyan.black.bold(" Fluxlay CLI "));try{await async function(e){await Jn.getSession()||(Fe.error(pt.red("You must be logged in to publish. Run `fluxlay login`.")),process.exit(1));const t=m.resolve(process.cwd(),e),n=m.join(t,"fluxlay.yaml");l.existsSync(n)||(Fe.error(pt.red("fluxlay.yaml is required in the project root.")),process.exit(1));const r=Ke();let s;r.start(pt.yellow("Validating manifest..."));try{const e=l.readFileSync(n,"utf-8");Ht(e),s=hd.load(e),r.stop(`${pt.green("✔")} Manifest validated: ${pt.cyan(s.name)} (v${s.version})`)}catch(h){r.stop(pt.red("Manifest validation failed")),Fe.error(h.message),process.exit(1)}const i=x.randomBytes(32),o=i.toString("hex");let a,c;r.start(pt.yellow("Registering wallpaper with API..."));try{const e=await Cc.registerWallpaper({slug:s.slug,name:s.name,version:s.version,contentKey:i});a=e.versionId,c=e.uploadUrl,r.stop(`${pt.green("✔")} Wallpaper registered.`)}catch(h){r.stop(pt.red("Registration failed")),Fe.error(h.message),process.exit(1)}const u=m.join(t,"dist"),d=m.join(t,`.fluxlay-${a}.tmp`);try{r.start(pt.yellow("Building component with Vite...")),await b({root:t,configFile:m.resolve(t,"vite.config.ts"),build:{outDir:"dist"},logLevel:"error"}),r.stop(`${pt.green("✔")} Component built.`),r.start(pt.yellow("Packaging with Content Key...")),await Lt(u,d,o,1),r.stop(`${pt.green("✔")} Package created.`),r.start(pt.yellow("Uploading to storage..."));const e=l.readFileSync(d),n=await fetch(c,{method:"PUT",body:e,headers:{"Content-Type":"application/octet-stream"}});if(!n.ok)throw new Error(`Upload failed: ${n.statusText}`);r.stop(`${pt.green("✔")} Upload completed.`),r.start(pt.yellow("Confirming upload with API...")),await Cc.confirmUpload({versionId:a}),r.stop(`${pt.green("✔")} Upload confirmed.`),Oe(`Wallpaper ID: ${pt.cyan(a)}`,"Success!")}catch(h){r.stop(pt.red("Publishing process failed")),Fe.error(h.message),Fe.warn(pt.yellow("Cancelling upload..."));try{await Cc.cancelUpload({versionId:a})}catch(g){Fe.error(`Failed to cancel upload: ${g.message}`)}process.exit(1)}finally{l.existsSync(d)&&l.unlinkSync(d)}}(e),He(pt.green("Published successfully."))}catch(t){_e(pt.red(`Publish failed: ${t}`)),process.exit(1)}}),Ap.command("dev").description("Start development server for a Fluxlay wallpaper").argument("[dir]","Directory to watch",".").action(async e=>{Ye(pt.bgCyan.black.bold(" Fluxlay CLI "));try{await Xc(e)}catch(t){_e(pt.red(`Dev server failed: ${t}`)),process.exit(1)}}),Ap.parse();