@pen.dev/cli 0.2.8 → 0.3.0
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/all-BRgnaRVf.mjs +2 -0
- package/dist/anthropic-messages-B0UGUOMk.mjs +40 -0
- package/dist/anthropic-messages-Bdjz4-4h.mjs +40 -0
- package/dist/azure-openai-responses-DGGHC-S9.mjs +2 -0
- package/dist/azure-openai-responses-Dcn9uJAW.mjs +2 -0
- package/dist/browserAll-B9bGRQuq.mjs +2 -0
- package/dist/deferred-tools-B1EgE_tY.mjs +2 -0
- package/dist/deferred-tools-DowE4eb1.mjs +2 -0
- package/dist/diagnostics-D0oRYjyK.mjs +2 -0
- package/dist/diagnostics-DZacjHpY.mjs +2 -0
- package/dist/{dist-BMO4tFTj.mjs → dist-YY0wuD4v.mjs} +361 -416
- package/dist/error-body-RPMBLEAJ.mjs +2 -0
- package/dist/event-stream-BrGAtXMV.mjs +2 -0
- package/dist/event-stream-CXocIcc6.mjs +2 -0
- package/dist/google-generative-ai-6QyLi6xj.mjs +2 -0
- package/dist/google-generative-ai-BG0mJ2Yd.mjs +2 -0
- package/dist/{google-shared-YCDndJGN.mjs → google-shared-BIfd6JKP.mjs} +2 -2
- package/dist/{google-shared-TkwodIGJ.mjs → google-shared-CgKgcf0q.mjs} +2 -2
- package/dist/google-vertex-CBwir-qy.mjs +2 -0
- package/dist/google-vertex-DlS7-xf8.mjs +2 -0
- package/dist/index.mjs +2 -2
- package/dist/{mistral-conversations-DIR6EyvH.mjs → mistral-conversations-BS3W7xJY.mjs} +2 -2
- package/dist/{mistral-conversations-JED5QLUZ.mjs → mistral-conversations-Bm5cpZKX.mjs} +1 -1
- package/dist/models-BZPNtJp1.mjs +2 -0
- package/dist/models-bnt621e8.mjs +2 -0
- package/dist/{multipart-parser-CYJPmLQW.mjs → multipart-parser-Ce015IGH.mjs} +1 -1
- package/dist/{multipart-parser-4wzMiNnD.mjs → multipart-parser-u0QlX_zW.mjs} +1 -1
- package/dist/openai-codex-responses-BJOfgqHD.mjs +8 -0
- package/dist/openai-codex-responses-DstMs9PK.mjs +8 -0
- package/dist/openai-completions-D81vzTqd.mjs +6 -0
- package/dist/openai-completions-mzPR2_al.mjs +6 -0
- package/dist/openai-responses-BpQ7bzV4.mjs +2 -0
- package/dist/openai-responses-BsyyuOSg.mjs +2 -0
- package/dist/openai-responses-shared-DujHRX-u.mjs +11 -0
- package/dist/openai-responses-shared-Nr5Yi_N5.mjs +11 -0
- package/dist/{openrouter-images-NEnwWNeg.mjs → openrouter-images-DEF66Jtk.mjs} +1 -1
- package/dist/openrouter-images-XPGQk4Yu.mjs +2 -0
- package/dist/{otel-BIqiVgiM.mjs → otel-BUSnyV78.mjs} +1 -1
- package/dist/{otel-BbTSxAZp.mjs → otel-Bv5u_Lik.mjs} +1 -1
- package/dist/out/mcp-server-darwin-arm64 +0 -0
- package/dist/out/mcp-server-darwin-x64 +0 -0
- package/dist/out/mcp-server-linux-arm64 +0 -0
- package/dist/out/mcp-server-linux-x64 +0 -0
- package/dist/out/mcp-server-windows-arm64.exe +0 -0
- package/dist/out/mcp-server-windows-x64.exe +0 -0
- package/dist/pi-messages-BMuD5Lsm.mjs +8 -0
- package/dist/pi-messages-Gq9Ttvbd.mjs +8 -0
- package/dist/session-resources-SNa1tEPO.mjs +2 -0
- package/dist/{src-Bk9f60_P.mjs → src-BxDQmPZ6.mjs} +1 -1
- package/dist/{src-CbkJodKR.mjs → src-C1Ztzxmo.mjs} +1 -1
- package/dist/transform-messages-C0FNxyyM.mjs +2 -0
- package/dist/transform-messages-s3jcHssz.mjs +2 -0
- package/dist/webworkerAll-B7UInSs7.mjs +2 -0
- package/package.json +3 -3
- package/dist/all-Bd-ariyL.mjs +0 -2
- package/dist/anthropic-messages-D9L1s6pn.mjs +0 -40
- package/dist/anthropic-messages-OUY8OJj7.mjs +0 -40
- package/dist/azure-openai-responses-DJKVhgL-.mjs +0 -2
- package/dist/azure-openai-responses-DSoXDHyP.mjs +0 -2
- package/dist/browserAll-CGZu5S9C.mjs +0 -2
- package/dist/diagnostics-hlO-DFfk.mjs +0 -2
- package/dist/google-generative-ai-BqfOLKon.mjs +0 -2
- package/dist/google-generative-ai-CZCmY9Gg.mjs +0 -2
- package/dist/google-vertex-COsje8-Z.mjs +0 -2
- package/dist/google-vertex-Cz5Ddo09.mjs +0 -2
- package/dist/models-CtsqYGxn.mjs +0 -2
- package/dist/models-DVeZ-5Ql.mjs +0 -2
- package/dist/openai-codex-responses-Cq8yFwfN.mjs +0 -8
- package/dist/openai-codex-responses-CzFfnGCe.mjs +0 -8
- package/dist/openai-completions-DT4sdoVc.mjs +0 -6
- package/dist/openai-completions-iO6yRDuR.mjs +0 -6
- package/dist/openai-responses-Cr3SvtkS.mjs +0 -2
- package/dist/openai-responses-Dtr2Vk2j.mjs +0 -2
- package/dist/openai-responses-shared-BLDoTd9K.mjs +0 -13
- package/dist/openai-responses-shared-C4PQs_0V.mjs +0 -11
- package/dist/openrouter-images-Dk-x2ke6.mjs +0 -2
- package/dist/transform-messages-DSEUXL48.mjs +0 -2
- package/dist/transform-messages-j96k5V_T.mjs +0 -2
- package/dist/webworkerAll-Dy6-Qx-T.mjs +0 -2
- /package/dist/{completionchunk-c1fsGiUK.mjs → completionchunk-CL_VFmtq.mjs} +0 -0
- /package/dist/{completionchunk-BaC49qbM.mjs → completionchunk-Dyma-JoP.mjs} +0 -0
- /package/dist/{dist-BupqiQep.mjs → dist-BgzWr9oi.mjs} +0 -0
- /package/dist/{dist-CCiXmKIu.mjs → dist-BtZHKnO9.mjs} +0 -0
- /package/dist/{dist-Dq7S86ex.mjs → dist-C3aEr0_q.mjs} +0 -0
- /package/dist/{emscripten-module.browser-F76W5DM6-3XbeCXXF.mjs → emscripten-module.browser-F76W5DM6-B_MffdHf.mjs} +0 -0
- /package/dist/{emscripten-module.browser-XIKQQPVU-JPkxo8p_.mjs → emscripten-module.browser-XIKQQPVU-ChFl3_k2.mjs} +0 -0
- /package/dist/{error-body-D-jnPxbB.mjs → error-body-3m883nGr.mjs} +0 -0
- /package/dist/{ffi-D6Fxg1d3.mjs → ffi-DEs9OsLe.mjs} +0 -0
- /package/dist/{ffi-u92ceo2s.mjs → ffi-jngwuqKl.mjs} +0 -0
- /package/dist/{from-BRY6g9CG.mjs → from-CeVGfYjJ.mjs} +0 -0
- /package/dist/{from-Bra_AO5N.mjs → from-DizeILWM.mjs} +0 -0
- /package/dist/{github-copilot-headers-ByQsj8SR.mjs → github-copilot-headers-Co77A9iu.mjs} +0 -0
- /package/dist/{github-copilot-headers-C4gA1Pjv.mjs → github-copilot-headers-Di-B2QFr.mjs} +0 -0
- /package/dist/{hash-BFdQp5Bn.mjs → hash-BJLGFTk8.mjs} +0 -0
- /package/dist/{hash-DFXd8wf4.mjs → hash-Dx9oN2Lv.mjs} +0 -0
- /package/dist/{headers-BkXFKypW.mjs → headers-8nMK0zm-.mjs} +0 -0
- /package/dist/{headers-DtjIrAKV.mjs → headers-Gh3dvZSc.mjs} +0 -0
- /package/dist/{html-DwPxy9Y2.mjs → html-De9v6PsV.mjs} +0 -0
- /package/dist/{init-BaeOBiNV.mjs → init-BwjB5mke.mjs} +0 -0
- /package/dist/{json-parse-BEWPMC87.mjs → json-parse-BjxNFuy6.mjs} +0 -0
- /package/dist/{json-parse-qcO5FIDw.mjs → json-parse-CoJ2PRW2.mjs} +0 -0
- /package/dist/{module-ES6BEMUI-DGywGVC7.mjs → module-ES6BEMUI-CiRafcvD.mjs} +0 -0
- /package/dist/{module-asyncify-2EFITU5U-BU2CORSO.mjs → module-asyncify-2EFITU5U-Bvf6Er23.mjs} +0 -0
- /package/dist/{openai-CJ1JzbCY.mjs → openai-Clqf3tig.mjs} +0 -0
- /package/dist/{openai-Cv91uXJB.mjs → openai-DtotRKm7.mjs} +0 -0
- /package/dist/{openai-prompt-cache-CjAED4AP.mjs → openai-prompt-cache-BbVvSxhO.mjs} +0 -0
- /package/dist/{openai-prompt-cache-tVxLccHG.mjs → openai-prompt-cache-ChV-9Dro.mjs} +0 -0
- /package/dist/{photon_rs-D_fXqzJa.mjs → photon_rs-DziCqNI5.mjs} +0 -0
- /package/dist/{provider-env-D0o9FEJi.mjs → provider-env-CgV7Mc0a.mjs} +0 -0
- /package/dist/{provider-env-DTh1Xe-B.mjs → provider-env-p-MKZrBX.mjs} +0 -0
- /package/dist/{sanitize-unicode-B5GgPEiu.mjs → sanitize-unicode-BU6jSNzJ.mjs} +0 -0
- /package/dist/{sanitize-unicode-DVHYNBlY.mjs → sanitize-unicode-C8aKmv6o.mjs} +0 -0
- /package/dist/{standalone-BGhJUGyg.mjs → standalone-NMu-shOx.mjs} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
function e(e){if(!(e instanceof Error))return{message:s(e),messageCarriesBody:!1};let r=e,i=t(r),a=n(r),o=a===void 0||e.message.includes(a);return{status:i,body:a,message:e.message,messageCarriesBody:o}}function t(e){if(typeof e.statusCode==`number`)return e.statusCode;if(typeof e.status==`number`)return e.status;if(typeof e.$metadata?.httpStatusCode==`number`)return e.$metadata.httpStatusCode;if(typeof e.$response?.statusCode==`number`)return e.$response.statusCode}function n(e){let t=r(e);if(t===void 0)return;let n=t.trim();if(n.length!==0)return o(n,4e3)}function r(e){if(typeof e.body==`string`)return e.body;if(i(e.error))return s(e.error);let t=e.$response?.body;if(typeof t==`string`)return t;if(i(t))return s(t)}function i(e){return typeof e==`object`&&!!e&&Object.keys(e).length>0}function a(e,t){return e.messageCarriesBody||e.status===void 0||e.body===void 0?t!==void 0&&e.status!==void 0?`${t} (${e.status}): ${e.message}`:e.message:t===void 0?`${e.status}: ${e.body}`:`${t} (${e.status}): ${e.body}`}function o(e,t){return e.length<=t?e:`${e.slice(0,t)}... [truncated ${e.length-t} chars]`}function s(e){try{let t=JSON.stringify(e);return t===void 0?String(e):t}catch{return String(e)}}export{e as n,a as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var e=class{queue=[];waiting=[];done=!1;finalResultPromise;resolveFinalResult;isComplete;extractResult;constructor(e,t){this.isComplete=e,this.extractResult=t,this.finalResultPromise=new Promise(e=>{this.resolveFinalResult=e})}push(e){if(this.done)return;this.isComplete(e)&&(this.done=!0,this.resolveFinalResult(this.extractResult(e)));let t=this.waiting.shift();t?t({value:e,done:!1}):this.queue.push(e)}end(e){for(this.done=!0,e!==void 0&&this.resolveFinalResult(e);this.waiting.length>0;)this.waiting.shift()({value:void 0,done:!0})}async*[Symbol.asyncIterator](){for(;;)if(this.queue.length>0)yield this.queue.shift();else if(this.done)return;else{let e=await new Promise(e=>this.waiting.push(e));if(e.done)return;yield e.value}}result(){return this.finalResultPromise}},t=class extends e{constructor(){super(e=>e.type===`done`||e.type===`error`,e=>{if(e.type===`done`)return e.message;if(e.type===`error`)return e.error;throw Error(`Unexpected event type for final result`)})}};export{t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var e=class{queue=[];waiting=[];done=!1;finalResultPromise;resolveFinalResult;isComplete;extractResult;constructor(e,t){this.isComplete=e,this.extractResult=t,this.finalResultPromise=new Promise(e=>{this.resolveFinalResult=e})}push(e){if(this.done)return;this.isComplete(e)&&(this.done=!0,this.resolveFinalResult(this.extractResult(e)));let t=this.waiting.shift();t?t({value:e,done:!1}):this.queue.push(e)}end(e){for(this.done=!0,e!==void 0&&this.resolveFinalResult(e);this.waiting.length>0;)this.waiting.shift()({value:void 0,done:!0})}async*[Symbol.asyncIterator](){for(;;)if(this.queue.length>0)yield this.queue.shift();else if(this.done)return;else{let e=await new Promise(e=>this.waiting.push(e));if(e.done)return;yield e.value}}result(){return this.finalResultPromise}},t=class extends e{constructor(){super(e=>e.type===`done`||e.type===`error`,e=>{if(e.type===`done`)return e.message;if(e.type===`error`)return e.error;throw Error(`Unexpected event type for final result`)})}};function n(){return new t}export{e as n,n as r,t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./event-stream-BrGAtXMV.mjs";import{n as t,t as n}from"./models-BZPNtJp1.mjs";import{n as r}from"./headers-Gh3dvZSc.mjs";import{t as i}from"./sanitize-unicode-C8aKmv6o.mjs";import{r as a}from"./transform-messages-s3jcHssz.mjs";import{n as o,t as s}from"./error-body-3m883nGr.mjs";import{a as c,i as l,n as u,o as d,r as f,s as p,t as m}from"./google-shared-CgKgcf0q.mjs";let h=0;const g=(t,r,i)=>{let a=new e;return(async()=>{let e={role:`assistant`,content:[],api:`google-generative-ai`,provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let o=i?.apiKey;if(!o)throw Error(`No API key for provider: ${t.provider}`);let s=v(t,o,i?.headers),c=y(t,r,i),u=await i?.onPayload?.(c,t);u!==void 0&&(c=u);let p=await s.models.generateContentStream(c);a.push({type:`start`,partial:e});let m=null,g=e.content,_=()=>g.length-1;for await(let r of p){e.responseId||=r.responseId;let i=r.candidates?.[0];if(i?.content?.parts)for(let t of i.content.parts){if(t.text!==void 0){let n=f(t);(!m||n&&m.type!==`thinking`||!n&&m.type!==`text`)&&(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:g.length-1,content:m.text,partial:e}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:e})),n?(m={type:`thinking`,thinking:``,thinkingSignature:void 0},e.content.push(m),a.push({type:`thinking_start`,contentIndex:_(),partial:e})):(m={type:`text`,text:``},e.content.push(m),a.push({type:`text_start`,contentIndex:_(),partial:e}))),m.type===`thinking`?(m.thinking+=t.text,m.thinkingSignature=d(m.thinkingSignature,t.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:_(),delta:t.text,partial:e})):(m.text+=t.text,m.textSignature=d(m.textSignature,t.thoughtSignature),a.push({type:`text_delta`,contentIndex:_(),delta:t.text,partial:e}))}if(t.functionCall){m&&=(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:e}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:e}),null);let n=t.functionCall.id,r={type:`toolCall`,id:!n||e.content.some(e=>e.type===`toolCall`&&e.id===n)?`${t.functionCall.name}_${Date.now()}_${++h}`:n,name:t.functionCall.name||``,arguments:t.functionCall.args??{},...t.thoughtSignature&&{thoughtSignature:t.thoughtSignature}};e.content.push(r),a.push({type:`toolcall_start`,contentIndex:_(),partial:e}),a.push({type:`toolcall_delta`,contentIndex:_(),delta:JSON.stringify(r.arguments),partial:e}),a.push({type:`toolcall_end`,contentIndex:_(),toolCall:r,partial:e})}}i?.finishReason&&(e.stopReason=l(i.finishReason),e.content.some(e=>e.type===`toolCall`)&&(e.stopReason=`toolUse`)),r.usageMetadata&&(e.usage={input:(r.usageMetadata.promptTokenCount||0)-(r.usageMetadata.cachedContentTokenCount||0),output:(r.usageMetadata.candidatesTokenCount||0)+(r.usageMetadata.thoughtsTokenCount||0),cacheRead:r.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:r.usageMetadata.thoughtsTokenCount||0,totalTokens:r.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},n(t,e.usage))}if(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:e}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:e})),i?.signal?.aborted)throw Error(`Request was aborted`);if(e.stopReason===`aborted`||e.stopReason===`error`)throw Error(`An unknown error occurred`);a.push({type:`done`,reason:e.stopReason,message:e}),a.end()}catch(t){for(let t of e.content)`index`in t&&delete t.index;e.stopReason=i?.signal?.aborted?`aborted`:`error`,e.errorMessage=s(o(t)),a.push({type:`error`,reason:e.stopReason,error:e}),a.end()}})(),a},_=(e,n,r)=>{let i=r?.apiKey;if(!i)throw Error(`No API key for provider: ${e.provider}`);let o=a(e,n,r,i);if(!r?.reasoning)return g(e,n,{...o,thinking:{enabled:!1}});let s=t(e,r.reasoning),c=s===`off`?`high`:s,l=e;return x(l)||S(l)||b(l)?g(e,n,{...o,thinking:{enabled:!0,level:w(c,l)}}):g(e,n,{...o,thinking:{enabled:!0,budgetTokens:T(l,c,r.thinkingBudgets)}})};function v(e,t,n){let i={};e.baseUrl&&(i.baseUrl=e.baseUrl,i.apiVersion=``);let a=r({...e.headers,...n});return a&&(i.headers=a),new p({apiKey:t,httpOptions:Object.keys(i).length>0?i:void 0})}function y(e,t,n={}){let r=m(e,t),a={};n.temperature!==void 0&&(a.temperature=n.temperature),n.maxTokens!==void 0&&(a.maxOutputTokens=n.maxTokens);let o={...Object.keys(a).length>0&&a,...t.systemPrompt&&{systemInstruction:i(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:u(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?o.toolConfig={functionCallingConfig:{mode:c(n.toolChoice)}}:o.toolConfig=void 0,n.thinking?.enabled&&e.reasoning){let e={includeThoughts:!0};n.thinking.level===void 0?n.thinking.budgetTokens!==void 0&&(e.thinkingBudget=n.thinking.budgetTokens):e.thinkingLevel=n.thinking.level,o.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(o.thinkingConfig=C(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);o.abortSignal=n.signal}return{model:e.id,contents:r,config:o}}function b(e){return/gemma-?4/.test(e.id.toLowerCase())}function x(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function S(e){let t=e.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(t)||t===`gemini-flash-latest`||t===`gemini-flash-lite-latest`}function C(e){return x(e)?{thinkingLevel:`LOW`}:S(e)||b(e)?{thinkingLevel:`MINIMAL`}:{thinkingBudget:0}}function w(e,t){if(x(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}if(b(t))switch(e){case`minimal`:case`low`:return`MINIMAL`;case`medium`:case`high`:return`HIGH`}switch(e){case`minimal`:return`MINIMAL`;case`low`:return`LOW`;case`medium`:return`MEDIUM`;case`high`:return`HIGH`}}function T(e,t,n){return n?.[t]===void 0?e.id.includes(`2.5-pro`)?{minimal:128,low:2048,medium:8192,high:32768}[t]:e.id.includes(`2.5-flash-lite`)?{minimal:512,low:2048,medium:8192,high:24576}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}export{g as stream,_ as streamSimple};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./event-stream-CXocIcc6.mjs";import{n as t,t as n}from"./models-bnt621e8.mjs";import{n as r}from"./headers-8nMK0zm-.mjs";import{t as i}from"./sanitize-unicode-BU6jSNzJ.mjs";import{r as a}from"./transform-messages-C0FNxyyM.mjs";import{n as o,t as s}from"./error-body-RPMBLEAJ.mjs";import{a as c,i as l,n as u,o as d,r as f,s as p,t as m}from"./google-shared-BIfd6JKP.mjs";let h=0;const g=(t,r,i)=>{let a=new e;return(async()=>{let e={role:`assistant`,content:[],api:`google-generative-ai`,provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let o=i?.apiKey;if(!o)throw Error(`No API key for provider: ${t.provider}`);let s=v(t,o,i?.headers),c=y(t,r,i),u=await i?.onPayload?.(c,t);u!==void 0&&(c=u);let p=await s.models.generateContentStream(c);a.push({type:`start`,partial:e});let m=null,g=e.content,_=()=>g.length-1;for await(let r of p){e.responseId||=r.responseId;let i=r.candidates?.[0];if(i?.content?.parts)for(let t of i.content.parts){if(t.text!==void 0){let n=f(t);(!m||n&&m.type!==`thinking`||!n&&m.type!==`text`)&&(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:g.length-1,content:m.text,partial:e}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:e})),n?(m={type:`thinking`,thinking:``,thinkingSignature:void 0},e.content.push(m),a.push({type:`thinking_start`,contentIndex:_(),partial:e})):(m={type:`text`,text:``},e.content.push(m),a.push({type:`text_start`,contentIndex:_(),partial:e}))),m.type===`thinking`?(m.thinking+=t.text,m.thinkingSignature=d(m.thinkingSignature,t.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:_(),delta:t.text,partial:e})):(m.text+=t.text,m.textSignature=d(m.textSignature,t.thoughtSignature),a.push({type:`text_delta`,contentIndex:_(),delta:t.text,partial:e}))}if(t.functionCall){m&&=(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:e}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:e}),null);let n=t.functionCall.id,r={type:`toolCall`,id:!n||e.content.some(e=>e.type===`toolCall`&&e.id===n)?`${t.functionCall.name}_${Date.now()}_${++h}`:n,name:t.functionCall.name||``,arguments:t.functionCall.args??{},...t.thoughtSignature&&{thoughtSignature:t.thoughtSignature}};e.content.push(r),a.push({type:`toolcall_start`,contentIndex:_(),partial:e}),a.push({type:`toolcall_delta`,contentIndex:_(),delta:JSON.stringify(r.arguments),partial:e}),a.push({type:`toolcall_end`,contentIndex:_(),toolCall:r,partial:e})}}i?.finishReason&&(e.stopReason=l(i.finishReason),e.content.some(e=>e.type===`toolCall`)&&(e.stopReason=`toolUse`)),r.usageMetadata&&(e.usage={input:(r.usageMetadata.promptTokenCount||0)-(r.usageMetadata.cachedContentTokenCount||0),output:(r.usageMetadata.candidatesTokenCount||0)+(r.usageMetadata.thoughtsTokenCount||0),cacheRead:r.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:r.usageMetadata.thoughtsTokenCount||0,totalTokens:r.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},n(t,e.usage))}if(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:e}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:e})),i?.signal?.aborted)throw Error(`Request was aborted`);if(e.stopReason===`aborted`||e.stopReason===`error`)throw Error(`An unknown error occurred`);a.push({type:`done`,reason:e.stopReason,message:e}),a.end()}catch(t){for(let t of e.content)`index`in t&&delete t.index;e.stopReason=i?.signal?.aborted?`aborted`:`error`,e.errorMessage=s(o(t)),a.push({type:`error`,reason:e.stopReason,error:e}),a.end()}})(),a},_=(e,n,r)=>{let i=r?.apiKey;if(!i)throw Error(`No API key for provider: ${e.provider}`);let o=a(e,n,r,i);if(!r?.reasoning)return g(e,n,{...o,thinking:{enabled:!1}});let s=t(e,r.reasoning),c=s===`off`?`high`:s,l=e;return x(l)||S(l)||b(l)?g(e,n,{...o,thinking:{enabled:!0,level:w(c,l)}}):g(e,n,{...o,thinking:{enabled:!0,budgetTokens:T(l,c,r.thinkingBudgets)}})};function v(e,t,n){let i={};e.baseUrl&&(i.baseUrl=e.baseUrl,i.apiVersion=``);let a=r({...e.headers,...n});return a&&(i.headers=a),new p({apiKey:t,httpOptions:Object.keys(i).length>0?i:void 0})}function y(e,t,n={}){let r=m(e,t),a={};n.temperature!==void 0&&(a.temperature=n.temperature),n.maxTokens!==void 0&&(a.maxOutputTokens=n.maxTokens);let o={...Object.keys(a).length>0&&a,...t.systemPrompt&&{systemInstruction:i(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:u(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?o.toolConfig={functionCallingConfig:{mode:c(n.toolChoice)}}:o.toolConfig=void 0,n.thinking?.enabled&&e.reasoning){let e={includeThoughts:!0};n.thinking.level===void 0?n.thinking.budgetTokens!==void 0&&(e.thinkingBudget=n.thinking.budgetTokens):e.thinkingLevel=n.thinking.level,o.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(o.thinkingConfig=C(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);o.abortSignal=n.signal}return{model:e.id,contents:r,config:o}}function b(e){return/gemma-?4/.test(e.id.toLowerCase())}function x(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function S(e){let t=e.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(t)||t===`gemini-flash-latest`||t===`gemini-flash-lite-latest`}function C(e){return x(e)?{thinkingLevel:`LOW`}:S(e)||b(e)?{thinkingLevel:`MINIMAL`}:{thinkingBudget:0}}function w(e,t){if(x(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}if(b(t))switch(e){case`minimal`:case`low`:return`MINIMAL`;case`medium`:case`high`:return`HIGH`}switch(e){case`minimal`:return`MINIMAL`;case`low`:return`LOW`;case`medium`:return`MEDIUM`;case`high`:return`HIGH`}}function T(e,t,n){return n?.[t]===void 0?e.id.includes(`2.5-pro`)?{minimal:128,low:2048,medium:8192,high:32768}[t]:e.id.includes(`2.5-flash-lite`)?{minimal:512,low:2048,medium:8192,high:24576}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}export{g as stream,_ as streamSimple};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{Ft as e,It as t,Mt as n}from"./index.mjs";import{t as r}from"./sanitize-unicode-DVHYNBlY.mjs";import{t as i}from"./transform-messages-DSEUXL48.mjs";import{createWriteStream as a}from"fs";import*as o from"path";import{Readable as s}from"node:stream";import{finished as c}from"node:stream/promises";import*as l from"fs/promises";import{writeFile as u}from"fs/promises";var d=n(((e,t)=>{function n(e,t){typeof t==`boolean`&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=n,n.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},n.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},n.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(Error(`RetryOperation timeout occurred`)),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n),this._options.unref&&this._timer.unref(),!0},n.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},n.prototype.try=function(e){console.log(`Using RetryOperation.try() is deprecated`),this.attempt(e)},n.prototype.start=function(e){console.log(`Using RetryOperation.start() is deprecated`),this.attempt(e)},n.prototype.start=n.prototype.try,n.prototype.errors=function(){return this._errors},n.prototype.attempts=function(){return this._attempts},n.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var i=this._errors[r],a=i.message,o=(e[a]||0)+1;e[a]=o,o>=n&&(t=i,n=o)}return t}})),f=n((e=>{var t=d();e.operation=function(n){return new t(e.timeouts(n),{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw Error(`minTimeout is greater than maxTimeout`);for(var r=[],i=0;i<t.retries;i++)r.push(this.createTimeout(i,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(i,t)),r.sort(function(e,t){return e-t}),r},e.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*Math.max(t.minTimeout,1)*t.factor**+e);return r=Math.min(r,t.maxTimeout),r},e.wrap=function(t,n,r){if(n instanceof Array&&(r=n,n=null),!r)for(var i in r=[],t)typeof t[i]==`function`&&r.push(i);for(var a=0;a<r.length;a++){var o=r[a],s=t[o];t[o]=function(r){var i=e.operation(n),a=Array.prototype.slice.call(arguments,1),o=a.pop();a.push(function(e){i.retry(e)||(e&&(arguments[0]=i.mainError()),o.apply(this,arguments))}),i.attempt(function(){r.apply(t,a)})}.bind(t,s),t[o].options=n}}})),p=n(((e,t)=>{t.exports=f()})),m=n(((e,t)=>{let n=p(),r=[`Failed to fetch`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`];var i=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name=`AbortError`,this.message=e}};let a=(e,t,n)=>{let r=n.retries-(t-1);return e.attemptNumber=t,e.retriesLeft=r,e},o=e=>r.includes(e),s=(e,t)=>new Promise((r,s)=>{t={onFailedAttempt:()=>{},retries:10,...t};let c=n.operation(t);c.attempt(async n=>{try{r(await e(n))}catch(e){if(!(e instanceof Error)){s(TypeError(`Non-error was thrown: "${e}". You should only throw errors.`));return}if(e instanceof i)c.stop(),s(e.originalError);else if(e instanceof TypeError&&!o(e.message))c.stop(),s(e);else{a(e,n,t);try{await t.onFailedAttempt(e)}catch(e){s(e);return}c.retry(e)||s(c.mainError())}}})});t.exports=s,t.exports.default=s,t.exports.AbortError=i})),h=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}})),g=n(((e,t)=>{t.exports={name:`gaxios`,version:`7.1.4`,description:`A simple common HTTP client specifically for Google APIs and services.`,main:`build/cjs/src/index.js`,types:`build/cjs/src/index.d.ts`,files:[`build/`],exports:{".":{import:{types:`./build/esm/src/index.d.ts`,default:`./build/esm/src/index.js`},require:{types:`./build/cjs/src/index.d.ts`,default:`./build/cjs/src/index.js`}}},scripts:{lint:`gts check --no-inline-config`,test:`c8 mocha build/esm/test`,"presystem-test":`npm run compile`,"system-test":`mocha build/esm/system-test --timeout 80000`,compile:`tsc -b ./tsconfig.json ./tsconfig.cjs.json && node utils/enable-esm.mjs`,fix:`gts fix`,prepare:`npm run compile`,pretest:`npm run compile`,webpack:`webpack`,"prebrowser-test":`npm run compile`,"browser-test":`node build/browser-test/browser-test-runner.js`,docs:`jsdoc -c .jsdoc.js`,"docs-test":`linkinator docs`,"predocs-test":`npm run docs`,"samples-test":`cd samples/ && npm link ../ && npm test && cd ../`,prelint:`cd samples; npm link ../; npm install`,clean:`gts clean`},repository:{type:`git`,directory:`packages/gaxios`,url:`https://github.com/googleapis/google-cloud-node-core.git`},keywords:[`google`],engines:{node:`>=18`},author:`Google, LLC`,license:`Apache-2.0`,devDependencies:{"@babel/plugin-proposal-private-methods":`^7.18.6`,"@types/cors":`^2.8.6`,"@types/express":`^5.0.0`,"@types/extend":`^3.0.1`,"@types/mocha":`^10.0.10`,"@types/multiparty":`4.2.1`,"@types/mv":`^2.1.0`,"@types/ncp":`^2.0.8`,"@types/node":`^22.13.1`,"@types/sinon":`^17.0.3`,"@types/tmp":`^0.2.6`,assert:`^2.0.0`,browserify:`^17.0.0`,c8:`^10.1.3`,cors:`^2.8.5`,express:`^5.0.0`,gts:`^6.0.2`,"is-docker":`^3.0.0`,jsdoc:`^4.0.4`,"jsdoc-fresh":`^5.0.0`,"jsdoc-region-tag":`^4.0.0`,karma:`^6.0.0`,"karma-chrome-launcher":`^3.0.0`,"karma-coverage":`^2.0.0`,"karma-firefox-launcher":`^2.0.0`,"karma-mocha":`^2.0.0`,"karma-remap-coverage":`^0.1.5`,"karma-sourcemap-loader":`^0.4.0`,"karma-webpack":`^5.0.1`,linkinator:`^6.1.2`,mocha:`^11.1.0`,multiparty:`^4.2.1`,mv:`^2.1.1`,ncp:`^2.0.0`,nock:`^14.0.5`,"null-loader":`^4.0.1`,"pack-n-play":`^4.0.0`,puppeteer:`^24.0.0`,sinon:`^21.0.0`,"stream-browserify":`^3.0.0`,tmp:`0.2.5`,"ts-loader":`^9.5.2`,typescript:`5.8.3`,webpack:`^5.97.1`,"webpack-cli":`^6.0.1`},dependencies:{extend:`^3.0.2`,"https-proxy-agent":`^7.0.1`,"node-fetch":`^3.3.2`},homepage:`https://github.com/googleapis/google-cloud-node-core/tree/main/packages/gaxios`}})),_=n(((e,t)=>{t.exports={pkg:g()}})),v=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.GaxiosError=e.GAXIOS_ERROR_SYMBOL=void 0,e.defaultErrorRedactor=a;let n=t(h()),r=t(_()).default.pkg;e.GAXIOS_ERROR_SYMBOL=Symbol.for(`${r.name}-gaxios-error`),e.GaxiosError=class t extends Error{config;response;code;status;error;[e.GAXIOS_ERROR_SYMBOL]=r.version;static[Symbol.hasInstance](n){return n&&typeof n==`object`&&e.GAXIOS_ERROR_SYMBOL in n&&n[e.GAXIOS_ERROR_SYMBOL]===r.version?!0:Function.prototype[Symbol.hasInstance].call(t,n)}constructor(e,t,r,a){if(super(e,{cause:a}),this.config=t,this.response=r,this.error=a instanceof Error?a:void 0,this.config=(0,n.default)(!0,{},t),this.response&&(this.response.config=(0,n.default)(!0,{},this.response.config)),this.response){try{this.response.data=i(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}a instanceof DOMException?this.code=a.name:a&&typeof a==`object`&&`code`in a&&(typeof a.code==`string`||typeof a.code==`number`)&&(this.code=a.code)}static extractAPIErrorFromResponse(e,t=`The request failed`){let n=t;if(typeof e.data==`string`&&(n=e.data),e.data&&typeof e.data==`object`&&`error`in e.data&&e.data.error&&!e.ok){if(typeof e.data.error==`string`)return{message:e.data.error,code:e.status,status:e.statusText};if(typeof e.data.error==`object`){n=`message`in e.data.error&&typeof e.data.error.message==`string`?e.data.error.message:n;let t=`status`in e.data.error&&typeof e.data.error.status==`string`?e.data.error.status:e.statusText,r=`code`in e.data.error&&typeof e.data.error.code==`number`?e.data.error.code:e.status;if(`errors`in e.data.error&&Array.isArray(e.data.error.errors)){let i=[];for(let t of e.data.error.errors)typeof t==`object`&&`message`in t&&typeof t.message==`string`&&i.push(t.message);return Object.assign({message:i.join(`
|
|
2
|
+
import{Ft as e,It as t,Mt as n}from"./index.mjs";import{t as r}from"./sanitize-unicode-BU6jSNzJ.mjs";import{t as i}from"./transform-messages-C0FNxyyM.mjs";import{createWriteStream as a}from"fs";import*as o from"path";import{Readable as s}from"node:stream";import{finished as c}from"node:stream/promises";import*as l from"fs/promises";import{writeFile as u}from"fs/promises";var d=n(((e,t)=>{function n(e,t){typeof t==`boolean`&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=n,n.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},n.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},n.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(Error(`RetryOperation timeout occurred`)),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n),this._options.unref&&this._timer.unref(),!0},n.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},n.prototype.try=function(e){console.log(`Using RetryOperation.try() is deprecated`),this.attempt(e)},n.prototype.start=function(e){console.log(`Using RetryOperation.start() is deprecated`),this.attempt(e)},n.prototype.start=n.prototype.try,n.prototype.errors=function(){return this._errors},n.prototype.attempts=function(){return this._attempts},n.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var i=this._errors[r],a=i.message,o=(e[a]||0)+1;e[a]=o,o>=n&&(t=i,n=o)}return t}})),f=n((e=>{var t=d();e.operation=function(n){return new t(e.timeouts(n),{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw Error(`minTimeout is greater than maxTimeout`);for(var r=[],i=0;i<t.retries;i++)r.push(this.createTimeout(i,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(i,t)),r.sort(function(e,t){return e-t}),r},e.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*Math.max(t.minTimeout,1)*t.factor**+e);return r=Math.min(r,t.maxTimeout),r},e.wrap=function(t,n,r){if(n instanceof Array&&(r=n,n=null),!r)for(var i in r=[],t)typeof t[i]==`function`&&r.push(i);for(var a=0;a<r.length;a++){var o=r[a],s=t[o];t[o]=function(r){var i=e.operation(n),a=Array.prototype.slice.call(arguments,1),o=a.pop();a.push(function(e){i.retry(e)||(e&&(arguments[0]=i.mainError()),o.apply(this,arguments))}),i.attempt(function(){r.apply(t,a)})}.bind(t,s),t[o].options=n}}})),p=n(((e,t)=>{t.exports=f()})),m=n(((e,t)=>{let n=p(),r=[`Failed to fetch`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`];var i=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name=`AbortError`,this.message=e}};let a=(e,t,n)=>{let r=n.retries-(t-1);return e.attemptNumber=t,e.retriesLeft=r,e},o=e=>r.includes(e),s=(e,t)=>new Promise((r,s)=>{t={onFailedAttempt:()=>{},retries:10,...t};let c=n.operation(t);c.attempt(async n=>{try{r(await e(n))}catch(e){if(!(e instanceof Error)){s(TypeError(`Non-error was thrown: "${e}". You should only throw errors.`));return}if(e instanceof i)c.stop(),s(e.originalError);else if(e instanceof TypeError&&!o(e.message))c.stop(),s(e);else{a(e,n,t);try{await t.onFailedAttempt(e)}catch(e){s(e);return}c.retry(e)||s(c.mainError())}}})});t.exports=s,t.exports.default=s,t.exports.AbortError=i})),h=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}})),g=n(((e,t)=>{t.exports={name:`gaxios`,version:`7.1.4`,description:`A simple common HTTP client specifically for Google APIs and services.`,main:`build/cjs/src/index.js`,types:`build/cjs/src/index.d.ts`,files:[`build/`],exports:{".":{import:{types:`./build/esm/src/index.d.ts`,default:`./build/esm/src/index.js`},require:{types:`./build/cjs/src/index.d.ts`,default:`./build/cjs/src/index.js`}}},scripts:{lint:`gts check --no-inline-config`,test:`c8 mocha build/esm/test`,"presystem-test":`npm run compile`,"system-test":`mocha build/esm/system-test --timeout 80000`,compile:`tsc -b ./tsconfig.json ./tsconfig.cjs.json && node utils/enable-esm.mjs`,fix:`gts fix`,prepare:`npm run compile`,pretest:`npm run compile`,webpack:`webpack`,"prebrowser-test":`npm run compile`,"browser-test":`node build/browser-test/browser-test-runner.js`,docs:`jsdoc -c .jsdoc.js`,"docs-test":`linkinator docs`,"predocs-test":`npm run docs`,"samples-test":`cd samples/ && npm link ../ && npm test && cd ../`,prelint:`cd samples; npm link ../; npm install`,clean:`gts clean`},repository:{type:`git`,directory:`packages/gaxios`,url:`https://github.com/googleapis/google-cloud-node-core.git`},keywords:[`google`],engines:{node:`>=18`},author:`Google, LLC`,license:`Apache-2.0`,devDependencies:{"@babel/plugin-proposal-private-methods":`^7.18.6`,"@types/cors":`^2.8.6`,"@types/express":`^5.0.0`,"@types/extend":`^3.0.1`,"@types/mocha":`^10.0.10`,"@types/multiparty":`4.2.1`,"@types/mv":`^2.1.0`,"@types/ncp":`^2.0.8`,"@types/node":`^22.13.1`,"@types/sinon":`^17.0.3`,"@types/tmp":`^0.2.6`,assert:`^2.0.0`,browserify:`^17.0.0`,c8:`^10.1.3`,cors:`^2.8.5`,express:`^5.0.0`,gts:`^6.0.2`,"is-docker":`^3.0.0`,jsdoc:`^4.0.4`,"jsdoc-fresh":`^5.0.0`,"jsdoc-region-tag":`^4.0.0`,karma:`^6.0.0`,"karma-chrome-launcher":`^3.0.0`,"karma-coverage":`^2.0.0`,"karma-firefox-launcher":`^2.0.0`,"karma-mocha":`^2.0.0`,"karma-remap-coverage":`^0.1.5`,"karma-sourcemap-loader":`^0.4.0`,"karma-webpack":`^5.0.1`,linkinator:`^6.1.2`,mocha:`^11.1.0`,multiparty:`^4.2.1`,mv:`^2.1.1`,ncp:`^2.0.0`,nock:`^14.0.5`,"null-loader":`^4.0.1`,"pack-n-play":`^4.0.0`,puppeteer:`^24.0.0`,sinon:`^21.0.0`,"stream-browserify":`^3.0.0`,tmp:`0.2.5`,"ts-loader":`^9.5.2`,typescript:`5.8.3`,webpack:`^5.97.1`,"webpack-cli":`^6.0.1`},dependencies:{extend:`^3.0.2`,"https-proxy-agent":`^7.0.1`,"node-fetch":`^3.3.2`},homepage:`https://github.com/googleapis/google-cloud-node-core/tree/main/packages/gaxios`}})),_=n(((e,t)=>{t.exports={pkg:g()}})),v=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.GaxiosError=e.GAXIOS_ERROR_SYMBOL=void 0,e.defaultErrorRedactor=a;let n=t(h()),r=t(_()).default.pkg;e.GAXIOS_ERROR_SYMBOL=Symbol.for(`${r.name}-gaxios-error`),e.GaxiosError=class t extends Error{config;response;code;status;error;[e.GAXIOS_ERROR_SYMBOL]=r.version;static[Symbol.hasInstance](n){return n&&typeof n==`object`&&e.GAXIOS_ERROR_SYMBOL in n&&n[e.GAXIOS_ERROR_SYMBOL]===r.version?!0:Function.prototype[Symbol.hasInstance].call(t,n)}constructor(e,t,r,a){if(super(e,{cause:a}),this.config=t,this.response=r,this.error=a instanceof Error?a:void 0,this.config=(0,n.default)(!0,{},t),this.response&&(this.response.config=(0,n.default)(!0,{},this.response.config)),this.response){try{this.response.data=i(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}a instanceof DOMException?this.code=a.name:a&&typeof a==`object`&&`code`in a&&(typeof a.code==`string`||typeof a.code==`number`)&&(this.code=a.code)}static extractAPIErrorFromResponse(e,t=`The request failed`){let n=t;if(typeof e.data==`string`&&(n=e.data),e.data&&typeof e.data==`object`&&`error`in e.data&&e.data.error&&!e.ok){if(typeof e.data.error==`string`)return{message:e.data.error,code:e.status,status:e.statusText};if(typeof e.data.error==`object`){n=`message`in e.data.error&&typeof e.data.error.message==`string`?e.data.error.message:n;let t=`status`in e.data.error&&typeof e.data.error.status==`string`?e.data.error.status:e.statusText,r=`code`in e.data.error&&typeof e.data.error.code==`number`?e.data.error.code:e.status;if(`errors`in e.data.error&&Array.isArray(e.data.error.errors)){let i=[];for(let t of e.data.error.errors)typeof t==`object`&&`message`in t&&typeof t.message==`string`&&i.push(t.message);return Object.assign({message:i.join(`
|
|
3
3
|
`)||n,code:r,status:t},e.data.error)}return Object.assign({message:n,code:r,status:t},e.data.error)}}return{message:n,code:e.status,status:e.statusText}}};function i(e,t){switch(e){case`stream`:return t;case`json`:return JSON.parse(JSON.stringify(t));case`arraybuffer`:return JSON.parse(Buffer.from(t).toString(`utf8`));case`blob`:return JSON.parse(t.text());default:return t}}function a(e){let t="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function n(e){e&&e.forEach((n,r)=>{(/^authentication$/i.test(r)||/^authorization$/i.test(r)||/secret/i.test(r))&&e.set(r,t)})}function r(e,n){if(typeof e==`object`&&e&&typeof e[n]==`string`){let r=e[n];(/grant_type=/i.test(r)||/assertion=/i.test(r)||/secret/i.test(r))&&(e[n]=t)}}function i(e){!e||typeof e!=`object`||(e instanceof FormData||e instanceof URLSearchParams||`forEach`in e&&`set`in e?e.forEach((n,r)=>{([`grant_type`,`assertion`].includes(r)||/secret/.test(r))&&e.set(r,t)}):(`grant_type`in e&&(e.grant_type=t),`assertion`in e&&(e.assertion=t),`client_secret`in e&&(e.client_secret=t)))}return e.config&&(n(e.config.headers),r(e.config,`data`),i(e.config.data),r(e.config,`body`),i(e.config.body),e.config.url.searchParams.has(`token`)&&e.config.url.searchParams.set(`token`,t),e.config.url.searchParams.has(`client_secret`)&&e.config.url.searchParams.set(`client_secret`,t)),e.response&&(a({config:e.response.config}),n(e.response.headers),e.response.bodyUsed&&(r(e.response,`data`),i(e.response.data))),e}})),y=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRetryConfig=t;async function t(e){let t=r(e);if(!e||!e.config||!t&&!e.config.retry)return{shouldRetry:!1};if(t||={},t.currentRetryAttempt=t.currentRetryAttempt||0,t.retry=t.retry===void 0||t.retry===null?3:t.retry,t.httpMethodsToRetry=t.httpMethodsToRetry||[`GET`,`HEAD`,`PUT`,`OPTIONS`,`DELETE`],t.noResponseRetries=t.noResponseRetries===void 0||t.noResponseRetries===null?2:t.noResponseRetries,t.retryDelayMultiplier=t.retryDelayMultiplier?t.retryDelayMultiplier:2,t.timeOfFirstRequest=t.timeOfFirstRequest?t.timeOfFirstRequest:Date.now(),t.totalTimeout=t.totalTimeout?t.totalTimeout:2**53-1,t.maxRetryDelay=t.maxRetryDelay?t.maxRetryDelay:2**53-1,t.statusCodesToRetry=t.statusCodesToRetry||[[100,199],[408,408],[429,429],[500,599]],e.config.retryConfig=t,!await(t.shouldRetry||n)(e))return{shouldRetry:!1,config:e.config};let a=i(t);e.config.retryConfig.currentRetryAttempt+=1;let o=t.retryBackoff?t.retryBackoff(e,a):new Promise(e=>{setTimeout(e,a)});return t.onRetryAttempt&&await t.onRetryAttempt(e),await o,{shouldRetry:!0,config:e.config}}function n(e){let t=r(e);if(e.config.signal?.aborted&&e.code!==`TimeoutError`||e.code===`AbortError`||!t||t.retry===0||!e.response&&(t.currentRetryAttempt||0)>=t.noResponseRetries||!t.httpMethodsToRetry||!t.httpMethodsToRetry.includes(e.config.method?.toUpperCase()||`GET`))return!1;if(e.response&&e.response.status){let n=!1;for(let[r,i]of t.statusCodesToRetry){let t=e.response.status;if(t>=r&&t<=i){n=!0;break}}if(!n)return!1}return t.currentRetryAttempt=t.currentRetryAttempt||0,!(t.currentRetryAttempt>=t.retry)}function r(e){if(e&&e.config&&e.config.retryConfig)return e.config.retryConfig}function i(e){let t=(e.currentRetryAttempt?0:e.retryDelay??100)+(e.retryDelayMultiplier**+e.currentRetryAttempt-1)/2*1e3,n=e.totalTimeout-(Date.now()-e.timeOfFirstRequest);return Math.min(t,n,e.maxRetryDelay)}})),b=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.GaxiosInterceptorManager=void 0,e.GaxiosInterceptorManager=class extends Set{}})),x=n((n=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i;Object.defineProperty(n,`__esModule`,{value:!0}),n.Gaxios=void 0;let a=r(h()),o=e(`https`),s=v(),c=y(),l=e(`stream`),u=b(),d=async()=>globalThis.crypto?.randomUUID()||(await import(`crypto`)).randomUUID();var f=class{agentCache=new Map;defaults;interceptors;constructor(e){this.defaults=e||{},this.interceptors={request:new u.GaxiosInterceptorManager,response:new u.GaxiosInterceptorManager}}fetch(...e){let t=e[0],n=e[1],r,a=new Headers;return typeof t==`string`?r=new URL(t):t instanceof URL?r=t:t&&t.url&&(r=new URL(t.url)),t&&typeof t==`object`&&`headers`in t&&i.mergeHeaders(a,t.headers),n&&i.mergeHeaders(a,new Headers(n.headers)),typeof t==`object`&&!(t instanceof URL)?this.request({...n,...t,headers:a,url:r}):this.request({...n,headers:a,url:r})}async request(e={}){let t=await this.#r(e);return t=await this.#t(t),this.#n(this._request(t))}async _defaultAdapter(e){let t=e.fetchImplementation||this.defaults.fetchImplementation||await i.#c(),n={...e};delete n.data;let r=await t(e.url,n),a=await this.getResponseData(e,r);return Object.getOwnPropertyDescriptor(r,`data`)?.configurable||Object.defineProperties(r,{data:{configurable:!0,writable:!0,enumerable:!0,value:a}}),Object.assign(r,{config:e,data:a})}async _request(e){try{let t;if(t=e.adapter?await e.adapter(e,this._defaultAdapter.bind(this)):await this._defaultAdapter(e),!e.validateStatus(t.status)){if(e.responseType===`stream`){let e=[];for await(let n of t.data)e.push(n);t.data=e.toString()}let n=s.GaxiosError.extractAPIErrorFromResponse(t,`Request failed with status code ${t.status}`);throw new s.GaxiosError(n?.message,e,t,n)}return t}catch(t){let n;n=t instanceof s.GaxiosError?t:t instanceof Error?new s.GaxiosError(t.message,e,void 0,t):new s.GaxiosError(`Unexpected Gaxios Error`,e,void 0,t);let{shouldRetry:r,config:i}=await(0,c.getRetryConfig)(n);if(r&&i)return n.config.retryConfig.currentRetryAttempt=i.retryConfig.currentRetryAttempt,e.retryConfig=n.config?.retryConfig,this.#i(e),this._request(e);throw e.errorRedactor&&e.errorRedactor(n),n}}async getResponseData(e,t){if(t.status===204)return``;if(e.maxContentLength&&t.headers.has(`content-length`)&&e.maxContentLength<Number.parseInt(t.headers?.get(`content-length`)||``))throw new s.GaxiosError("Response's `Content-Length` is over the limit.",e,Object.assign(t,{config:e}));switch(e.responseType){case`stream`:return t.body;case`json`:{let e=await t.text();try{return JSON.parse(e)}catch{return e}}case`arraybuffer`:return t.arrayBuffer();case`blob`:return t.blob();case`text`:return t.text();default:return this.getResponseDataFromContentType(t)}}#e(e,t=[]){let n=new URL(e),r=[...t],i=(process.env.NO_PROXY??process.env.no_proxy)?.split(`,`)||[];for(let e of i)r.push(e.trim());for(let e of r)if(e instanceof RegExp){if(e.test(n.toString()))return!1}else if(e instanceof URL){if(e.origin===n.origin)return!1}else if(e.startsWith(`*.`)||e.startsWith(`.`)){let t=e.replace(/^\*\./,`.`);if(n.hostname.endsWith(t))return!1}else if(e===n.origin||e===n.hostname||e===n.href)return!1;return!0}async#t(e){let t=Promise.resolve(e);for(let e of this.interceptors.request.values())e&&(t=t.then(e.resolved,e.rejected));return t}async#n(e){let t=Promise.resolve(e);for(let e of this.interceptors.response.values())e&&(t=t.then(e.resolved,e.rejected));return t}async#r(e){let t=new Headers(this.defaults.headers);i.mergeHeaders(t,e.headers);let n=(0,a.default)(!0,{},this.defaults,e);if(!n.url)throw Error(`URL is required.`);if(n.baseURL&&(n.url=new URL(n.url,n.baseURL)),n.url=new URL(n.url),n.params)if(n.paramsSerializer){let e=n.paramsSerializer(n.params);e.startsWith(`?`)&&(e=e.slice(1));let t=n.url.toString().includes(`?`)?`&`:`?`;n.url=n.url+t+e}else{let e=n.url instanceof URL?n.url:new URL(n.url);for(let[t,r]of new URLSearchParams(n.params))e.searchParams.append(t,r);n.url=e}typeof e.maxContentLength==`number`&&(n.size=e.maxContentLength),typeof e.maxRedirects==`number`&&(n.follow=e.maxRedirects);let r=typeof n.data==`string`||n.data instanceof ArrayBuffer||n.data instanceof Blob||globalThis.File&&n.data instanceof File||n.data instanceof FormData||n.data instanceof l.Readable||n.data instanceof ReadableStream||n.data instanceof String||n.data instanceof URLSearchParams||ArrayBuffer.isView(n.data)||[`Blob`,`File`,`FormData`].includes(n.data?.constructor?.name||``);if(n.multipart?.length){let e=await d();t.set(`content-type`,`multipart/related; boundary=${e}`),n.body=l.Readable.from(this.getMultipartRequest(n.multipart,e))}else r?n.body=n.data:typeof n.data==`object`?t.get(`Content-Type`)===`application/x-www-form-urlencoded`?n.body=n.paramsSerializer?n.paramsSerializer(n.data):new URLSearchParams(n.data):(t.has(`content-type`)||t.set(`content-type`,`application/json`),n.body=JSON.stringify(n.data)):n.data&&(n.body=n.data);n.validateStatus=n.validateStatus||this.validateStatus,n.responseType=n.responseType||`unknown`,!t.has(`accept`)&&n.responseType===`json`&&t.set(`accept`,`application/json`);let c=n.proxy||process?.env?.HTTPS_PROXY||process?.env?.https_proxy||process?.env?.HTTP_PROXY||process?.env?.http_proxy;if(!n.agent)if(c&&this.#e(n.url,n.noProxy)){let e=await i.#s();this.agentCache.has(c)?n.agent=this.agentCache.get(c):(n.agent=new e(c,{cert:n.cert,key:n.key}),this.agentCache.set(c,n.agent))}else n.cert&&n.key&&(this.agentCache.has(n.key)?n.agent=this.agentCache.get(n.key):(n.agent=new o.Agent({cert:n.cert,key:n.key}),this.agentCache.set(n.key,n.agent)));return typeof n.errorRedactor!=`function`&&n.errorRedactor!==!1&&(n.errorRedactor=s.defaultErrorRedactor),n.body&&!(`duplex`in n)&&(n.duplex=`half`),this.#i(n),Object.assign(n,{headers:t,url:n.url instanceof URL?n.url:new URL(n.url)})}#i(e){if(e.timeout){let t=AbortSignal.timeout(e.timeout);e.signal&&!e.signal.aborted?e.signal=AbortSignal.any([e.signal,t]):e.signal=t}}validateStatus(e){return e>=200&&e<300}async getResponseDataFromContentType(e){let t=e.headers.get(`Content-Type`);if(t===null)return e.text();if(t=t.toLowerCase(),t.includes(`application/json`)){let t=await e.text();try{t=JSON.parse(t)}catch{}return t}else if(t.match(/^text\//))return e.text();else return e.blob()}async*getMultipartRequest(e,t){let n=`--${t}--`;for(let n of e)yield`--${t}\r\nContent-Type: ${n.headers.get(`Content-Type`)||`application/octet-stream`}\r\n\r\n`,typeof n.content==`string`?yield n.content:yield*n.content,yield`\r
|
|
4
|
-
`;yield n}static#a;static#o;static async#s(){return this.#a||=(await import(`./dist-CCiXmKIu.mjs`).then(e=>t(e.default))).HttpsProxyAgent,this.#a}static async#c(){let e=typeof window<`u`&&!!window;return this.#o||=e?window.fetch:(await import(`./src-CbkJodKR.mjs`)).default,this.#o}static mergeHeaders(e,...t){e=e instanceof Headers?e:new Headers(e);for(let n of t)(n instanceof Headers?n:new Headers(n)).forEach((t,n)=>{n===`set-cookie`?e.append(n,t):e.set(n,t)});return e}};n.Gaxios=f,i=f})),S=n((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.instance=e.Gaxios=e.GaxiosError=void 0,e.request=a;let r=x();Object.defineProperty(e,`Gaxios`,{enumerable:!0,get:function(){return r.Gaxios}});var i=v();Object.defineProperty(e,`GaxiosError`,{enumerable:!0,get:function(){return i.GaxiosError}}),n(b(),e),e.instance=new r.Gaxios;async function a(t){return e.instance.request(t)}})),C=n(((e,t)=>{(function(e){var n,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,a=Math.floor,o=`[BigNumber Error] `,s=o+`Number primitive has more than 15 significant digits: `,c=0x5af3107a4000,l=14,u=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,0xe8d4a51000,0x9184e72a000],f=1e7,p=1e9;function m(e){var t,n,S,C=F.prototype={constructor:F,toString:null,valueOf:null},w=new F(1),T=20,E=4,D=-7,O=21,k=-1e7,A=1e7,j=!1,M=1,N=0,ee={prefix:``,groupSize:3,secondaryGroupSize:0,groupSeparator:`,`,decimalSeparator:`.`,fractionGroupSize:0,fractionGroupSeparator:`\xA0`,suffix:``},P=`0123456789abcdefghijklmnopqrstuvwxyz`,te=!0;function F(e,t){var i,o,c,d,f,p,m,h,g=this;if(!(g instanceof F))return new F(e,t);if(t==null){if(e&&e._isBigNumber===!0){g.s=e.s,!e.c||e.e>A?g.c=g.e=null:e.e<k?g.c=[g.e=0]:(g.e=e.e,g.c=e.c.slice());return}if((p=typeof e==`number`)&&e*0==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(d=0,f=e;f>=10;f/=10,d++);d>A?g.c=g.e=null:(g.e=d,g.c=[e]);return}h=String(e)}else{if(!r.test(h=String(e)))return S(g,h,p);g.s=h.charCodeAt(0)==45?(h=h.slice(1),-1):1}(d=h.indexOf(`.`))>-1&&(h=h.replace(`.`,``)),(f=h.search(/e/i))>0?(d<0&&(d=f),d+=+h.slice(f+1),h=h.substring(0,f)):d<0&&(d=h.length)}else{if(v(t,2,P.length,`Base`),t==10&&te)return g=new F(e),L(g,T+g.e+1,E);if(h=String(e),p=typeof e==`number`){if(e*0!=0)return S(g,h,p,t);if(g.s=1/e<0?(h=h.slice(1),-1):1,F.DEBUG&&h.replace(/^0\.0*|\./,``).length>15)throw Error(s+e)}else g.s=h.charCodeAt(0)===45?(h=h.slice(1),-1):1;for(i=P.slice(0,t),d=f=0,m=h.length;f<m;f++)if(i.indexOf(o=h.charAt(f))<0){if(o==`.`){if(f>d){d=m;continue}}else if(!c&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){c=!0,f=-1,d=0;continue}return S(g,String(e),p,t)}p=!1,h=n(h,t,10,g.s),(d=h.indexOf(`.`))>-1?h=h.replace(`.`,``):d=h.length}for(f=0;h.charCodeAt(f)===48;f++);for(m=h.length;h.charCodeAt(--m)===48;);if(h=h.slice(f,++m)){if(m-=f,p&&F.DEBUG&&m>15&&(e>u||e!==a(e)))throw Error(s+g.s*e);if((d=d-f-1)>A)g.c=g.e=null;else if(d<k)g.c=[g.e=0];else{if(g.e=d,g.c=[],f=(d+1)%l,d<0&&(f+=l),f<m){for(f&&g.c.push(+h.slice(0,f)),m-=l;f<m;)g.c.push(+h.slice(f,f+=l));f=l-(h=h.slice(f)).length}else f-=m;for(;f--;h+=`0`);g.c.push(+h)}}else g.c=[g.e=0]}F.clone=m,F.ROUND_UP=0,F.ROUND_DOWN=1,F.ROUND_CEIL=2,F.ROUND_FLOOR=3,F.ROUND_HALF_UP=4,F.ROUND_HALF_DOWN=5,F.ROUND_HALF_EVEN=6,F.ROUND_HALF_CEIL=7,F.ROUND_HALF_FLOOR=8,F.EUCLID=9,F.config=F.set=function(e){var t,n;if(e!=null)if(typeof e==`object`){if(e.hasOwnProperty(t=`DECIMAL_PLACES`)&&(n=e[t],v(n,0,p,t),T=n),e.hasOwnProperty(t=`ROUNDING_MODE`)&&(n=e[t],v(n,0,8,t),E=n),e.hasOwnProperty(t=`EXPONENTIAL_AT`)&&(n=e[t],n&&n.pop?(v(n[0],-p,0,t),v(n[1],0,p,t),D=n[0],O=n[1]):(v(n,-p,p,t),D=-(O=n<0?-n:n))),e.hasOwnProperty(t=`RANGE`))if(n=e[t],n&&n.pop)v(n[0],-p,-1,t),v(n[1],1,p,t),k=n[0],A=n[1];else if(v(n,-p,p,t),n)k=-(A=n<0?-n:n);else throw Error(o+t+` cannot be zero: `+n);if(e.hasOwnProperty(t=`CRYPTO`))if(n=e[t],n===!!n)if(n)if(typeof crypto<`u`&&crypto&&(crypto.getRandomValues||crypto.randomBytes))j=n;else throw j=!n,Error(o+`crypto unavailable`);else j=n;else throw Error(o+t+` not true or false: `+n);if(e.hasOwnProperty(t=`MODULO_MODE`)&&(n=e[t],v(n,0,9,t),M=n),e.hasOwnProperty(t=`POW_PRECISION`)&&(n=e[t],v(n,0,p,t),N=n),e.hasOwnProperty(t=`FORMAT`))if(n=e[t],typeof n==`object`)ee=n;else throw Error(o+t+` not an object: `+n);if(e.hasOwnProperty(t=`ALPHABET`))if(n=e[t],typeof n==`string`&&!/^.?$|[+\-.\s]|(.).*\1/.test(n))te=n.slice(0,10)==`0123456789`,P=n;else throw Error(o+t+` invalid: `+n)}else throw Error(o+`Object expected: `+e);return{DECIMAL_PLACES:T,ROUNDING_MODE:E,EXPONENTIAL_AT:[D,O],RANGE:[k,A],CRYPTO:j,MODULO_MODE:M,POW_PRECISION:N,FORMAT:ee,ALPHABET:P}},F.isBigNumber=function(e){if(!e||e._isBigNumber!==!0)return!1;if(!F.DEBUG)return!0;var t,n,r=e.c,i=e.e,s=e.s;out:if({}.toString.call(r)==`[object Array]`){if((s===1||s===-1)&&i>=-p&&i<=p&&i===a(i)){if(r[0]===0){if(i===0&&r.length===1)return!0;break out}if(t=(i+1)%l,t<1&&(t+=l),String(r[0]).length==t){for(t=0;t<r.length;t++)if(n=r[t],n<0||n>=c||n!==a(n))break out;if(n!==0)return!0}}}else if(r===null&&i===null&&(s===null||s===1||s===-1))return!0;throw Error(o+`Invalid BigNumber: `+e)},F.maximum=F.max=function(){return re(arguments,-1)},F.minimum=F.min=function(){return re(arguments,1)},F.random=(function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return a(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(e){var n,r,s,c,u,f=0,m=[],h=new F(w);if(e==null?e=T:v(e,0,p),c=i(e/l),j)if(crypto.getRandomValues){for(n=crypto.getRandomValues(new Uint32Array(c*=2));f<c;)u=n[f]*131072+(n[f+1]>>>11),u>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),n[f]=r[0],n[f+1]=r[1]):(m.push(u%0x5af3107a4000),f+=2);f=c/2}else if(crypto.randomBytes){for(n=crypto.randomBytes(c*=7);f<c;)u=(n[f]&31)*281474976710656+n[f+1]*1099511627776+n[f+2]*4294967296+n[f+3]*16777216+(n[f+4]<<16)+(n[f+5]<<8)+n[f+6],u>=9e15?crypto.randomBytes(7).copy(n,f):(m.push(u%0x5af3107a4000),f+=7);f=c/7}else throw j=!1,Error(o+`crypto unavailable`);if(!j)for(;f<c;)u=t(),u<9e15&&(m[f++]=u%0x5af3107a4000);for(c=m[--f],e%=l,c&&e&&(u=d[l-e],m[f]=a(c/u)*u);m[f]===0;m.pop(),f--);if(f<0)m=[s=0];else{for(s=-1;m[0]===0;m.splice(0,1),s-=l);for(f=1,u=m[0];u>=10;u/=10,f++);f<l&&(s-=l-f)}return h.e=s,h.c=m,h}})(),F.sum=function(){for(var e=1,t=arguments,n=new F(t[0]);e<t.length;)n=n.plus(t[e++]);return n},n=(function(){var e=`0123456789`;function n(e,t,n,r){for(var i,a=[0],o,s=0,c=e.length;s<c;){for(o=a.length;o--;a[o]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>n-1&&(a[i+1]??(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(r,i,a,o,s){var c,l,u,d,f,p,m,h,_=r.indexOf(`.`),v=T,y=E;for(_>=0&&(d=N,N=0,r=r.replace(`.`,``),h=new F(i),p=h.pow(r.length-_),N=d,h.c=n(x(g(p.c),p.e,`0`),10,a,e),h.e=h.c.length),m=n(r,i,a,s?(c=P,e):(c=e,P)),u=d=m.length;m[--d]==0;m.pop());if(!m[0])return c.charAt(0);if(_<0?--u:(p.c=m,p.e=u,p.s=o,p=t(p,h,v,y,a),m=p.c,f=p.r,u=p.e),l=u+v+1,_=m[l],d=a/2,f=f||l<0||m[l+1]!=null,f=y<4?(_!=null||f)&&(y==0||y==(p.s<0?3:2)):_>d||_==d&&(y==4||f||y==6&&m[l-1]&1||y==(p.s<0?8:7)),l<1||!m[0])r=f?x(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(m.length=l,f)for(--a;++m[--l]>a;)m[l]=0,l||(++u,m=[1].concat(m));for(d=m.length;!m[--d];);for(_=0,r=``;_<=d;r+=c.charAt(m[_++]));r=x(r,u,c.charAt(0))}return r}})(),t=(function(){function e(e,t,n){var r,i,a,o,s=0,c=e.length,l=t%f,u=t/f|0;for(e=e.slice();c--;)a=e[c]%f,o=e[c]/f|0,r=u*a+o*l,i=l*a+r%f*f+s,s=(i/n|0)+(r/f|0)+u*o,e[c]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,i,o,s,u){var d,f,p,m,g,_,v,y,b,x,S,C,w,T,E,D,O,k=r.s==i.s?1:-1,A=r.c,j=i.c;if(!A||!A[0]||!j||!j[0])return new F(!r.s||!i.s||(A?j&&A[0]==j[0]:!j)?NaN:A&&A[0]==0||!j?k*0:k/0);for(y=new F(k),b=y.c=[],f=r.e-i.e,k=o+f+1,u||(u=c,f=h(r.e/l)-h(i.e/l),k=k/l|0),p=0;j[p]==(A[p]||0);p++);if(j[p]>(A[p]||0)&&f--,k<0)b.push(1),m=!0;else{for(T=A.length,D=j.length,p=0,k+=2,g=a(u/(j[0]+1)),g>1&&(j=e(j,g,u),A=e(A,g,u),D=j.length,T=A.length),w=D,x=A.slice(0,D),S=x.length;S<D;x[S++]=0);O=j.slice(),O=[0].concat(O),E=j[0],j[1]>=u/2&&E++;do{if(g=0,d=t(j,x,D,S),d<0){if(C=x[0],D!=S&&(C=C*u+(x[1]||0)),g=a(C/E),g>1)for(g>=u&&(g=u-1),_=e(j,g,u),v=_.length,S=x.length;t(_,x,v,S)==1;)g--,n(_,D<v?O:j,v,u),v=_.length,d=1;else g==0&&(d=g=1),_=j.slice(),v=_.length;if(v<S&&(_=[0].concat(_)),n(x,_,S,u),S=x.length,d==-1)for(;t(j,x,D,S)<1;)g++,n(x,D<S?O:j,S,u),S=x.length}else d===0&&(g++,x=[0]);b[p++]=g,x[0]?x[S++]=A[w]||0:(x=[A[w]],S=1)}while((w++<T||x[0]!=null)&&k--);m=x[0]!=null,b[0]||b.splice(0,1)}if(u==c){for(p=1,k=b[0];k>=10;k/=10,p++);L(y,o+(y.e=p+f*l-1)+1,s,m)}else y.e=f,y.r=+m;return y}})();function ne(e,t,n,r){var i,a,o,s,c;if(n==null?n=E:v(n,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,t==null)c=g(e.c),c=r==1||r==2&&(o<=D||o>=O)?b(c,o):x(c,o,`0`);else if(e=L(new F(e),t,n),a=e.e,c=g(e.c),s=c.length,r==1||r==2&&(t<=a||a<=D)){for(;s<t;c+=`0`,s++);c=b(c,a)}else if(t-=o+(r===2&&a>o),c=x(c,a,`0`),a+1>s){if(--t>0)for(c+=`.`;t--;c+=`0`);}else if(t+=a-s,t>0)for(a+1==s&&(c+=`.`);t--;c+=`0`);return e.s<0&&i?`-`+c:c}function re(e,t){for(var n,r,i=1,a=new F(e[0]);i<e.length;i++)r=new F(e[i]),(!r.s||(n=_(a,r))===t||n===0&&a.s===t)&&(a=r);return a}function I(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*l-1)>A?e.c=e.e=null:n<k?e.c=[e.e=0]:(e.e=n,e.c=t),e}S=(function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,n=/^\.([^.]+)$/,r=/^-?(Infinity|NaN)$/,i=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(a,s,c,l){var u,d=c?s:s.replace(i,``);if(r.test(d))a.s=isNaN(d)?null:d<0?-1:1;else{if(!c&&(d=d.replace(e,function(e,t,n){return u=(n=n.toLowerCase())==`x`?16:n==`b`?2:8,!l||l==u?t:e}),l&&(u=l,d=d.replace(t,`$1`).replace(n,`0.$1`)),s!=d))return new F(d,u);if(F.DEBUG)throw Error(o+`Not a`+(l?` base `+l:``)+` number: `+s);a.s=null}a.c=a.e=null}})();function L(e,t,n,r){var o,s,u,f,p,m,h,g=e.c,_=d;if(g){out:{for(o=1,f=g[0];f>=10;f/=10,o++);if(s=t-o,s<0)s+=l,u=t,p=g[m=0],h=a(p/_[o-u-1]%10);else if(m=i((s+1)/l),m>=g.length)if(r){for(;g.length<=m;g.push(0));p=h=0,o=1,s%=l,u=s-l+1}else break out;else{for(p=f=g[m],o=1;f>=10;f/=10,o++);s%=l,u=s-l+o,h=u<0?0:a(p/_[o-u-1]%10)}if(r=r||t<0||g[m+1]!=null||(u<0?p:p%_[o-u-1]),r=n<4?(h||r)&&(n==0||n==(e.s<0?3:2)):h>5||h==5&&(n==4||r||n==6&&(s>0?u>0?p/_[o-u]:0:g[m-1])%10&1||n==(e.s<0?8:7)),t<1||!g[0])return g.length=0,r?(t-=e.e+1,g[0]=_[(l-t%l)%l],e.e=-t||0):g[0]=e.e=0,e;if(s==0?(g.length=m,f=1,m--):(g.length=m+1,f=_[l-s],g[m]=u>0?a(p/_[o-u]%_[u])*f:0),r)for(;;)if(m==0){for(s=1,u=g[0];u>=10;u/=10,s++);for(u=g[0]+=f,f=1;u>=10;u/=10,f++);s!=f&&(e.e++,g[0]==c&&(g[0]=1));break}else{if(g[m]+=f,g[m]!=c)break;g[m--]=0,f=1}for(s=g.length;g[--s]===0;g.pop());}e.e>A?e.c=e.e=null:e.e<k&&(e.c=[e.e=0])}return e}function R(e){var t,n=e.e;return n===null?e.toString():(t=g(e.c),t=n<=D||n>=O?b(t,n):x(t,n,`0`),e.s<0?`-`+t:t)}return C.absoluteValue=C.abs=function(){var e=new F(this);return e.s<0&&(e.s=1),e},C.comparedTo=function(e,t){return _(this,new F(e,t))},C.decimalPlaces=C.dp=function(e,t){var n,r,i,a=this;if(e!=null)return v(e,0,p),t==null?t=E:v(t,0,8),L(new F(a),e+a.e+1,t);if(!(n=a.c))return null;if(r=((i=n.length-1)-h(this.e/l))*l,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},C.dividedBy=C.div=function(e,n){return t(this,new F(e,n),T,E)},C.dividedToIntegerBy=C.idiv=function(e,n){return t(this,new F(e,n),0,1)},C.exponentiatedBy=C.pow=function(e,t){var n,r,s,c,u,d,f,p,m,h=this;if(e=new F(e),e.c&&!e.isInteger())throw Error(o+`Exponent not an integer: `+R(e));if(t!=null&&(t=new F(t)),d=e.e>14,!h.c||!h.c[0]||h.c[0]==1&&!h.e&&h.c.length==1||!e.c||!e.c[0])return m=new F(R(h)**(d?e.s*(2-y(e)):+R(e))),t?m.mod(t):m;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new F(NaN);r=!f&&h.isInteger()&&t.isInteger(),r&&(h=h.mod(t))}else if(e.e>9&&(h.e>0||h.e<-1||(h.e==0?h.c[0]>1||d&&h.c[1]>=24e7:h.c[0]<8e13||d&&h.c[0]<=9999975e7)))return c=h.s<0&&y(e)?-0:0,h.e>-1&&(c=1/c),new F(f?1/c:c);else N&&(c=i(N/l+2));for(d?(n=new F(.5),f&&(e.s=1),p=y(e)):(s=Math.abs(+R(e)),p=s%2),m=new F(w);;){if(p){if(m=m.times(h),!m.c)break;c?m.c.length>c&&(m.c.length=c):r&&(m=m.mod(t))}if(s){if(s=a(s/2),s===0)break;p=s%2}else if(e=e.times(n),L(e,e.e+1,1),e.e>14)p=y(e);else{if(s=+R(e),s===0)break;p=s%2}h=h.times(h),c?h.c&&h.c.length>c&&(h.c.length=c):r&&(h=h.mod(t))}return r?m:(f&&(m=w.div(m)),t?m.mod(t):c?L(m,N,E,u):m)},C.integerValue=function(e){var t=new F(this);return e==null?e=E:v(e,0,8),L(t,t.e+1,e)},C.isEqualTo=C.eq=function(e,t){return _(this,new F(e,t))===0},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(e,t){return _(this,new F(e,t))>0},C.isGreaterThanOrEqualTo=C.gte=function(e,t){return(t=_(this,new F(e,t)))===1||t===0},C.isInteger=function(){return!!this.c&&h(this.e/l)>this.c.length-2},C.isLessThan=C.lt=function(e,t){return _(this,new F(e,t))<0},C.isLessThanOrEqualTo=C.lte=function(e,t){return(t=_(this,new F(e,t)))===-1||t===0},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&this.c[0]==0},C.minus=function(e,t){var n,r,i,a,o=this,s=o.s;if(e=new F(e,t),t=e.s,!s||!t)return new F(NaN);if(s!=t)return e.s=-t,o.plus(e);var u=o.e/l,d=e.e/l,f=o.c,p=e.c;if(!u||!d){if(!f||!p)return f?(e.s=-t,e):new F(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new F(f[0]?o:E==3?-0:0)}if(u=h(u),d=h(d),f=f.slice(),s=u-d){for((a=s<0)?(s=-s,i=f):(d=u,i=p),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(r=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;t<r;t++)if(f[t]!=p[t]){a=f[t]<p[t];break}if(a&&(i=f,f=p,p=i,e.s=-e.s),t=(r=p.length)-(n=f.length),t>0)for(;t--;f[n++]=0);for(t=c-1;r>s;){if(f[--r]<p[r]){for(n=r;n&&!f[--n];f[n]=t);--f[n],f[r]+=c}f[r]-=p[r]}for(;f[0]==0;f.splice(0,1),--d);return f[0]?I(e,f,d):(e.s=E==3?-1:1,e.c=[e.e=0],e)},C.modulo=C.mod=function(e,n){var r,i,a=this;return e=new F(e,n),!a.c||!e.s||e.c&&!e.c[0]?new F(NaN):!e.c||a.c&&!a.c[0]?new F(a):(M==9?(i=e.s,e.s=1,r=t(a,e,0,3),e.s=i,r.s*=i):r=t(a,e,0,M),e=a.minus(r.times(e)),!e.c[0]&&M==1&&(e.s=a.s),e)},C.multipliedBy=C.times=function(e,t){var n,r,i,a,o,s,u,d,p,m,g,_,v,y,b,x=this,S=x.c,C=(e=new F(e,t)).c;if(!S||!C||!S[0]||!C[0])return!x.s||!e.s||S&&!S[0]&&!C||C&&!C[0]&&!S?e.c=e.e=e.s=null:(e.s*=x.s,!S||!C?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(r=h(x.e/l)+h(e.e/l),e.s*=x.s,u=S.length,m=C.length,u<m&&(v=S,S=C,C=v,i=u,u=m,m=i),i=u+m,v=[];i--;v.push(0));for(y=c,b=f,i=m;--i>=0;){for(n=0,g=C[i]%b,_=C[i]/b|0,o=u,a=i+o;a>i;)d=S[--o]%b,p=S[o]/b|0,s=_*d+p*g,d=g*d+s%b*b+v[a]+n,n=(d/y|0)+(s/b|0)+_*p,v[a--]=d%y;v[a]=n}return n?++r:v.splice(0,1),I(e,v,r)},C.negated=function(){var e=new F(this);return e.s=-e.s||null,e},C.plus=function(e,t){var n,r=this,i=r.s;if(e=new F(e,t),t=e.s,!i||!t)return new F(NaN);if(i!=t)return e.s=-t,r.minus(e);var a=r.e/l,o=e.e/l,s=r.c,u=e.c;if(!a||!o){if(!s||!u)return new F(i/0);if(!s[0]||!u[0])return u[0]?e:new F(s[0]?r:i*0)}if(a=h(a),o=h(o),s=s.slice(),i=a-o){for(i>0?(o=a,n=u):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for(i=s.length,t=u.length,i-t<0&&(n=u,u=s,s=n,t=i),i=0;t;)i=(s[--t]=s[t]+u[t]+i)/c|0,s[t]=c===s[t]?0:s[t]%c;return i&&(s=[i].concat(s),++o),I(e,s,o)},C.precision=C.sd=function(e,t){var n,r,i,a=this;if(e!=null&&e!==!!e)return v(e,1,p),t==null?t=E:v(t,0,8),L(new F(a),e,t);if(!(n=a.c))return null;if(i=n.length-1,r=i*l+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&a.e+1>r&&(r=a.e+1),r},C.shiftedBy=function(e){return v(e,-u,u),this.times(`1e`+e)},C.squareRoot=C.sqrt=function(){var e,n,r,i,a,o=this,s=o.c,c=o.s,l=o.e,u=T+4,d=new F(`0.5`);if(c!==1||!s||!s[0])return new F(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);if(c=Math.sqrt(+R(o)),c==0||c==1/0?(n=g(s),(n.length+l)%2==0&&(n+=`0`),c=Math.sqrt(+n),l=h((l+1)/2)-(l<0||l%2),c==1/0?n=`5e`+l:(n=c.toExponential(),n=n.slice(0,n.indexOf(`e`)+1)+l),r=new F(n)):r=new F(c+``),r.c[0]){for(l=r.e,c=l+u,c<3&&(c=0);;)if(a=r,r=d.times(a.plus(t(o,a,u,1))),g(a.c).slice(0,c)===(n=g(r.c)).slice(0,c))if(r.e<l&&--c,n=n.slice(c-3,c+1),n==`9999`||!i&&n==`4999`){if(!i&&(L(a,a.e+T+2,0),a.times(a).eq(o))){r=a;break}u+=4,c+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)==`5`)&&(L(r,r.e+T+2,1),e=!r.times(r).eq(o));break}}return L(r,r.e+T+1,E,e)},C.toExponential=function(e,t){return e!=null&&(v(e,0,p),e++),ne(this,e,t,1)},C.toFixed=function(e,t){return e!=null&&(v(e,0,p),e=e+this.e+1),ne(this,e,t)},C.toFormat=function(e,t,n){var r,i=this;if(n==null)e!=null&&t&&typeof t==`object`?(n=t,t=null):e&&typeof e==`object`?(n=e,e=t=null):n=ee;else if(typeof n!=`object`)throw Error(o+`Argument not an object: `+n);if(r=i.toFixed(e,t),i.c){var a,s=r.split(`.`),c=+n.groupSize,l=+n.secondaryGroupSize,u=n.groupSeparator||``,d=s[0],f=s[1],p=i.s<0,m=p?d.slice(1):d,h=m.length;if(l&&(a=c,c=l,l=a,h-=a),c>0&&h>0){for(a=h%c||c,d=m.substr(0,a);a<h;a+=c)d+=u+m.substr(a,c);l>0&&(d+=u+m.slice(a)),p&&(d=`-`+d)}r=f?d+(n.decimalSeparator||``)+((l=+n.fractionGroupSize)?f.replace(RegExp(`\\d{`+l+`}\\B`,`g`),`$&`+(n.fractionGroupSeparator||``)):f):d}return(n.prefix||``)+r+(n.suffix||``)},C.toFraction=function(e){var n,r,i,a,s,c,u,f,p,m,h,_,v=this,y=v.c;if(e!=null&&(u=new F(e),!u.isInteger()&&(u.c||u.s!==1)||u.lt(w)))throw Error(o+`Argument `+(u.isInteger()?`out of range: `:`not an integer: `)+R(u));if(!y)return new F(v);for(n=new F(w),p=r=new F(w),i=f=new F(w),_=g(y),s=n.e=_.length-v.e-1,n.c[0]=d[(c=s%l)<0?l+c:c],e=!e||u.comparedTo(n)>0?s>0?n:p:u,c=A,A=1/0,u=new F(_),f.c[0]=0;m=t(u,n,0,1),a=r.plus(m.times(i)),a.comparedTo(e)!=1;)r=i,i=a,p=f.plus(m.times(a=p)),f=a,n=u.minus(m.times(a=n)),u=a;return a=t(e.minus(r),i,0,1),f=f.plus(a.times(p)),r=r.plus(a.times(i)),f.s=p.s=v.s,s*=2,h=t(p,i,s,E).minus(v).abs().comparedTo(t(f,r,s,E).minus(v).abs())<1?[p,i]:[f,r],A=c,h},C.toNumber=function(){return+R(this)},C.toPrecision=function(e,t){return e!=null&&v(e,1,p),ne(this,e,t,2)},C.toString=function(e){var t,r=this,i=r.s,a=r.e;return a===null?i?(t=`Infinity`,i<0&&(t=`-`+t)):t=`NaN`:(e==null?t=a<=D||a>=O?b(g(r.c),a):x(g(r.c),a,`0`):e===10&&te?(r=L(new F(r),T+a+1,E),t=x(g(r.c),r.e,`0`)):(v(e,2,P.length,`Base`),t=n(x(g(r.c),a,`0`),10,e,i,!0)),i<0&&r.c[0]&&(t=`-`+t)),t},C.valueOf=C.toJSON=function(){return R(this)},C._isBigNumber=!0,e!=null&&F.set(e),F}function h(e){var t=e|0;return e>0||e===t?t:t-1}function g(e){for(var t,n,r=1,i=e.length,a=e[0]+``;r<i;){for(t=e[r++]+``,n=l-t.length;n--;t=`0`+t);a+=t}for(i=a.length;a.charCodeAt(--i)===48;);return a.slice(0,i+1||1)}function _(e,t){var n,r,i=e.c,a=t.c,o=e.s,s=t.s,c=e.e,l=t.e;if(!o||!s)return null;if(n=i&&!i[0],r=a&&!a[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=c==l,!i||!a)return r?0:!i^n?1:-1;if(!r)return c>l^n?1:-1;for(s=(c=i.length)<(l=a.length)?c:l,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^n?1:-1;return c==l?0:c>l^n?1:-1}function v(e,t,n,r){if(e<t||e>n||e!==a(e))throw Error(o+(r||`Argument`)+(typeof e==`number`?e<t||e>n?` out of range: `:` not an integer: `:` not a primitive number: `)+String(e))}function y(e){var t=e.c.length-1;return h(e.e/l)==t&&e.c[t]%2!=0}function b(e,t){return(e.length>1?e.charAt(0)+`.`+e.slice(1):e)+(t<0?`e`:`e+`)+t}function x(e,t,n){var r,i;if(t<0){for(i=n+`.`;++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+`.`+e.slice(t));return e}n=m(),n.default=n.BigNumber=n,typeof define==`function`&&define.amd?define(function(){return n}):t!==void 0&&t.exports?t.exports=n:(e||=typeof self<`u`&&self?self:window,e.BigNumber=n)})(e)})),w=n(((e,t)=>{var n=C(),r=t.exports;(function(){var e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,t,i,a={"\b":`\\b`," ":`\\t`,"\n":`\\n`,"\f":`\\f`,"\r":`\\r`,'"':`\\"`,"\\":`\\\\`},o;function s(t){return e.lastIndex=0,e.test(t)?`"`+t.replace(e,function(e){var t=a[e];return typeof t==`string`?t:`\\u`+(`0000`+e.charCodeAt(0).toString(16)).slice(-4)})+`"`:`"`+t+`"`}function c(e,r){var a,l,u,d,f=t,p,m=r[e],h=m!=null&&(m instanceof n||n.isBigNumber(m));switch(m&&typeof m==`object`&&typeof m.toJSON==`function`&&(m=m.toJSON(e)),typeof o==`function`&&(m=o.call(r,e,m)),typeof m){case`string`:return h?m:s(m);case`number`:return isFinite(m)?String(m):`null`;case`boolean`:case`null`:case`bigint`:return String(m);case`object`:if(!m)return`null`;if(t+=i,p=[],Object.prototype.toString.apply(m)===`[object Array]`){for(d=m.length,a=0;a<d;a+=1)p[a]=c(a,m)||`null`;return u=p.length===0?`[]`:t?`[
|
|
4
|
+
`;yield n}static#a;static#o;static async#s(){return this.#a||=(await import(`./dist-BgzWr9oi.mjs`).then(e=>t(e.default))).HttpsProxyAgent,this.#a}static async#c(){let e=typeof window<`u`&&!!window;return this.#o||=e?window.fetch:(await import(`./src-C1Ztzxmo.mjs`)).default,this.#o}static mergeHeaders(e,...t){e=e instanceof Headers?e:new Headers(e);for(let n of t)(n instanceof Headers?n:new Headers(n)).forEach((t,n)=>{n===`set-cookie`?e.append(n,t):e.set(n,t)});return e}};n.Gaxios=f,i=f})),S=n((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.instance=e.Gaxios=e.GaxiosError=void 0,e.request=a;let r=x();Object.defineProperty(e,`Gaxios`,{enumerable:!0,get:function(){return r.Gaxios}});var i=v();Object.defineProperty(e,`GaxiosError`,{enumerable:!0,get:function(){return i.GaxiosError}}),n(b(),e),e.instance=new r.Gaxios;async function a(t){return e.instance.request(t)}})),C=n(((e,t)=>{(function(e){var n,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,a=Math.floor,o=`[BigNumber Error] `,s=o+`Number primitive has more than 15 significant digits: `,c=0x5af3107a4000,l=14,u=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,0xe8d4a51000,0x9184e72a000],f=1e7,p=1e9;function m(e){var t,n,S,C=F.prototype={constructor:F,toString:null,valueOf:null},w=new F(1),T=20,E=4,D=-7,O=21,k=-1e7,A=1e7,j=!1,M=1,N=0,ee={prefix:``,groupSize:3,secondaryGroupSize:0,groupSeparator:`,`,decimalSeparator:`.`,fractionGroupSize:0,fractionGroupSeparator:`\xA0`,suffix:``},P=`0123456789abcdefghijklmnopqrstuvwxyz`,te=!0;function F(e,t){var i,o,c,d,f,p,m,h,g=this;if(!(g instanceof F))return new F(e,t);if(t==null){if(e&&e._isBigNumber===!0){g.s=e.s,!e.c||e.e>A?g.c=g.e=null:e.e<k?g.c=[g.e=0]:(g.e=e.e,g.c=e.c.slice());return}if((p=typeof e==`number`)&&e*0==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(d=0,f=e;f>=10;f/=10,d++);d>A?g.c=g.e=null:(g.e=d,g.c=[e]);return}h=String(e)}else{if(!r.test(h=String(e)))return S(g,h,p);g.s=h.charCodeAt(0)==45?(h=h.slice(1),-1):1}(d=h.indexOf(`.`))>-1&&(h=h.replace(`.`,``)),(f=h.search(/e/i))>0?(d<0&&(d=f),d+=+h.slice(f+1),h=h.substring(0,f)):d<0&&(d=h.length)}else{if(v(t,2,P.length,`Base`),t==10&&te)return g=new F(e),L(g,T+g.e+1,E);if(h=String(e),p=typeof e==`number`){if(e*0!=0)return S(g,h,p,t);if(g.s=1/e<0?(h=h.slice(1),-1):1,F.DEBUG&&h.replace(/^0\.0*|\./,``).length>15)throw Error(s+e)}else g.s=h.charCodeAt(0)===45?(h=h.slice(1),-1):1;for(i=P.slice(0,t),d=f=0,m=h.length;f<m;f++)if(i.indexOf(o=h.charAt(f))<0){if(o==`.`){if(f>d){d=m;continue}}else if(!c&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){c=!0,f=-1,d=0;continue}return S(g,String(e),p,t)}p=!1,h=n(h,t,10,g.s),(d=h.indexOf(`.`))>-1?h=h.replace(`.`,``):d=h.length}for(f=0;h.charCodeAt(f)===48;f++);for(m=h.length;h.charCodeAt(--m)===48;);if(h=h.slice(f,++m)){if(m-=f,p&&F.DEBUG&&m>15&&(e>u||e!==a(e)))throw Error(s+g.s*e);if((d=d-f-1)>A)g.c=g.e=null;else if(d<k)g.c=[g.e=0];else{if(g.e=d,g.c=[],f=(d+1)%l,d<0&&(f+=l),f<m){for(f&&g.c.push(+h.slice(0,f)),m-=l;f<m;)g.c.push(+h.slice(f,f+=l));f=l-(h=h.slice(f)).length}else f-=m;for(;f--;h+=`0`);g.c.push(+h)}}else g.c=[g.e=0]}F.clone=m,F.ROUND_UP=0,F.ROUND_DOWN=1,F.ROUND_CEIL=2,F.ROUND_FLOOR=3,F.ROUND_HALF_UP=4,F.ROUND_HALF_DOWN=5,F.ROUND_HALF_EVEN=6,F.ROUND_HALF_CEIL=7,F.ROUND_HALF_FLOOR=8,F.EUCLID=9,F.config=F.set=function(e){var t,n;if(e!=null)if(typeof e==`object`){if(e.hasOwnProperty(t=`DECIMAL_PLACES`)&&(n=e[t],v(n,0,p,t),T=n),e.hasOwnProperty(t=`ROUNDING_MODE`)&&(n=e[t],v(n,0,8,t),E=n),e.hasOwnProperty(t=`EXPONENTIAL_AT`)&&(n=e[t],n&&n.pop?(v(n[0],-p,0,t),v(n[1],0,p,t),D=n[0],O=n[1]):(v(n,-p,p,t),D=-(O=n<0?-n:n))),e.hasOwnProperty(t=`RANGE`))if(n=e[t],n&&n.pop)v(n[0],-p,-1,t),v(n[1],1,p,t),k=n[0],A=n[1];else if(v(n,-p,p,t),n)k=-(A=n<0?-n:n);else throw Error(o+t+` cannot be zero: `+n);if(e.hasOwnProperty(t=`CRYPTO`))if(n=e[t],n===!!n)if(n)if(typeof crypto<`u`&&crypto&&(crypto.getRandomValues||crypto.randomBytes))j=n;else throw j=!n,Error(o+`crypto unavailable`);else j=n;else throw Error(o+t+` not true or false: `+n);if(e.hasOwnProperty(t=`MODULO_MODE`)&&(n=e[t],v(n,0,9,t),M=n),e.hasOwnProperty(t=`POW_PRECISION`)&&(n=e[t],v(n,0,p,t),N=n),e.hasOwnProperty(t=`FORMAT`))if(n=e[t],typeof n==`object`)ee=n;else throw Error(o+t+` not an object: `+n);if(e.hasOwnProperty(t=`ALPHABET`))if(n=e[t],typeof n==`string`&&!/^.?$|[+\-.\s]|(.).*\1/.test(n))te=n.slice(0,10)==`0123456789`,P=n;else throw Error(o+t+` invalid: `+n)}else throw Error(o+`Object expected: `+e);return{DECIMAL_PLACES:T,ROUNDING_MODE:E,EXPONENTIAL_AT:[D,O],RANGE:[k,A],CRYPTO:j,MODULO_MODE:M,POW_PRECISION:N,FORMAT:ee,ALPHABET:P}},F.isBigNumber=function(e){if(!e||e._isBigNumber!==!0)return!1;if(!F.DEBUG)return!0;var t,n,r=e.c,i=e.e,s=e.s;out:if({}.toString.call(r)==`[object Array]`){if((s===1||s===-1)&&i>=-p&&i<=p&&i===a(i)){if(r[0]===0){if(i===0&&r.length===1)return!0;break out}if(t=(i+1)%l,t<1&&(t+=l),String(r[0]).length==t){for(t=0;t<r.length;t++)if(n=r[t],n<0||n>=c||n!==a(n))break out;if(n!==0)return!0}}}else if(r===null&&i===null&&(s===null||s===1||s===-1))return!0;throw Error(o+`Invalid BigNumber: `+e)},F.maximum=F.max=function(){return re(arguments,-1)},F.minimum=F.min=function(){return re(arguments,1)},F.random=(function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return a(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(e){var n,r,s,c,u,f=0,m=[],h=new F(w);if(e==null?e=T:v(e,0,p),c=i(e/l),j)if(crypto.getRandomValues){for(n=crypto.getRandomValues(new Uint32Array(c*=2));f<c;)u=n[f]*131072+(n[f+1]>>>11),u>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),n[f]=r[0],n[f+1]=r[1]):(m.push(u%0x5af3107a4000),f+=2);f=c/2}else if(crypto.randomBytes){for(n=crypto.randomBytes(c*=7);f<c;)u=(n[f]&31)*281474976710656+n[f+1]*1099511627776+n[f+2]*4294967296+n[f+3]*16777216+(n[f+4]<<16)+(n[f+5]<<8)+n[f+6],u>=9e15?crypto.randomBytes(7).copy(n,f):(m.push(u%0x5af3107a4000),f+=7);f=c/7}else throw j=!1,Error(o+`crypto unavailable`);if(!j)for(;f<c;)u=t(),u<9e15&&(m[f++]=u%0x5af3107a4000);for(c=m[--f],e%=l,c&&e&&(u=d[l-e],m[f]=a(c/u)*u);m[f]===0;m.pop(),f--);if(f<0)m=[s=0];else{for(s=-1;m[0]===0;m.splice(0,1),s-=l);for(f=1,u=m[0];u>=10;u/=10,f++);f<l&&(s-=l-f)}return h.e=s,h.c=m,h}})(),F.sum=function(){for(var e=1,t=arguments,n=new F(t[0]);e<t.length;)n=n.plus(t[e++]);return n},n=(function(){var e=`0123456789`;function n(e,t,n,r){for(var i,a=[0],o,s=0,c=e.length;s<c;){for(o=a.length;o--;a[o]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>n-1&&(a[i+1]??(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(r,i,a,o,s){var c,l,u,d,f,p,m,h,_=r.indexOf(`.`),v=T,y=E;for(_>=0&&(d=N,N=0,r=r.replace(`.`,``),h=new F(i),p=h.pow(r.length-_),N=d,h.c=n(x(g(p.c),p.e,`0`),10,a,e),h.e=h.c.length),m=n(r,i,a,s?(c=P,e):(c=e,P)),u=d=m.length;m[--d]==0;m.pop());if(!m[0])return c.charAt(0);if(_<0?--u:(p.c=m,p.e=u,p.s=o,p=t(p,h,v,y,a),m=p.c,f=p.r,u=p.e),l=u+v+1,_=m[l],d=a/2,f=f||l<0||m[l+1]!=null,f=y<4?(_!=null||f)&&(y==0||y==(p.s<0?3:2)):_>d||_==d&&(y==4||f||y==6&&m[l-1]&1||y==(p.s<0?8:7)),l<1||!m[0])r=f?x(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(m.length=l,f)for(--a;++m[--l]>a;)m[l]=0,l||(++u,m=[1].concat(m));for(d=m.length;!m[--d];);for(_=0,r=``;_<=d;r+=c.charAt(m[_++]));r=x(r,u,c.charAt(0))}return r}})(),t=(function(){function e(e,t,n){var r,i,a,o,s=0,c=e.length,l=t%f,u=t/f|0;for(e=e.slice();c--;)a=e[c]%f,o=e[c]/f|0,r=u*a+o*l,i=l*a+r%f*f+s,s=(i/n|0)+(r/f|0)+u*o,e[c]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,i,o,s,u){var d,f,p,m,g,_,v,y,b,x,S,C,w,T,E,D,O,k=r.s==i.s?1:-1,A=r.c,j=i.c;if(!A||!A[0]||!j||!j[0])return new F(!r.s||!i.s||(A?j&&A[0]==j[0]:!j)?NaN:A&&A[0]==0||!j?k*0:k/0);for(y=new F(k),b=y.c=[],f=r.e-i.e,k=o+f+1,u||(u=c,f=h(r.e/l)-h(i.e/l),k=k/l|0),p=0;j[p]==(A[p]||0);p++);if(j[p]>(A[p]||0)&&f--,k<0)b.push(1),m=!0;else{for(T=A.length,D=j.length,p=0,k+=2,g=a(u/(j[0]+1)),g>1&&(j=e(j,g,u),A=e(A,g,u),D=j.length,T=A.length),w=D,x=A.slice(0,D),S=x.length;S<D;x[S++]=0);O=j.slice(),O=[0].concat(O),E=j[0],j[1]>=u/2&&E++;do{if(g=0,d=t(j,x,D,S),d<0){if(C=x[0],D!=S&&(C=C*u+(x[1]||0)),g=a(C/E),g>1)for(g>=u&&(g=u-1),_=e(j,g,u),v=_.length,S=x.length;t(_,x,v,S)==1;)g--,n(_,D<v?O:j,v,u),v=_.length,d=1;else g==0&&(d=g=1),_=j.slice(),v=_.length;if(v<S&&(_=[0].concat(_)),n(x,_,S,u),S=x.length,d==-1)for(;t(j,x,D,S)<1;)g++,n(x,D<S?O:j,S,u),S=x.length}else d===0&&(g++,x=[0]);b[p++]=g,x[0]?x[S++]=A[w]||0:(x=[A[w]],S=1)}while((w++<T||x[0]!=null)&&k--);m=x[0]!=null,b[0]||b.splice(0,1)}if(u==c){for(p=1,k=b[0];k>=10;k/=10,p++);L(y,o+(y.e=p+f*l-1)+1,s,m)}else y.e=f,y.r=+m;return y}})();function ne(e,t,n,r){var i,a,o,s,c;if(n==null?n=E:v(n,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,t==null)c=g(e.c),c=r==1||r==2&&(o<=D||o>=O)?b(c,o):x(c,o,`0`);else if(e=L(new F(e),t,n),a=e.e,c=g(e.c),s=c.length,r==1||r==2&&(t<=a||a<=D)){for(;s<t;c+=`0`,s++);c=b(c,a)}else if(t-=o+(r===2&&a>o),c=x(c,a,`0`),a+1>s){if(--t>0)for(c+=`.`;t--;c+=`0`);}else if(t+=a-s,t>0)for(a+1==s&&(c+=`.`);t--;c+=`0`);return e.s<0&&i?`-`+c:c}function re(e,t){for(var n,r,i=1,a=new F(e[0]);i<e.length;i++)r=new F(e[i]),(!r.s||(n=_(a,r))===t||n===0&&a.s===t)&&(a=r);return a}function I(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*l-1)>A?e.c=e.e=null:n<k?e.c=[e.e=0]:(e.e=n,e.c=t),e}S=(function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,n=/^\.([^.]+)$/,r=/^-?(Infinity|NaN)$/,i=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(a,s,c,l){var u,d=c?s:s.replace(i,``);if(r.test(d))a.s=isNaN(d)?null:d<0?-1:1;else{if(!c&&(d=d.replace(e,function(e,t,n){return u=(n=n.toLowerCase())==`x`?16:n==`b`?2:8,!l||l==u?t:e}),l&&(u=l,d=d.replace(t,`$1`).replace(n,`0.$1`)),s!=d))return new F(d,u);if(F.DEBUG)throw Error(o+`Not a`+(l?` base `+l:``)+` number: `+s);a.s=null}a.c=a.e=null}})();function L(e,t,n,r){var o,s,u,f,p,m,h,g=e.c,_=d;if(g){out:{for(o=1,f=g[0];f>=10;f/=10,o++);if(s=t-o,s<0)s+=l,u=t,p=g[m=0],h=a(p/_[o-u-1]%10);else if(m=i((s+1)/l),m>=g.length)if(r){for(;g.length<=m;g.push(0));p=h=0,o=1,s%=l,u=s-l+1}else break out;else{for(p=f=g[m],o=1;f>=10;f/=10,o++);s%=l,u=s-l+o,h=u<0?0:a(p/_[o-u-1]%10)}if(r=r||t<0||g[m+1]!=null||(u<0?p:p%_[o-u-1]),r=n<4?(h||r)&&(n==0||n==(e.s<0?3:2)):h>5||h==5&&(n==4||r||n==6&&(s>0?u>0?p/_[o-u]:0:g[m-1])%10&1||n==(e.s<0?8:7)),t<1||!g[0])return g.length=0,r?(t-=e.e+1,g[0]=_[(l-t%l)%l],e.e=-t||0):g[0]=e.e=0,e;if(s==0?(g.length=m,f=1,m--):(g.length=m+1,f=_[l-s],g[m]=u>0?a(p/_[o-u]%_[u])*f:0),r)for(;;)if(m==0){for(s=1,u=g[0];u>=10;u/=10,s++);for(u=g[0]+=f,f=1;u>=10;u/=10,f++);s!=f&&(e.e++,g[0]==c&&(g[0]=1));break}else{if(g[m]+=f,g[m]!=c)break;g[m--]=0,f=1}for(s=g.length;g[--s]===0;g.pop());}e.e>A?e.c=e.e=null:e.e<k&&(e.c=[e.e=0])}return e}function R(e){var t,n=e.e;return n===null?e.toString():(t=g(e.c),t=n<=D||n>=O?b(t,n):x(t,n,`0`),e.s<0?`-`+t:t)}return C.absoluteValue=C.abs=function(){var e=new F(this);return e.s<0&&(e.s=1),e},C.comparedTo=function(e,t){return _(this,new F(e,t))},C.decimalPlaces=C.dp=function(e,t){var n,r,i,a=this;if(e!=null)return v(e,0,p),t==null?t=E:v(t,0,8),L(new F(a),e+a.e+1,t);if(!(n=a.c))return null;if(r=((i=n.length-1)-h(this.e/l))*l,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},C.dividedBy=C.div=function(e,n){return t(this,new F(e,n),T,E)},C.dividedToIntegerBy=C.idiv=function(e,n){return t(this,new F(e,n),0,1)},C.exponentiatedBy=C.pow=function(e,t){var n,r,s,c,u,d,f,p,m,h=this;if(e=new F(e),e.c&&!e.isInteger())throw Error(o+`Exponent not an integer: `+R(e));if(t!=null&&(t=new F(t)),d=e.e>14,!h.c||!h.c[0]||h.c[0]==1&&!h.e&&h.c.length==1||!e.c||!e.c[0])return m=new F(R(h)**(d?e.s*(2-y(e)):+R(e))),t?m.mod(t):m;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new F(NaN);r=!f&&h.isInteger()&&t.isInteger(),r&&(h=h.mod(t))}else if(e.e>9&&(h.e>0||h.e<-1||(h.e==0?h.c[0]>1||d&&h.c[1]>=24e7:h.c[0]<8e13||d&&h.c[0]<=9999975e7)))return c=h.s<0&&y(e)?-0:0,h.e>-1&&(c=1/c),new F(f?1/c:c);else N&&(c=i(N/l+2));for(d?(n=new F(.5),f&&(e.s=1),p=y(e)):(s=Math.abs(+R(e)),p=s%2),m=new F(w);;){if(p){if(m=m.times(h),!m.c)break;c?m.c.length>c&&(m.c.length=c):r&&(m=m.mod(t))}if(s){if(s=a(s/2),s===0)break;p=s%2}else if(e=e.times(n),L(e,e.e+1,1),e.e>14)p=y(e);else{if(s=+R(e),s===0)break;p=s%2}h=h.times(h),c?h.c&&h.c.length>c&&(h.c.length=c):r&&(h=h.mod(t))}return r?m:(f&&(m=w.div(m)),t?m.mod(t):c?L(m,N,E,u):m)},C.integerValue=function(e){var t=new F(this);return e==null?e=E:v(e,0,8),L(t,t.e+1,e)},C.isEqualTo=C.eq=function(e,t){return _(this,new F(e,t))===0},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(e,t){return _(this,new F(e,t))>0},C.isGreaterThanOrEqualTo=C.gte=function(e,t){return(t=_(this,new F(e,t)))===1||t===0},C.isInteger=function(){return!!this.c&&h(this.e/l)>this.c.length-2},C.isLessThan=C.lt=function(e,t){return _(this,new F(e,t))<0},C.isLessThanOrEqualTo=C.lte=function(e,t){return(t=_(this,new F(e,t)))===-1||t===0},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&this.c[0]==0},C.minus=function(e,t){var n,r,i,a,o=this,s=o.s;if(e=new F(e,t),t=e.s,!s||!t)return new F(NaN);if(s!=t)return e.s=-t,o.plus(e);var u=o.e/l,d=e.e/l,f=o.c,p=e.c;if(!u||!d){if(!f||!p)return f?(e.s=-t,e):new F(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new F(f[0]?o:E==3?-0:0)}if(u=h(u),d=h(d),f=f.slice(),s=u-d){for((a=s<0)?(s=-s,i=f):(d=u,i=p),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(r=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;t<r;t++)if(f[t]!=p[t]){a=f[t]<p[t];break}if(a&&(i=f,f=p,p=i,e.s=-e.s),t=(r=p.length)-(n=f.length),t>0)for(;t--;f[n++]=0);for(t=c-1;r>s;){if(f[--r]<p[r]){for(n=r;n&&!f[--n];f[n]=t);--f[n],f[r]+=c}f[r]-=p[r]}for(;f[0]==0;f.splice(0,1),--d);return f[0]?I(e,f,d):(e.s=E==3?-1:1,e.c=[e.e=0],e)},C.modulo=C.mod=function(e,n){var r,i,a=this;return e=new F(e,n),!a.c||!e.s||e.c&&!e.c[0]?new F(NaN):!e.c||a.c&&!a.c[0]?new F(a):(M==9?(i=e.s,e.s=1,r=t(a,e,0,3),e.s=i,r.s*=i):r=t(a,e,0,M),e=a.minus(r.times(e)),!e.c[0]&&M==1&&(e.s=a.s),e)},C.multipliedBy=C.times=function(e,t){var n,r,i,a,o,s,u,d,p,m,g,_,v,y,b,x=this,S=x.c,C=(e=new F(e,t)).c;if(!S||!C||!S[0]||!C[0])return!x.s||!e.s||S&&!S[0]&&!C||C&&!C[0]&&!S?e.c=e.e=e.s=null:(e.s*=x.s,!S||!C?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(r=h(x.e/l)+h(e.e/l),e.s*=x.s,u=S.length,m=C.length,u<m&&(v=S,S=C,C=v,i=u,u=m,m=i),i=u+m,v=[];i--;v.push(0));for(y=c,b=f,i=m;--i>=0;){for(n=0,g=C[i]%b,_=C[i]/b|0,o=u,a=i+o;a>i;)d=S[--o]%b,p=S[o]/b|0,s=_*d+p*g,d=g*d+s%b*b+v[a]+n,n=(d/y|0)+(s/b|0)+_*p,v[a--]=d%y;v[a]=n}return n?++r:v.splice(0,1),I(e,v,r)},C.negated=function(){var e=new F(this);return e.s=-e.s||null,e},C.plus=function(e,t){var n,r=this,i=r.s;if(e=new F(e,t),t=e.s,!i||!t)return new F(NaN);if(i!=t)return e.s=-t,r.minus(e);var a=r.e/l,o=e.e/l,s=r.c,u=e.c;if(!a||!o){if(!s||!u)return new F(i/0);if(!s[0]||!u[0])return u[0]?e:new F(s[0]?r:i*0)}if(a=h(a),o=h(o),s=s.slice(),i=a-o){for(i>0?(o=a,n=u):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for(i=s.length,t=u.length,i-t<0&&(n=u,u=s,s=n,t=i),i=0;t;)i=(s[--t]=s[t]+u[t]+i)/c|0,s[t]=c===s[t]?0:s[t]%c;return i&&(s=[i].concat(s),++o),I(e,s,o)},C.precision=C.sd=function(e,t){var n,r,i,a=this;if(e!=null&&e!==!!e)return v(e,1,p),t==null?t=E:v(t,0,8),L(new F(a),e,t);if(!(n=a.c))return null;if(i=n.length-1,r=i*l+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&a.e+1>r&&(r=a.e+1),r},C.shiftedBy=function(e){return v(e,-u,u),this.times(`1e`+e)},C.squareRoot=C.sqrt=function(){var e,n,r,i,a,o=this,s=o.c,c=o.s,l=o.e,u=T+4,d=new F(`0.5`);if(c!==1||!s||!s[0])return new F(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);if(c=Math.sqrt(+R(o)),c==0||c==1/0?(n=g(s),(n.length+l)%2==0&&(n+=`0`),c=Math.sqrt(+n),l=h((l+1)/2)-(l<0||l%2),c==1/0?n=`5e`+l:(n=c.toExponential(),n=n.slice(0,n.indexOf(`e`)+1)+l),r=new F(n)):r=new F(c+``),r.c[0]){for(l=r.e,c=l+u,c<3&&(c=0);;)if(a=r,r=d.times(a.plus(t(o,a,u,1))),g(a.c).slice(0,c)===(n=g(r.c)).slice(0,c))if(r.e<l&&--c,n=n.slice(c-3,c+1),n==`9999`||!i&&n==`4999`){if(!i&&(L(a,a.e+T+2,0),a.times(a).eq(o))){r=a;break}u+=4,c+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)==`5`)&&(L(r,r.e+T+2,1),e=!r.times(r).eq(o));break}}return L(r,r.e+T+1,E,e)},C.toExponential=function(e,t){return e!=null&&(v(e,0,p),e++),ne(this,e,t,1)},C.toFixed=function(e,t){return e!=null&&(v(e,0,p),e=e+this.e+1),ne(this,e,t)},C.toFormat=function(e,t,n){var r,i=this;if(n==null)e!=null&&t&&typeof t==`object`?(n=t,t=null):e&&typeof e==`object`?(n=e,e=t=null):n=ee;else if(typeof n!=`object`)throw Error(o+`Argument not an object: `+n);if(r=i.toFixed(e,t),i.c){var a,s=r.split(`.`),c=+n.groupSize,l=+n.secondaryGroupSize,u=n.groupSeparator||``,d=s[0],f=s[1],p=i.s<0,m=p?d.slice(1):d,h=m.length;if(l&&(a=c,c=l,l=a,h-=a),c>0&&h>0){for(a=h%c||c,d=m.substr(0,a);a<h;a+=c)d+=u+m.substr(a,c);l>0&&(d+=u+m.slice(a)),p&&(d=`-`+d)}r=f?d+(n.decimalSeparator||``)+((l=+n.fractionGroupSize)?f.replace(RegExp(`\\d{`+l+`}\\B`,`g`),`$&`+(n.fractionGroupSeparator||``)):f):d}return(n.prefix||``)+r+(n.suffix||``)},C.toFraction=function(e){var n,r,i,a,s,c,u,f,p,m,h,_,v=this,y=v.c;if(e!=null&&(u=new F(e),!u.isInteger()&&(u.c||u.s!==1)||u.lt(w)))throw Error(o+`Argument `+(u.isInteger()?`out of range: `:`not an integer: `)+R(u));if(!y)return new F(v);for(n=new F(w),p=r=new F(w),i=f=new F(w),_=g(y),s=n.e=_.length-v.e-1,n.c[0]=d[(c=s%l)<0?l+c:c],e=!e||u.comparedTo(n)>0?s>0?n:p:u,c=A,A=1/0,u=new F(_),f.c[0]=0;m=t(u,n,0,1),a=r.plus(m.times(i)),a.comparedTo(e)!=1;)r=i,i=a,p=f.plus(m.times(a=p)),f=a,n=u.minus(m.times(a=n)),u=a;return a=t(e.minus(r),i,0,1),f=f.plus(a.times(p)),r=r.plus(a.times(i)),f.s=p.s=v.s,s*=2,h=t(p,i,s,E).minus(v).abs().comparedTo(t(f,r,s,E).minus(v).abs())<1?[p,i]:[f,r],A=c,h},C.toNumber=function(){return+R(this)},C.toPrecision=function(e,t){return e!=null&&v(e,1,p),ne(this,e,t,2)},C.toString=function(e){var t,r=this,i=r.s,a=r.e;return a===null?i?(t=`Infinity`,i<0&&(t=`-`+t)):t=`NaN`:(e==null?t=a<=D||a>=O?b(g(r.c),a):x(g(r.c),a,`0`):e===10&&te?(r=L(new F(r),T+a+1,E),t=x(g(r.c),r.e,`0`)):(v(e,2,P.length,`Base`),t=n(x(g(r.c),a,`0`),10,e,i,!0)),i<0&&r.c[0]&&(t=`-`+t)),t},C.valueOf=C.toJSON=function(){return R(this)},C._isBigNumber=!0,e!=null&&F.set(e),F}function h(e){var t=e|0;return e>0||e===t?t:t-1}function g(e){for(var t,n,r=1,i=e.length,a=e[0]+``;r<i;){for(t=e[r++]+``,n=l-t.length;n--;t=`0`+t);a+=t}for(i=a.length;a.charCodeAt(--i)===48;);return a.slice(0,i+1||1)}function _(e,t){var n,r,i=e.c,a=t.c,o=e.s,s=t.s,c=e.e,l=t.e;if(!o||!s)return null;if(n=i&&!i[0],r=a&&!a[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=c==l,!i||!a)return r?0:!i^n?1:-1;if(!r)return c>l^n?1:-1;for(s=(c=i.length)<(l=a.length)?c:l,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^n?1:-1;return c==l?0:c>l^n?1:-1}function v(e,t,n,r){if(e<t||e>n||e!==a(e))throw Error(o+(r||`Argument`)+(typeof e==`number`?e<t||e>n?` out of range: `:` not an integer: `:` not a primitive number: `)+String(e))}function y(e){var t=e.c.length-1;return h(e.e/l)==t&&e.c[t]%2!=0}function b(e,t){return(e.length>1?e.charAt(0)+`.`+e.slice(1):e)+(t<0?`e`:`e+`)+t}function x(e,t,n){var r,i;if(t<0){for(i=n+`.`;++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+`.`+e.slice(t));return e}n=m(),n.default=n.BigNumber=n,typeof define==`function`&&define.amd?define(function(){return n}):t!==void 0&&t.exports?t.exports=n:(e||=typeof self<`u`&&self?self:window,e.BigNumber=n)})(e)})),w=n(((e,t)=>{var n=C(),r=t.exports;(function(){var e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,t,i,a={"\b":`\\b`," ":`\\t`,"\n":`\\n`,"\f":`\\f`,"\r":`\\r`,'"':`\\"`,"\\":`\\\\`},o;function s(t){return e.lastIndex=0,e.test(t)?`"`+t.replace(e,function(e){var t=a[e];return typeof t==`string`?t:`\\u`+(`0000`+e.charCodeAt(0).toString(16)).slice(-4)})+`"`:`"`+t+`"`}function c(e,r){var a,l,u,d,f=t,p,m=r[e],h=m!=null&&(m instanceof n||n.isBigNumber(m));switch(m&&typeof m==`object`&&typeof m.toJSON==`function`&&(m=m.toJSON(e)),typeof o==`function`&&(m=o.call(r,e,m)),typeof m){case`string`:return h?m:s(m);case`number`:return isFinite(m)?String(m):`null`;case`boolean`:case`null`:case`bigint`:return String(m);case`object`:if(!m)return`null`;if(t+=i,p=[],Object.prototype.toString.apply(m)===`[object Array]`){for(d=m.length,a=0;a<d;a+=1)p[a]=c(a,m)||`null`;return u=p.length===0?`[]`:t?`[
|
|
5
5
|
`+t+p.join(`,
|
|
6
6
|
`+t)+`
|
|
7
7
|
`+f+`]`:`[`+p.join(`,`)+`]`,t=f,u}if(o&&typeof o==`object`)for(d=o.length,a=0;a<d;a+=1)typeof o[a]==`string`&&(l=o[a],u=c(l,m),u&&p.push(s(l)+(t?`: `:`:`)+u));else Object.keys(m).forEach(function(e){var n=c(e,m);n&&p.push(s(e)+(t?`: `:`:`)+n)});return u=p.length===0?`{}`:t?`{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{Ft as e,It as t,Mt as n}from"./index.mjs";import{t as r}from"./sanitize-unicode-B5GgPEiu.mjs";import{t as i}from"./transform-messages-j96k5V_T.mjs";import{createWriteStream as a}from"fs";import*as o from"path";import{Readable as s}from"node:stream";import{finished as c}from"node:stream/promises";import*as l from"fs/promises";import{writeFile as u}from"fs/promises";var d=n(((e,t)=>{function n(e,t){typeof t==`boolean`&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=n,n.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},n.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},n.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(Error(`RetryOperation timeout occurred`)),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n),this._options.unref&&this._timer.unref(),!0},n.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},n.prototype.try=function(e){console.log(`Using RetryOperation.try() is deprecated`),this.attempt(e)},n.prototype.start=function(e){console.log(`Using RetryOperation.start() is deprecated`),this.attempt(e)},n.prototype.start=n.prototype.try,n.prototype.errors=function(){return this._errors},n.prototype.attempts=function(){return this._attempts},n.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var i=this._errors[r],a=i.message,o=(e[a]||0)+1;e[a]=o,o>=n&&(t=i,n=o)}return t}})),f=n((e=>{var t=d();e.operation=function(n){return new t(e.timeouts(n),{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw Error(`minTimeout is greater than maxTimeout`);for(var r=[],i=0;i<t.retries;i++)r.push(this.createTimeout(i,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(i,t)),r.sort(function(e,t){return e-t}),r},e.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*Math.max(t.minTimeout,1)*t.factor**+e);return r=Math.min(r,t.maxTimeout),r},e.wrap=function(t,n,r){if(n instanceof Array&&(r=n,n=null),!r)for(var i in r=[],t)typeof t[i]==`function`&&r.push(i);for(var a=0;a<r.length;a++){var o=r[a],s=t[o];t[o]=function(r){var i=e.operation(n),a=Array.prototype.slice.call(arguments,1),o=a.pop();a.push(function(e){i.retry(e)||(e&&(arguments[0]=i.mainError()),o.apply(this,arguments))}),i.attempt(function(){r.apply(t,a)})}.bind(t,s),t[o].options=n}}})),p=n(((e,t)=>{t.exports=f()})),m=n(((e,t)=>{let n=p(),r=[`Failed to fetch`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`];var i=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name=`AbortError`,this.message=e}};let a=(e,t,n)=>{let r=n.retries-(t-1);return e.attemptNumber=t,e.retriesLeft=r,e},o=e=>r.includes(e),s=(e,t)=>new Promise((r,s)=>{t={onFailedAttempt:()=>{},retries:10,...t};let c=n.operation(t);c.attempt(async n=>{try{r(await e(n))}catch(e){if(!(e instanceof Error)){s(TypeError(`Non-error was thrown: "${e}". You should only throw errors.`));return}if(e instanceof i)c.stop(),s(e.originalError);else if(e instanceof TypeError&&!o(e.message))c.stop(),s(e);else{a(e,n,t);try{await t.onFailedAttempt(e)}catch(e){s(e);return}c.retry(e)||s(c.mainError())}}})});t.exports=s,t.exports.default=s,t.exports.AbortError=i})),h=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}})),g=n(((e,t)=>{t.exports={name:`gaxios`,version:`7.1.4`,description:`A simple common HTTP client specifically for Google APIs and services.`,main:`build/cjs/src/index.js`,types:`build/cjs/src/index.d.ts`,files:[`build/`],exports:{".":{import:{types:`./build/esm/src/index.d.ts`,default:`./build/esm/src/index.js`},require:{types:`./build/cjs/src/index.d.ts`,default:`./build/cjs/src/index.js`}}},scripts:{lint:`gts check --no-inline-config`,test:`c8 mocha build/esm/test`,"presystem-test":`npm run compile`,"system-test":`mocha build/esm/system-test --timeout 80000`,compile:`tsc -b ./tsconfig.json ./tsconfig.cjs.json && node utils/enable-esm.mjs`,fix:`gts fix`,prepare:`npm run compile`,pretest:`npm run compile`,webpack:`webpack`,"prebrowser-test":`npm run compile`,"browser-test":`node build/browser-test/browser-test-runner.js`,docs:`jsdoc -c .jsdoc.js`,"docs-test":`linkinator docs`,"predocs-test":`npm run docs`,"samples-test":`cd samples/ && npm link ../ && npm test && cd ../`,prelint:`cd samples; npm link ../; npm install`,clean:`gts clean`},repository:{type:`git`,directory:`packages/gaxios`,url:`https://github.com/googleapis/google-cloud-node-core.git`},keywords:[`google`],engines:{node:`>=18`},author:`Google, LLC`,license:`Apache-2.0`,devDependencies:{"@babel/plugin-proposal-private-methods":`^7.18.6`,"@types/cors":`^2.8.6`,"@types/express":`^5.0.0`,"@types/extend":`^3.0.1`,"@types/mocha":`^10.0.10`,"@types/multiparty":`4.2.1`,"@types/mv":`^2.1.0`,"@types/ncp":`^2.0.8`,"@types/node":`^22.13.1`,"@types/sinon":`^17.0.3`,"@types/tmp":`^0.2.6`,assert:`^2.0.0`,browserify:`^17.0.0`,c8:`^10.1.3`,cors:`^2.8.5`,express:`^5.0.0`,gts:`^6.0.2`,"is-docker":`^3.0.0`,jsdoc:`^4.0.4`,"jsdoc-fresh":`^5.0.0`,"jsdoc-region-tag":`^4.0.0`,karma:`^6.0.0`,"karma-chrome-launcher":`^3.0.0`,"karma-coverage":`^2.0.0`,"karma-firefox-launcher":`^2.0.0`,"karma-mocha":`^2.0.0`,"karma-remap-coverage":`^0.1.5`,"karma-sourcemap-loader":`^0.4.0`,"karma-webpack":`^5.0.1`,linkinator:`^6.1.2`,mocha:`^11.1.0`,multiparty:`^4.2.1`,mv:`^2.1.1`,ncp:`^2.0.0`,nock:`^14.0.5`,"null-loader":`^4.0.1`,"pack-n-play":`^4.0.0`,puppeteer:`^24.0.0`,sinon:`^21.0.0`,"stream-browserify":`^3.0.0`,tmp:`0.2.5`,"ts-loader":`^9.5.2`,typescript:`5.8.3`,webpack:`^5.97.1`,"webpack-cli":`^6.0.1`},dependencies:{extend:`^3.0.2`,"https-proxy-agent":`^7.0.1`,"node-fetch":`^3.3.2`},homepage:`https://github.com/googleapis/google-cloud-node-core/tree/main/packages/gaxios`}})),_=n(((e,t)=>{t.exports={pkg:g()}})),v=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.GaxiosError=e.GAXIOS_ERROR_SYMBOL=void 0,e.defaultErrorRedactor=a;let n=t(h()),r=t(_()).default.pkg;e.GAXIOS_ERROR_SYMBOL=Symbol.for(`${r.name}-gaxios-error`),e.GaxiosError=class t extends Error{config;response;code;status;error;[e.GAXIOS_ERROR_SYMBOL]=r.version;static[Symbol.hasInstance](n){return n&&typeof n==`object`&&e.GAXIOS_ERROR_SYMBOL in n&&n[e.GAXIOS_ERROR_SYMBOL]===r.version?!0:Function.prototype[Symbol.hasInstance].call(t,n)}constructor(e,t,r,a){if(super(e,{cause:a}),this.config=t,this.response=r,this.error=a instanceof Error?a:void 0,this.config=(0,n.default)(!0,{},t),this.response&&(this.response.config=(0,n.default)(!0,{},this.response.config)),this.response){try{this.response.data=i(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}a instanceof DOMException?this.code=a.name:a&&typeof a==`object`&&`code`in a&&(typeof a.code==`string`||typeof a.code==`number`)&&(this.code=a.code)}static extractAPIErrorFromResponse(e,t=`The request failed`){let n=t;if(typeof e.data==`string`&&(n=e.data),e.data&&typeof e.data==`object`&&`error`in e.data&&e.data.error&&!e.ok){if(typeof e.data.error==`string`)return{message:e.data.error,code:e.status,status:e.statusText};if(typeof e.data.error==`object`){n=`message`in e.data.error&&typeof e.data.error.message==`string`?e.data.error.message:n;let t=`status`in e.data.error&&typeof e.data.error.status==`string`?e.data.error.status:e.statusText,r=`code`in e.data.error&&typeof e.data.error.code==`number`?e.data.error.code:e.status;if(`errors`in e.data.error&&Array.isArray(e.data.error.errors)){let i=[];for(let t of e.data.error.errors)typeof t==`object`&&`message`in t&&typeof t.message==`string`&&i.push(t.message);return Object.assign({message:i.join(`
|
|
2
|
+
import{Ft as e,It as t,Mt as n}from"./index.mjs";import{t as r}from"./sanitize-unicode-C8aKmv6o.mjs";import{t as i}from"./transform-messages-s3jcHssz.mjs";import{createWriteStream as a}from"fs";import*as o from"path";import{Readable as s}from"node:stream";import{finished as c}from"node:stream/promises";import*as l from"fs/promises";import{writeFile as u}from"fs/promises";var d=n(((e,t)=>{function n(e,t){typeof t==`boolean`&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=n,n.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},n.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},n.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(Error(`RetryOperation timeout occurred`)),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n),this._options.unref&&this._timer.unref(),!0},n.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},n.prototype.try=function(e){console.log(`Using RetryOperation.try() is deprecated`),this.attempt(e)},n.prototype.start=function(e){console.log(`Using RetryOperation.start() is deprecated`),this.attempt(e)},n.prototype.start=n.prototype.try,n.prototype.errors=function(){return this._errors},n.prototype.attempts=function(){return this._attempts},n.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var i=this._errors[r],a=i.message,o=(e[a]||0)+1;e[a]=o,o>=n&&(t=i,n=o)}return t}})),f=n((e=>{var t=d();e.operation=function(n){return new t(e.timeouts(n),{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw Error(`minTimeout is greater than maxTimeout`);for(var r=[],i=0;i<t.retries;i++)r.push(this.createTimeout(i,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(i,t)),r.sort(function(e,t){return e-t}),r},e.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*Math.max(t.minTimeout,1)*t.factor**+e);return r=Math.min(r,t.maxTimeout),r},e.wrap=function(t,n,r){if(n instanceof Array&&(r=n,n=null),!r)for(var i in r=[],t)typeof t[i]==`function`&&r.push(i);for(var a=0;a<r.length;a++){var o=r[a],s=t[o];t[o]=function(r){var i=e.operation(n),a=Array.prototype.slice.call(arguments,1),o=a.pop();a.push(function(e){i.retry(e)||(e&&(arguments[0]=i.mainError()),o.apply(this,arguments))}),i.attempt(function(){r.apply(t,a)})}.bind(t,s),t[o].options=n}}})),p=n(((e,t)=>{t.exports=f()})),m=n(((e,t)=>{let n=p(),r=[`Failed to fetch`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`];var i=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name=`AbortError`,this.message=e}};let a=(e,t,n)=>{let r=n.retries-(t-1);return e.attemptNumber=t,e.retriesLeft=r,e},o=e=>r.includes(e),s=(e,t)=>new Promise((r,s)=>{t={onFailedAttempt:()=>{},retries:10,...t};let c=n.operation(t);c.attempt(async n=>{try{r(await e(n))}catch(e){if(!(e instanceof Error)){s(TypeError(`Non-error was thrown: "${e}". You should only throw errors.`));return}if(e instanceof i)c.stop(),s(e.originalError);else if(e instanceof TypeError&&!o(e.message))c.stop(),s(e);else{a(e,n,t);try{await t.onFailedAttempt(e)}catch(e){s(e);return}c.retry(e)||s(c.mainError())}}})});t.exports=s,t.exports.default=s,t.exports.AbortError=i})),h=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}})),g=n(((e,t)=>{t.exports={name:`gaxios`,version:`7.1.4`,description:`A simple common HTTP client specifically for Google APIs and services.`,main:`build/cjs/src/index.js`,types:`build/cjs/src/index.d.ts`,files:[`build/`],exports:{".":{import:{types:`./build/esm/src/index.d.ts`,default:`./build/esm/src/index.js`},require:{types:`./build/cjs/src/index.d.ts`,default:`./build/cjs/src/index.js`}}},scripts:{lint:`gts check --no-inline-config`,test:`c8 mocha build/esm/test`,"presystem-test":`npm run compile`,"system-test":`mocha build/esm/system-test --timeout 80000`,compile:`tsc -b ./tsconfig.json ./tsconfig.cjs.json && node utils/enable-esm.mjs`,fix:`gts fix`,prepare:`npm run compile`,pretest:`npm run compile`,webpack:`webpack`,"prebrowser-test":`npm run compile`,"browser-test":`node build/browser-test/browser-test-runner.js`,docs:`jsdoc -c .jsdoc.js`,"docs-test":`linkinator docs`,"predocs-test":`npm run docs`,"samples-test":`cd samples/ && npm link ../ && npm test && cd ../`,prelint:`cd samples; npm link ../; npm install`,clean:`gts clean`},repository:{type:`git`,directory:`packages/gaxios`,url:`https://github.com/googleapis/google-cloud-node-core.git`},keywords:[`google`],engines:{node:`>=18`},author:`Google, LLC`,license:`Apache-2.0`,devDependencies:{"@babel/plugin-proposal-private-methods":`^7.18.6`,"@types/cors":`^2.8.6`,"@types/express":`^5.0.0`,"@types/extend":`^3.0.1`,"@types/mocha":`^10.0.10`,"@types/multiparty":`4.2.1`,"@types/mv":`^2.1.0`,"@types/ncp":`^2.0.8`,"@types/node":`^22.13.1`,"@types/sinon":`^17.0.3`,"@types/tmp":`^0.2.6`,assert:`^2.0.0`,browserify:`^17.0.0`,c8:`^10.1.3`,cors:`^2.8.5`,express:`^5.0.0`,gts:`^6.0.2`,"is-docker":`^3.0.0`,jsdoc:`^4.0.4`,"jsdoc-fresh":`^5.0.0`,"jsdoc-region-tag":`^4.0.0`,karma:`^6.0.0`,"karma-chrome-launcher":`^3.0.0`,"karma-coverage":`^2.0.0`,"karma-firefox-launcher":`^2.0.0`,"karma-mocha":`^2.0.0`,"karma-remap-coverage":`^0.1.5`,"karma-sourcemap-loader":`^0.4.0`,"karma-webpack":`^5.0.1`,linkinator:`^6.1.2`,mocha:`^11.1.0`,multiparty:`^4.2.1`,mv:`^2.1.1`,ncp:`^2.0.0`,nock:`^14.0.5`,"null-loader":`^4.0.1`,"pack-n-play":`^4.0.0`,puppeteer:`^24.0.0`,sinon:`^21.0.0`,"stream-browserify":`^3.0.0`,tmp:`0.2.5`,"ts-loader":`^9.5.2`,typescript:`5.8.3`,webpack:`^5.97.1`,"webpack-cli":`^6.0.1`},dependencies:{extend:`^3.0.2`,"https-proxy-agent":`^7.0.1`,"node-fetch":`^3.3.2`},homepage:`https://github.com/googleapis/google-cloud-node-core/tree/main/packages/gaxios`}})),_=n(((e,t)=>{t.exports={pkg:g()}})),v=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.GaxiosError=e.GAXIOS_ERROR_SYMBOL=void 0,e.defaultErrorRedactor=a;let n=t(h()),r=t(_()).default.pkg;e.GAXIOS_ERROR_SYMBOL=Symbol.for(`${r.name}-gaxios-error`),e.GaxiosError=class t extends Error{config;response;code;status;error;[e.GAXIOS_ERROR_SYMBOL]=r.version;static[Symbol.hasInstance](n){return n&&typeof n==`object`&&e.GAXIOS_ERROR_SYMBOL in n&&n[e.GAXIOS_ERROR_SYMBOL]===r.version?!0:Function.prototype[Symbol.hasInstance].call(t,n)}constructor(e,t,r,a){if(super(e,{cause:a}),this.config=t,this.response=r,this.error=a instanceof Error?a:void 0,this.config=(0,n.default)(!0,{},t),this.response&&(this.response.config=(0,n.default)(!0,{},this.response.config)),this.response){try{this.response.data=i(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}a instanceof DOMException?this.code=a.name:a&&typeof a==`object`&&`code`in a&&(typeof a.code==`string`||typeof a.code==`number`)&&(this.code=a.code)}static extractAPIErrorFromResponse(e,t=`The request failed`){let n=t;if(typeof e.data==`string`&&(n=e.data),e.data&&typeof e.data==`object`&&`error`in e.data&&e.data.error&&!e.ok){if(typeof e.data.error==`string`)return{message:e.data.error,code:e.status,status:e.statusText};if(typeof e.data.error==`object`){n=`message`in e.data.error&&typeof e.data.error.message==`string`?e.data.error.message:n;let t=`status`in e.data.error&&typeof e.data.error.status==`string`?e.data.error.status:e.statusText,r=`code`in e.data.error&&typeof e.data.error.code==`number`?e.data.error.code:e.status;if(`errors`in e.data.error&&Array.isArray(e.data.error.errors)){let i=[];for(let t of e.data.error.errors)typeof t==`object`&&`message`in t&&typeof t.message==`string`&&i.push(t.message);return Object.assign({message:i.join(`
|
|
3
3
|
`)||n,code:r,status:t},e.data.error)}return Object.assign({message:n,code:r,status:t},e.data.error)}}return{message:n,code:e.status,status:e.statusText}}};function i(e,t){switch(e){case`stream`:return t;case`json`:return JSON.parse(JSON.stringify(t));case`arraybuffer`:return JSON.parse(Buffer.from(t).toString(`utf8`));case`blob`:return JSON.parse(t.text());default:return t}}function a(e){let t="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function n(e){e&&e.forEach((n,r)=>{(/^authentication$/i.test(r)||/^authorization$/i.test(r)||/secret/i.test(r))&&e.set(r,t)})}function r(e,n){if(typeof e==`object`&&e&&typeof e[n]==`string`){let r=e[n];(/grant_type=/i.test(r)||/assertion=/i.test(r)||/secret/i.test(r))&&(e[n]=t)}}function i(e){!e||typeof e!=`object`||(e instanceof FormData||e instanceof URLSearchParams||`forEach`in e&&`set`in e?e.forEach((n,r)=>{([`grant_type`,`assertion`].includes(r)||/secret/.test(r))&&e.set(r,t)}):(`grant_type`in e&&(e.grant_type=t),`assertion`in e&&(e.assertion=t),`client_secret`in e&&(e.client_secret=t)))}return e.config&&(n(e.config.headers),r(e.config,`data`),i(e.config.data),r(e.config,`body`),i(e.config.body),e.config.url.searchParams.has(`token`)&&e.config.url.searchParams.set(`token`,t),e.config.url.searchParams.has(`client_secret`)&&e.config.url.searchParams.set(`client_secret`,t)),e.response&&(a({config:e.response.config}),n(e.response.headers),e.response.bodyUsed&&(r(e.response,`data`),i(e.response.data))),e}})),y=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRetryConfig=t;async function t(e){let t=r(e);if(!e||!e.config||!t&&!e.config.retry)return{shouldRetry:!1};if(t||={},t.currentRetryAttempt=t.currentRetryAttempt||0,t.retry=t.retry===void 0||t.retry===null?3:t.retry,t.httpMethodsToRetry=t.httpMethodsToRetry||[`GET`,`HEAD`,`PUT`,`OPTIONS`,`DELETE`],t.noResponseRetries=t.noResponseRetries===void 0||t.noResponseRetries===null?2:t.noResponseRetries,t.retryDelayMultiplier=t.retryDelayMultiplier?t.retryDelayMultiplier:2,t.timeOfFirstRequest=t.timeOfFirstRequest?t.timeOfFirstRequest:Date.now(),t.totalTimeout=t.totalTimeout?t.totalTimeout:2**53-1,t.maxRetryDelay=t.maxRetryDelay?t.maxRetryDelay:2**53-1,t.statusCodesToRetry=t.statusCodesToRetry||[[100,199],[408,408],[429,429],[500,599]],e.config.retryConfig=t,!await(t.shouldRetry||n)(e))return{shouldRetry:!1,config:e.config};let a=i(t);e.config.retryConfig.currentRetryAttempt+=1;let o=t.retryBackoff?t.retryBackoff(e,a):new Promise(e=>{setTimeout(e,a)});return t.onRetryAttempt&&await t.onRetryAttempt(e),await o,{shouldRetry:!0,config:e.config}}function n(e){let t=r(e);if(e.config.signal?.aborted&&e.code!==`TimeoutError`||e.code===`AbortError`||!t||t.retry===0||!e.response&&(t.currentRetryAttempt||0)>=t.noResponseRetries||!t.httpMethodsToRetry||!t.httpMethodsToRetry.includes(e.config.method?.toUpperCase()||`GET`))return!1;if(e.response&&e.response.status){let n=!1;for(let[r,i]of t.statusCodesToRetry){let t=e.response.status;if(t>=r&&t<=i){n=!0;break}}if(!n)return!1}return t.currentRetryAttempt=t.currentRetryAttempt||0,!(t.currentRetryAttempt>=t.retry)}function r(e){if(e&&e.config&&e.config.retryConfig)return e.config.retryConfig}function i(e){let t=(e.currentRetryAttempt?0:e.retryDelay??100)+(e.retryDelayMultiplier**+e.currentRetryAttempt-1)/2*1e3,n=e.totalTimeout-(Date.now()-e.timeOfFirstRequest);return Math.min(t,n,e.maxRetryDelay)}})),b=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.GaxiosInterceptorManager=void 0,e.GaxiosInterceptorManager=class extends Set{}})),x=n((n=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i;Object.defineProperty(n,`__esModule`,{value:!0}),n.Gaxios=void 0;let a=r(h()),o=e(`https`),s=v(),c=y(),l=e(`stream`),u=b(),d=async()=>globalThis.crypto?.randomUUID()||(await import(`crypto`)).randomUUID();var f=class{agentCache=new Map;defaults;interceptors;constructor(e){this.defaults=e||{},this.interceptors={request:new u.GaxiosInterceptorManager,response:new u.GaxiosInterceptorManager}}fetch(...e){let t=e[0],n=e[1],r,a=new Headers;return typeof t==`string`?r=new URL(t):t instanceof URL?r=t:t&&t.url&&(r=new URL(t.url)),t&&typeof t==`object`&&`headers`in t&&i.mergeHeaders(a,t.headers),n&&i.mergeHeaders(a,new Headers(n.headers)),typeof t==`object`&&!(t instanceof URL)?this.request({...n,...t,headers:a,url:r}):this.request({...n,headers:a,url:r})}async request(e={}){let t=await this.#r(e);return t=await this.#t(t),this.#n(this._request(t))}async _defaultAdapter(e){let t=e.fetchImplementation||this.defaults.fetchImplementation||await i.#c(),n={...e};delete n.data;let r=await t(e.url,n),a=await this.getResponseData(e,r);return Object.getOwnPropertyDescriptor(r,`data`)?.configurable||Object.defineProperties(r,{data:{configurable:!0,writable:!0,enumerable:!0,value:a}}),Object.assign(r,{config:e,data:a})}async _request(e){try{let t;if(t=e.adapter?await e.adapter(e,this._defaultAdapter.bind(this)):await this._defaultAdapter(e),!e.validateStatus(t.status)){if(e.responseType===`stream`){let e=[];for await(let n of t.data)e.push(n);t.data=e.toString()}let n=s.GaxiosError.extractAPIErrorFromResponse(t,`Request failed with status code ${t.status}`);throw new s.GaxiosError(n?.message,e,t,n)}return t}catch(t){let n;n=t instanceof s.GaxiosError?t:t instanceof Error?new s.GaxiosError(t.message,e,void 0,t):new s.GaxiosError(`Unexpected Gaxios Error`,e,void 0,t);let{shouldRetry:r,config:i}=await(0,c.getRetryConfig)(n);if(r&&i)return n.config.retryConfig.currentRetryAttempt=i.retryConfig.currentRetryAttempt,e.retryConfig=n.config?.retryConfig,this.#i(e),this._request(e);throw e.errorRedactor&&e.errorRedactor(n),n}}async getResponseData(e,t){if(t.status===204)return``;if(e.maxContentLength&&t.headers.has(`content-length`)&&e.maxContentLength<Number.parseInt(t.headers?.get(`content-length`)||``))throw new s.GaxiosError("Response's `Content-Length` is over the limit.",e,Object.assign(t,{config:e}));switch(e.responseType){case`stream`:return t.body;case`json`:{let e=await t.text();try{return JSON.parse(e)}catch{return e}}case`arraybuffer`:return t.arrayBuffer();case`blob`:return t.blob();case`text`:return t.text();default:return this.getResponseDataFromContentType(t)}}#e(e,t=[]){let n=new URL(e),r=[...t],i=(process.env.NO_PROXY??process.env.no_proxy)?.split(`,`)||[];for(let e of i)r.push(e.trim());for(let e of r)if(e instanceof RegExp){if(e.test(n.toString()))return!1}else if(e instanceof URL){if(e.origin===n.origin)return!1}else if(e.startsWith(`*.`)||e.startsWith(`.`)){let t=e.replace(/^\*\./,`.`);if(n.hostname.endsWith(t))return!1}else if(e===n.origin||e===n.hostname||e===n.href)return!1;return!0}async#t(e){let t=Promise.resolve(e);for(let e of this.interceptors.request.values())e&&(t=t.then(e.resolved,e.rejected));return t}async#n(e){let t=Promise.resolve(e);for(let e of this.interceptors.response.values())e&&(t=t.then(e.resolved,e.rejected));return t}async#r(e){let t=new Headers(this.defaults.headers);i.mergeHeaders(t,e.headers);let n=(0,a.default)(!0,{},this.defaults,e);if(!n.url)throw Error(`URL is required.`);if(n.baseURL&&(n.url=new URL(n.url,n.baseURL)),n.url=new URL(n.url),n.params)if(n.paramsSerializer){let e=n.paramsSerializer(n.params);e.startsWith(`?`)&&(e=e.slice(1));let t=n.url.toString().includes(`?`)?`&`:`?`;n.url=n.url+t+e}else{let e=n.url instanceof URL?n.url:new URL(n.url);for(let[t,r]of new URLSearchParams(n.params))e.searchParams.append(t,r);n.url=e}typeof e.maxContentLength==`number`&&(n.size=e.maxContentLength),typeof e.maxRedirects==`number`&&(n.follow=e.maxRedirects);let r=typeof n.data==`string`||n.data instanceof ArrayBuffer||n.data instanceof Blob||globalThis.File&&n.data instanceof File||n.data instanceof FormData||n.data instanceof l.Readable||n.data instanceof ReadableStream||n.data instanceof String||n.data instanceof URLSearchParams||ArrayBuffer.isView(n.data)||[`Blob`,`File`,`FormData`].includes(n.data?.constructor?.name||``);if(n.multipart?.length){let e=await d();t.set(`content-type`,`multipart/related; boundary=${e}`),n.body=l.Readable.from(this.getMultipartRequest(n.multipart,e))}else r?n.body=n.data:typeof n.data==`object`?t.get(`Content-Type`)===`application/x-www-form-urlencoded`?n.body=n.paramsSerializer?n.paramsSerializer(n.data):new URLSearchParams(n.data):(t.has(`content-type`)||t.set(`content-type`,`application/json`),n.body=JSON.stringify(n.data)):n.data&&(n.body=n.data);n.validateStatus=n.validateStatus||this.validateStatus,n.responseType=n.responseType||`unknown`,!t.has(`accept`)&&n.responseType===`json`&&t.set(`accept`,`application/json`);let c=n.proxy||process?.env?.HTTPS_PROXY||process?.env?.https_proxy||process?.env?.HTTP_PROXY||process?.env?.http_proxy;if(!n.agent)if(c&&this.#e(n.url,n.noProxy)){let e=await i.#s();this.agentCache.has(c)?n.agent=this.agentCache.get(c):(n.agent=new e(c,{cert:n.cert,key:n.key}),this.agentCache.set(c,n.agent))}else n.cert&&n.key&&(this.agentCache.has(n.key)?n.agent=this.agentCache.get(n.key):(n.agent=new o.Agent({cert:n.cert,key:n.key}),this.agentCache.set(n.key,n.agent)));return typeof n.errorRedactor!=`function`&&n.errorRedactor!==!1&&(n.errorRedactor=s.defaultErrorRedactor),n.body&&!(`duplex`in n)&&(n.duplex=`half`),this.#i(n),Object.assign(n,{headers:t,url:n.url instanceof URL?n.url:new URL(n.url)})}#i(e){if(e.timeout){let t=AbortSignal.timeout(e.timeout);e.signal&&!e.signal.aborted?e.signal=AbortSignal.any([e.signal,t]):e.signal=t}}validateStatus(e){return e>=200&&e<300}async getResponseDataFromContentType(e){let t=e.headers.get(`Content-Type`);if(t===null)return e.text();if(t=t.toLowerCase(),t.includes(`application/json`)){let t=await e.text();try{t=JSON.parse(t)}catch{}return t}else if(t.match(/^text\//))return e.text();else return e.blob()}async*getMultipartRequest(e,t){let n=`--${t}--`;for(let n of e)yield`--${t}\r\nContent-Type: ${n.headers.get(`Content-Type`)||`application/octet-stream`}\r\n\r\n`,typeof n.content==`string`?yield n.content:yield*n.content,yield`\r
|
|
4
|
-
`;yield n}static#a;static#o;static async#s(){return this.#a||=(await import(`./dist-BupqiQep.mjs`).then(e=>t(e.default))).HttpsProxyAgent,this.#a}static async#c(){let e=typeof window<`u`&&!!window;return this.#o||=e?window.fetch:(await import(`./src-Bk9f60_P.mjs`)).default,this.#o}static mergeHeaders(e,...t){e=e instanceof Headers?e:new Headers(e);for(let n of t)(n instanceof Headers?n:new Headers(n)).forEach((t,n)=>{n===`set-cookie`?e.append(n,t):e.set(n,t)});return e}};n.Gaxios=f,i=f})),S=n((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.instance=e.Gaxios=e.GaxiosError=void 0,e.request=a;let r=x();Object.defineProperty(e,`Gaxios`,{enumerable:!0,get:function(){return r.Gaxios}});var i=v();Object.defineProperty(e,`GaxiosError`,{enumerable:!0,get:function(){return i.GaxiosError}}),n(b(),e),e.instance=new r.Gaxios;async function a(t){return e.instance.request(t)}})),C=n(((e,t)=>{(function(e){var n,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,a=Math.floor,o=`[BigNumber Error] `,s=o+`Number primitive has more than 15 significant digits: `,c=0x5af3107a4000,l=14,u=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,0xe8d4a51000,0x9184e72a000],f=1e7,p=1e9;function m(e){var t,n,S,C=F.prototype={constructor:F,toString:null,valueOf:null},w=new F(1),T=20,E=4,D=-7,O=21,k=-1e7,A=1e7,j=!1,M=1,N=0,ee={prefix:``,groupSize:3,secondaryGroupSize:0,groupSeparator:`,`,decimalSeparator:`.`,fractionGroupSize:0,fractionGroupSeparator:`\xA0`,suffix:``},P=`0123456789abcdefghijklmnopqrstuvwxyz`,te=!0;function F(e,t){var i,o,c,d,f,p,m,h,g=this;if(!(g instanceof F))return new F(e,t);if(t==null){if(e&&e._isBigNumber===!0){g.s=e.s,!e.c||e.e>A?g.c=g.e=null:e.e<k?g.c=[g.e=0]:(g.e=e.e,g.c=e.c.slice());return}if((p=typeof e==`number`)&&e*0==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(d=0,f=e;f>=10;f/=10,d++);d>A?g.c=g.e=null:(g.e=d,g.c=[e]);return}h=String(e)}else{if(!r.test(h=String(e)))return S(g,h,p);g.s=h.charCodeAt(0)==45?(h=h.slice(1),-1):1}(d=h.indexOf(`.`))>-1&&(h=h.replace(`.`,``)),(f=h.search(/e/i))>0?(d<0&&(d=f),d+=+h.slice(f+1),h=h.substring(0,f)):d<0&&(d=h.length)}else{if(v(t,2,P.length,`Base`),t==10&&te)return g=new F(e),L(g,T+g.e+1,E);if(h=String(e),p=typeof e==`number`){if(e*0!=0)return S(g,h,p,t);if(g.s=1/e<0?(h=h.slice(1),-1):1,F.DEBUG&&h.replace(/^0\.0*|\./,``).length>15)throw Error(s+e)}else g.s=h.charCodeAt(0)===45?(h=h.slice(1),-1):1;for(i=P.slice(0,t),d=f=0,m=h.length;f<m;f++)if(i.indexOf(o=h.charAt(f))<0){if(o==`.`){if(f>d){d=m;continue}}else if(!c&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){c=!0,f=-1,d=0;continue}return S(g,String(e),p,t)}p=!1,h=n(h,t,10,g.s),(d=h.indexOf(`.`))>-1?h=h.replace(`.`,``):d=h.length}for(f=0;h.charCodeAt(f)===48;f++);for(m=h.length;h.charCodeAt(--m)===48;);if(h=h.slice(f,++m)){if(m-=f,p&&F.DEBUG&&m>15&&(e>u||e!==a(e)))throw Error(s+g.s*e);if((d=d-f-1)>A)g.c=g.e=null;else if(d<k)g.c=[g.e=0];else{if(g.e=d,g.c=[],f=(d+1)%l,d<0&&(f+=l),f<m){for(f&&g.c.push(+h.slice(0,f)),m-=l;f<m;)g.c.push(+h.slice(f,f+=l));f=l-(h=h.slice(f)).length}else f-=m;for(;f--;h+=`0`);g.c.push(+h)}}else g.c=[g.e=0]}F.clone=m,F.ROUND_UP=0,F.ROUND_DOWN=1,F.ROUND_CEIL=2,F.ROUND_FLOOR=3,F.ROUND_HALF_UP=4,F.ROUND_HALF_DOWN=5,F.ROUND_HALF_EVEN=6,F.ROUND_HALF_CEIL=7,F.ROUND_HALF_FLOOR=8,F.EUCLID=9,F.config=F.set=function(e){var t,n;if(e!=null)if(typeof e==`object`){if(e.hasOwnProperty(t=`DECIMAL_PLACES`)&&(n=e[t],v(n,0,p,t),T=n),e.hasOwnProperty(t=`ROUNDING_MODE`)&&(n=e[t],v(n,0,8,t),E=n),e.hasOwnProperty(t=`EXPONENTIAL_AT`)&&(n=e[t],n&&n.pop?(v(n[0],-p,0,t),v(n[1],0,p,t),D=n[0],O=n[1]):(v(n,-p,p,t),D=-(O=n<0?-n:n))),e.hasOwnProperty(t=`RANGE`))if(n=e[t],n&&n.pop)v(n[0],-p,-1,t),v(n[1],1,p,t),k=n[0],A=n[1];else if(v(n,-p,p,t),n)k=-(A=n<0?-n:n);else throw Error(o+t+` cannot be zero: `+n);if(e.hasOwnProperty(t=`CRYPTO`))if(n=e[t],n===!!n)if(n)if(typeof crypto<`u`&&crypto&&(crypto.getRandomValues||crypto.randomBytes))j=n;else throw j=!n,Error(o+`crypto unavailable`);else j=n;else throw Error(o+t+` not true or false: `+n);if(e.hasOwnProperty(t=`MODULO_MODE`)&&(n=e[t],v(n,0,9,t),M=n),e.hasOwnProperty(t=`POW_PRECISION`)&&(n=e[t],v(n,0,p,t),N=n),e.hasOwnProperty(t=`FORMAT`))if(n=e[t],typeof n==`object`)ee=n;else throw Error(o+t+` not an object: `+n);if(e.hasOwnProperty(t=`ALPHABET`))if(n=e[t],typeof n==`string`&&!/^.?$|[+\-.\s]|(.).*\1/.test(n))te=n.slice(0,10)==`0123456789`,P=n;else throw Error(o+t+` invalid: `+n)}else throw Error(o+`Object expected: `+e);return{DECIMAL_PLACES:T,ROUNDING_MODE:E,EXPONENTIAL_AT:[D,O],RANGE:[k,A],CRYPTO:j,MODULO_MODE:M,POW_PRECISION:N,FORMAT:ee,ALPHABET:P}},F.isBigNumber=function(e){if(!e||e._isBigNumber!==!0)return!1;if(!F.DEBUG)return!0;var t,n,r=e.c,i=e.e,s=e.s;out:if({}.toString.call(r)==`[object Array]`){if((s===1||s===-1)&&i>=-p&&i<=p&&i===a(i)){if(r[0]===0){if(i===0&&r.length===1)return!0;break out}if(t=(i+1)%l,t<1&&(t+=l),String(r[0]).length==t){for(t=0;t<r.length;t++)if(n=r[t],n<0||n>=c||n!==a(n))break out;if(n!==0)return!0}}}else if(r===null&&i===null&&(s===null||s===1||s===-1))return!0;throw Error(o+`Invalid BigNumber: `+e)},F.maximum=F.max=function(){return re(arguments,-1)},F.minimum=F.min=function(){return re(arguments,1)},F.random=(function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return a(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(e){var n,r,s,c,u,f=0,m=[],h=new F(w);if(e==null?e=T:v(e,0,p),c=i(e/l),j)if(crypto.getRandomValues){for(n=crypto.getRandomValues(new Uint32Array(c*=2));f<c;)u=n[f]*131072+(n[f+1]>>>11),u>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),n[f]=r[0],n[f+1]=r[1]):(m.push(u%0x5af3107a4000),f+=2);f=c/2}else if(crypto.randomBytes){for(n=crypto.randomBytes(c*=7);f<c;)u=(n[f]&31)*281474976710656+n[f+1]*1099511627776+n[f+2]*4294967296+n[f+3]*16777216+(n[f+4]<<16)+(n[f+5]<<8)+n[f+6],u>=9e15?crypto.randomBytes(7).copy(n,f):(m.push(u%0x5af3107a4000),f+=7);f=c/7}else throw j=!1,Error(o+`crypto unavailable`);if(!j)for(;f<c;)u=t(),u<9e15&&(m[f++]=u%0x5af3107a4000);for(c=m[--f],e%=l,c&&e&&(u=d[l-e],m[f]=a(c/u)*u);m[f]===0;m.pop(),f--);if(f<0)m=[s=0];else{for(s=-1;m[0]===0;m.splice(0,1),s-=l);for(f=1,u=m[0];u>=10;u/=10,f++);f<l&&(s-=l-f)}return h.e=s,h.c=m,h}})(),F.sum=function(){for(var e=1,t=arguments,n=new F(t[0]);e<t.length;)n=n.plus(t[e++]);return n},n=(function(){var e=`0123456789`;function n(e,t,n,r){for(var i,a=[0],o,s=0,c=e.length;s<c;){for(o=a.length;o--;a[o]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>n-1&&(a[i+1]??(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(r,i,a,o,s){var c,l,u,d,f,p,m,h,_=r.indexOf(`.`),v=T,y=E;for(_>=0&&(d=N,N=0,r=r.replace(`.`,``),h=new F(i),p=h.pow(r.length-_),N=d,h.c=n(x(g(p.c),p.e,`0`),10,a,e),h.e=h.c.length),m=n(r,i,a,s?(c=P,e):(c=e,P)),u=d=m.length;m[--d]==0;m.pop());if(!m[0])return c.charAt(0);if(_<0?--u:(p.c=m,p.e=u,p.s=o,p=t(p,h,v,y,a),m=p.c,f=p.r,u=p.e),l=u+v+1,_=m[l],d=a/2,f=f||l<0||m[l+1]!=null,f=y<4?(_!=null||f)&&(y==0||y==(p.s<0?3:2)):_>d||_==d&&(y==4||f||y==6&&m[l-1]&1||y==(p.s<0?8:7)),l<1||!m[0])r=f?x(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(m.length=l,f)for(--a;++m[--l]>a;)m[l]=0,l||(++u,m=[1].concat(m));for(d=m.length;!m[--d];);for(_=0,r=``;_<=d;r+=c.charAt(m[_++]));r=x(r,u,c.charAt(0))}return r}})(),t=(function(){function e(e,t,n){var r,i,a,o,s=0,c=e.length,l=t%f,u=t/f|0;for(e=e.slice();c--;)a=e[c]%f,o=e[c]/f|0,r=u*a+o*l,i=l*a+r%f*f+s,s=(i/n|0)+(r/f|0)+u*o,e[c]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,i,o,s,u){var d,f,p,m,g,_,v,y,b,x,S,C,w,T,E,D,O,k=r.s==i.s?1:-1,A=r.c,j=i.c;if(!A||!A[0]||!j||!j[0])return new F(!r.s||!i.s||(A?j&&A[0]==j[0]:!j)?NaN:A&&A[0]==0||!j?k*0:k/0);for(y=new F(k),b=y.c=[],f=r.e-i.e,k=o+f+1,u||(u=c,f=h(r.e/l)-h(i.e/l),k=k/l|0),p=0;j[p]==(A[p]||0);p++);if(j[p]>(A[p]||0)&&f--,k<0)b.push(1),m=!0;else{for(T=A.length,D=j.length,p=0,k+=2,g=a(u/(j[0]+1)),g>1&&(j=e(j,g,u),A=e(A,g,u),D=j.length,T=A.length),w=D,x=A.slice(0,D),S=x.length;S<D;x[S++]=0);O=j.slice(),O=[0].concat(O),E=j[0],j[1]>=u/2&&E++;do{if(g=0,d=t(j,x,D,S),d<0){if(C=x[0],D!=S&&(C=C*u+(x[1]||0)),g=a(C/E),g>1)for(g>=u&&(g=u-1),_=e(j,g,u),v=_.length,S=x.length;t(_,x,v,S)==1;)g--,n(_,D<v?O:j,v,u),v=_.length,d=1;else g==0&&(d=g=1),_=j.slice(),v=_.length;if(v<S&&(_=[0].concat(_)),n(x,_,S,u),S=x.length,d==-1)for(;t(j,x,D,S)<1;)g++,n(x,D<S?O:j,S,u),S=x.length}else d===0&&(g++,x=[0]);b[p++]=g,x[0]?x[S++]=A[w]||0:(x=[A[w]],S=1)}while((w++<T||x[0]!=null)&&k--);m=x[0]!=null,b[0]||b.splice(0,1)}if(u==c){for(p=1,k=b[0];k>=10;k/=10,p++);L(y,o+(y.e=p+f*l-1)+1,s,m)}else y.e=f,y.r=+m;return y}})();function ne(e,t,n,r){var i,a,o,s,c;if(n==null?n=E:v(n,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,t==null)c=g(e.c),c=r==1||r==2&&(o<=D||o>=O)?b(c,o):x(c,o,`0`);else if(e=L(new F(e),t,n),a=e.e,c=g(e.c),s=c.length,r==1||r==2&&(t<=a||a<=D)){for(;s<t;c+=`0`,s++);c=b(c,a)}else if(t-=o+(r===2&&a>o),c=x(c,a,`0`),a+1>s){if(--t>0)for(c+=`.`;t--;c+=`0`);}else if(t+=a-s,t>0)for(a+1==s&&(c+=`.`);t--;c+=`0`);return e.s<0&&i?`-`+c:c}function re(e,t){for(var n,r,i=1,a=new F(e[0]);i<e.length;i++)r=new F(e[i]),(!r.s||(n=_(a,r))===t||n===0&&a.s===t)&&(a=r);return a}function I(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*l-1)>A?e.c=e.e=null:n<k?e.c=[e.e=0]:(e.e=n,e.c=t),e}S=(function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,n=/^\.([^.]+)$/,r=/^-?(Infinity|NaN)$/,i=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(a,s,c,l){var u,d=c?s:s.replace(i,``);if(r.test(d))a.s=isNaN(d)?null:d<0?-1:1;else{if(!c&&(d=d.replace(e,function(e,t,n){return u=(n=n.toLowerCase())==`x`?16:n==`b`?2:8,!l||l==u?t:e}),l&&(u=l,d=d.replace(t,`$1`).replace(n,`0.$1`)),s!=d))return new F(d,u);if(F.DEBUG)throw Error(o+`Not a`+(l?` base `+l:``)+` number: `+s);a.s=null}a.c=a.e=null}})();function L(e,t,n,r){var o,s,u,f,p,m,h,g=e.c,_=d;if(g){out:{for(o=1,f=g[0];f>=10;f/=10,o++);if(s=t-o,s<0)s+=l,u=t,p=g[m=0],h=a(p/_[o-u-1]%10);else if(m=i((s+1)/l),m>=g.length)if(r){for(;g.length<=m;g.push(0));p=h=0,o=1,s%=l,u=s-l+1}else break out;else{for(p=f=g[m],o=1;f>=10;f/=10,o++);s%=l,u=s-l+o,h=u<0?0:a(p/_[o-u-1]%10)}if(r=r||t<0||g[m+1]!=null||(u<0?p:p%_[o-u-1]),r=n<4?(h||r)&&(n==0||n==(e.s<0?3:2)):h>5||h==5&&(n==4||r||n==6&&(s>0?u>0?p/_[o-u]:0:g[m-1])%10&1||n==(e.s<0?8:7)),t<1||!g[0])return g.length=0,r?(t-=e.e+1,g[0]=_[(l-t%l)%l],e.e=-t||0):g[0]=e.e=0,e;if(s==0?(g.length=m,f=1,m--):(g.length=m+1,f=_[l-s],g[m]=u>0?a(p/_[o-u]%_[u])*f:0),r)for(;;)if(m==0){for(s=1,u=g[0];u>=10;u/=10,s++);for(u=g[0]+=f,f=1;u>=10;u/=10,f++);s!=f&&(e.e++,g[0]==c&&(g[0]=1));break}else{if(g[m]+=f,g[m]!=c)break;g[m--]=0,f=1}for(s=g.length;g[--s]===0;g.pop());}e.e>A?e.c=e.e=null:e.e<k&&(e.c=[e.e=0])}return e}function R(e){var t,n=e.e;return n===null?e.toString():(t=g(e.c),t=n<=D||n>=O?b(t,n):x(t,n,`0`),e.s<0?`-`+t:t)}return C.absoluteValue=C.abs=function(){var e=new F(this);return e.s<0&&(e.s=1),e},C.comparedTo=function(e,t){return _(this,new F(e,t))},C.decimalPlaces=C.dp=function(e,t){var n,r,i,a=this;if(e!=null)return v(e,0,p),t==null?t=E:v(t,0,8),L(new F(a),e+a.e+1,t);if(!(n=a.c))return null;if(r=((i=n.length-1)-h(this.e/l))*l,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},C.dividedBy=C.div=function(e,n){return t(this,new F(e,n),T,E)},C.dividedToIntegerBy=C.idiv=function(e,n){return t(this,new F(e,n),0,1)},C.exponentiatedBy=C.pow=function(e,t){var n,r,s,c,u,d,f,p,m,h=this;if(e=new F(e),e.c&&!e.isInteger())throw Error(o+`Exponent not an integer: `+R(e));if(t!=null&&(t=new F(t)),d=e.e>14,!h.c||!h.c[0]||h.c[0]==1&&!h.e&&h.c.length==1||!e.c||!e.c[0])return m=new F(R(h)**(d?e.s*(2-y(e)):+R(e))),t?m.mod(t):m;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new F(NaN);r=!f&&h.isInteger()&&t.isInteger(),r&&(h=h.mod(t))}else if(e.e>9&&(h.e>0||h.e<-1||(h.e==0?h.c[0]>1||d&&h.c[1]>=24e7:h.c[0]<8e13||d&&h.c[0]<=9999975e7)))return c=h.s<0&&y(e)?-0:0,h.e>-1&&(c=1/c),new F(f?1/c:c);else N&&(c=i(N/l+2));for(d?(n=new F(.5),f&&(e.s=1),p=y(e)):(s=Math.abs(+R(e)),p=s%2),m=new F(w);;){if(p){if(m=m.times(h),!m.c)break;c?m.c.length>c&&(m.c.length=c):r&&(m=m.mod(t))}if(s){if(s=a(s/2),s===0)break;p=s%2}else if(e=e.times(n),L(e,e.e+1,1),e.e>14)p=y(e);else{if(s=+R(e),s===0)break;p=s%2}h=h.times(h),c?h.c&&h.c.length>c&&(h.c.length=c):r&&(h=h.mod(t))}return r?m:(f&&(m=w.div(m)),t?m.mod(t):c?L(m,N,E,u):m)},C.integerValue=function(e){var t=new F(this);return e==null?e=E:v(e,0,8),L(t,t.e+1,e)},C.isEqualTo=C.eq=function(e,t){return _(this,new F(e,t))===0},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(e,t){return _(this,new F(e,t))>0},C.isGreaterThanOrEqualTo=C.gte=function(e,t){return(t=_(this,new F(e,t)))===1||t===0},C.isInteger=function(){return!!this.c&&h(this.e/l)>this.c.length-2},C.isLessThan=C.lt=function(e,t){return _(this,new F(e,t))<0},C.isLessThanOrEqualTo=C.lte=function(e,t){return(t=_(this,new F(e,t)))===-1||t===0},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&this.c[0]==0},C.minus=function(e,t){var n,r,i,a,o=this,s=o.s;if(e=new F(e,t),t=e.s,!s||!t)return new F(NaN);if(s!=t)return e.s=-t,o.plus(e);var u=o.e/l,d=e.e/l,f=o.c,p=e.c;if(!u||!d){if(!f||!p)return f?(e.s=-t,e):new F(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new F(f[0]?o:E==3?-0:0)}if(u=h(u),d=h(d),f=f.slice(),s=u-d){for((a=s<0)?(s=-s,i=f):(d=u,i=p),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(r=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;t<r;t++)if(f[t]!=p[t]){a=f[t]<p[t];break}if(a&&(i=f,f=p,p=i,e.s=-e.s),t=(r=p.length)-(n=f.length),t>0)for(;t--;f[n++]=0);for(t=c-1;r>s;){if(f[--r]<p[r]){for(n=r;n&&!f[--n];f[n]=t);--f[n],f[r]+=c}f[r]-=p[r]}for(;f[0]==0;f.splice(0,1),--d);return f[0]?I(e,f,d):(e.s=E==3?-1:1,e.c=[e.e=0],e)},C.modulo=C.mod=function(e,n){var r,i,a=this;return e=new F(e,n),!a.c||!e.s||e.c&&!e.c[0]?new F(NaN):!e.c||a.c&&!a.c[0]?new F(a):(M==9?(i=e.s,e.s=1,r=t(a,e,0,3),e.s=i,r.s*=i):r=t(a,e,0,M),e=a.minus(r.times(e)),!e.c[0]&&M==1&&(e.s=a.s),e)},C.multipliedBy=C.times=function(e,t){var n,r,i,a,o,s,u,d,p,m,g,_,v,y,b,x=this,S=x.c,C=(e=new F(e,t)).c;if(!S||!C||!S[0]||!C[0])return!x.s||!e.s||S&&!S[0]&&!C||C&&!C[0]&&!S?e.c=e.e=e.s=null:(e.s*=x.s,!S||!C?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(r=h(x.e/l)+h(e.e/l),e.s*=x.s,u=S.length,m=C.length,u<m&&(v=S,S=C,C=v,i=u,u=m,m=i),i=u+m,v=[];i--;v.push(0));for(y=c,b=f,i=m;--i>=0;){for(n=0,g=C[i]%b,_=C[i]/b|0,o=u,a=i+o;a>i;)d=S[--o]%b,p=S[o]/b|0,s=_*d+p*g,d=g*d+s%b*b+v[a]+n,n=(d/y|0)+(s/b|0)+_*p,v[a--]=d%y;v[a]=n}return n?++r:v.splice(0,1),I(e,v,r)},C.negated=function(){var e=new F(this);return e.s=-e.s||null,e},C.plus=function(e,t){var n,r=this,i=r.s;if(e=new F(e,t),t=e.s,!i||!t)return new F(NaN);if(i!=t)return e.s=-t,r.minus(e);var a=r.e/l,o=e.e/l,s=r.c,u=e.c;if(!a||!o){if(!s||!u)return new F(i/0);if(!s[0]||!u[0])return u[0]?e:new F(s[0]?r:i*0)}if(a=h(a),o=h(o),s=s.slice(),i=a-o){for(i>0?(o=a,n=u):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for(i=s.length,t=u.length,i-t<0&&(n=u,u=s,s=n,t=i),i=0;t;)i=(s[--t]=s[t]+u[t]+i)/c|0,s[t]=c===s[t]?0:s[t]%c;return i&&(s=[i].concat(s),++o),I(e,s,o)},C.precision=C.sd=function(e,t){var n,r,i,a=this;if(e!=null&&e!==!!e)return v(e,1,p),t==null?t=E:v(t,0,8),L(new F(a),e,t);if(!(n=a.c))return null;if(i=n.length-1,r=i*l+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&a.e+1>r&&(r=a.e+1),r},C.shiftedBy=function(e){return v(e,-u,u),this.times(`1e`+e)},C.squareRoot=C.sqrt=function(){var e,n,r,i,a,o=this,s=o.c,c=o.s,l=o.e,u=T+4,d=new F(`0.5`);if(c!==1||!s||!s[0])return new F(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);if(c=Math.sqrt(+R(o)),c==0||c==1/0?(n=g(s),(n.length+l)%2==0&&(n+=`0`),c=Math.sqrt(+n),l=h((l+1)/2)-(l<0||l%2),c==1/0?n=`5e`+l:(n=c.toExponential(),n=n.slice(0,n.indexOf(`e`)+1)+l),r=new F(n)):r=new F(c+``),r.c[0]){for(l=r.e,c=l+u,c<3&&(c=0);;)if(a=r,r=d.times(a.plus(t(o,a,u,1))),g(a.c).slice(0,c)===(n=g(r.c)).slice(0,c))if(r.e<l&&--c,n=n.slice(c-3,c+1),n==`9999`||!i&&n==`4999`){if(!i&&(L(a,a.e+T+2,0),a.times(a).eq(o))){r=a;break}u+=4,c+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)==`5`)&&(L(r,r.e+T+2,1),e=!r.times(r).eq(o));break}}return L(r,r.e+T+1,E,e)},C.toExponential=function(e,t){return e!=null&&(v(e,0,p),e++),ne(this,e,t,1)},C.toFixed=function(e,t){return e!=null&&(v(e,0,p),e=e+this.e+1),ne(this,e,t)},C.toFormat=function(e,t,n){var r,i=this;if(n==null)e!=null&&t&&typeof t==`object`?(n=t,t=null):e&&typeof e==`object`?(n=e,e=t=null):n=ee;else if(typeof n!=`object`)throw Error(o+`Argument not an object: `+n);if(r=i.toFixed(e,t),i.c){var a,s=r.split(`.`),c=+n.groupSize,l=+n.secondaryGroupSize,u=n.groupSeparator||``,d=s[0],f=s[1],p=i.s<0,m=p?d.slice(1):d,h=m.length;if(l&&(a=c,c=l,l=a,h-=a),c>0&&h>0){for(a=h%c||c,d=m.substr(0,a);a<h;a+=c)d+=u+m.substr(a,c);l>0&&(d+=u+m.slice(a)),p&&(d=`-`+d)}r=f?d+(n.decimalSeparator||``)+((l=+n.fractionGroupSize)?f.replace(RegExp(`\\d{`+l+`}\\B`,`g`),`$&`+(n.fractionGroupSeparator||``)):f):d}return(n.prefix||``)+r+(n.suffix||``)},C.toFraction=function(e){var n,r,i,a,s,c,u,f,p,m,h,_,v=this,y=v.c;if(e!=null&&(u=new F(e),!u.isInteger()&&(u.c||u.s!==1)||u.lt(w)))throw Error(o+`Argument `+(u.isInteger()?`out of range: `:`not an integer: `)+R(u));if(!y)return new F(v);for(n=new F(w),p=r=new F(w),i=f=new F(w),_=g(y),s=n.e=_.length-v.e-1,n.c[0]=d[(c=s%l)<0?l+c:c],e=!e||u.comparedTo(n)>0?s>0?n:p:u,c=A,A=1/0,u=new F(_),f.c[0]=0;m=t(u,n,0,1),a=r.plus(m.times(i)),a.comparedTo(e)!=1;)r=i,i=a,p=f.plus(m.times(a=p)),f=a,n=u.minus(m.times(a=n)),u=a;return a=t(e.minus(r),i,0,1),f=f.plus(a.times(p)),r=r.plus(a.times(i)),f.s=p.s=v.s,s*=2,h=t(p,i,s,E).minus(v).abs().comparedTo(t(f,r,s,E).minus(v).abs())<1?[p,i]:[f,r],A=c,h},C.toNumber=function(){return+R(this)},C.toPrecision=function(e,t){return e!=null&&v(e,1,p),ne(this,e,t,2)},C.toString=function(e){var t,r=this,i=r.s,a=r.e;return a===null?i?(t=`Infinity`,i<0&&(t=`-`+t)):t=`NaN`:(e==null?t=a<=D||a>=O?b(g(r.c),a):x(g(r.c),a,`0`):e===10&&te?(r=L(new F(r),T+a+1,E),t=x(g(r.c),r.e,`0`)):(v(e,2,P.length,`Base`),t=n(x(g(r.c),a,`0`),10,e,i,!0)),i<0&&r.c[0]&&(t=`-`+t)),t},C.valueOf=C.toJSON=function(){return R(this)},C._isBigNumber=!0,e!=null&&F.set(e),F}function h(e){var t=e|0;return e>0||e===t?t:t-1}function g(e){for(var t,n,r=1,i=e.length,a=e[0]+``;r<i;){for(t=e[r++]+``,n=l-t.length;n--;t=`0`+t);a+=t}for(i=a.length;a.charCodeAt(--i)===48;);return a.slice(0,i+1||1)}function _(e,t){var n,r,i=e.c,a=t.c,o=e.s,s=t.s,c=e.e,l=t.e;if(!o||!s)return null;if(n=i&&!i[0],r=a&&!a[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=c==l,!i||!a)return r?0:!i^n?1:-1;if(!r)return c>l^n?1:-1;for(s=(c=i.length)<(l=a.length)?c:l,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^n?1:-1;return c==l?0:c>l^n?1:-1}function v(e,t,n,r){if(e<t||e>n||e!==a(e))throw Error(o+(r||`Argument`)+(typeof e==`number`?e<t||e>n?` out of range: `:` not an integer: `:` not a primitive number: `)+String(e))}function y(e){var t=e.c.length-1;return h(e.e/l)==t&&e.c[t]%2!=0}function b(e,t){return(e.length>1?e.charAt(0)+`.`+e.slice(1):e)+(t<0?`e`:`e+`)+t}function x(e,t,n){var r,i;if(t<0){for(i=n+`.`;++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+`.`+e.slice(t));return e}n=m(),n.default=n.BigNumber=n,typeof define==`function`&&define.amd?define(function(){return n}):t!==void 0&&t.exports?t.exports=n:(e||=typeof self<`u`&&self?self:window,e.BigNumber=n)})(e)})),w=n(((e,t)=>{var n=C(),r=t.exports;(function(){var e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,t,i,a={"\b":`\\b`," ":`\\t`,"\n":`\\n`,"\f":`\\f`,"\r":`\\r`,'"':`\\"`,"\\":`\\\\`},o;function s(t){return e.lastIndex=0,e.test(t)?`"`+t.replace(e,function(e){var t=a[e];return typeof t==`string`?t:`\\u`+(`0000`+e.charCodeAt(0).toString(16)).slice(-4)})+`"`:`"`+t+`"`}function c(e,r){var a,l,u,d,f=t,p,m=r[e],h=m!=null&&(m instanceof n||n.isBigNumber(m));switch(m&&typeof m==`object`&&typeof m.toJSON==`function`&&(m=m.toJSON(e)),typeof o==`function`&&(m=o.call(r,e,m)),typeof m){case`string`:return h?m:s(m);case`number`:return isFinite(m)?String(m):`null`;case`boolean`:case`null`:case`bigint`:return String(m);case`object`:if(!m)return`null`;if(t+=i,p=[],Object.prototype.toString.apply(m)===`[object Array]`){for(d=m.length,a=0;a<d;a+=1)p[a]=c(a,m)||`null`;return u=p.length===0?`[]`:t?`[
|
|
4
|
+
`;yield n}static#a;static#o;static async#s(){return this.#a||=(await import(`./dist-BtZHKnO9.mjs`).then(e=>t(e.default))).HttpsProxyAgent,this.#a}static async#c(){let e=typeof window<`u`&&!!window;return this.#o||=e?window.fetch:(await import(`./src-BxDQmPZ6.mjs`)).default,this.#o}static mergeHeaders(e,...t){e=e instanceof Headers?e:new Headers(e);for(let n of t)(n instanceof Headers?n:new Headers(n)).forEach((t,n)=>{n===`set-cookie`?e.append(n,t):e.set(n,t)});return e}};n.Gaxios=f,i=f})),S=n((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.instance=e.Gaxios=e.GaxiosError=void 0,e.request=a;let r=x();Object.defineProperty(e,`Gaxios`,{enumerable:!0,get:function(){return r.Gaxios}});var i=v();Object.defineProperty(e,`GaxiosError`,{enumerable:!0,get:function(){return i.GaxiosError}}),n(b(),e),e.instance=new r.Gaxios;async function a(t){return e.instance.request(t)}})),C=n(((e,t)=>{(function(e){var n,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,a=Math.floor,o=`[BigNumber Error] `,s=o+`Number primitive has more than 15 significant digits: `,c=0x5af3107a4000,l=14,u=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,0xe8d4a51000,0x9184e72a000],f=1e7,p=1e9;function m(e){var t,n,S,C=F.prototype={constructor:F,toString:null,valueOf:null},w=new F(1),T=20,E=4,D=-7,O=21,k=-1e7,A=1e7,j=!1,M=1,N=0,ee={prefix:``,groupSize:3,secondaryGroupSize:0,groupSeparator:`,`,decimalSeparator:`.`,fractionGroupSize:0,fractionGroupSeparator:`\xA0`,suffix:``},P=`0123456789abcdefghijklmnopqrstuvwxyz`,te=!0;function F(e,t){var i,o,c,d,f,p,m,h,g=this;if(!(g instanceof F))return new F(e,t);if(t==null){if(e&&e._isBigNumber===!0){g.s=e.s,!e.c||e.e>A?g.c=g.e=null:e.e<k?g.c=[g.e=0]:(g.e=e.e,g.c=e.c.slice());return}if((p=typeof e==`number`)&&e*0==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(d=0,f=e;f>=10;f/=10,d++);d>A?g.c=g.e=null:(g.e=d,g.c=[e]);return}h=String(e)}else{if(!r.test(h=String(e)))return S(g,h,p);g.s=h.charCodeAt(0)==45?(h=h.slice(1),-1):1}(d=h.indexOf(`.`))>-1&&(h=h.replace(`.`,``)),(f=h.search(/e/i))>0?(d<0&&(d=f),d+=+h.slice(f+1),h=h.substring(0,f)):d<0&&(d=h.length)}else{if(v(t,2,P.length,`Base`),t==10&&te)return g=new F(e),L(g,T+g.e+1,E);if(h=String(e),p=typeof e==`number`){if(e*0!=0)return S(g,h,p,t);if(g.s=1/e<0?(h=h.slice(1),-1):1,F.DEBUG&&h.replace(/^0\.0*|\./,``).length>15)throw Error(s+e)}else g.s=h.charCodeAt(0)===45?(h=h.slice(1),-1):1;for(i=P.slice(0,t),d=f=0,m=h.length;f<m;f++)if(i.indexOf(o=h.charAt(f))<0){if(o==`.`){if(f>d){d=m;continue}}else if(!c&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){c=!0,f=-1,d=0;continue}return S(g,String(e),p,t)}p=!1,h=n(h,t,10,g.s),(d=h.indexOf(`.`))>-1?h=h.replace(`.`,``):d=h.length}for(f=0;h.charCodeAt(f)===48;f++);for(m=h.length;h.charCodeAt(--m)===48;);if(h=h.slice(f,++m)){if(m-=f,p&&F.DEBUG&&m>15&&(e>u||e!==a(e)))throw Error(s+g.s*e);if((d=d-f-1)>A)g.c=g.e=null;else if(d<k)g.c=[g.e=0];else{if(g.e=d,g.c=[],f=(d+1)%l,d<0&&(f+=l),f<m){for(f&&g.c.push(+h.slice(0,f)),m-=l;f<m;)g.c.push(+h.slice(f,f+=l));f=l-(h=h.slice(f)).length}else f-=m;for(;f--;h+=`0`);g.c.push(+h)}}else g.c=[g.e=0]}F.clone=m,F.ROUND_UP=0,F.ROUND_DOWN=1,F.ROUND_CEIL=2,F.ROUND_FLOOR=3,F.ROUND_HALF_UP=4,F.ROUND_HALF_DOWN=5,F.ROUND_HALF_EVEN=6,F.ROUND_HALF_CEIL=7,F.ROUND_HALF_FLOOR=8,F.EUCLID=9,F.config=F.set=function(e){var t,n;if(e!=null)if(typeof e==`object`){if(e.hasOwnProperty(t=`DECIMAL_PLACES`)&&(n=e[t],v(n,0,p,t),T=n),e.hasOwnProperty(t=`ROUNDING_MODE`)&&(n=e[t],v(n,0,8,t),E=n),e.hasOwnProperty(t=`EXPONENTIAL_AT`)&&(n=e[t],n&&n.pop?(v(n[0],-p,0,t),v(n[1],0,p,t),D=n[0],O=n[1]):(v(n,-p,p,t),D=-(O=n<0?-n:n))),e.hasOwnProperty(t=`RANGE`))if(n=e[t],n&&n.pop)v(n[0],-p,-1,t),v(n[1],1,p,t),k=n[0],A=n[1];else if(v(n,-p,p,t),n)k=-(A=n<0?-n:n);else throw Error(o+t+` cannot be zero: `+n);if(e.hasOwnProperty(t=`CRYPTO`))if(n=e[t],n===!!n)if(n)if(typeof crypto<`u`&&crypto&&(crypto.getRandomValues||crypto.randomBytes))j=n;else throw j=!n,Error(o+`crypto unavailable`);else j=n;else throw Error(o+t+` not true or false: `+n);if(e.hasOwnProperty(t=`MODULO_MODE`)&&(n=e[t],v(n,0,9,t),M=n),e.hasOwnProperty(t=`POW_PRECISION`)&&(n=e[t],v(n,0,p,t),N=n),e.hasOwnProperty(t=`FORMAT`))if(n=e[t],typeof n==`object`)ee=n;else throw Error(o+t+` not an object: `+n);if(e.hasOwnProperty(t=`ALPHABET`))if(n=e[t],typeof n==`string`&&!/^.?$|[+\-.\s]|(.).*\1/.test(n))te=n.slice(0,10)==`0123456789`,P=n;else throw Error(o+t+` invalid: `+n)}else throw Error(o+`Object expected: `+e);return{DECIMAL_PLACES:T,ROUNDING_MODE:E,EXPONENTIAL_AT:[D,O],RANGE:[k,A],CRYPTO:j,MODULO_MODE:M,POW_PRECISION:N,FORMAT:ee,ALPHABET:P}},F.isBigNumber=function(e){if(!e||e._isBigNumber!==!0)return!1;if(!F.DEBUG)return!0;var t,n,r=e.c,i=e.e,s=e.s;out:if({}.toString.call(r)==`[object Array]`){if((s===1||s===-1)&&i>=-p&&i<=p&&i===a(i)){if(r[0]===0){if(i===0&&r.length===1)return!0;break out}if(t=(i+1)%l,t<1&&(t+=l),String(r[0]).length==t){for(t=0;t<r.length;t++)if(n=r[t],n<0||n>=c||n!==a(n))break out;if(n!==0)return!0}}}else if(r===null&&i===null&&(s===null||s===1||s===-1))return!0;throw Error(o+`Invalid BigNumber: `+e)},F.maximum=F.max=function(){return re(arguments,-1)},F.minimum=F.min=function(){return re(arguments,1)},F.random=(function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return a(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(e){var n,r,s,c,u,f=0,m=[],h=new F(w);if(e==null?e=T:v(e,0,p),c=i(e/l),j)if(crypto.getRandomValues){for(n=crypto.getRandomValues(new Uint32Array(c*=2));f<c;)u=n[f]*131072+(n[f+1]>>>11),u>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),n[f]=r[0],n[f+1]=r[1]):(m.push(u%0x5af3107a4000),f+=2);f=c/2}else if(crypto.randomBytes){for(n=crypto.randomBytes(c*=7);f<c;)u=(n[f]&31)*281474976710656+n[f+1]*1099511627776+n[f+2]*4294967296+n[f+3]*16777216+(n[f+4]<<16)+(n[f+5]<<8)+n[f+6],u>=9e15?crypto.randomBytes(7).copy(n,f):(m.push(u%0x5af3107a4000),f+=7);f=c/7}else throw j=!1,Error(o+`crypto unavailable`);if(!j)for(;f<c;)u=t(),u<9e15&&(m[f++]=u%0x5af3107a4000);for(c=m[--f],e%=l,c&&e&&(u=d[l-e],m[f]=a(c/u)*u);m[f]===0;m.pop(),f--);if(f<0)m=[s=0];else{for(s=-1;m[0]===0;m.splice(0,1),s-=l);for(f=1,u=m[0];u>=10;u/=10,f++);f<l&&(s-=l-f)}return h.e=s,h.c=m,h}})(),F.sum=function(){for(var e=1,t=arguments,n=new F(t[0]);e<t.length;)n=n.plus(t[e++]);return n},n=(function(){var e=`0123456789`;function n(e,t,n,r){for(var i,a=[0],o,s=0,c=e.length;s<c;){for(o=a.length;o--;a[o]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>n-1&&(a[i+1]??(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(r,i,a,o,s){var c,l,u,d,f,p,m,h,_=r.indexOf(`.`),v=T,y=E;for(_>=0&&(d=N,N=0,r=r.replace(`.`,``),h=new F(i),p=h.pow(r.length-_),N=d,h.c=n(x(g(p.c),p.e,`0`),10,a,e),h.e=h.c.length),m=n(r,i,a,s?(c=P,e):(c=e,P)),u=d=m.length;m[--d]==0;m.pop());if(!m[0])return c.charAt(0);if(_<0?--u:(p.c=m,p.e=u,p.s=o,p=t(p,h,v,y,a),m=p.c,f=p.r,u=p.e),l=u+v+1,_=m[l],d=a/2,f=f||l<0||m[l+1]!=null,f=y<4?(_!=null||f)&&(y==0||y==(p.s<0?3:2)):_>d||_==d&&(y==4||f||y==6&&m[l-1]&1||y==(p.s<0?8:7)),l<1||!m[0])r=f?x(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(m.length=l,f)for(--a;++m[--l]>a;)m[l]=0,l||(++u,m=[1].concat(m));for(d=m.length;!m[--d];);for(_=0,r=``;_<=d;r+=c.charAt(m[_++]));r=x(r,u,c.charAt(0))}return r}})(),t=(function(){function e(e,t,n){var r,i,a,o,s=0,c=e.length,l=t%f,u=t/f|0;for(e=e.slice();c--;)a=e[c]%f,o=e[c]/f|0,r=u*a+o*l,i=l*a+r%f*f+s,s=(i/n|0)+(r/f|0)+u*o,e[c]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,i,o,s,u){var d,f,p,m,g,_,v,y,b,x,S,C,w,T,E,D,O,k=r.s==i.s?1:-1,A=r.c,j=i.c;if(!A||!A[0]||!j||!j[0])return new F(!r.s||!i.s||(A?j&&A[0]==j[0]:!j)?NaN:A&&A[0]==0||!j?k*0:k/0);for(y=new F(k),b=y.c=[],f=r.e-i.e,k=o+f+1,u||(u=c,f=h(r.e/l)-h(i.e/l),k=k/l|0),p=0;j[p]==(A[p]||0);p++);if(j[p]>(A[p]||0)&&f--,k<0)b.push(1),m=!0;else{for(T=A.length,D=j.length,p=0,k+=2,g=a(u/(j[0]+1)),g>1&&(j=e(j,g,u),A=e(A,g,u),D=j.length,T=A.length),w=D,x=A.slice(0,D),S=x.length;S<D;x[S++]=0);O=j.slice(),O=[0].concat(O),E=j[0],j[1]>=u/2&&E++;do{if(g=0,d=t(j,x,D,S),d<0){if(C=x[0],D!=S&&(C=C*u+(x[1]||0)),g=a(C/E),g>1)for(g>=u&&(g=u-1),_=e(j,g,u),v=_.length,S=x.length;t(_,x,v,S)==1;)g--,n(_,D<v?O:j,v,u),v=_.length,d=1;else g==0&&(d=g=1),_=j.slice(),v=_.length;if(v<S&&(_=[0].concat(_)),n(x,_,S,u),S=x.length,d==-1)for(;t(j,x,D,S)<1;)g++,n(x,D<S?O:j,S,u),S=x.length}else d===0&&(g++,x=[0]);b[p++]=g,x[0]?x[S++]=A[w]||0:(x=[A[w]],S=1)}while((w++<T||x[0]!=null)&&k--);m=x[0]!=null,b[0]||b.splice(0,1)}if(u==c){for(p=1,k=b[0];k>=10;k/=10,p++);L(y,o+(y.e=p+f*l-1)+1,s,m)}else y.e=f,y.r=+m;return y}})();function ne(e,t,n,r){var i,a,o,s,c;if(n==null?n=E:v(n,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,t==null)c=g(e.c),c=r==1||r==2&&(o<=D||o>=O)?b(c,o):x(c,o,`0`);else if(e=L(new F(e),t,n),a=e.e,c=g(e.c),s=c.length,r==1||r==2&&(t<=a||a<=D)){for(;s<t;c+=`0`,s++);c=b(c,a)}else if(t-=o+(r===2&&a>o),c=x(c,a,`0`),a+1>s){if(--t>0)for(c+=`.`;t--;c+=`0`);}else if(t+=a-s,t>0)for(a+1==s&&(c+=`.`);t--;c+=`0`);return e.s<0&&i?`-`+c:c}function re(e,t){for(var n,r,i=1,a=new F(e[0]);i<e.length;i++)r=new F(e[i]),(!r.s||(n=_(a,r))===t||n===0&&a.s===t)&&(a=r);return a}function I(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*l-1)>A?e.c=e.e=null:n<k?e.c=[e.e=0]:(e.e=n,e.c=t),e}S=(function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,n=/^\.([^.]+)$/,r=/^-?(Infinity|NaN)$/,i=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(a,s,c,l){var u,d=c?s:s.replace(i,``);if(r.test(d))a.s=isNaN(d)?null:d<0?-1:1;else{if(!c&&(d=d.replace(e,function(e,t,n){return u=(n=n.toLowerCase())==`x`?16:n==`b`?2:8,!l||l==u?t:e}),l&&(u=l,d=d.replace(t,`$1`).replace(n,`0.$1`)),s!=d))return new F(d,u);if(F.DEBUG)throw Error(o+`Not a`+(l?` base `+l:``)+` number: `+s);a.s=null}a.c=a.e=null}})();function L(e,t,n,r){var o,s,u,f,p,m,h,g=e.c,_=d;if(g){out:{for(o=1,f=g[0];f>=10;f/=10,o++);if(s=t-o,s<0)s+=l,u=t,p=g[m=0],h=a(p/_[o-u-1]%10);else if(m=i((s+1)/l),m>=g.length)if(r){for(;g.length<=m;g.push(0));p=h=0,o=1,s%=l,u=s-l+1}else break out;else{for(p=f=g[m],o=1;f>=10;f/=10,o++);s%=l,u=s-l+o,h=u<0?0:a(p/_[o-u-1]%10)}if(r=r||t<0||g[m+1]!=null||(u<0?p:p%_[o-u-1]),r=n<4?(h||r)&&(n==0||n==(e.s<0?3:2)):h>5||h==5&&(n==4||r||n==6&&(s>0?u>0?p/_[o-u]:0:g[m-1])%10&1||n==(e.s<0?8:7)),t<1||!g[0])return g.length=0,r?(t-=e.e+1,g[0]=_[(l-t%l)%l],e.e=-t||0):g[0]=e.e=0,e;if(s==0?(g.length=m,f=1,m--):(g.length=m+1,f=_[l-s],g[m]=u>0?a(p/_[o-u]%_[u])*f:0),r)for(;;)if(m==0){for(s=1,u=g[0];u>=10;u/=10,s++);for(u=g[0]+=f,f=1;u>=10;u/=10,f++);s!=f&&(e.e++,g[0]==c&&(g[0]=1));break}else{if(g[m]+=f,g[m]!=c)break;g[m--]=0,f=1}for(s=g.length;g[--s]===0;g.pop());}e.e>A?e.c=e.e=null:e.e<k&&(e.c=[e.e=0])}return e}function R(e){var t,n=e.e;return n===null?e.toString():(t=g(e.c),t=n<=D||n>=O?b(t,n):x(t,n,`0`),e.s<0?`-`+t:t)}return C.absoluteValue=C.abs=function(){var e=new F(this);return e.s<0&&(e.s=1),e},C.comparedTo=function(e,t){return _(this,new F(e,t))},C.decimalPlaces=C.dp=function(e,t){var n,r,i,a=this;if(e!=null)return v(e,0,p),t==null?t=E:v(t,0,8),L(new F(a),e+a.e+1,t);if(!(n=a.c))return null;if(r=((i=n.length-1)-h(this.e/l))*l,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},C.dividedBy=C.div=function(e,n){return t(this,new F(e,n),T,E)},C.dividedToIntegerBy=C.idiv=function(e,n){return t(this,new F(e,n),0,1)},C.exponentiatedBy=C.pow=function(e,t){var n,r,s,c,u,d,f,p,m,h=this;if(e=new F(e),e.c&&!e.isInteger())throw Error(o+`Exponent not an integer: `+R(e));if(t!=null&&(t=new F(t)),d=e.e>14,!h.c||!h.c[0]||h.c[0]==1&&!h.e&&h.c.length==1||!e.c||!e.c[0])return m=new F(R(h)**(d?e.s*(2-y(e)):+R(e))),t?m.mod(t):m;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new F(NaN);r=!f&&h.isInteger()&&t.isInteger(),r&&(h=h.mod(t))}else if(e.e>9&&(h.e>0||h.e<-1||(h.e==0?h.c[0]>1||d&&h.c[1]>=24e7:h.c[0]<8e13||d&&h.c[0]<=9999975e7)))return c=h.s<0&&y(e)?-0:0,h.e>-1&&(c=1/c),new F(f?1/c:c);else N&&(c=i(N/l+2));for(d?(n=new F(.5),f&&(e.s=1),p=y(e)):(s=Math.abs(+R(e)),p=s%2),m=new F(w);;){if(p){if(m=m.times(h),!m.c)break;c?m.c.length>c&&(m.c.length=c):r&&(m=m.mod(t))}if(s){if(s=a(s/2),s===0)break;p=s%2}else if(e=e.times(n),L(e,e.e+1,1),e.e>14)p=y(e);else{if(s=+R(e),s===0)break;p=s%2}h=h.times(h),c?h.c&&h.c.length>c&&(h.c.length=c):r&&(h=h.mod(t))}return r?m:(f&&(m=w.div(m)),t?m.mod(t):c?L(m,N,E,u):m)},C.integerValue=function(e){var t=new F(this);return e==null?e=E:v(e,0,8),L(t,t.e+1,e)},C.isEqualTo=C.eq=function(e,t){return _(this,new F(e,t))===0},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(e,t){return _(this,new F(e,t))>0},C.isGreaterThanOrEqualTo=C.gte=function(e,t){return(t=_(this,new F(e,t)))===1||t===0},C.isInteger=function(){return!!this.c&&h(this.e/l)>this.c.length-2},C.isLessThan=C.lt=function(e,t){return _(this,new F(e,t))<0},C.isLessThanOrEqualTo=C.lte=function(e,t){return(t=_(this,new F(e,t)))===-1||t===0},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&this.c[0]==0},C.minus=function(e,t){var n,r,i,a,o=this,s=o.s;if(e=new F(e,t),t=e.s,!s||!t)return new F(NaN);if(s!=t)return e.s=-t,o.plus(e);var u=o.e/l,d=e.e/l,f=o.c,p=e.c;if(!u||!d){if(!f||!p)return f?(e.s=-t,e):new F(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new F(f[0]?o:E==3?-0:0)}if(u=h(u),d=h(d),f=f.slice(),s=u-d){for((a=s<0)?(s=-s,i=f):(d=u,i=p),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(r=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;t<r;t++)if(f[t]!=p[t]){a=f[t]<p[t];break}if(a&&(i=f,f=p,p=i,e.s=-e.s),t=(r=p.length)-(n=f.length),t>0)for(;t--;f[n++]=0);for(t=c-1;r>s;){if(f[--r]<p[r]){for(n=r;n&&!f[--n];f[n]=t);--f[n],f[r]+=c}f[r]-=p[r]}for(;f[0]==0;f.splice(0,1),--d);return f[0]?I(e,f,d):(e.s=E==3?-1:1,e.c=[e.e=0],e)},C.modulo=C.mod=function(e,n){var r,i,a=this;return e=new F(e,n),!a.c||!e.s||e.c&&!e.c[0]?new F(NaN):!e.c||a.c&&!a.c[0]?new F(a):(M==9?(i=e.s,e.s=1,r=t(a,e,0,3),e.s=i,r.s*=i):r=t(a,e,0,M),e=a.minus(r.times(e)),!e.c[0]&&M==1&&(e.s=a.s),e)},C.multipliedBy=C.times=function(e,t){var n,r,i,a,o,s,u,d,p,m,g,_,v,y,b,x=this,S=x.c,C=(e=new F(e,t)).c;if(!S||!C||!S[0]||!C[0])return!x.s||!e.s||S&&!S[0]&&!C||C&&!C[0]&&!S?e.c=e.e=e.s=null:(e.s*=x.s,!S||!C?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(r=h(x.e/l)+h(e.e/l),e.s*=x.s,u=S.length,m=C.length,u<m&&(v=S,S=C,C=v,i=u,u=m,m=i),i=u+m,v=[];i--;v.push(0));for(y=c,b=f,i=m;--i>=0;){for(n=0,g=C[i]%b,_=C[i]/b|0,o=u,a=i+o;a>i;)d=S[--o]%b,p=S[o]/b|0,s=_*d+p*g,d=g*d+s%b*b+v[a]+n,n=(d/y|0)+(s/b|0)+_*p,v[a--]=d%y;v[a]=n}return n?++r:v.splice(0,1),I(e,v,r)},C.negated=function(){var e=new F(this);return e.s=-e.s||null,e},C.plus=function(e,t){var n,r=this,i=r.s;if(e=new F(e,t),t=e.s,!i||!t)return new F(NaN);if(i!=t)return e.s=-t,r.minus(e);var a=r.e/l,o=e.e/l,s=r.c,u=e.c;if(!a||!o){if(!s||!u)return new F(i/0);if(!s[0]||!u[0])return u[0]?e:new F(s[0]?r:i*0)}if(a=h(a),o=h(o),s=s.slice(),i=a-o){for(i>0?(o=a,n=u):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for(i=s.length,t=u.length,i-t<0&&(n=u,u=s,s=n,t=i),i=0;t;)i=(s[--t]=s[t]+u[t]+i)/c|0,s[t]=c===s[t]?0:s[t]%c;return i&&(s=[i].concat(s),++o),I(e,s,o)},C.precision=C.sd=function(e,t){var n,r,i,a=this;if(e!=null&&e!==!!e)return v(e,1,p),t==null?t=E:v(t,0,8),L(new F(a),e,t);if(!(n=a.c))return null;if(i=n.length-1,r=i*l+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&a.e+1>r&&(r=a.e+1),r},C.shiftedBy=function(e){return v(e,-u,u),this.times(`1e`+e)},C.squareRoot=C.sqrt=function(){var e,n,r,i,a,o=this,s=o.c,c=o.s,l=o.e,u=T+4,d=new F(`0.5`);if(c!==1||!s||!s[0])return new F(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);if(c=Math.sqrt(+R(o)),c==0||c==1/0?(n=g(s),(n.length+l)%2==0&&(n+=`0`),c=Math.sqrt(+n),l=h((l+1)/2)-(l<0||l%2),c==1/0?n=`5e`+l:(n=c.toExponential(),n=n.slice(0,n.indexOf(`e`)+1)+l),r=new F(n)):r=new F(c+``),r.c[0]){for(l=r.e,c=l+u,c<3&&(c=0);;)if(a=r,r=d.times(a.plus(t(o,a,u,1))),g(a.c).slice(0,c)===(n=g(r.c)).slice(0,c))if(r.e<l&&--c,n=n.slice(c-3,c+1),n==`9999`||!i&&n==`4999`){if(!i&&(L(a,a.e+T+2,0),a.times(a).eq(o))){r=a;break}u+=4,c+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)==`5`)&&(L(r,r.e+T+2,1),e=!r.times(r).eq(o));break}}return L(r,r.e+T+1,E,e)},C.toExponential=function(e,t){return e!=null&&(v(e,0,p),e++),ne(this,e,t,1)},C.toFixed=function(e,t){return e!=null&&(v(e,0,p),e=e+this.e+1),ne(this,e,t)},C.toFormat=function(e,t,n){var r,i=this;if(n==null)e!=null&&t&&typeof t==`object`?(n=t,t=null):e&&typeof e==`object`?(n=e,e=t=null):n=ee;else if(typeof n!=`object`)throw Error(o+`Argument not an object: `+n);if(r=i.toFixed(e,t),i.c){var a,s=r.split(`.`),c=+n.groupSize,l=+n.secondaryGroupSize,u=n.groupSeparator||``,d=s[0],f=s[1],p=i.s<0,m=p?d.slice(1):d,h=m.length;if(l&&(a=c,c=l,l=a,h-=a),c>0&&h>0){for(a=h%c||c,d=m.substr(0,a);a<h;a+=c)d+=u+m.substr(a,c);l>0&&(d+=u+m.slice(a)),p&&(d=`-`+d)}r=f?d+(n.decimalSeparator||``)+((l=+n.fractionGroupSize)?f.replace(RegExp(`\\d{`+l+`}\\B`,`g`),`$&`+(n.fractionGroupSeparator||``)):f):d}return(n.prefix||``)+r+(n.suffix||``)},C.toFraction=function(e){var n,r,i,a,s,c,u,f,p,m,h,_,v=this,y=v.c;if(e!=null&&(u=new F(e),!u.isInteger()&&(u.c||u.s!==1)||u.lt(w)))throw Error(o+`Argument `+(u.isInteger()?`out of range: `:`not an integer: `)+R(u));if(!y)return new F(v);for(n=new F(w),p=r=new F(w),i=f=new F(w),_=g(y),s=n.e=_.length-v.e-1,n.c[0]=d[(c=s%l)<0?l+c:c],e=!e||u.comparedTo(n)>0?s>0?n:p:u,c=A,A=1/0,u=new F(_),f.c[0]=0;m=t(u,n,0,1),a=r.plus(m.times(i)),a.comparedTo(e)!=1;)r=i,i=a,p=f.plus(m.times(a=p)),f=a,n=u.minus(m.times(a=n)),u=a;return a=t(e.minus(r),i,0,1),f=f.plus(a.times(p)),r=r.plus(a.times(i)),f.s=p.s=v.s,s*=2,h=t(p,i,s,E).minus(v).abs().comparedTo(t(f,r,s,E).minus(v).abs())<1?[p,i]:[f,r],A=c,h},C.toNumber=function(){return+R(this)},C.toPrecision=function(e,t){return e!=null&&v(e,1,p),ne(this,e,t,2)},C.toString=function(e){var t,r=this,i=r.s,a=r.e;return a===null?i?(t=`Infinity`,i<0&&(t=`-`+t)):t=`NaN`:(e==null?t=a<=D||a>=O?b(g(r.c),a):x(g(r.c),a,`0`):e===10&&te?(r=L(new F(r),T+a+1,E),t=x(g(r.c),r.e,`0`)):(v(e,2,P.length,`Base`),t=n(x(g(r.c),a,`0`),10,e,i,!0)),i<0&&r.c[0]&&(t=`-`+t)),t},C.valueOf=C.toJSON=function(){return R(this)},C._isBigNumber=!0,e!=null&&F.set(e),F}function h(e){var t=e|0;return e>0||e===t?t:t-1}function g(e){for(var t,n,r=1,i=e.length,a=e[0]+``;r<i;){for(t=e[r++]+``,n=l-t.length;n--;t=`0`+t);a+=t}for(i=a.length;a.charCodeAt(--i)===48;);return a.slice(0,i+1||1)}function _(e,t){var n,r,i=e.c,a=t.c,o=e.s,s=t.s,c=e.e,l=t.e;if(!o||!s)return null;if(n=i&&!i[0],r=a&&!a[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=c==l,!i||!a)return r?0:!i^n?1:-1;if(!r)return c>l^n?1:-1;for(s=(c=i.length)<(l=a.length)?c:l,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^n?1:-1;return c==l?0:c>l^n?1:-1}function v(e,t,n,r){if(e<t||e>n||e!==a(e))throw Error(o+(r||`Argument`)+(typeof e==`number`?e<t||e>n?` out of range: `:` not an integer: `:` not a primitive number: `)+String(e))}function y(e){var t=e.c.length-1;return h(e.e/l)==t&&e.c[t]%2!=0}function b(e,t){return(e.length>1?e.charAt(0)+`.`+e.slice(1):e)+(t<0?`e`:`e+`)+t}function x(e,t,n){var r,i;if(t<0){for(i=n+`.`;++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+`.`+e.slice(t));return e}n=m(),n.default=n.BigNumber=n,typeof define==`function`&&define.amd?define(function(){return n}):t!==void 0&&t.exports?t.exports=n:(e||=typeof self<`u`&&self?self:window,e.BigNumber=n)})(e)})),w=n(((e,t)=>{var n=C(),r=t.exports;(function(){var e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,t,i,a={"\b":`\\b`," ":`\\t`,"\n":`\\n`,"\f":`\\f`,"\r":`\\r`,'"':`\\"`,"\\":`\\\\`},o;function s(t){return e.lastIndex=0,e.test(t)?`"`+t.replace(e,function(e){var t=a[e];return typeof t==`string`?t:`\\u`+(`0000`+e.charCodeAt(0).toString(16)).slice(-4)})+`"`:`"`+t+`"`}function c(e,r){var a,l,u,d,f=t,p,m=r[e],h=m!=null&&(m instanceof n||n.isBigNumber(m));switch(m&&typeof m==`object`&&typeof m.toJSON==`function`&&(m=m.toJSON(e)),typeof o==`function`&&(m=o.call(r,e,m)),typeof m){case`string`:return h?m:s(m);case`number`:return isFinite(m)?String(m):`null`;case`boolean`:case`null`:case`bigint`:return String(m);case`object`:if(!m)return`null`;if(t+=i,p=[],Object.prototype.toString.apply(m)===`[object Array]`){for(d=m.length,a=0;a<d;a+=1)p[a]=c(a,m)||`null`;return u=p.length===0?`[]`:t?`[
|
|
5
5
|
`+t+p.join(`,
|
|
6
6
|
`+t)+`
|
|
7
7
|
`+f+`]`:`[`+p.join(`,`)+`]`,t=f,u}if(o&&typeof o==`object`)for(d=o.length,a=0;a<d;a+=1)typeof o[a]==`string`&&(l=o[a],u=c(l,m),u&&p.push(s(l)+(t?`: `:`:`)+u));else Object.keys(m).forEach(function(e){var n=c(e,m);n&&p.push(s(e)+(t?`: `:`:`)+n)});return u=p.length===0?`{}`:t?`{
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./event-stream-BrGAtXMV.mjs";import{n as t,t as n}from"./models-BZPNtJp1.mjs";import{n as r}from"./headers-Gh3dvZSc.mjs";import{t as i}from"./provider-env-CgV7Mc0a.mjs";import{t as a}from"./sanitize-unicode-C8aKmv6o.mjs";import{r as o}from"./transform-messages-s3jcHssz.mjs";import{n as s,t as c}from"./error-body-3m883nGr.mjs";import{a as l,c as u,i as d,l as f,n as p,o as m,r as h,s as g,t as _}from"./google-shared-CgKgcf0q.mjs";const v={THINKING_LEVEL_UNSPECIFIED:f.THINKING_LEVEL_UNSPECIFIED,MINIMAL:f.MINIMAL,LOW:f.LOW,MEDIUM:f.MEDIUM,HIGH:f.HIGH};let y=0;const b=(t,r,i)=>{let a=new e;return(async()=>{let e={role:`assistant`,content:[],api:`google-vertex`,provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let o=O(i),s=o?C(t,o,i?.headers):S(t,A(i),j(i),i?.headers,i?.env),c=M(t,r,i),l=await i?.onPayload?.(c,t);l!==void 0&&(c=l);let u=await s.models.generateContentStream(c);a.push({type:`start`,partial:e});let f=null,p=e.content,g=()=>p.length-1;for await(let r of u){e.responseId||=r.responseId;let i=r.candidates?.[0];if(i?.content?.parts)for(let t of i.content.parts){if(t.text!==void 0){let n=h(t);(!f||n&&f.type!==`thinking`||!n&&f.type!==`text`)&&(f&&(f.type===`text`?a.push({type:`text_end`,contentIndex:p.length-1,content:f.text,partial:e}):a.push({type:`thinking_end`,contentIndex:g(),content:f.thinking,partial:e})),n?(f={type:`thinking`,thinking:``,thinkingSignature:void 0},e.content.push(f),a.push({type:`thinking_start`,contentIndex:g(),partial:e})):(f={type:`text`,text:``},e.content.push(f),a.push({type:`text_start`,contentIndex:g(),partial:e}))),f.type===`thinking`?(f.thinking+=t.text,f.thinkingSignature=m(f.thinkingSignature,t.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:g(),delta:t.text,partial:e})):(f.text+=t.text,f.textSignature=m(f.textSignature,t.thoughtSignature),a.push({type:`text_delta`,contentIndex:g(),delta:t.text,partial:e}))}if(t.functionCall){f&&=(f.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:f.text,partial:e}):a.push({type:`thinking_end`,contentIndex:g(),content:f.thinking,partial:e}),null);let n=t.functionCall.id,r={type:`toolCall`,id:!n||e.content.some(e=>e.type===`toolCall`&&e.id===n)?`${t.functionCall.name}_${Date.now()}_${++y}`:n,name:t.functionCall.name||``,arguments:t.functionCall.args??{},...t.thoughtSignature&&{thoughtSignature:t.thoughtSignature}};e.content.push(r),a.push({type:`toolcall_start`,contentIndex:g(),partial:e}),a.push({type:`toolcall_delta`,contentIndex:g(),delta:JSON.stringify(r.arguments),partial:e}),a.push({type:`toolcall_end`,contentIndex:g(),toolCall:r,partial:e})}}i?.finishReason&&(e.stopReason=d(i.finishReason),e.content.some(e=>e.type===`toolCall`)&&(e.stopReason=`toolUse`)),r.usageMetadata&&(e.usage={input:(r.usageMetadata.promptTokenCount||0)-(r.usageMetadata.cachedContentTokenCount||0),output:(r.usageMetadata.candidatesTokenCount||0)+(r.usageMetadata.thoughtsTokenCount||0),cacheRead:r.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:r.usageMetadata.thoughtsTokenCount||0,totalTokens:r.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},n(t,e.usage))}if(f&&(f.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:f.text,partial:e}):a.push({type:`thinking_end`,contentIndex:g(),content:f.thinking,partial:e})),i?.signal?.aborted)throw Error(`Request was aborted`);if(e.stopReason===`aborted`||e.stopReason===`error`)throw Error(`An unknown error occurred`);a.push({type:`done`,reason:e.stopReason,message:e}),a.end()}catch(t){for(let t of e.content)`index`in t&&delete t.index;e.stopReason=i?.signal?.aborted?`aborted`:`error`,e.errorMessage=c(s(t)),a.push({type:`error`,reason:e.stopReason,error:e}),a.end()}})(),a},x=(e,n,r)=>{let i=o(e,n,r,void 0);if(!r?.reasoning)return b(e,n,{...i,thinking:{enabled:!1}});let a=t(e,r.reasoning),s=a===`off`?`high`:a,c=e;return N(c)||P(c)?b(e,n,{...i,thinking:{enabled:!0,level:I(s,c)}}):b(e,n,{...i,thinking:{enabled:!0,budgetTokens:L(c,s,r.thinkingBudgets)}})};function S(e,t,n,r,i){let a=D(i);return new g({vertexai:!0,project:t,location:n,apiVersion:`v1`,...a?{googleAuthOptions:a}:{},httpOptions:w(e,r)})}function C(e,t,n){return new g({vertexai:!0,apiKey:t,apiVersion:`v1`,httpOptions:w(e,n)})}function w(e,t){let n={},i=T(e.baseUrl);i&&(n.baseUrl=i,n.baseUrlResourceScope=u.COLLECTION,E(i)&&(n.apiVersion=``));let a=r({...e.headers,...t});return a&&(n.headers=a),Object.keys(n).length>0?n:void 0}function T(e){let t=e.trim();if(!(!t||t.includes(`{location}`)))return t}function E(e){try{return new URL(e).pathname.split(`/`).some(e=>/^v\d+(?:beta\d*)?$/.test(e))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(e)}}function D(e){let t=i(`GOOGLE_APPLICATION_CREDENTIALS`,e);return t?{keyFilename:t}:void 0}function O(e){let t=e?.apiKey?.trim();if(!(!t||t===`gcp-vertex-credentials`||k(t)))return t}function k(e){return/^<[^>]+>$/.test(e)}function A(e){let t=e?.project||i(`GOOGLE_CLOUD_PROJECT`,e?.env)||i(`GCLOUD_PROJECT`,e?.env);if(!t)throw Error(`Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.`);return t}function j(e){let t=e?.location||i(`GOOGLE_CLOUD_LOCATION`,e?.env);if(!t)throw Error(`Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.`);return t}function M(e,t,n={}){let r=_(e,t),i={};n.temperature!==void 0&&(i.temperature=n.temperature),n.maxTokens!==void 0&&(i.maxOutputTokens=n.maxTokens);let o={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:a(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:p(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?o.toolConfig={functionCallingConfig:{mode:l(n.toolChoice)}}:o.toolConfig=void 0,n.thinking?.enabled&&e.reasoning){let e={includeThoughts:!0};n.thinking.level===void 0?n.thinking.budgetTokens!==void 0&&(e.thinkingBudget=n.thinking.budgetTokens):e.thinkingLevel=v[n.thinking.level],o.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(o.thinkingConfig=F(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);o.abortSignal=n.signal}return{model:e.id,contents:r,config:o}}function N(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function P(e){let t=e.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(t)||t===`gemini-flash-latest`||t===`gemini-flash-lite-latest`}function F(e){let t=e;return N(t)?{thinkingLevel:f.LOW}:P(t)?{thinkingLevel:f.MINIMAL}:{thinkingBudget:0}}function I(e,t){if(N(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}switch(e){case`minimal`:return`MINIMAL`;case`low`:return`LOW`;case`medium`:return`MEDIUM`;case`high`:return`HIGH`}}function L(e,t,n){return n?.[t]===void 0?e.id.includes(`2.5-pro`)?{minimal:128,low:2048,medium:8192,high:32768}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}export{b as stream,x as streamSimple};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./event-stream-CXocIcc6.mjs";import{n as t,t as n}from"./models-bnt621e8.mjs";import{t as r}from"./provider-env-p-MKZrBX.mjs";import{n as i}from"./headers-8nMK0zm-.mjs";import{t as a}from"./sanitize-unicode-BU6jSNzJ.mjs";import{r as o}from"./transform-messages-C0FNxyyM.mjs";import{n as s,t as c}from"./error-body-RPMBLEAJ.mjs";import{a as l,c as u,i as d,l as f,n as p,o as m,r as h,s as g,t as _}from"./google-shared-BIfd6JKP.mjs";const v={THINKING_LEVEL_UNSPECIFIED:f.THINKING_LEVEL_UNSPECIFIED,MINIMAL:f.MINIMAL,LOW:f.LOW,MEDIUM:f.MEDIUM,HIGH:f.HIGH};let y=0;const b=(t,r,i)=>{let a=new e;return(async()=>{let e={role:`assistant`,content:[],api:`google-vertex`,provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let o=O(i),s=o?C(t,o,i?.headers):S(t,A(i),j(i),i?.headers,i?.env),c=M(t,r,i),l=await i?.onPayload?.(c,t);l!==void 0&&(c=l);let u=await s.models.generateContentStream(c);a.push({type:`start`,partial:e});let f=null,p=e.content,g=()=>p.length-1;for await(let r of u){e.responseId||=r.responseId;let i=r.candidates?.[0];if(i?.content?.parts)for(let t of i.content.parts){if(t.text!==void 0){let n=h(t);(!f||n&&f.type!==`thinking`||!n&&f.type!==`text`)&&(f&&(f.type===`text`?a.push({type:`text_end`,contentIndex:p.length-1,content:f.text,partial:e}):a.push({type:`thinking_end`,contentIndex:g(),content:f.thinking,partial:e})),n?(f={type:`thinking`,thinking:``,thinkingSignature:void 0},e.content.push(f),a.push({type:`thinking_start`,contentIndex:g(),partial:e})):(f={type:`text`,text:``},e.content.push(f),a.push({type:`text_start`,contentIndex:g(),partial:e}))),f.type===`thinking`?(f.thinking+=t.text,f.thinkingSignature=m(f.thinkingSignature,t.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:g(),delta:t.text,partial:e})):(f.text+=t.text,f.textSignature=m(f.textSignature,t.thoughtSignature),a.push({type:`text_delta`,contentIndex:g(),delta:t.text,partial:e}))}if(t.functionCall){f&&=(f.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:f.text,partial:e}):a.push({type:`thinking_end`,contentIndex:g(),content:f.thinking,partial:e}),null);let n=t.functionCall.id,r={type:`toolCall`,id:!n||e.content.some(e=>e.type===`toolCall`&&e.id===n)?`${t.functionCall.name}_${Date.now()}_${++y}`:n,name:t.functionCall.name||``,arguments:t.functionCall.args??{},...t.thoughtSignature&&{thoughtSignature:t.thoughtSignature}};e.content.push(r),a.push({type:`toolcall_start`,contentIndex:g(),partial:e}),a.push({type:`toolcall_delta`,contentIndex:g(),delta:JSON.stringify(r.arguments),partial:e}),a.push({type:`toolcall_end`,contentIndex:g(),toolCall:r,partial:e})}}i?.finishReason&&(e.stopReason=d(i.finishReason),e.content.some(e=>e.type===`toolCall`)&&(e.stopReason=`toolUse`)),r.usageMetadata&&(e.usage={input:(r.usageMetadata.promptTokenCount||0)-(r.usageMetadata.cachedContentTokenCount||0),output:(r.usageMetadata.candidatesTokenCount||0)+(r.usageMetadata.thoughtsTokenCount||0),cacheRead:r.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:r.usageMetadata.thoughtsTokenCount||0,totalTokens:r.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},n(t,e.usage))}if(f&&(f.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:f.text,partial:e}):a.push({type:`thinking_end`,contentIndex:g(),content:f.thinking,partial:e})),i?.signal?.aborted)throw Error(`Request was aborted`);if(e.stopReason===`aborted`||e.stopReason===`error`)throw Error(`An unknown error occurred`);a.push({type:`done`,reason:e.stopReason,message:e}),a.end()}catch(t){for(let t of e.content)`index`in t&&delete t.index;e.stopReason=i?.signal?.aborted?`aborted`:`error`,e.errorMessage=c(s(t)),a.push({type:`error`,reason:e.stopReason,error:e}),a.end()}})(),a},x=(e,n,r)=>{let i=o(e,n,r,void 0);if(!r?.reasoning)return b(e,n,{...i,thinking:{enabled:!1}});let a=t(e,r.reasoning),s=a===`off`?`high`:a,c=e;return N(c)||P(c)?b(e,n,{...i,thinking:{enabled:!0,level:I(s,c)}}):b(e,n,{...i,thinking:{enabled:!0,budgetTokens:L(c,s,r.thinkingBudgets)}})};function S(e,t,n,r,i){let a=D(i);return new g({vertexai:!0,project:t,location:n,apiVersion:`v1`,...a?{googleAuthOptions:a}:{},httpOptions:w(e,r)})}function C(e,t,n){return new g({vertexai:!0,apiKey:t,apiVersion:`v1`,httpOptions:w(e,n)})}function w(e,t){let n={},r=T(e.baseUrl);r&&(n.baseUrl=r,n.baseUrlResourceScope=u.COLLECTION,E(r)&&(n.apiVersion=``));let a=i({...e.headers,...t});return a&&(n.headers=a),Object.keys(n).length>0?n:void 0}function T(e){let t=e.trim();if(!(!t||t.includes(`{location}`)))return t}function E(e){try{return new URL(e).pathname.split(`/`).some(e=>/^v\d+(?:beta\d*)?$/.test(e))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(e)}}function D(e){let t=r(`GOOGLE_APPLICATION_CREDENTIALS`,e);return t?{keyFilename:t}:void 0}function O(e){let t=e?.apiKey?.trim();if(!(!t||t===`gcp-vertex-credentials`||k(t)))return t}function k(e){return/^<[^>]+>$/.test(e)}function A(e){let t=e?.project||r(`GOOGLE_CLOUD_PROJECT`,e?.env)||r(`GCLOUD_PROJECT`,e?.env);if(!t)throw Error(`Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.`);return t}function j(e){let t=e?.location||r(`GOOGLE_CLOUD_LOCATION`,e?.env);if(!t)throw Error(`Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.`);return t}function M(e,t,n={}){let r=_(e,t),i={};n.temperature!==void 0&&(i.temperature=n.temperature),n.maxTokens!==void 0&&(i.maxOutputTokens=n.maxTokens);let o={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:a(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:p(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?o.toolConfig={functionCallingConfig:{mode:l(n.toolChoice)}}:o.toolConfig=void 0,n.thinking?.enabled&&e.reasoning){let e={includeThoughts:!0};n.thinking.level===void 0?n.thinking.budgetTokens!==void 0&&(e.thinkingBudget=n.thinking.budgetTokens):e.thinkingLevel=v[n.thinking.level],o.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(o.thinkingConfig=F(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);o.abortSignal=n.signal}return{model:e.id,contents:r,config:o}}function N(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function P(e){let t=e.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(t)||t===`gemini-flash-latest`||t===`gemini-flash-lite-latest`}function F(e){let t=e;return N(t)?{thinkingLevel:f.LOW}:P(t)?{thinkingLevel:f.MINIMAL}:{thinkingBudget:0}}function I(e,t){if(N(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}switch(e){case`minimal`:return`MINIMAL`;case`low`:return`LOW`;case`medium`:return`MEDIUM`;case`high`:return`HIGH`}}function L(e,t,n){return n?.[t]===void 0?e.id.includes(`2.5-pro`)?{minimal:128,low:2048,medium:8192,high:32768}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}export{b as stream,x as streamSimple};
|