/home/ccuser/rateright-v2/.next-old/server/chunks/node_modules_next_dist_esm_build_templates_app-route_afd1fc2c.js:${sb(e)}`);return{...o,id:a,type:i,function:{...h,name:c,arguments:l}}})}}:{...i,message:{...c,content:a,role:h,refusal:t.refusal??null},finish_reason:s,index:n,logprobs:r}}),created:i,model:a,object:"chat.completion",...o?{system_fingerprint:o}:{}},t&&sl(t)?so(s,t):{...s,choices:s.choices.map(e=>(sc(e.message.tool_calls),{...e,message:{...e.message,parsed:null,...e.message.tool_calls?{tool_calls:e.message.tool_calls}:void 0}}))}}(e,eK(this,C,"f"))},q=function(){let e=eK(this,C,"f")?.response_format;return si(e)?e:null},U=function(e){var t,s,n,r;let i=eK(this,N,"f"),{choices:a,...o}=e;for(let{delta:a,finish_reason:l,index:c,logprobs:h=null,...u}of(i?Object.assign(i,o):i=eX(this,N,{...o,choices:[]},"f"),e.choices)){let e=i.choices[c];if(e||(e=i.choices[c]={finish_reason:l,index:c,message:{},logprobs:h,...u}),h)if(e.logprobs){let{content:n,refusal:r,...i}=h;sv(i),Object.assign(e.logprobs,i),n&&((t=e.logprobs).content??(t.content=[]),e.logprobs.content.push(...n)),r&&((s=e.logprobs).refusal??(s.refusal=[]),e.logprobs.refusal.push(...r))}else e.logprobs=Object.assign({},h);if(l&&(e.finish_reason=l,eK(this,C,"f")&&sl(eK(this,C,"f")))){if("length"===l)throw new e7;if("content_filter"===l)throw new te}if(Object.assign(e,u),!a)continue;let{content:o,refusal:d,function_call:p,role:f,tool_calls:m,...g}=a;if(sv(g),Object.assign(e.message,g),d&&(e.message.refusal=(e.message.refusal||"")+d),f&&(e.message.role=f),p&&(e.message.function_call?(p.name&&(e.message.function_call.name=p.name),p.arguments&&((n=e.message.function_call).arguments??(n.arguments=""),e.message.function_call.arguments+=p.arguments)):e.message.function_call=p),o&&(e.message.content=(e.message.content||"")+o,!e.message.refusal&&eK(this,P,"m",q).call(this)&&(e.message.parsed=sw(e.message.content))),m)for(let{index:t,id:s,type:n,function:i,...a}of(e.message.tool_calls||(e.message.tool_calls=[]),m)){let o=(r=e.message.tool_calls)[t]??(r[t]={});Object.assign(o,a),s&&(o.id=s),n&&(o.type=n),i&&(o.function??(o.function={name:i.name??"",arguments:""})),i?.name&&(o.function.name=i.name),i?.arguments&&(o.function.arguments+=i.arguments,function(e,t){if(!e||!("tools"in e)||!e.tools)return!1;let s=e.tools?.find(e=>sr(e)&&e.function?.name===t.function.name);return sr(s)&&(sa(s)||s?.function.strict||!1)}(eK(this,C,"f"),o)&&(o.function.parsed_arguments=sw(o.function.arguments)))}}return i},Symbol.asyncIterator)](){let e=[],t=[],s=!1;return this.on("chunk",s=>{let n=t.shift();n?n.resolve(s):e.push(s)}),this.on("end",()=>{for(let e of(s=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let n of(s=!0,t))n.reject(e);t.length=0}),this.on("error",e=>{for(let n of(s=!0,t))n.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:s?{value:void 0,done:!0}:new Promise((e,s)=>t.push({resolve:e,reject:s})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new tD(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function sb(e){return JSON.stringify(e)}function sv(e){}function sx(e){}class sS extends s_{static fromReadableStream(e){let t=new sS(null);return t._run(()=>t._fromReadableStream(e)),t}static runTools(e,t,s){let n=new sS(t),r={...s,headers:{...s?.headers,"X-Stainless-Helper-Method":"runTools"}};return n._run(()=>n._runTools(e,t,r)),n}}class s$ extends t7{constructor(){super(...arguments),this.messages=new sn(this._client)}create(e,t){return this._client.post("/chat/completions",{body:e,...t,stream:e.stream??!1})}retrieve(e,t){return this._client.get(ss`/chat/completions/${e}`,t)}update(e,t,s){return this._client.post(ss`/chat/completions/${e}`,{body:t,...s})}list(e={},t){return this._client.getAPIList("/chat/completions",tJ,{query:e,...t})}delete(e,t){return this._client.delete(ss`/chat/completions/${e}`,t)}parse(e,t){for(let t of e.tools??[]){if("function"!==t.type)throw new eG(`Currently only \`function\` tool types support auto-parsing; Received \`${t.type}\``);if(!0!==t.function.strict)throw new eG(`The \`${t.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}return this._client.chat.completions.create(e,{...t,headers:{...t?.headers,"X-Stainless-Helper-Method":"chat.completions.parse"}})._thenUnwrap(t=>so(t,e))}runTools(e,t){return e.stream?sS.runTools(this._client,e,t):sf.runTools(this._client,e,t)}stream(e,t){return s_.createChatCompletion(this._client,e,t)}}s$.Messages=sn;class sA extends t7{constructor(){super(...arguments),this.completions=new s$(this._client)}}sA.Completions=s$,e.s([],98546);let sR=Symbol("brand.privateNullableHeaders"),sO=e=>{let t=new Headers,s=new Set;for(let n of e){let e=new Set;for(let[r,i]of function*(e){let t;if(!e)return;if(sR in e){let{values:t,nulls:s}=e;for(let e of(yield*t.entries(),s))yield[e,null];return}let s=!1;for(let n of(e instanceof Headers?t=e.entries():tr(e)?t=e:(s=!0,t=Object.entries(e??{})),t)){let e=n[0];if("string"!=typeof e)throw TypeError("expected header name to be a string");let t=tr(n[1])?n[1]:[n[1]],r=!1;for(let n of t)void 0!==n&&(s&&!r&&(r=!0,yield[e,null]),yield[e,n])}}(n)){let n=r.toLowerCase();e.has(n)||(t.delete(r),e.add(n)),null===i?(t.delete(r),s.add(n)):(t.append(r,i),s.delete(n))}}return{[sR]:!0,values:t,nulls:s}};class sk extends t7{create(e,t){return this._client.post("/audio/speech",{body:e,...t,headers:sO([{Accept:"application/octet-stream"},t?.headers]),__binaryResponse:!0})}}class sI extends t7{create(e,t){return this._client.post("/audio/transcriptions",t0({body:e,...t,stream:e.stream??!1,__metadata:{model:e.model}},this._client))}}class sE extends t7{create(e,t){return this._client.post("/audio/translations",t0({body:e,...t,__metadata:{model:e.model}},this._client))}}class sP extends t7{constructor(){super(...arguments),this.transcriptions=new sI(this._client),this.translations=new sE(this._client),this.speech=new sk(this._client)}}sP.Transcriptions=sI,sP.Translations=sE,sP.Speech=sk;class sC extends t7{create(e,t){return this._client.post("/batches",{body:e,...t})}retrieve(e,t){return this._client.get(ss`/batches/${e}`,t)}list(e={},t){return this._client.getAPIList("/batches",tJ,{query:e,...t})}cancel(e,t){return this._client.post(ss`/batches/${e}/cancel`,t)}}class sT extends t7{create(e,t){return this._client.post("/assistants",{body:e,...t,headers:sO([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}retrieve(e,t){return this._client.get(ss`/assistants/${e}`,{...t,headers:sO([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}update(e,t,s){return this._client.post(ss`/assistants/${e}`,{body:t,...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}list(e={},t){return this._client.getAPIList("/assistants",tJ,{query:e,...t,headers:sO([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}delete(e,t){return this._client.delete(ss`/assistants/${e}`,{...t,headers:sO([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}}class sN extends t7{create(e,t){return this._client.post("/realtime/sessions",{body:e,...t,headers:sO([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}}class sj extends t7{create(e,t){return this._client.post("/realtime/transcription_sessions",{body:e,...t,headers:sO([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}}class sM extends t7{constructor(){super(...arguments),this.sessions=new sN(this._client),this.transcriptionSessions=new sj(this._client)}}sM.Sessions=sN,sM.TranscriptionSessions=sj;class sD extends t7{create(e,t){return this._client.post("/chatkit/sessions",{body:e,...t,headers:sO([{"OpenAI-Beta":"chatkit_beta=v1"},t?.headers])})}cancel(e,t){return this._client.post(ss`/chatkit/sessions/${e}/cancel`,{...t,headers:sO([{"OpenAI-Beta":"chatkit_beta=v1"},t?.headers])})}}class sL extends t7{retrieve(e,t){return this._client.get(ss`/chatkit/threads/${e}`,{...t,headers:sO([{"OpenAI-Beta":"chatkit_beta=v1"},t?.headers])})}list(e={},t){return this._client.getAPIList("/chatkit/threads",tV,{query:e,...t,headers:sO([{"OpenAI-Beta":"chatkit_beta=v1"},t?.headers])})}delete(e,t){return this._client.delete(ss`/chatkit/threads/${e}`,{...t,headers:sO([{"OpenAI-Beta":"chatkit_beta=v1"},t?.headers])})}listItems(e,t={},s){return this._client.getAPIList(ss`/chatkit/threads/${e}/items`,tV,{query:t,...s,headers:sO([{"OpenAI-Beta":"chatkit_beta=v1"},s?.headers])})}}class sB extends t7{constructor(){super(...arguments),this.sessions=new sD(this._client),this.threads=new sL(this._client)}}sB.Sessions=sD,sB.Threads=sL;class sW extends t7{create(e,t,s){return this._client.post(ss`/threads/${e}/messages`,{body:t,...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}retrieve(e,t,s){let{thread_id:n}=t;return this._client.get(ss`/threads/${n}/messages/${e}`,{...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}update(e,t,s){let{thread_id:n,...r}=t;return this._client.post(ss`/threads/${n}/messages/${e}`,{body:r,...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}list(e,t={},s){return this._client.getAPIList(ss`/threads/${e}/messages`,tJ,{query:t,...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}delete(e,t,s){let{thread_id:n}=t;return this._client.delete(ss`/threads/${n}/messages/${e}`,{...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}}class sq extends t7{retrieve(e,t,s){let{thread_id:n,run_id:r,...i}=t;return this._client.get(ss`/threads/${n}/runs/${r}/steps/${e}`,{query:i,...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}list(e,t,s){let{thread_id:n,...r}=t;return this._client.getAPIList(ss`/threads/${n}/runs/${e}/steps`,tJ,{query:r,...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}}let sU=e=>void 0!==globalThis.process?globalThis.process.env?.[e]?.trim()??void 0:void 0!==globalThis.Deno?globalThis.Deno.env?.get?.(e)?.trim():void 0;class sF extends sd{constructor(){super(...arguments),F.add(this),X.set(this,[]),K.set(this,{}),J.set(this,{}),V.set(this,void 0),z.set(this,void 0),G.set(this,void 0),Q.set(this,void 0),Y.set(this,void 0),Z.set(this,void 0),ee.set(this,void 0),et.set(this,void 0),es.set(this,void 0)}[(X=new WeakMap,K=new WeakMap,J=new WeakMap,V=new WeakMap,z=new WeakMap,G=new WeakMap,Q=new WeakMap,Y=new WeakMap,Z=new WeakMap,ee=new WeakMap,et=new WeakMap,es=new WeakMap,F=new WeakSet,Symbol.asyncIterator)](){let e=[],t=[],s=!1;return this.on("event",s=>{let n=t.shift();n?n.resolve(s):e.push(s)}),this.on("end",()=>{for(let e of(s=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let n of(s=!0,t))n.reject(e);t.length=0}),this.on("error",e=>{for(let n of(s=!0,t))n.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:s?{value:void 0,done:!0}:new Promise((e,s)=>t.push({resolve:e,reject:s})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}static fromReadableStream(e){let t=new H;return t._run(()=>t._fromReadableStream(e)),t}async _fromReadableStream(e,t){let s=t?.signal;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort())),this._connected();let n=tD.fromReadableStream(e,this.controller);for await(let e of n)eK(this,F,"m",en).call(this,e);if(n.controller.signal?.aborted)throw new eY;return this._addRun(eK(this,F,"m",er).call(this))}toReadableStream(){return new tD(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(e,t,s,n){let r=new H;return r._run(()=>r._runToolAssistantStream(e,t,s,{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),r}async _createToolAssistantStream(e,t,s,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort()));let i={...s,stream:!0},a=await e.submitToolOutputs(t,i,{...n,signal:this.controller.signal});for await(let e of(this._connected(),a))eK(this,F,"m",en).call(this,e);if(a.controller.signal?.aborted)throw new eY;return this._addRun(eK(this,F,"m",er).call(this))}static createThreadAssistantStream(e,t,s){let n=new H;return n._run(()=>n._threadAssistantStream(e,t,{...s,headers:{...s?.headers,"X-Stainless-Helper-Method":"stream"}})),n}static createAssistantStream(e,t,s,n){let r=new H;return r._run(()=>r._runAssistantStream(e,t,s,{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),r}currentEvent(){return eK(this,ee,"f")}currentRun(){return eK(this,et,"f")}currentMessageSnapshot(){return eK(this,V,"f")}currentRunStepSnapshot(){return eK(this,es,"f")}async finalRunSteps(){return await this.done(),Object.values(eK(this,K,"f"))}async finalMessages(){return await this.done(),Object.values(eK(this,J,"f"))}async finalRun(){if(await this.done(),!eK(this,z,"f"))throw Error("Final run was not received.");return eK(this,z,"f")}async _createThreadAssistantStream(e,t,s){let n=s?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort()));let r={...t,stream:!0},i=await e.createAndRun(r,{...s,signal:this.controller.signal});for await(let e of(this._connected(),i))eK(this,F,"m",en).call(this,e);if(i.controller.signal?.aborted)throw new eY;return this._addRun(eK(this,F,"m",er).call(this))}async _createAssistantStream(e,t,s,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort()));let i={...s,stream:!0},a=await e.create(t,i,{...n,signal:this.controller.signal});for await(let e of(this._connected(),a))eK(this,F,"m",en).call(this,e);if(a.controller.signal?.aborted)throw new eY;return this._addRun(eK(this,F,"m",er).call(this))}static accumulateDelta(e,t){for(let[s,n]of Object.entries(t)){if(!e.hasOwnProperty(s)){e[s]=n;continue}let t=e[s];if(null==t||"index"===s||"type"===s){e[s]=n;continue}if("string"==typeof t&&"string"==typeof n)t+=n;else if("number"==typeof t&&"number"==typeof n)t+=n;else if(ta(t)&&ta(n))t=this.accumulateDelta(t,n);else if(Array.isArray(t)&&Array.isArray(n)){if(t.every(e=>"string"==typeof e||"number"==typeof e)){t.push(...n);continue}for(let e of n){if(!ta(e))throw Error(`Expected array delta entry to be an object but got: ${e}`);let s=e.index;if(null==s)throw console.error(e),Error("Expected array delta entry to have an `index` property");if("number"!=typeof s)throw Error(`Expected array delta entry \`index\` property to be a number but got ${s}`);let n=t[s];null==n?t.push(e):t[s]=this.accumulateDelta(n,e)}continue}else throw Error(`Unhandled record type: ${s}, deltaValue: ${n}, accValue: ${t}`);e[s]=t}return e}_addRun(e){return e}async _threadAssistantStream(e,t,s){return await this._createThreadAssistantStream(t,e,s)}async _runAssistantStream(e,t,s,n){return await this._createAssistantStream(t,e,s,n)}async _runToolAssistantStream(e,t,s,n){return await this._createToolAssistantStream(t,e,s,n)}}H=sF,en=function(e){if(!this.ended)switch(eX(this,ee,e,"f"),eK(this,F,"m",eo).call(this,e),e.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":eK(this,F,"m",eu).call(this,e);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":eK(this,F,"m",ea).call(this,e);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":eK(this,F,"m",ei).call(this,e);break;case"error":throw Error("Encountered an error event in event processing - errors should be processed earlier")}},er=function(){if(this.ended)throw new eG("stream has ended, this shouldn't happen");if(!eK(this,z,"f"))throw Error("Final run has not been received");return eK(this,z,"f")},ei=function(e){let[t,s]=eK(this,F,"m",ec).call(this,e,eK(this,V,"f"));for(let e of(eX(this,V,t,"f"),eK(this,J,"f")[t.id]=t,s)){let s=t.content[e.index];s?.type=="text"&&this._emit("textCreated",s.text)}switch(e.event){case"thread.message.created":this._emit("messageCreated",e.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",e.data.delta,t),e.data.delta.content)for(let s of e.data.delta.content){if("text"==s.type&&s.text){let e=s.text,n=t.content[s.index];if(n&&"text"==n.type)this._emit("textDelta",e,n.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(s.index!=eK(this,G,"f")){if(eK(this,Q,"f"))switch(eK(this,Q,"f").type){case"text":this._emit("textDone",eK(this,Q,"f").text,eK(this,V,"f"));break;case"image_file":this._emit("imageFileDone",eK(this,Q,"f").image_file,eK(this,V,"f"))}eX(this,G,s.index,"f")}eX(this,Q,t.content[s.index],"f")}break;case"thread.message.completed":case"thread.message.incomplete":if(void 0!==eK(this,G,"f")){let t=e.data.content[eK(this,G,"f")];if(t)switch(t.type){case"image_file":this._emit("imageFileDone",t.image_file,eK(this,V,"f"));break;case"text":this._emit("textDone",t.text,eK(this,V,"f"))}}eK(this,V,"f")&&this._emit("messageDone",e.data),eX(this,V,void 0,"f")}},ea=function(e){let t=eK(this,F,"m",el).call(this,e);switch(eX(this,es,t,"f"),e.event){case"thread.run.step.created":this._emit("runStepCreated",e.data);break;case"thread.run.step.delta":let s=e.data.delta;if(s.step_details&&"tool_calls"==s.step_details.type&&s.step_details.tool_calls&&"tool_calls"==t.step_details.type)for(let e of s.step_details.tool_calls)e.index==eK(this,Y,"f")?this._emit("toolCallDelta",e,t.step_details.tool_calls[e.index]):(eK(this,Z,"f")&&this._emit("toolCallDone",eK(this,Z,"f")),eX(this,Y,e.index,"f"),eX(this,Z,t.step_details.tool_calls[e.index],"f"),eK(this,Z,"f")&&this._emit("toolCallCreated",eK(this,Z,"f")));this._emit("runStepDelta",e.data.delta,t);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":eX(this,es,void 0,"f"),"tool_calls"==e.data.step_details.type&&eK(this,Z,"f")&&(this._emit("toolCallDone",eK(this,Z,"f")),eX(this,Z,void 0,"f")),this._emit("runStepDone",e.data,t)}},eo=function(e){eK(this,X,"f").push(e),this._emit("event",e)},el=function(e){switch(e.event){case"thread.run.step.created":return eK(this,K,"f")[e.data.id]=e.data,e.data;case"thread.run.step.delta":let t=eK(this,K,"f")[e.data.id];if(!t)throw Error("Received a RunStepDelta before creation of a snapshot");let s=e.data;if(s.delta){let n=H.accumulateDelta(t,s.delta);eK(this,K,"f")[e.data.id]=n}return eK(this,K,"f")[e.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":eK(this,K,"f")[e.data.id]=e.data}if(eK(this,K,"f")[e.data.id])return eK(this,K,"f")[e.data.id];throw Error("No snapshot available")},ec=function(e,t){let s=[];switch(e.event){case"thread.message.created":return[e.data,s];case"thread.message.delta":if(!t)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let n=e.data;if(n.delta.content)for(let e of n.delta.content)if(e.index in t.content){let s=t.content[e.index];t.content[e.index]=eK(this,F,"m",eh).call(this,e,s)}else t.content[e.index]=e,s.push(e);return[t,s];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(t)return[t,s];throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},eh=function(e,t){return H.accumulateDelta(t,e)},eu=function(e){switch(eX(this,et,e.data,"f"),e.event){case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":case"thread.run.incomplete":eX(this,z,e.data,"f"),eK(this,Z,"f")&&(this._emit("toolCallDone",eK(this,Z,"f")),eX(this,Z,void 0,"f"))}};class sH extends t7{constructor(){super(...arguments),this.steps=new sq(this._client)}create(e,t,s){let{include:n,...r}=t;return this._client.post(ss`/threads/${e}/runs`,{query:{include:n},body:r,...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers]),stream:t.stream??!1})}retrieve(e,t,s){let{thread_id:n}=t;return this._client.get(ss`/threads/${n}/runs/${e}`,{...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}update(e,t,s){let{thread_id:n,...r}=t;return this._client.post(ss`/threads/${n}/runs/${e}`,{body:r,...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}list(e,t={},s){return this._client.getAPIList(ss`/threads/${e}/runs`,tJ,{query:t,...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}cancel(e,t,s){let{thread_id:n}=t;return this._client.post(ss`/threads/${n}/runs/${e}/cancel`,{...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}async createAndPoll(e,t,s){let n=await this.create(e,t,s);return await this.poll(n.id,{thread_id:e},s)}createAndStream(e,t,s){return sF.createAssistantStream(e,this._client.beta.threads.runs,t,s)}async poll(e,t,s){let n=sO([s?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":s?.pollIntervalMs?.toString()??void 0}]);for(;;){let{data:r,response:i}=await this.retrieve(e,t,{...s,headers:{...s?.headers,...n}}).withResponse();switch(r.status){case"queued":case"in_progress":case"cancelling":let a=5e3;if(s?.pollIntervalMs)a=s.pollIntervalMs;else{let e=i.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(a=t)}}await to(a);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return r}}}stream(e,t,s){return sF.createAssistantStream(e,this._client.beta.threads.runs,t,s)}submitToolOutputs(e,t,s){let{thread_id:n,...r}=t;return this._client.post(ss`/threads/${n}/runs/${e}/submit_tool_outputs`,{body:r,...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers]),stream:t.stream??!1})}async submitToolOutputsAndPoll(e,t,s){let n=await this.submitToolOutputs(e,t,s);return await this.poll(n.id,t,s)}submitToolOutputsStream(e,t,s){return sF.createToolAssistantStream(e,this._client.beta.threads.runs,t,s)}}sH.Steps=sq;class sX extends t7{constructor(){super(...arguments),this.runs=new sH(this._client),this.messages=new sW(this._client)}create(e={},t){return this._client.post("/threads",{body:e,...t,headers:sO([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}retrieve(e,t){return this._client.get(ss`/threads/${e}`,{...t,headers:sO([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}update(e,t,s){return this._client.post(ss`/threads/${e}`,{body:t,...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}delete(e,t){return this._client.delete(ss`/threads/${e}`,{...t,headers:sO([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}createAndRun(e,t){return this._client.post("/threads/runs",{body:e,...t,headers:sO([{"OpenAI-Beta":"assistants=v2"},t?.headers]),stream:e.stream??!1})}async createAndRunPoll(e,t){let s=await this.createAndRun(e,t);return await this.runs.poll(s.id,{thread_id:s.thread_id},t)}createAndRunStream(e,t){return sF.createThreadAssistantStream(e,this._client.beta.threads,t)}}sX.Runs=sH,sX.Messages=sW;class sK extends t7{constructor(){super(...arguments),this.realtime=new sM(this._client),this.chatkit=new sB(this._client),this.assistants=new sT(this._client),this.threads=new sX(this._client)}}sK.Realtime=sM,sK.ChatKit=sB,sK.Assistants=sT,sK.Threads=sX;class sJ extends t7{create(e,t){return this._client.post("/completions",{body:e,...t,stream:e.stream??!1})}}class sV extends t7{retrieve(e,t,s){let{container_id:n}=t;return this._client.get(ss`/containers/${n}/files/${e}/content`,{...s,headers:sO([{Accept:"application/binary"},s?.headers]),__binaryResponse:!0})}}class sz extends t7{constructor(){super(...arguments),this.content=new sV(this._client)}create(e,t,s){return this._client.post(ss`/containers/${e}/files`,t0({body:t,...s},this._client))}retrieve(e,t,s){let{container_id:n}=t;return this._client.get(ss`/containers/${n}/files/${e}`,s)}list(e,t={},s){return this._client.getAPIList(ss`/containers/${e}/files`,tJ,{query:t,...s})}delete(e,t,s){let{container_id:n}=t;return this._client.delete(ss`/containers/${n}/files/${e}`,{...s,headers:sO([{Accept:"*/*"},s?.headers])})}}sz.Content=sV;class sG extends t7{constructor(){super(...arguments),this.files=new sz(this._client)}create(e,t){return this._client.post("/containers",{body:e,...t})}retrieve(e,t){return this._client.get(ss`/containers/${e}`,t)}list(e={},t){return this._client.getAPIList("/containers",tJ,{query:e,...t})}delete(e,t){return this._client.delete(ss`/containers/${e}`,{...t,headers:sO([{Accept:"*/*"},t?.headers])})}}sG.Files=sz;class sQ extends t7{create(e,t,s){let{include:n,...r}=t;return this._client.post(ss`/conversations/${e}/items`,{query:{include:n},body:r,...s})}retrieve(e,t,s){let{conversation_id:n,...r}=t;return this._client.get(ss`/conversations/${n}/items/${e}`,{query:r,...s})}list(e,t={},s){return this._client.getAPIList(ss`/conversations/${e}/items`,tV,{query:t,...s})}delete(e,t,s){let{conversation_id:n}=t;return this._client.delete(ss`/conversations/${n}/items/${e}`,s)}}class sY extends t7{constructor(){super(...arguments),this.items=new sQ(this._client)}create(e={},t){return this._client.post("/conversations",{body:e,...t})}retrieve(e,t){return this._client.get(ss`/conversations/${e}`,t)}update(e,t,s){return this._client.post(ss`/conversations/${e}`,{body:t,...s})}delete(e,t){return this._client.delete(ss`/conversations/${e}`,t)}}sY.Items=sQ;class sZ extends t7{create(e,t){let s=!!e.encoding_format,n=s?e.encoding_format:"base64";s&&tj(this._client).debug("embeddings/user defined encoding_format:",e.encoding_format);let r=this._client.post("/embeddings",{body:{...e,encoding_format:n},...t});return s?r:(tj(this._client).debug("embeddings/decoding base64 embeddings from base64"),r._thenUnwrap(e=>(e&&e.data&&e.data.forEach(e=>{let t=e.embedding;e.embedding=(e=>{if("u">typeof Buffer){let t=Buffer.from(e,"base64");return Array.from(new Float32Array(t.buffer,t.byteOffset,t.length/Float32Array.BYTES_PER_ELEMENT))}{let t=atob(e),s=t.length,n=new Uint8Array(s);for(let e=0;es)throw new e0({message:`Giving up on waiting for file ${e} to finish processing after ${s} milliseconds.`});return i}}class s3 extends t7{}class s6 extends t7{run(e,t){return this._client.post("/fine_tuning/alpha/graders/run",{body:e,...t})}validate(e,t){return this._client.post("/fine_tuning/alpha/graders/validate",{body:e,...t})}}class s8 extends t7{constructor(){super(...arguments),this.graders=new s6(this._client)}}s8.Graders=s6;class s5 extends t7{create(e,t,s){return this._client.getAPIList(ss`/fine_tuning/checkpoints/${e}/permissions`,tK,{body:t,method:"post",...s})}retrieve(e,t={},s){return this._client.get(ss`/fine_tuning/checkpoints/${e}/permissions`,{query:t,...s})}delete(e,t,s){let{fine_tuned_model_checkpoint:n}=t;return this._client.delete(ss`/fine_tuning/checkpoints/${n}/permissions/${e}`,s)}}class s9 extends t7{constructor(){super(...arguments),this.permissions=new s5(this._client)}}s9.Permissions=s5;class s7 extends t7{list(e,t={},s){return this._client.getAPIList(ss`/fine_tuning/jobs/${e}/checkpoints`,tJ,{query:t,...s})}}class ne extends t7{constructor(){super(...arguments),this.checkpoints=new s7(this._client)}create(e,t){return this._client.post("/fine_tuning/jobs",{body:e,...t})}retrieve(e,t){return this._client.get(ss`/fine_tuning/jobs/${e}`,t)}list(e={},t){return this._client.getAPIList("/fine_tuning/jobs",tJ,{query:e,...t})}cancel(e,t){return this._client.post(ss`/fine_tuning/jobs/${e}/cancel`,t)}listEvents(e,t={},s){return this._client.getAPIList(ss`/fine_tuning/jobs/${e}/events`,tJ,{query:t,...s})}pause(e,t){return this._client.post(ss`/fine_tuning/jobs/${e}/pause`,t)}resume(e,t){return this._client.post(ss`/fine_tuning/jobs/${e}/resume`,t)}}ne.Checkpoints=s7;class nt extends t7{constructor(){super(...arguments),this.methods=new s3(this._client),this.jobs=new ne(this._client),this.checkpoints=new s9(this._client),this.alpha=new s8(this._client)}}nt.Methods=s3,nt.Jobs=ne,nt.Checkpoints=s9,nt.Alpha=s8;class ns extends t7{}class nn extends t7{constructor(){super(...arguments),this.graderModels=new ns(this._client)}}nn.GraderModels=ns;class nr extends t7{createVariation(e,t){return this._client.post("/images/variations",t0({body:e,...t},this._client))}edit(e,t){return this._client.post("/images/edits",t0({body:e,...t,stream:e.stream??!1},this._client))}generate(e,t){return this._client.post("/images/generations",{body:e,...t,stream:e.stream??!1})}}class ni extends t7{retrieve(e,t){return this._client.get(ss`/models/${e}`,t)}list(e){return this._client.getAPIList("/models",tK,e)}delete(e,t){return this._client.delete(ss`/models/${e}`,t)}}class na extends t7{create(e,t){return this._client.post("/moderations",{body:e,...t})}}class no extends t7{accept(e,t,s){return this._client.post(ss`/realtime/calls/${e}/accept`,{body:t,...s,headers:sO([{Accept:"*/*"},s?.headers])})}hangup(e,t){return this._client.post(ss`/realtime/calls/${e}/hangup`,{...t,headers:sO([{Accept:"*/*"},t?.headers])})}refer(e,t,s){return this._client.post(ss`/realtime/calls/${e}/refer`,{body:t,...s,headers:sO([{Accept:"*/*"},s?.headers])})}reject(e,t={},s){return this._client.post(ss`/realtime/calls/${e}/reject`,{body:t,...s,headers:sO([{Accept:"*/*"},s?.headers])})}}class nl extends t7{create(e,t){return this._client.post("/realtime/client_secrets",{body:e,...t})}}class nc extends t7{constructor(){super(...arguments),this.clientSecrets=new nl(this._client),this.calls=new no(this._client)}}function nh(e,t){let s=e.output.map(e=>{if("function_call"===e.type)return{...e,parsed_arguments:function(e,t){var s,n;let r=(s=e.tools??[],n=t.name,s.find(e=>"function"===e.type&&e.name===n));return{...t,...t,parsed_arguments:r?.$brand==="auto-parseable-tool"?r.$parseRaw(t.arguments):r?.strict?JSON.parse(t.arguments):null}}(t,e)};if("message"===e.type){let s=e.content.map(e=>{var s,n;return"output_text"===e.type?{...e,parsed:(s=t,n=e.text,s.text?.format?.type!=="json_schema"?null:"$parseRaw"in s.text?.format?(s.text?.format).$parseRaw(n):JSON.parse(n))}:e});return{...e,content:s}}return e}),n=Object.assign({},e,{output:s});return Object.getOwnPropertyDescriptor(e,"output_text")||nu(n),Object.defineProperty(n,"output_parsed",{enumerable:!0,get(){for(let e of n.output)if("message"===e.type){for(let t of e.content)if("output_text"===t.type&&null!==t.parsed)return t.parsed}return null}}),n}function nu(e){let t=[];for(let s of e.output)if("message"===s.type)for(let e of s.content)"output_text"===e.type&&t.push(e.text);e.output_text=t.join("")}nc.ClientSecrets=nl,nc.Calls=no;class nd extends sd{constructor(e){super(),ed.add(this),ep.set(this,void 0),ef.set(this,void 0),em.set(this,void 0),eX(this,ep,e,"f")}static createResponse(e,t,s){let n=new nd(t);return n._run(()=>n._createOrRetrieveResponse(e,t,{...s,headers:{...s?.headers,"X-Stainless-Helper-Method":"stream"}})),n}async _createOrRetrieveResponse(e,t,s){let n,r=s?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),eK(this,ed,"m",eg).call(this);let i=null;for await(let r of("response_id"in t?(n=await e.responses.retrieve(t.response_id,{stream:!0},{...s,signal:this.controller.signal,stream:!0}),i=t.starting_after??null):n=await e.responses.create({...t,stream:!0},{...s,signal:this.controller.signal}),this._connected(),n))eK(this,ed,"m",ey).call(this,r,i);if(n.controller.signal?.aborted)throw new eY;return eK(this,ed,"m",ew).call(this)}[(ep=new WeakMap,ef=new WeakMap,em=new WeakMap,ed=new WeakSet,eg=function(){this.ended||eX(this,ef,void 0,"f")},ey=function(e,t){if(this.ended)return;let s=(e,s)=>{(null==t||s.sequence_number>t)&&this._emit(e,s)},n=eK(this,ed,"m",e_).call(this,e);switch(s("event",e),e.type){case"response.output_text.delta":{let t=n.output[e.output_index];if(!t)throw new eG(`missing output at index ${e.output_index}`);if("message"===t.type){let n=t.content[e.content_index];if(!n)throw new eG(`missing content at index ${e.content_index}`);if("output_text"!==n.type)throw new eG(`expected content to be 'output_text', got ${n.type}`);s("response.output_text.delta",{...e,snapshot:n.text})}break}case"response.function_call_arguments.delta":{let t=n.output[e.output_index];if(!t)throw new eG(`missing output at index ${e.output_index}`);"function_call"===t.type&&s("response.function_call_arguments.delta",{...e,snapshot:t.arguments});break}default:s(e.type,e)}},ew=function(){if(this.ended)throw new eG("stream has ended, this shouldn't happen");let e=eK(this,ef,"f");if(!e)throw new eG("request ended without sending any events");eX(this,ef,void 0,"f");let t=function(e,t){var s;return t&&(s=t,si(s.text?.format))?nh(e,t):{...e,output_parsed:null,output:e.output.map(e=>"function_call"===e.type?{...e,parsed_arguments:null}:"message"===e.type?{...e,content:e.content.map(e=>({...e,parsed:null}))}:e)}}(e,eK(this,ep,"f"));return eX(this,em,t,"f"),t},e_=function(e){let t=eK(this,ef,"f");if(!t){if("response.created"!==e.type)throw new eG(`When snapshot hasn't been set yet, expected 'response.created' event, got ${e.type}`);return eX(this,ef,e.response,"f")}switch(e.type){case"response.output_item.added":t.output.push(e.item);break;case"response.content_part.added":{let s=t.output[e.output_index];if(!s)throw new eG(`missing output at index ${e.output_index}`);let n=s.type,r=e.part;"message"===n&&"reasoning_text"!==r.type?s.content.push(r):"reasoning"===n&&"reasoning_text"===r.type&&(s.content||(s.content=[]),s.content.push(r));break}case"response.output_text.delta":{let s=t.output[e.output_index];if(!s)throw new eG(`missing output at index ${e.output_index}`);if("message"===s.type){let t=s.content[e.content_index];if(!t)throw new eG(`missing content at index ${e.content_index}`);if("output_text"!==t.type)throw new eG(`expected content to be 'output_text', got ${t.type}`);t.text+=e.delta}break}case"response.function_call_arguments.delta":{let s=t.output[e.output_index];if(!s)throw new eG(`missing output at index ${e.output_index}`);"function_call"===s.type&&(s.arguments+=e.delta);break}case"response.reasoning_text.delta":{let s=t.output[e.output_index];if(!s)throw new eG(`missing output at index ${e.output_index}`);if("reasoning"===s.type){let t=s.content?.[e.content_index];if(!t)throw new eG(`missing content at index ${e.content_index}`);if("reasoning_text"!==t.type)throw new eG(`expected content to be 'reasoning_text', got ${t.type}`);t.text+=e.delta}break}case"response.completed":eX(this,ef,e.response,"f")}return t},Symbol.asyncIterator)](){let e=[],t=[],s=!1;return this.on("event",s=>{let n=t.shift();n?n.resolve(s):e.push(s)}),this.on("end",()=>{for(let e of(s=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let n of(s=!0,t))n.reject(e);t.length=0}),this.on("error",e=>{for(let n of(s=!0,t))n.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:s?{value:void 0,done:!0}:new Promise((e,s)=>t.push({resolve:e,reject:s})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}async finalResponse(){await this.done();let e=eK(this,em,"f");if(!e)throw new eG("stream ended without producing a ChatCompletion");return e}}class np extends t7{list(e,t={},s){return this._client.getAPIList(ss`/responses/${e}/input_items`,tJ,{query:t,...s})}}class nf extends t7{count(e={},t){return this._client.post("/responses/input_tokens",{body:e,...t})}}class nm extends t7{constructor(){super(...arguments),this.inputItems=new np(this._client),this.inputTokens=new nf(this._client)}create(e,t){return this._client.post("/responses",{body:e,...t,stream:e.stream??!1})._thenUnwrap(e=>("object"in e&&"response"===e.object&&nu(e),e))}retrieve(e,t={},s){return this._client.get(ss`/responses/${e}`,{query:t,...s,stream:t?.stream??!1})._thenUnwrap(e=>("object"in e&&"response"===e.object&&nu(e),e))}delete(e,t){return this._client.delete(ss`/responses/${e}`,{...t,headers:sO([{Accept:"*/*"},t?.headers])})}parse(e,t){return this._client.responses.create(e,t)._thenUnwrap(t=>nh(t,e))}stream(e,t){return nd.createResponse(this._client,e,t)}cancel(e,t){return this._client.post(ss`/responses/${e}/cancel`,t)}compact(e,t){return this._client.post("/responses/compact",{body:e,...t})}}nm.InputItems=np,nm.InputTokens=nf;class ng extends t7{create(e,t,s){return this._client.post(ss`/uploads/${e}/parts`,t0({body:t,...s},this._client))}}class ny extends t7{constructor(){super(...arguments),this.parts=new ng(this._client)}create(e,t){return this._client.post("/uploads",{body:e,...t})}cancel(e,t){return this._client.post(ss`/uploads/${e}/cancel`,t)}complete(e,t,s){return this._client.post(ss`/uploads/${e}/complete`,{body:t,...s})}}ny.Parts=ng;let nw=async e=>{let t=await Promise.allSettled(e),s=t.filter(e=>"rejected"===e.status);if(s.length){for(let e of s)console.error(e.reason);throw Error(`${s.length} promise(s) failed - see the above errors`)}let n=[];for(let e of t)"fulfilled"===e.status&&n.push(e.value);return n};class n_ extends t7{create(e,t,s){return this._client.post(ss`/vector_stores/${e}/file_batches`,{body:t,...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}retrieve(e,t,s){let{vector_store_id:n}=t;return this._client.get(ss`/vector_stores/${n}/file_batches/${e}`,{...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}cancel(e,t,s){let{vector_store_id:n}=t;return this._client.post(ss`/vector_stores/${n}/file_batches/${e}/cancel`,{...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}async createAndPoll(e,t,s){let n=await this.create(e,t);return await this.poll(e,n.id,s)}listFiles(e,t,s){let{vector_store_id:n,...r}=t;return this._client.getAPIList(ss`/vector_stores/${n}/file_batches/${e}/files`,tJ,{query:r,...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}async poll(e,t,s){let n=sO([s?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":s?.pollIntervalMs?.toString()??void 0}]);for(;;){let{data:r,response:i}=await this.retrieve(t,{vector_store_id:e},{...s,headers:n}).withResponse();switch(r.status){case"in_progress":let a=5e3;if(s?.pollIntervalMs)a=s.pollIntervalMs;else{let e=i.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(a=t)}}await to(a);break;case"failed":case"cancelled":case"completed":return r}}}async uploadAndPoll(e,{files:t,fileIds:s=[]},n){if(null==t||0==t.length)throw Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");let r=Math.min(n?.maxConcurrency??5,t.length),i=this._client,a=t.values(),o=[...s];async function l(e){for(let t of e){let e=await i.files.create({file:t,purpose:"assistants"},n);o.push(e.id)}}let c=Array(r).fill(a).map(l);return await nw(c),await this.createAndPoll(e,{file_ids:o})}}class nb extends t7{create(e,t,s){return this._client.post(ss`/vector_stores/${e}/files`,{body:t,...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}retrieve(e,t,s){let{vector_store_id:n}=t;return this._client.get(ss`/vector_stores/${n}/files/${e}`,{...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}update(e,t,s){let{vector_store_id:n,...r}=t;return this._client.post(ss`/vector_stores/${n}/files/${e}`,{body:r,...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}list(e,t={},s){return this._client.getAPIList(ss`/vector_stores/${e}/files`,tJ,{query:t,...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}delete(e,t,s){let{vector_store_id:n}=t;return this._client.delete(ss`/vector_stores/${n}/files/${e}`,{...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}async createAndPoll(e,t,s){let n=await this.create(e,t,s);return await this.poll(e,n.id,s)}async poll(e,t,s){let n=sO([s?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":s?.pollIntervalMs?.toString()??void 0}]);for(;;){let r=await this.retrieve(t,{vector_store_id:e},{...s,headers:n}).withResponse(),i=r.data;switch(i.status){case"in_progress":let a=5e3;if(s?.pollIntervalMs)a=s.pollIntervalMs;else{let e=r.response.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(a=t)}}await to(a);break;case"failed":case"completed":return i}}}async upload(e,t,s){let n=await this._client.files.create({file:t,purpose:"assistants"},s);return this.create(e,{file_id:n.id},s)}async uploadAndPoll(e,t,s){let n=await this.upload(e,t,s);return await this.poll(e,n.id,s)}content(e,t,s){let{vector_store_id:n}=t;return this._client.getAPIList(ss`/vector_stores/${n}/files/${e}/content`,tK,{...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}}class nv extends t7{constructor(){super(...arguments),this.files=new nb(this._client),this.fileBatches=new n_(this._client)}create(e,t){return this._client.post("/vector_stores",{body:e,...t,headers:sO([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}retrieve(e,t){return this._client.get(ss`/vector_stores/${e}`,{...t,headers:sO([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}update(e,t,s){return this._client.post(ss`/vector_stores/${e}`,{body:t,...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}list(e={},t){return this._client.getAPIList("/vector_stores",tJ,{query:e,...t,headers:sO([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}delete(e,t){return this._client.delete(ss`/vector_stores/${e}`,{...t,headers:sO([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}search(e,t,s){return this._client.getAPIList(ss`/vector_stores/${e}/search`,tK,{body:t,method:"post",...s,headers:sO([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}}nv.Files=nb,nv.FileBatches=n_;class nx extends t7{create(e,t){return this._client.post("/videos",tZ({body:e,...t},this._client))}retrieve(e,t){return this._client.get(ss`/videos/${e}`,t)}list(e={},t){return this._client.getAPIList("/videos",tV,{query:e,...t})}delete(e,t){return this._client.delete(ss`/videos/${e}`,t)}downloadContent(e,t={},s){return this._client.get(ss`/videos/${e}/content`,{query:t,...s,headers:sO([{Accept:"application/binary"},s?.headers]),__binaryResponse:!0})}remix(e,t,s){return this._client.post(ss`/videos/${e}/remix`,tZ({body:t,...s},this._client))}}class nS extends t7{constructor(){super(...arguments),eb.add(this)}async unwrap(e,t,s=this._client.webhookSecret,n=300){return await this.verifySignature(e,t,s,n),JSON.parse(e)}async verifySignature(e,t,s=this._client.webhookSecret,n=300){if("u"n)throw new tt("Webhook timestamp is too old");if(l>c+n)throw new tt("Webhook timestamp is too new");let h=i.split(" ").map(e=>e.startsWith("v1,")?e.substring(3):e),u=s.startsWith("whsec_")?Buffer.from(s.replace("whsec_",""),"base64"):Buffer.from(s,"utf-8"),d=o?`${o}.${a}.${e}`:`${a}.${e}`,p=await crypto.subtle.importKey("raw",u,{name:"HMAC",hash:"SHA-256"},!1,["verify"]);for(let e of h)try{let t=Buffer.from(e,"base64");if(await crypto.subtle.verify("HMAC",p,t,new TextEncoder().encode(d)))return}catch{continue}throw new tt("The given webhook signature does not match the expected signature")}}eb=new WeakSet,ev=function(e){if("string"!=typeof e||0===e.length)throw Error("The webhook secret must either be set using the env var, OPENAI_WEBHOOK_SECRET, on the client class, OpenAI({ webhookSecret: '123' }), or passed to this function")},ex=function(e,t){if(!e)throw Error("Headers are required");let s=e.get(t);if(null==s)throw Error(`Missing required header: ${t}`);return s},e.i(98546);class n${constructor({baseURL:e=sU("OPENAI_BASE_URL"),apiKey:t=sU("OPENAI_API_KEY"),organization:s=sU("OPENAI_ORG_ID")??null,project:n=sU("OPENAI_PROJECT_ID")??null,webhookSecret:r=sU("OPENAI_WEBHOOK_SECRET")??null,...i}={}){if(eS.add(this),eA.set(this,void 0),this.completions=new sJ(this),this.chat=new sA(this),this.embeddings=new sZ(this),this.files=new s4(this),this.images=new nr(this),this.audio=new sP(this),this.moderations=new na(this),this.models=new ni(this),this.fineTuning=new nt(this),this.graders=new nn(this),this.vectorStores=new nv(this),this.webhooks=new nS(this),this.beta=new sK(this),this.batches=new sC(this),this.uploads=new ny(this),this.responses=new nm(this),this.realtime=new nc(this),this.conversations=new sY(this),this.evals=new s2(this),this.containers=new sG(this),this.videos=new nx(this),void 0===t)throw new eG("Missing credentials. Please pass an `apiKey`, or set the `OPENAI_API_KEY` environment variable.");const a={apiKey:t,organization:s,project:n,webhookSecret:r,...i,baseURL:e||"https://api.openai.com/v1"};a.dangerouslyAllowBrowser,this.baseURL=a.baseURL,this.timeout=a.timeout??e$.DEFAULT_TIMEOUT,this.logger=a.logger??console;const o="warn";this.logLevel=o,this.logLevel=tE(a.logLevel,"ClientOptions.logLevel",this)??tE(sU("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??o,this.fetchOptions=a.fetchOptions,this.maxRetries=a.maxRetries??2,this.fetch=a.fetch??function(){if("u">typeof fetch)return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}(),eX(this,eA,tm,"f"),this._options=a,this.apiKey="string"==typeof t?t:"Missing Key",this.organization=s,this.project=n,this.webhookSecret=r}withOptions(e){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t}){}async authHeaders(e){return sO([{Authorization:`Bearer ${this.apiKey}`}])}stringifyQuery(e){return function(e,t={}){let s,n=e,r=function(e=t$){let t;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw TypeError("Encoder has to be a function.");let s=e.charset||t$.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let n=tg;if(void 0!==e.format){if(!t_(tw,e.format))throw TypeError("Unknown format option provided.");n=e.format}let r=tw[n],i=t$.filter;if(("function"==typeof e.filter||tn(e.filter))&&(i=e.filter),t=e.arrayFormat&&e.arrayFormat in tx?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":t$.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw TypeError("`commaRoundTrip` must be a boolean, or absent");let a=void 0===e.allowDots?!0==!!e.encodeDotInKeys||t$.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:t$.addQueryPrefix,allowDots:a,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:t$.allowEmptyArrays,arrayFormat:t,charset:s,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:t$.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?t$.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:t$.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:t$.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:t$.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:t$.encodeValuesOnly,filter:i,format:n,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:t$.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:t$.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:t$.strictNullHandling}}(t);"function"==typeof r.filter?n=(0,r.filter)("",n):tn(r.filter)&&(s=r.filter);let i=[];if("object"!=typeof n||null===n)return"";let a=tx[r.arrayFormat],o="comma"===a&&r.commaRoundTrip;s||(s=Object.keys(n)),r.sort&&s.sort(r.sort);let l=new WeakMap;for(let e=0;e0?x.join(",")||null:void 0}];else if(tn(h))v=h;else{let e=Object.keys(x);v=u?e.sort(u):e}let O=l?String(s).replace(/\./g,"%2E"):String(s),k=r&&tn(x)&&1===x.length?O+"[]":O;if(i&&tn(x)&&0===x.length)return k+"[]";for(let s=0;s0?h+c:""}(e,{arrayFormat:"brackets"})}getUserAgent(){return`${this.constructor.name}/JS ${tl}`}defaultIdempotencyKey(){return`stainless-node-retry-${eJ()}`}makeStatusError(e,t,s,n){return eQ.generate(e,t,s,n)}async _callApiKey(){let e,t=this._options.apiKey;if("function"!=typeof t)return!1;try{e=await t()}catch(e){if(e instanceof eG)throw e;throw new eG(`Failed to get token from 'apiKey' function: ${e.message}`,{cause:e})}if("string"!=typeof e||!e)throw new eG(`Expected 'apiKey' function argument to return a string but it returned ${e}`);return this.apiKey=e,!0}buildURL(e,t,s){let n=!eK(this,eS,"m",eR).call(this)&&s||this.baseURL,r=new URL(ts.test(e)?e:n+(n.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),i=this.defaultQuery();return!function(e){if(!e)return!0;for(let t in e)return!1;return!0}(i)&&(t={...i,...t}),"object"==typeof t&&t&&!Array.isArray(t)&&(r.search=this.stringifyQuery(t)),r.toString()}async prepareOptions(e){await this._callApiKey()}async prepareRequest(e,{url:t,options:s}){}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,s){return this.request(Promise.resolve(s).then(s=>({method:e,path:t,...s})))}request(e,t=null){return new tF(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,s){let n=await e,r=n.maxRetries??this.maxRetries;null==t&&(t=r),await this.prepareOptions(n);let{req:i,url:a,timeout:o}=await this.buildRequest(n,{retryCount:r-t});await this.prepareRequest(i,{url:a,options:n});let l="log_"+(0x1000000*Math.random()|0).toString(16).padStart(6,"0"),c=void 0===s?"":`, retryOf: ${s}`,h=Date.now();if(tj(this).debug(`[${l}] sending request`,tM({retryOfRequestLogID:s,method:n.method,url:a,options:n,headers:i.headers})),n.signal?.aborted)throw new eY;let u=new AbortController,d=await this.fetchWithTimeout(a,i,o,u).catch(ez),p=Date.now();if(d instanceof globalThis.Error){let e=`retrying, ${t} attempts remaining`;if(n.signal?.aborted)throw new eY;let r=eV(d)||/timed? ?out/i.test(String(d)+("cause"in d?String(d.cause):""));if(t)return tj(this).info(`[${l}] connection ${r?"timed out":"failed"} - ${e}`),tj(this).debug(`[${l}] connection ${r?"timed out":"failed"} (${e})`,tM({retryOfRequestLogID:s,url:a,durationMs:p-h,message:d.message})),this.retryRequest(n,t,s??l);if(tj(this).info(`[${l}] connection ${r?"timed out":"failed"} - error; no more retries left`),tj(this).debug(`[${l}] connection ${r?"timed out":"failed"} (error; no more retries left)`,tM({retryOfRequestLogID:s,url:a,durationMs:p-h,message:d.message})),r)throw new e0;throw new eZ({cause:d})}let f=[...d.headers.entries()].filter(([e])=>"x-request-id"===e).map(([e,t])=>", "+e+": "+JSON.stringify(t)).join(""),m=`[${l}${c}${f}] ${i.method} ${a} ${d.ok?"succeeded":"failed"} with status ${d.status} in ${p-h}ms`;if(!d.ok){let e=await this.shouldRetry(d);if(t&&e){let e=`retrying, ${t} attempts remaining`;return await tf(d.body),tj(this).info(`${m} - ${e}`),tj(this).debug(`[${l}] response error (${e})`,tM({retryOfRequestLogID:s,url:d.url,status:d.status,headers:d.headers,durationMs:p-h})),this.retryRequest(n,t,s??l,d.headers)}let r=e?"error; no more retries left":"error; not retryable";tj(this).info(`${m} - ${r}`);let i=await d.text().catch(e=>ez(e).message),a=(e=>{try{return JSON.parse(e)}catch(e){return}})(i),o=a?void 0:i;throw tj(this).debug(`[${l}] response error (${r})`,tM({retryOfRequestLogID:s,url:d.url,status:d.status,headers:d.headers,message:o,durationMs:Date.now()-h})),this.makeStatusError(d.status,a,o,d.headers)}return tj(this).info(m),tj(this).debug(`[${l}] response start`,tM({retryOfRequestLogID:s,url:d.url,status:d.status,headers:d.headers,durationMs:p-h})),{response:d,options:n,controller:u,requestLogID:l,retryOfRequestLogID:s,startTime:h}}getAPIList(e,t,s){return this.requestAPIList(t,s&&"then"in s?s.then(t=>({method:"get",path:e,...t})):{method:"get",path:e,...s})}requestAPIList(e,t){return new tX(this,this.makeRequest(t,null,void 0),e)}async fetchWithTimeout(e,t,s,n){let{signal:r,method:i,...a}=t||{},o=this._makeAbort(n);r&&r.addEventListener("abort",o,{once:!0});let l=setTimeout(o,s),c=globalThis.ReadableStream&&a.body instanceof globalThis.ReadableStream||"object"==typeof a.body&&null!==a.body&&Symbol.asyncIterator in a.body,h={signal:n.signal,...c?{duplex:"half"}:{},method:"GET",...a};i&&(h.method=i.toUpperCase());try{return await this.fetch.call(void 0,e,h)}finally{clearTimeout(l)}}async shouldRetry(e){let t=e.headers.get("x-should-retry");return"true"===t||"false"!==t&&(408===e.status||409===e.status||429===e.status||!!(e.status>=500))}async retryRequest(e,t,s,n){let r,i=n?.get("retry-after-ms");if(i){let e=parseFloat(i);Number.isNaN(e)||(r=e)}let a=n?.get("retry-after");if(a&&!r){let e=parseFloat(a);r=Number.isNaN(e)?Date.parse(a)-Date.now():1e3*e}if(!(r&&0<=r&&r<6e4)){let s=e.maxRetries??this.maxRetries;r=this.calculateDefaultRetryTimeoutMillis(t,s)}return await to(r),this.makeRequest(e,t-1,s)}calculateDefaultRetryTimeoutMillis(e,t){return Math.min(.5*Math.pow(2,t-e),8)*(1-.25*Math.random())*1e3}async buildRequest(e,{retryCount:t=0}={}){let s={...e},{method:n,path:r,query:i,defaultBaseURL:a}=s,o=this.buildURL(r,i,a);"timeout"in s&&((e,t)=>{if("number"!=typeof t||!Number.isInteger(t))throw new eG(`${e} must be an integer`);if(t<0)throw new eG(`${e} must be a positive integer`)})("timeout",s.timeout),s.timeout=s.timeout??this.timeout;let{bodyHeaders:l,body:c}=this.buildBody({options:s}),h=await this.buildHeaders({options:e,method:n,bodyHeaders:l,retryCount:t});return{req:{method:n,headers:h,...s.signal&&{signal:s.signal},...globalThis.ReadableStream&&c instanceof globalThis.ReadableStream&&{duplex:"half"},...c&&{body:c},...this.fetchOptions??{},...s.fetchOptions??{}},url:o,timeout:s.timeout}}async buildHeaders({options:e,method:s,bodyHeaders:n,retryCount:r}){let i={};this.idempotencyHeader&&"get"!==s&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),i[this.idempotencyHeader]=e.idempotencyKey);let a=sO([i,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...t??(t=(()=>{let e="u">typeof Deno&&null!=Deno.build?"deno":"u">typeof EdgeRuntime?"edge":"[object process]"===Object.prototype.toString.call(void 0!==globalThis.process?globalThis.process:0)?"node":"unknown";if("deno"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":tl,"X-Stainless-OS":th(Deno.build.os),"X-Stainless-Arch":tc(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":"string"==typeof Deno.version?Deno.version:Deno.version?.deno??"unknown"};if("u">typeof EdgeRuntime)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":tl,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if("node"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":tl,"X-Stainless-OS":th(globalThis.process.platform??"unknown"),"X-Stainless-Arch":tc(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=function(){if("u"e.abort()}buildBody({options:{body:e,headers:t}}){if(!e)return{bodyHeaders:void 0,body:void 0};let s=sO([t]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||"string"==typeof e&&s.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:"object"==typeof e&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&"function"==typeof e.next)?{bodyHeaders:void 0,body:td(e)}:eK(this,eA,"f").call(this,{body:e,headers:s})}}e$=n$,eA=new WeakMap,eS=new WeakSet,eR=function(){return"https://api.openai.com/v1"!==this.baseURL},n$.OpenAI=e$,n$.DEFAULT_TIMEOUT=6e5,n$.OpenAIError=eG,n$.APIError=eQ,n$.APIConnectionError=eZ,n$.APIConnectionTimeoutError=e0,n$.APIUserAbortError=eY,n$.NotFoundError=e3,n$.ConflictError=e6,n$.RateLimitError=e5,n$.BadRequestError=e1,n$.AuthenticationError=e2,n$.InternalServerError=e9,n$.PermissionDeniedError=e4,n$.UnprocessableEntityError=e8,n$.InvalidWebhookSignatureError=tt,n$.toFile=t5,n$.Completions=sJ,n$.Chat=sA,n$.Embeddings=sZ,n$.Files=s4,n$.Images=nr,n$.Audio=sP,n$.Moderations=na,n$.Models=ni,n$.FineTuning=nt,n$.Graders=nn,n$.VectorStores=nv,n$.Webhooks=nS,n$.Beta=sK,n$.Batches=sC,n$.Uploads=ny,n$.Responses=nm,n$.Realtime=nc,n$.Conversations=sY,n$.Evals=s2,n$.Containers=sG,n$.Videos=nx;let nA=new n$({apiKey:process.env.OPENAI_API_KEY||""});async function nR(e){try{let{trade:t,experience:s,location:n,availability:r}=await e.json();if(!t||void 0===s||!n||!r)return eH.NextResponse.json({error:"Missing required fields"},{status:400});let i=`You are an expert construction industry recruiter. Based on the following information about a construction worker, generate a professional profile. /home/ccuser/rateright-v2/.next/app-path-routes-manifest.json: "/api/webhooks/stripe/route": "/api/webhooks/stripe", /home/ccuser/rateright-v2/.next/routes-manifest.json: "page": "/api/webhooks/stripe", /home/ccuser/rateright-v2/.next/routes-manifest.json: "regex": "^/api/webhooks/stripe(?:/)?$", /home/ccuser/rateright-v2/.next/routes-manifest.json: "namedRegex": "^/api/webhooks/stripe(?:/)?$" /home/ccuser/rateright-v2/.next/server/app/api/webhooks/stripe/route.js.nft.json:{"version":1,"files":["../../../../../../node_modules/next/dist/client/components/app-router-headers.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../../../../node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../../../../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js","../../../../../../node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js","../../../../../../node_modules/next/dist/lib/client-and-server-references.js","../../../../../../node_modules/next/dist/lib/constants.js","../../../../../../node_modules/next/dist/lib/interop-default.js","../../../../../../node_modules/next/dist/lib/is-error.js","../../../../../../node_modules/next/dist/lib/semver-noop.js","../../../../../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/action-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/async-local-storage.js","../../../../../../node_modules/next/dist/server/app-render/cache-signal.js","../../../../../../node_modules/next/dist/server/app-render/console-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/console-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js","../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js","../../../../../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../../../../node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js","../../../../../../node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js","../../../../../../node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js","../../../../../../node_modules/next/dist/server/lib/lru-cache.js","../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js","../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js","../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../node_modules/next/dist/server/load-manifest.external.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js","../../../../../../node_modules/next/dist/server/response-cache/types.js","../../../../../../node_modules/next/dist/server/runtime-reacts.external.js","../../../../../../node_modules/next/dist/shared/lib/deep-freeze.js","../../../../../../node_modules/next/dist/shared/lib/invariant-error.js","../../../../../../node_modules/next/dist/shared/lib/is-plain-object.js","../../../../../../node_modules/next/dist/shared/lib/is-thenable.js","../../../../../../node_modules/next/dist/shared/lib/no-fallback-error.external.js","../../../../../../node_modules/next/dist/shared/lib/server-reference-info.js","../../../../../../node_modules/next/package.json","../../../../chunks/[root-of-the-server]__8f0ff92b._.js","../../../../chunks/[root-of-the-server]__f26eca3d._.js","../../../../chunks/[root-of-the-server]__f408c708._.js","../../../../chunks/[turbopack]_runtime.js","../../../../chunks/_next-internal_server_app_api_webhooks_stripe_route_actions_3d08966d.js","../../../../chunks/node_modules_70c77f3e._.js","./route_client-reference-manifest.js"]} /home/ccuser/rateright-v2/.next/server/app/api/webhooks/stripe/route/app-paths-manifest.json: "/api/webhooks/stripe/route": "app/api/webhooks/stripe/route.js" /home/ccuser/rateright-v2/.next/server/app/api/webhooks/stripe/route_client-reference-manifest.js:globalThis.__RSC_MANIFEST["/api/webhooks/stripe/route"] = {"moduleLoading":{"prefix":"","crossOrigin":null},"clientModules":{},"ssrModuleMapping":{},"edgeSSRModuleMapping":{},"rscModuleMapping":{},"edgeRscModuleMapping":{},"entryCSSFiles":{},"entryJSFiles":{}} /home/ccuser/rateright-v2/.next/server/app/api/webhooks/stripe/route.js:var R=require("../../../../chunks/[turbopack]_runtime.js")("server/app/api/webhooks/stripe/route.js") /home/ccuser/rateright-v2/.next/server/app/api/webhooks/stripe/route.js:R.c("server/chunks/_next-internal_server_app_api_webhooks_stripe_route_actions_3d08966d.js") /home/ccuser/rateright-v2/.next/server/chunks/_next-internal_server_app_api_webhooks_stripe_route_actions_3d08966d.js://# sourceMappingURL=_next-internal_server_app_api_webhooks_stripe_route_actions_3d08966d.js.map /home/ccuser/rateright-v2/.next/server/chunks/[root-of-the-server]__f26eca3d._.js:module.exports=[93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},26500,e=>{"use strict";e.i(94879);var t=e.i(87022),r=e.i(24389),a=e.i(93458);async function n(){let e=await (0,a.cookies)();return(0,t.createServerClient)("https://memscjotxrzqnhrvnnkc.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im1lbXNjam90eHJ6cW5ocnZubmtjIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0MjIwNTAsImV4cCI6MjA4Mzk5ODA1MH0.wDb6WAANxQJZDBB9ZSHv6rVIZFZjKmb9DFy5jRmWYjs",{cookies:{getAll:()=>e.getAll(),setAll(t){try{t.forEach(({name:t,value:r,options:a})=>e.set(t,r,a))}catch{}}}})}let o=null;function i(){if(o)return o;let e=process.env.SUPABASE_SERVICE_KEY;if(!e)throw Error("SUPABASE_SERVICE_KEY is not configured. Please add it to your .env.local file. See SUPABASE-KEY-ROTATION-GUIDE.md for details.");return o=(0,r.createClient)("https://memscjotxrzqnhrvnnkc.supabase.co",e,{auth:{autoRefreshToken:!1,persistSession:!1}})}new Proxy({},{get:(e,t)=>i()[t]}),e.s(["createClient",()=>n,"getSupabaseAdmin",()=>i])},54799,(e,t,r)=>{t.exports=e.x("crypto",()=>require("crypto"))},27890,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),o=e.i(61916),i=e.i(74677),s=e.i(69741),l=e.i(16795),d=e.i(87718),c=e.i(95169),u=e.i(47587),p=e.i(66012),h=e.i(70101),m=e.i(26937),f=e.i(10372),y=e.i(93695);e.i(52474);var g=e.i(5232),x=e.i(89171),v=e.i(63349),R=e.i(26500);async function w(e){try{let t,r=await e.text(),a=e.headers.get("stripe-signature");if(!a)return x.NextResponse.json({error:"Missing stripe-signature header"},{status:400});try{t=(0,v.constructWebhookEvent)(r,a)}catch(e){return console.error("Webhook signature verification failed:",e),x.NextResponse.json({error:"Invalid signature"},{status:400})}let n=(0,R.getSupabaseAdmin)();switch(t.type){case"payment_intent.succeeded":{let e=t.data.object;await E(n,e);break}case"payment_intent.payment_failed":{let e=t.data.object;await b(n,e);break}case"payment_intent.canceled":{let e=t.data.object;await _(n,e);break}default:console.log(`Unhandled event type: ${t.type}`)}return x.NextResponse.json({received:!0})}catch(e){return console.error("Webhook error:",e),x.NextResponse.json({error:"Webhook processing failed"},{status:500})}}async function E(e,t){let r=t.metadata?.match_id;if(!r)return void console.error("No match_id in payment intent metadata");try{let{data:a,error:n}=await e.from("payments").update({status:"charged"}).eq("stripe_payment_id",t.id).select("id, match_id, company_id").single();if(n)return void console.error("Error updating payment status:",n);if(!a)return void console.error("Payment not found for intent:",t.id);let{error:o}=await e.from("matches").update({status:"hired",contractor_action:"accepted",hired_at:new Date().toISOString(),fee_charged:!0}).eq("id",r);if(o)return void console.error("Error updating match status:",o);let{data:i}=await e.from("matches").select("worker_id, jobs(title)").eq("id",r).single();if(i){let t=i.jobs.title||"a job";await e.from("notifications").insert({profile_id:i.worker_id,type:"hire_confirmed",title:"You've been hired!",body:`Congratulations! You've been hired for ${t}.`,data:{match_id:r,payment_id:a.id}})}console.log("Payment success processed for match:",r)}catch(e){console.error("Error processing payment success:",e)}}async function b(e,t){try{let{error:r}=await e.from("payments").update({status:"pending"}).eq("stripe_payment_id",t.id);r&&console.error("Error updating payment failure:",r),console.log("Payment failed for intent:",t.id)}catch(e){console.error("Error handling payment failure:",e)}}async function _(e,t){try{let{error:r}=await e.from("payments").delete().eq("stripe_payment_id",t.id).eq("status","pending");r&&console.error("Error deleting cancelled payment:",r),console.log("Payment cancelled for intent:",t.id)}catch(e){console.error("Error handling payment cancellation:",e)}}e.s(["POST",()=>w,"dynamic",0,"force-dynamic","runtime",0,"nodejs"],28562);var A=e.i(28562);let C=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/webhooks/stripe/route",pathname:"/api/webhooks/stripe",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/webhooks/stripe/route.ts",nextConfigOutput:"",userland:A}),{workAsyncStorage:k,workUnitAsyncStorage:j,serverHooks:I}=C;function S(){return(0,a.patchFetch)({workAsyncStorage:k,workUnitAsyncStorage:j})}async function N(e,t,a){C.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let x="/api/webhooks/stripe/route";x=x.replace(/\/index$/,"")||"/";let v=await C.prepare(e,t,{srcPage:x,multiZoneDraftMode:!1});if(!v)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:R,params:w,nextConfig:E,parsedUrl:b,isDraftMode:_,prerenderManifest:A,routerServerContext:k,isOnDemandRevalidate:j,revalidateOnlyGenerated:I,resolvedPathname:S,clientReferenceManifest:N,serverActionsManifest:P}=v,q=(0,s.normalizeAppPath)(x),O=!!(A.dynamicRoutes[q]||A.routes[S]),T=async()=>((null==k?void 0:k.render404)?await k.render404(e,t,b,!1):t.end("This page could not be found"),null);if(O&&!_){let e=!!A.routes[S],t=A.dynamicRoutes[q];if(t&&!1===t.fallback&&!e){if(E.experimental.adapterPath)return await T();throw new y.NoFallbackError}}let U=null;!O||C.isDev||_||(U="/index"===(U=S)?"/":U);let H=!0===C.isDev||!O,D=O&&!H;P&&N&&(0,i.setManifestsSingleton)({page:x,clientReferenceManifest:N,serverActionsManifest:P});let M=e.method||"GET",F=(0,o.getTracer)(),K=F.getActiveScopeSpan(),B={params:w,prerenderManifest:A,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:H,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:E.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>C.onRequestError(e,t,a,n,k)},sharedContext:{buildId:R}},$=new l.NodeNextRequest(e),J=new l.NodeNextResponse(t),W=d.NextRequestAdapter.fromNodeNextRequest($,(0,d.signalFromNodeResponse)(t));try{let i=async e=>C.handle(W,B).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${M} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${M} ${x}`)}),s=!!(0,n.getRequestMeta)(e,"minimalMode"),l=async n=>{var o,l;let d=async({previousCacheEntry:r})=>{try{if(!s&&j&&I&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let o=await i(n);e.fetchMetrics=B.renderOpts.fetchMetrics;let l=B.renderOpts.pendingWaitUntil;l&&a.waitUntil&&(a.waitUntil(l),l=void 0);let d=B.renderOpts.collectedTags;if(!O)return await (0,p.sendResponse)($,J,o,B.renderOpts.pendingWaitUntil),null;{let e=await o.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(o.headers);d&&(t[f.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==B.renderOpts.collectedRevalidate&&!(B.renderOpts.collectedRevalidate>=f.INFINITE_CACHE)&&B.renderOpts.collectedRevalidate,a=void 0===B.renderOpts.collectedExpire||B.renderOpts.collectedExpire>=f.INFINITE_CACHE?void 0:B.renderOpts.collectedExpire;return{value:{kind:g.CachedRouteKind.APP_ROUTE,status:o.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await C.onRequestError(e,t,{routerKind:"App Router",routePath:x,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:j})},!1,k),t}},c=await C.handleResponse({req:e,nextConfig:E,cacheKey:U,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:j,revalidateOnlyGenerated:I,responseGenerator:d,waitUntil:a.waitUntil,isMinimalMode:s});if(!O)return null;if((null==c||null==(o=c.value)?void 0:o.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==c||null==(l=c.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});s||t.setHeader("x-nextjs-cache",j?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),_&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let y=(0,h.fromNodeOutgoingHttpHeaders)(c.value.headers);return s&&O||y.delete(f.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||y.get("Cache-Control")||y.set("Cache-Control",(0,m.getCacheControlHeader)(c.cacheControl)),await (0,p.sendResponse)($,J,new Response(c.value.body,{headers:y,status:c.value.status||200})),null};K?await l(K):await F.withPropagatedContext(e.headers,()=>F.trace(c.BaseServerSpan.handleRequest,{spanName:`${M} ${x}`,kind:o.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},l))}catch(t){if(t instanceof y.NoFallbackError||await C.onRequestError(e,t,{routerKind:"App Router",routePath:q,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:j})},!1,k),O)throw t;return await (0,p.sendResponse)($,J,new Response(null,{status:500})),null}}e.s(["handler",()=>N,"patchFetch",()=>S,"routeModule",()=>C,"serverHooks",()=>I,"workAsyncStorage",()=>k,"workUnitAsyncStorage",()=>j],27890)}]; /home/ccuser/rateright-v2/.next/server/chunks/node_modules_openai_index_mjs_88cf4560._.js:${ss(e)}`);return{...o,id:a,type:i,function:{...h,name:c,arguments:l}}})}}:{...i,message:{...c,content:a,role:h,refusal:t.refusal??null},finish_reason:s,index:n,logprobs:r}}),created:i,model:a,object:"chat.completion",...o?{system_fingerprint:o}:{}},t&&t0(t)?tZ(s,t):{...s,choices:s.choices.map(e=>(t1(e.message.tool_calls),{...e,message:{...e.message,parsed:null,...e.message.tool_calls?{tool_calls:e.message.tool_calls}:void 0}}))}}(e,eI(this,I,"f"))},L=function(){let e=eI(this,I,"f")?.response_format;return tG(e)?e:null},D=function(e){var t,s,n,r;let i=eI(this,E,"f"),{choices:a,...o}=e;for(let{delta:a,finish_reason:l,index:c,logprobs:h=null,...u}of(i?Object.assign(i,o):i=ek(this,E,{...o,choices:[]},"f"),e.choices)){let e=i.choices[c];if(e||(e=i.choices[c]={finish_reason:l,index:c,message:{},logprobs:h,...u}),h)if(e.logprobs){let{content:n,refusal:r,...i}=h;sn(i),Object.assign(e.logprobs,i),n&&((t=e.logprobs).content??(t.content=[]),e.logprobs.content.push(...n)),r&&((s=e.logprobs).refusal??(s.refusal=[]),e.logprobs.refusal.push(...r))}else e.logprobs=Object.assign({},h);if(l&&(e.finish_reason=l,eI(this,I,"f")&&t0(eI(this,I,"f")))){if("length"===l)throw new eH;if("content_filter"===l)throw new eJ}if(Object.assign(e,u),!a)continue;let{content:o,refusal:d,function_call:f,role:p,tool_calls:m,...g}=a;if(sn(g),Object.assign(e.message,g),d&&(e.message.refusal=(e.message.refusal||"")+d),p&&(e.message.role=p),f&&(e.message.function_call?(f.name&&(e.message.function_call.name=f.name),f.arguments&&((n=e.message.function_call).arguments??(n.arguments=""),e.message.function_call.arguments+=f.arguments)):e.message.function_call=f),o&&(e.message.content=(e.message.content||"")+o,!e.message.refusal&&eI(this,k,"m",L).call(this)&&(e.message.parsed=se(e.message.content))),m)for(let{index:t,id:s,type:n,function:i,...a}of(e.message.tool_calls||(e.message.tool_calls=[]),m)){let o=(r=e.message.tool_calls)[t]??(r[t]={});Object.assign(o,a),s&&(o.id=s),n&&(o.type=n),i&&(o.function??(o.function={name:i.name??"",arguments:""})),i?.name&&(o.function.name=i.name),i?.arguments&&(o.function.arguments+=i.arguments,function(e,t){if(!e||!("tools"in e)||!e.tools)return!1;let s=e.tools?.find(e=>tQ(e)&&e.function?.name===t.function.name);return tQ(s)&&(tY(s)||s?.function.strict||!1)}(eI(this,I,"f"),o)&&(o.function.parsed_arguments=se(o.function.arguments)))}}return i},Symbol.asyncIterator)](){let e=[],t=[],s=!1;return this.on("chunk",s=>{let n=t.shift();n?n.resolve(s):e.push(s)}),this.on("end",()=>{for(let e of(s=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let n of(s=!0,t))n.reject(e);t.length=0}),this.on("error",e=>{for(let n of(s=!0,t))n.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:s?{value:void 0,done:!0}:new Promise((e,s)=>t.push({resolve:e,reject:s})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new tw(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function ss(e){return JSON.stringify(e)}function sn(e){}function sr(e){}class si extends st{static fromReadableStream(e){let t=new si(null);return t._run(()=>t._fromReadableStream(e)),t}static runTools(e,t,s){let n=new si(t),r={...s,headers:{...s?.headers,"X-Stainless-Helper-Method":"runTools"}};return n._run(()=>n._runTools(e,t,r)),n}}class sa extends tH{constructor(){super(...arguments),this.messages=new tz(this._client)}create(e,t){return this._client.post("/chat/completions",{body:e,...t,stream:e.stream??!1})}retrieve(e,t){return this._client.get(tV`/chat/completions/${e}`,t)}update(e,t,s){return this._client.post(tV`/chat/completions/${e}`,{body:t,...s})}list(e={},t){return this._client.getAPIList("/chat/completions",tR,{query:e,...t})}delete(e,t){return this._client.delete(tV`/chat/completions/${e}`,t)}parse(e,t){for(let t of e.tools??[]){if("function"!==t.type)throw new eC(`Currently only \`function\` tool types support auto-parsing; Received \`${t.type}\``);if(!0!==t.function.strict)throw new eC(`The \`${t.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}return this._client.chat.completions.create(e,{...t,headers:{...t?.headers,"X-Stainless-Helper-Method":"chat.completions.parse"}})._thenUnwrap(t=>tZ(t,e))}runTools(e,t){return e.stream?si.runTools(this._client,e,t):t6.runTools(this._client,e,t)}stream(e,t){return st.createChatCompletion(this._client,e,t)}}sa.Messages=tz;class so extends tH{constructor(){super(...arguments),this.completions=new sa(this._client)}}so.Completions=sa,e.s([],98546);let sl=Symbol("brand.privateNullableHeaders"),sc=e=>{let t=new Headers,s=new Set;for(let n of e){let e=new Set;for(let[r,i]of function*(e){let t;if(!e)return;if(sl in e){let{values:t,nulls:s}=e;for(let e of(yield*t.entries(),s))yield[e,null];return}let s=!1;for(let n of(e instanceof Headers?t=e.entries():eQ(e)?t=e:(s=!0,t=Object.entries(e??{})),t)){let e=n[0];if("string"!=typeof e)throw TypeError("expected header name to be a string");let t=eQ(n[1])?n[1]:[n[1]],r=!1;for(let n of t)void 0!==n&&(s&&!r&&(r=!0,yield[e,null]),yield[e,n])}}(n)){let n=r.toLowerCase();e.has(n)||(t.delete(r),e.add(n)),null===i?(t.delete(r),s.add(n)):(t.append(r,i),s.delete(n))}}return{[sl]:!0,values:t,nulls:s}};class sh extends tH{create(e,t){return this._client.post("/audio/speech",{body:e,...t,headers:sc([{Accept:"application/octet-stream"},t?.headers]),__binaryResponse:!0})}}class su extends tH{create(e,t){return this._client.post("/audio/transcriptions",tN({body:e,...t,stream:e.stream??!1,__metadata:{model:e.model}},this._client))}}class sd extends tH{create(e,t){return this._client.post("/audio/translations",tN({body:e,...t,__metadata:{model:e.model}},this._client))}}class sf extends tH{constructor(){super(...arguments),this.transcriptions=new su(this._client),this.translations=new sd(this._client),this.speech=new sh(this._client)}}sf.Transcriptions=su,sf.Translations=sd,sf.Speech=sh;class sp extends tH{create(e,t){return this._client.post("/batches",{body:e,...t})}retrieve(e,t){return this._client.get(tV`/batches/${e}`,t)}list(e={},t){return this._client.getAPIList("/batches",tR,{query:e,...t})}cancel(e,t){return this._client.post(tV`/batches/${e}/cancel`,t)}}class sm extends tH{create(e,t){return this._client.post("/assistants",{body:e,...t,headers:sc([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}retrieve(e,t){return this._client.get(tV`/assistants/${e}`,{...t,headers:sc([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}update(e,t,s){return this._client.post(tV`/assistants/${e}`,{body:t,...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}list(e={},t){return this._client.getAPIList("/assistants",tR,{query:e,...t,headers:sc([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}delete(e,t){return this._client.delete(tV`/assistants/${e}`,{...t,headers:sc([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}}class sg extends tH{create(e,t){return this._client.post("/realtime/sessions",{body:e,...t,headers:sc([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}}class s_ extends tH{create(e,t){return this._client.post("/realtime/transcription_sessions",{body:e,...t,headers:sc([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}}class sy extends tH{constructor(){super(...arguments),this.sessions=new sg(this._client),this.transcriptionSessions=new s_(this._client)}}sy.Sessions=sg,sy.TranscriptionSessions=s_;class sw extends tH{create(e,t){return this._client.post("/chatkit/sessions",{body:e,...t,headers:sc([{"OpenAI-Beta":"chatkit_beta=v1"},t?.headers])})}cancel(e,t){return this._client.post(tV`/chatkit/sessions/${e}/cancel`,{...t,headers:sc([{"OpenAI-Beta":"chatkit_beta=v1"},t?.headers])})}}class sb extends tH{retrieve(e,t){return this._client.get(tV`/chatkit/threads/${e}`,{...t,headers:sc([{"OpenAI-Beta":"chatkit_beta=v1"},t?.headers])})}list(e={},t){return this._client.getAPIList("/chatkit/threads",tE,{query:e,...t,headers:sc([{"OpenAI-Beta":"chatkit_beta=v1"},t?.headers])})}delete(e,t){return this._client.delete(tV`/chatkit/threads/${e}`,{...t,headers:sc([{"OpenAI-Beta":"chatkit_beta=v1"},t?.headers])})}listItems(e,t={},s){return this._client.getAPIList(tV`/chatkit/threads/${e}/items`,tE,{query:t,...s,headers:sc([{"OpenAI-Beta":"chatkit_beta=v1"},s?.headers])})}}class sv extends tH{constructor(){super(...arguments),this.sessions=new sw(this._client),this.threads=new sb(this._client)}}sv.Sessions=sw,sv.Threads=sb;class sx extends tH{create(e,t,s){return this._client.post(tV`/threads/${e}/messages`,{body:t,...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}retrieve(e,t,s){let{thread_id:n}=t;return this._client.get(tV`/threads/${n}/messages/${e}`,{...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}update(e,t,s){let{thread_id:n,...r}=t;return this._client.post(tV`/threads/${n}/messages/${e}`,{body:r,...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}list(e,t={},s){return this._client.getAPIList(tV`/threads/${e}/messages`,tR,{query:t,...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}delete(e,t,s){let{thread_id:n}=t;return this._client.delete(tV`/threads/${n}/messages/${e}`,{...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}}class sS extends tH{retrieve(e,t,s){let{thread_id:n,run_id:r,...i}=t;return this._client.get(tV`/threads/${n}/runs/${r}/steps/${e}`,{query:i,...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}list(e,t,s){let{thread_id:n,...r}=t;return this._client.getAPIList(tV`/threads/${n}/runs/${e}/steps`,tR,{query:r,...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}}let s$=e=>void 0!==globalThis.process?globalThis.process.env?.[e]?.trim()??void 0:void 0!==globalThis.Deno?globalThis.Deno.env?.get?.(e)?.trim():void 0;class sA extends t3{constructor(){super(...arguments),B.add(this),q.set(this,[]),U.set(this,{}),F.set(this,{}),X.set(this,void 0),H.set(this,void 0),J.set(this,void 0),K.set(this,void 0),V.set(this,void 0),z.set(this,void 0),Q.set(this,void 0),G.set(this,void 0),Y.set(this,void 0)}[(q=new WeakMap,U=new WeakMap,F=new WeakMap,X=new WeakMap,H=new WeakMap,J=new WeakMap,K=new WeakMap,V=new WeakMap,z=new WeakMap,Q=new WeakMap,G=new WeakMap,Y=new WeakMap,B=new WeakSet,Symbol.asyncIterator)](){let e=[],t=[],s=!1;return this.on("event",s=>{let n=t.shift();n?n.resolve(s):e.push(s)}),this.on("end",()=>{for(let e of(s=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let n of(s=!0,t))n.reject(e);t.length=0}),this.on("error",e=>{for(let n of(s=!0,t))n.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:s?{value:void 0,done:!0}:new Promise((e,s)=>t.push({resolve:e,reject:s})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}static fromReadableStream(e){let t=new W;return t._run(()=>t._fromReadableStream(e)),t}async _fromReadableStream(e,t){let s=t?.signal;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort())),this._connected();let n=tw.fromReadableStream(e,this.controller);for await(let e of n)eI(this,B,"m",Z).call(this,e);if(n.controller.signal?.aborted)throw new ej;return this._addRun(eI(this,B,"m",ee).call(this))}toReadableStream(){return new tw(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(e,t,s,n){let r=new W;return r._run(()=>r._runToolAssistantStream(e,t,s,{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),r}async _createToolAssistantStream(e,t,s,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort()));let i={...s,stream:!0},a=await e.submitToolOutputs(t,i,{...n,signal:this.controller.signal});for await(let e of(this._connected(),a))eI(this,B,"m",Z).call(this,e);if(a.controller.signal?.aborted)throw new ej;return this._addRun(eI(this,B,"m",ee).call(this))}static createThreadAssistantStream(e,t,s){let n=new W;return n._run(()=>n._threadAssistantStream(e,t,{...s,headers:{...s?.headers,"X-Stainless-Helper-Method":"stream"}})),n}static createAssistantStream(e,t,s,n){let r=new W;return r._run(()=>r._runAssistantStream(e,t,s,{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),r}currentEvent(){return eI(this,Q,"f")}currentRun(){return eI(this,G,"f")}currentMessageSnapshot(){return eI(this,X,"f")}currentRunStepSnapshot(){return eI(this,Y,"f")}async finalRunSteps(){return await this.done(),Object.values(eI(this,U,"f"))}async finalMessages(){return await this.done(),Object.values(eI(this,F,"f"))}async finalRun(){if(await this.done(),!eI(this,H,"f"))throw Error("Final run was not received.");return eI(this,H,"f")}async _createThreadAssistantStream(e,t,s){let n=s?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort()));let r={...t,stream:!0},i=await e.createAndRun(r,{...s,signal:this.controller.signal});for await(let e of(this._connected(),i))eI(this,B,"m",Z).call(this,e);if(i.controller.signal?.aborted)throw new ej;return this._addRun(eI(this,B,"m",ee).call(this))}async _createAssistantStream(e,t,s,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort()));let i={...s,stream:!0},a=await e.create(t,i,{...n,signal:this.controller.signal});for await(let e of(this._connected(),a))eI(this,B,"m",Z).call(this,e);if(a.controller.signal?.aborted)throw new ej;return this._addRun(eI(this,B,"m",ee).call(this))}static accumulateDelta(e,t){for(let[s,n]of Object.entries(t)){if(!e.hasOwnProperty(s)){e[s]=n;continue}let t=e[s];if(null==t||"index"===s||"type"===s){e[s]=n;continue}if("string"==typeof t&&"string"==typeof n)t+=n;else if("number"==typeof t&&"number"==typeof n)t+=n;else if(eY(t)&&eY(n))t=this.accumulateDelta(t,n);else if(Array.isArray(t)&&Array.isArray(n)){if(t.every(e=>"string"==typeof e||"number"==typeof e)){t.push(...n);continue}for(let e of n){if(!eY(e))throw Error(`Expected array delta entry to be an object but got: ${e}`);let s=e.index;if(null==s)throw console.error(e),Error("Expected array delta entry to have an `index` property");if("number"!=typeof s)throw Error(`Expected array delta entry \`index\` property to be a number but got ${s}`);let n=t[s];null==n?t.push(e):t[s]=this.accumulateDelta(n,e)}continue}else throw Error(`Unhandled record type: ${s}, deltaValue: ${n}, accValue: ${t}`);e[s]=t}return e}_addRun(e){return e}async _threadAssistantStream(e,t,s){return await this._createThreadAssistantStream(t,e,s)}async _runAssistantStream(e,t,s,n){return await this._createAssistantStream(t,e,s,n)}async _runToolAssistantStream(e,t,s,n){return await this._createToolAssistantStream(t,e,s,n)}}W=sA,Z=function(e){if(!this.ended)switch(ek(this,Q,e,"f"),eI(this,B,"m",en).call(this,e),e.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":eI(this,B,"m",eo).call(this,e);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":eI(this,B,"m",es).call(this,e);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":eI(this,B,"m",et).call(this,e);break;case"error":throw Error("Encountered an error event in event processing - errors should be processed earlier")}},ee=function(){if(this.ended)throw new eC("stream has ended, this shouldn't happen");if(!eI(this,H,"f"))throw Error("Final run has not been received");return eI(this,H,"f")},et=function(e){let[t,s]=eI(this,B,"m",ei).call(this,e,eI(this,X,"f"));for(let e of(ek(this,X,t,"f"),eI(this,F,"f")[t.id]=t,s)){let s=t.content[e.index];s?.type=="text"&&this._emit("textCreated",s.text)}switch(e.event){case"thread.message.created":this._emit("messageCreated",e.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",e.data.delta,t),e.data.delta.content)for(let s of e.data.delta.content){if("text"==s.type&&s.text){let e=s.text,n=t.content[s.index];if(n&&"text"==n.type)this._emit("textDelta",e,n.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(s.index!=eI(this,J,"f")){if(eI(this,K,"f"))switch(eI(this,K,"f").type){case"text":this._emit("textDone",eI(this,K,"f").text,eI(this,X,"f"));break;case"image_file":this._emit("imageFileDone",eI(this,K,"f").image_file,eI(this,X,"f"))}ek(this,J,s.index,"f")}ek(this,K,t.content[s.index],"f")}break;case"thread.message.completed":case"thread.message.incomplete":if(void 0!==eI(this,J,"f")){let t=e.data.content[eI(this,J,"f")];if(t)switch(t.type){case"image_file":this._emit("imageFileDone",t.image_file,eI(this,X,"f"));break;case"text":this._emit("textDone",t.text,eI(this,X,"f"))}}eI(this,X,"f")&&this._emit("messageDone",e.data),ek(this,X,void 0,"f")}},es=function(e){let t=eI(this,B,"m",er).call(this,e);switch(ek(this,Y,t,"f"),e.event){case"thread.run.step.created":this._emit("runStepCreated",e.data);break;case"thread.run.step.delta":let s=e.data.delta;if(s.step_details&&"tool_calls"==s.step_details.type&&s.step_details.tool_calls&&"tool_calls"==t.step_details.type)for(let e of s.step_details.tool_calls)e.index==eI(this,V,"f")?this._emit("toolCallDelta",e,t.step_details.tool_calls[e.index]):(eI(this,z,"f")&&this._emit("toolCallDone",eI(this,z,"f")),ek(this,V,e.index,"f"),ek(this,z,t.step_details.tool_calls[e.index],"f"),eI(this,z,"f")&&this._emit("toolCallCreated",eI(this,z,"f")));this._emit("runStepDelta",e.data.delta,t);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":ek(this,Y,void 0,"f"),"tool_calls"==e.data.step_details.type&&eI(this,z,"f")&&(this._emit("toolCallDone",eI(this,z,"f")),ek(this,z,void 0,"f")),this._emit("runStepDone",e.data,t)}},en=function(e){eI(this,q,"f").push(e),this._emit("event",e)},er=function(e){switch(e.event){case"thread.run.step.created":return eI(this,U,"f")[e.data.id]=e.data,e.data;case"thread.run.step.delta":let t=eI(this,U,"f")[e.data.id];if(!t)throw Error("Received a RunStepDelta before creation of a snapshot");let s=e.data;if(s.delta){let n=W.accumulateDelta(t,s.delta);eI(this,U,"f")[e.data.id]=n}return eI(this,U,"f")[e.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":eI(this,U,"f")[e.data.id]=e.data}if(eI(this,U,"f")[e.data.id])return eI(this,U,"f")[e.data.id];throw Error("No snapshot available")},ei=function(e,t){let s=[];switch(e.event){case"thread.message.created":return[e.data,s];case"thread.message.delta":if(!t)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let n=e.data;if(n.delta.content)for(let e of n.delta.content)if(e.index in t.content){let s=t.content[e.index];t.content[e.index]=eI(this,B,"m",ea).call(this,e,s)}else t.content[e.index]=e,s.push(e);return[t,s];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(t)return[t,s];throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},ea=function(e,t){return W.accumulateDelta(t,e)},eo=function(e){switch(ek(this,G,e.data,"f"),e.event){case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":case"thread.run.incomplete":ek(this,H,e.data,"f"),eI(this,z,"f")&&(this._emit("toolCallDone",eI(this,z,"f")),ek(this,z,void 0,"f"))}};class sO extends tH{constructor(){super(...arguments),this.steps=new sS(this._client)}create(e,t,s){let{include:n,...r}=t;return this._client.post(tV`/threads/${e}/runs`,{query:{include:n},body:r,...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers]),stream:t.stream??!1})}retrieve(e,t,s){let{thread_id:n}=t;return this._client.get(tV`/threads/${n}/runs/${e}`,{...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}update(e,t,s){let{thread_id:n,...r}=t;return this._client.post(tV`/threads/${n}/runs/${e}`,{body:r,...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}list(e,t={},s){return this._client.getAPIList(tV`/threads/${e}/runs`,tR,{query:t,...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}cancel(e,t,s){let{thread_id:n}=t;return this._client.post(tV`/threads/${n}/runs/${e}/cancel`,{...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}async createAndPoll(e,t,s){let n=await this.create(e,t,s);return await this.poll(n.id,{thread_id:e},s)}createAndStream(e,t,s){return sA.createAssistantStream(e,this._client.beta.threads.runs,t,s)}async poll(e,t,s){let n=sc([s?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":s?.pollIntervalMs?.toString()??void 0}]);for(;;){let{data:r,response:i}=await this.retrieve(e,t,{...s,headers:{...s?.headers,...n}}).withResponse();switch(r.status){case"queued":case"in_progress":case"cancelling":let a=5e3;if(s?.pollIntervalMs)a=s.pollIntervalMs;else{let e=i.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(a=t)}}await eZ(a);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return r}}}stream(e,t,s){return sA.createAssistantStream(e,this._client.beta.threads.runs,t,s)}submitToolOutputs(e,t,s){let{thread_id:n,...r}=t;return this._client.post(tV`/threads/${n}/runs/${e}/submit_tool_outputs`,{body:r,...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers]),stream:t.stream??!1})}async submitToolOutputsAndPoll(e,t,s){let n=await this.submitToolOutputs(e,t,s);return await this.poll(n.id,t,s)}submitToolOutputsStream(e,t,s){return sA.createToolAssistantStream(e,this._client.beta.threads.runs,t,s)}}sO.Steps=sS;class sk extends tH{constructor(){super(...arguments),this.runs=new sO(this._client),this.messages=new sx(this._client)}create(e={},t){return this._client.post("/threads",{body:e,...t,headers:sc([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}retrieve(e,t){return this._client.get(tV`/threads/${e}`,{...t,headers:sc([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}update(e,t,s){return this._client.post(tV`/threads/${e}`,{body:t,...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}delete(e,t){return this._client.delete(tV`/threads/${e}`,{...t,headers:sc([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}createAndRun(e,t){return this._client.post("/threads/runs",{body:e,...t,headers:sc([{"OpenAI-Beta":"assistants=v2"},t?.headers]),stream:e.stream??!1})}async createAndRunPoll(e,t){let s=await this.createAndRun(e,t);return await this.runs.poll(s.id,{thread_id:s.thread_id},t)}createAndRunStream(e,t){return sA.createThreadAssistantStream(e,this._client.beta.threads,t)}}sk.Runs=sO,sk.Messages=sx;class sI extends tH{constructor(){super(...arguments),this.realtime=new sy(this._client),this.chatkit=new sv(this._client),this.assistants=new sm(this._client),this.threads=new sk(this._client)}}sI.Realtime=sy,sI.ChatKit=sv,sI.Assistants=sm,sI.Threads=sk;class sR extends tH{create(e,t){return this._client.post("/completions",{body:e,...t,stream:e.stream??!1})}}class sE extends tH{retrieve(e,t,s){let{container_id:n}=t;return this._client.get(tV`/containers/${n}/files/${e}/content`,{...s,headers:sc([{Accept:"application/binary"},s?.headers]),__binaryResponse:!0})}}class sP extends tH{constructor(){super(...arguments),this.content=new sE(this._client)}create(e,t,s){return this._client.post(tV`/containers/${e}/files`,tN({body:t,...s},this._client))}retrieve(e,t,s){let{container_id:n}=t;return this._client.get(tV`/containers/${n}/files/${e}`,s)}list(e,t={},s){return this._client.getAPIList(tV`/containers/${e}/files`,tR,{query:t,...s})}delete(e,t,s){let{container_id:n}=t;return this._client.delete(tV`/containers/${n}/files/${e}`,{...s,headers:sc([{Accept:"*/*"},s?.headers])})}}sP.Content=sE;class sC extends tH{constructor(){super(...arguments),this.files=new sP(this._client)}create(e,t){return this._client.post("/containers",{body:e,...t})}retrieve(e,t){return this._client.get(tV`/containers/${e}`,t)}list(e={},t){return this._client.getAPIList("/containers",tR,{query:e,...t})}delete(e,t){return this._client.delete(tV`/containers/${e}`,{...t,headers:sc([{Accept:"*/*"},t?.headers])})}}sC.Files=sP;class sT extends tH{create(e,t,s){let{include:n,...r}=t;return this._client.post(tV`/conversations/${e}/items`,{query:{include:n},body:r,...s})}retrieve(e,t,s){let{conversation_id:n,...r}=t;return this._client.get(tV`/conversations/${n}/items/${e}`,{query:r,...s})}list(e,t={},s){return this._client.getAPIList(tV`/conversations/${e}/items`,tE,{query:t,...s})}delete(e,t,s){let{conversation_id:n}=t;return this._client.delete(tV`/conversations/${n}/items/${e}`,s)}}class sj extends tH{constructor(){super(...arguments),this.items=new sT(this._client)}create(e={},t){return this._client.post("/conversations",{body:e,...t})}retrieve(e,t){return this._client.get(tV`/conversations/${e}`,t)}update(e,t,s){return this._client.post(tV`/conversations/${e}`,{body:t,...s})}delete(e,t){return this._client.delete(tV`/conversations/${e}`,t)}}sj.Items=sT;class sM extends tH{create(e,t){let s=!!e.encoding_format,n=s?e.encoding_format:"base64";s&&t_(this._client).debug("embeddings/user defined encoding_format:",e.encoding_format);let r=this._client.post("/embeddings",{body:{...e,encoding_format:n},...t});return s?r:(t_(this._client).debug("embeddings/decoding base64 embeddings from base64"),r._thenUnwrap(e=>(e&&e.data&&e.data.forEach(e=>{let t=e.embedding;e.embedding=(e=>{if("u">typeof Buffer){let t=Buffer.from(e,"base64");return Array.from(new Float32Array(t.buffer,t.byteOffset,t.length/Float32Array.BYTES_PER_ELEMENT))}{let t=atob(e),s=t.length,n=new Uint8Array(s);for(let e=0;es)throw new eN({message:`Giving up on waiting for file ${e} to finish processing after ${s} milliseconds.`});return i}}class sW extends tH{}class sq extends tH{run(e,t){return this._client.post("/fine_tuning/alpha/graders/run",{body:e,...t})}validate(e,t){return this._client.post("/fine_tuning/alpha/graders/validate",{body:e,...t})}}class sU extends tH{constructor(){super(...arguments),this.graders=new sq(this._client)}}sU.Graders=sq;class sF extends tH{create(e,t,s){return this._client.getAPIList(tV`/fine_tuning/checkpoints/${e}/permissions`,tI,{body:t,method:"post",...s})}retrieve(e,t={},s){return this._client.get(tV`/fine_tuning/checkpoints/${e}/permissions`,{query:t,...s})}delete(e,t,s){let{fine_tuned_model_checkpoint:n}=t;return this._client.delete(tV`/fine_tuning/checkpoints/${n}/permissions/${e}`,s)}}class sX extends tH{constructor(){super(...arguments),this.permissions=new sF(this._client)}}sX.Permissions=sF;class sH extends tH{list(e,t={},s){return this._client.getAPIList(tV`/fine_tuning/jobs/${e}/checkpoints`,tR,{query:t,...s})}}class sJ extends tH{constructor(){super(...arguments),this.checkpoints=new sH(this._client)}create(e,t){return this._client.post("/fine_tuning/jobs",{body:e,...t})}retrieve(e,t){return this._client.get(tV`/fine_tuning/jobs/${e}`,t)}list(e={},t){return this._client.getAPIList("/fine_tuning/jobs",tR,{query:e,...t})}cancel(e,t){return this._client.post(tV`/fine_tuning/jobs/${e}/cancel`,t)}listEvents(e,t={},s){return this._client.getAPIList(tV`/fine_tuning/jobs/${e}/events`,tR,{query:t,...s})}pause(e,t){return this._client.post(tV`/fine_tuning/jobs/${e}/pause`,t)}resume(e,t){return this._client.post(tV`/fine_tuning/jobs/${e}/resume`,t)}}sJ.Checkpoints=sH;class sK extends tH{constructor(){super(...arguments),this.methods=new sW(this._client),this.jobs=new sJ(this._client),this.checkpoints=new sX(this._client),this.alpha=new sU(this._client)}}sK.Methods=sW,sK.Jobs=sJ,sK.Checkpoints=sX,sK.Alpha=sU;class sV extends tH{}class sz extends tH{constructor(){super(...arguments),this.graderModels=new sV(this._client)}}sz.GraderModels=sV;class sQ extends tH{createVariation(e,t){return this._client.post("/images/variations",tN({body:e,...t},this._client))}edit(e,t){return this._client.post("/images/edits",tN({body:e,...t,stream:e.stream??!1},this._client))}generate(e,t){return this._client.post("/images/generations",{body:e,...t,stream:e.stream??!1})}}class sG extends tH{retrieve(e,t){return this._client.get(tV`/models/${e}`,t)}list(e){return this._client.getAPIList("/models",tI,e)}delete(e,t){return this._client.delete(tV`/models/${e}`,t)}}class sY extends tH{create(e,t){return this._client.post("/moderations",{body:e,...t})}}class sZ extends tH{accept(e,t,s){return this._client.post(tV`/realtime/calls/${e}/accept`,{body:t,...s,headers:sc([{Accept:"*/*"},s?.headers])})}hangup(e,t){return this._client.post(tV`/realtime/calls/${e}/hangup`,{...t,headers:sc([{Accept:"*/*"},t?.headers])})}refer(e,t,s){return this._client.post(tV`/realtime/calls/${e}/refer`,{body:t,...s,headers:sc([{Accept:"*/*"},s?.headers])})}reject(e,t={},s){return this._client.post(tV`/realtime/calls/${e}/reject`,{body:t,...s,headers:sc([{Accept:"*/*"},s?.headers])})}}class s0 extends tH{create(e,t){return this._client.post("/realtime/client_secrets",{body:e,...t})}}class s1 extends tH{constructor(){super(...arguments),this.clientSecrets=new s0(this._client),this.calls=new sZ(this._client)}}function s2(e,t){let s=e.output.map(e=>{if("function_call"===e.type)return{...e,parsed_arguments:function(e,t){var s,n;let r=(s=e.tools??[],n=t.name,s.find(e=>"function"===e.type&&e.name===n));return{...t,...t,parsed_arguments:r?.$brand==="auto-parseable-tool"?r.$parseRaw(t.arguments):r?.strict?JSON.parse(t.arguments):null}}(t,e)};if("message"===e.type){let s=e.content.map(e=>{var s,n;return"output_text"===e.type?{...e,parsed:(s=t,n=e.text,s.text?.format?.type!=="json_schema"?null:"$parseRaw"in s.text?.format?(s.text?.format).$parseRaw(n):JSON.parse(n))}:e});return{...e,content:s}}return e}),n=Object.assign({},e,{output:s});return Object.getOwnPropertyDescriptor(e,"output_text")||s8(n),Object.defineProperty(n,"output_parsed",{enumerable:!0,get(){for(let e of n.output)if("message"===e.type){for(let t of e.content)if("output_text"===t.type&&null!==t.parsed)return t.parsed}return null}}),n}function s8(e){let t=[];for(let s of e.output)if("message"===s.type)for(let e of s.content)"output_text"===e.type&&t.push(e.text);e.output_text=t.join("")}s1.ClientSecrets=s0,s1.Calls=sZ;class s3 extends t3{constructor(e){super(),el.add(this),ec.set(this,void 0),eh.set(this,void 0),eu.set(this,void 0),ek(this,ec,e,"f")}static createResponse(e,t,s){let n=new s3(t);return n._run(()=>n._createOrRetrieveResponse(e,t,{...s,headers:{...s?.headers,"X-Stainless-Helper-Method":"stream"}})),n}async _createOrRetrieveResponse(e,t,s){let n,r=s?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),eI(this,el,"m",ed).call(this);let i=null;for await(let r of("response_id"in t?(n=await e.responses.retrieve(t.response_id,{stream:!0},{...s,signal:this.controller.signal,stream:!0}),i=t.starting_after??null):n=await e.responses.create({...t,stream:!0},{...s,signal:this.controller.signal}),this._connected(),n))eI(this,el,"m",ef).call(this,r,i);if(n.controller.signal?.aborted)throw new ej;return eI(this,el,"m",ep).call(this)}[(ec=new WeakMap,eh=new WeakMap,eu=new WeakMap,el=new WeakSet,ed=function(){this.ended||ek(this,eh,void 0,"f")},ef=function(e,t){if(this.ended)return;let s=(e,s)=>{(null==t||s.sequence_number>t)&&this._emit(e,s)},n=eI(this,el,"m",em).call(this,e);switch(s("event",e),e.type){case"response.output_text.delta":{let t=n.output[e.output_index];if(!t)throw new eC(`missing output at index ${e.output_index}`);if("message"===t.type){let n=t.content[e.content_index];if(!n)throw new eC(`missing content at index ${e.content_index}`);if("output_text"!==n.type)throw new eC(`expected content to be 'output_text', got ${n.type}`);s("response.output_text.delta",{...e,snapshot:n.text})}break}case"response.function_call_arguments.delta":{let t=n.output[e.output_index];if(!t)throw new eC(`missing output at index ${e.output_index}`);"function_call"===t.type&&s("response.function_call_arguments.delta",{...e,snapshot:t.arguments});break}default:s(e.type,e)}},ep=function(){if(this.ended)throw new eC("stream has ended, this shouldn't happen");let e=eI(this,eh,"f");if(!e)throw new eC("request ended without sending any events");ek(this,eh,void 0,"f");let t=function(e,t){var s;return t&&(s=t,tG(s.text?.format))?s2(e,t):{...e,output_parsed:null,output:e.output.map(e=>"function_call"===e.type?{...e,parsed_arguments:null}:"message"===e.type?{...e,content:e.content.map(e=>({...e,parsed:null}))}:e)}}(e,eI(this,ec,"f"));return ek(this,eu,t,"f"),t},em=function(e){let t=eI(this,eh,"f");if(!t){if("response.created"!==e.type)throw new eC(`When snapshot hasn't been set yet, expected 'response.created' event, got ${e.type}`);return ek(this,eh,e.response,"f")}switch(e.type){case"response.output_item.added":t.output.push(e.item);break;case"response.content_part.added":{let s=t.output[e.output_index];if(!s)throw new eC(`missing output at index ${e.output_index}`);let n=s.type,r=e.part;"message"===n&&"reasoning_text"!==r.type?s.content.push(r):"reasoning"===n&&"reasoning_text"===r.type&&(s.content||(s.content=[]),s.content.push(r));break}case"response.output_text.delta":{let s=t.output[e.output_index];if(!s)throw new eC(`missing output at index ${e.output_index}`);if("message"===s.type){let t=s.content[e.content_index];if(!t)throw new eC(`missing content at index ${e.content_index}`);if("output_text"!==t.type)throw new eC(`expected content to be 'output_text', got ${t.type}`);t.text+=e.delta}break}case"response.function_call_arguments.delta":{let s=t.output[e.output_index];if(!s)throw new eC(`missing output at index ${e.output_index}`);"function_call"===s.type&&(s.arguments+=e.delta);break}case"response.reasoning_text.delta":{let s=t.output[e.output_index];if(!s)throw new eC(`missing output at index ${e.output_index}`);if("reasoning"===s.type){let t=s.content?.[e.content_index];if(!t)throw new eC(`missing content at index ${e.content_index}`);if("reasoning_text"!==t.type)throw new eC(`expected content to be 'reasoning_text', got ${t.type}`);t.text+=e.delta}break}case"response.completed":ek(this,eh,e.response,"f")}return t},Symbol.asyncIterator)](){let e=[],t=[],s=!1;return this.on("event",s=>{let n=t.shift();n?n.resolve(s):e.push(s)}),this.on("end",()=>{for(let e of(s=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let n of(s=!0,t))n.reject(e);t.length=0}),this.on("error",e=>{for(let n of(s=!0,t))n.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:s?{value:void 0,done:!0}:new Promise((e,s)=>t.push({resolve:e,reject:s})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}async finalResponse(){await this.done();let e=eI(this,eu,"f");if(!e)throw new eC("stream ended without producing a ChatCompletion");return e}}class s4 extends tH{list(e,t={},s){return this._client.getAPIList(tV`/responses/${e}/input_items`,tR,{query:t,...s})}}class s6 extends tH{count(e={},t){return this._client.post("/responses/input_tokens",{body:e,...t})}}class s5 extends tH{constructor(){super(...arguments),this.inputItems=new s4(this._client),this.inputTokens=new s6(this._client)}create(e,t){return this._client.post("/responses",{body:e,...t,stream:e.stream??!1})._thenUnwrap(e=>("object"in e&&"response"===e.object&&s8(e),e))}retrieve(e,t={},s){return this._client.get(tV`/responses/${e}`,{query:t,...s,stream:t?.stream??!1})._thenUnwrap(e=>("object"in e&&"response"===e.object&&s8(e),e))}delete(e,t){return this._client.delete(tV`/responses/${e}`,{...t,headers:sc([{Accept:"*/*"},t?.headers])})}parse(e,t){return this._client.responses.create(e,t)._thenUnwrap(t=>s2(t,e))}stream(e,t){return s3.createResponse(this._client,e,t)}cancel(e,t){return this._client.post(tV`/responses/${e}/cancel`,t)}compact(e,t){return this._client.post("/responses/compact",{body:e,...t})}}s5.InputItems=s4,s5.InputTokens=s6;class s9 extends tH{create(e,t,s){return this._client.post(tV`/uploads/${e}/parts`,tN({body:t,...s},this._client))}}class s7 extends tH{constructor(){super(...arguments),this.parts=new s9(this._client)}create(e,t){return this._client.post("/uploads",{body:e,...t})}cancel(e,t){return this._client.post(tV`/uploads/${e}/cancel`,t)}complete(e,t,s){return this._client.post(tV`/uploads/${e}/complete`,{body:t,...s})}}s7.Parts=s9;let ne=async e=>{let t=await Promise.allSettled(e),s=t.filter(e=>"rejected"===e.status);if(s.length){for(let e of s)console.error(e.reason);throw Error(`${s.length} promise(s) failed - see the above errors`)}let n=[];for(let e of t)"fulfilled"===e.status&&n.push(e.value);return n};class nt extends tH{create(e,t,s){return this._client.post(tV`/vector_stores/${e}/file_batches`,{body:t,...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}retrieve(e,t,s){let{vector_store_id:n}=t;return this._client.get(tV`/vector_stores/${n}/file_batches/${e}`,{...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}cancel(e,t,s){let{vector_store_id:n}=t;return this._client.post(tV`/vector_stores/${n}/file_batches/${e}/cancel`,{...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}async createAndPoll(e,t,s){let n=await this.create(e,t);return await this.poll(e,n.id,s)}listFiles(e,t,s){let{vector_store_id:n,...r}=t;return this._client.getAPIList(tV`/vector_stores/${n}/file_batches/${e}/files`,tR,{query:r,...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}async poll(e,t,s){let n=sc([s?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":s?.pollIntervalMs?.toString()??void 0}]);for(;;){let{data:r,response:i}=await this.retrieve(t,{vector_store_id:e},{...s,headers:n}).withResponse();switch(r.status){case"in_progress":let a=5e3;if(s?.pollIntervalMs)a=s.pollIntervalMs;else{let e=i.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(a=t)}}await eZ(a);break;case"failed":case"cancelled":case"completed":return r}}}async uploadAndPoll(e,{files:t,fileIds:s=[]},n){if(null==t||0==t.length)throw Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");let r=Math.min(n?.maxConcurrency??5,t.length),i=this._client,a=t.values(),o=[...s];async function l(e){for(let t of e){let e=await i.files.create({file:t,purpose:"assistants"},n);o.push(e.id)}}let c=Array(r).fill(a).map(l);return await ne(c),await this.createAndPoll(e,{file_ids:o})}}class ns extends tH{create(e,t,s){return this._client.post(tV`/vector_stores/${e}/files`,{body:t,...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}retrieve(e,t,s){let{vector_store_id:n}=t;return this._client.get(tV`/vector_stores/${n}/files/${e}`,{...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}update(e,t,s){let{vector_store_id:n,...r}=t;return this._client.post(tV`/vector_stores/${n}/files/${e}`,{body:r,...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}list(e,t={},s){return this._client.getAPIList(tV`/vector_stores/${e}/files`,tR,{query:t,...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}delete(e,t,s){let{vector_store_id:n}=t;return this._client.delete(tV`/vector_stores/${n}/files/${e}`,{...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}async createAndPoll(e,t,s){let n=await this.create(e,t,s);return await this.poll(e,n.id,s)}async poll(e,t,s){let n=sc([s?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":s?.pollIntervalMs?.toString()??void 0}]);for(;;){let r=await this.retrieve(t,{vector_store_id:e},{...s,headers:n}).withResponse(),i=r.data;switch(i.status){case"in_progress":let a=5e3;if(s?.pollIntervalMs)a=s.pollIntervalMs;else{let e=r.response.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(a=t)}}await eZ(a);break;case"failed":case"completed":return i}}}async upload(e,t,s){let n=await this._client.files.create({file:t,purpose:"assistants"},s);return this.create(e,{file_id:n.id},s)}async uploadAndPoll(e,t,s){let n=await this.upload(e,t,s);return await this.poll(e,n.id,s)}content(e,t,s){let{vector_store_id:n}=t;return this._client.getAPIList(tV`/vector_stores/${n}/files/${e}/content`,tI,{...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}}class nn extends tH{constructor(){super(...arguments),this.files=new ns(this._client),this.fileBatches=new nt(this._client)}create(e,t){return this._client.post("/vector_stores",{body:e,...t,headers:sc([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}retrieve(e,t){return this._client.get(tV`/vector_stores/${e}`,{...t,headers:sc([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}update(e,t,s){return this._client.post(tV`/vector_stores/${e}`,{body:t,...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}list(e={},t){return this._client.getAPIList("/vector_stores",tR,{query:e,...t,headers:sc([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}delete(e,t){return this._client.delete(tV`/vector_stores/${e}`,{...t,headers:sc([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}search(e,t,s){return this._client.getAPIList(tV`/vector_stores/${e}/search`,tI,{body:t,method:"post",...s,headers:sc([{"OpenAI-Beta":"assistants=v2"},s?.headers])})}}nn.Files=ns,nn.FileBatches=nt;class nr extends tH{create(e,t){return this._client.post("/videos",tM({body:e,...t},this._client))}retrieve(e,t){return this._client.get(tV`/videos/${e}`,t)}list(e={},t){return this._client.getAPIList("/videos",tE,{query:e,...t})}delete(e,t){return this._client.delete(tV`/videos/${e}`,t)}downloadContent(e,t={},s){return this._client.get(tV`/videos/${e}/content`,{query:t,...s,headers:sc([{Accept:"application/binary"},s?.headers]),__binaryResponse:!0})}remix(e,t,s){return this._client.post(tV`/videos/${e}/remix`,tM({body:t,...s},this._client))}}class ni extends tH{constructor(){super(...arguments),eg.add(this)}async unwrap(e,t,s=this._client.webhookSecret,n=300){return await this.verifySignature(e,t,s,n),JSON.parse(e)}async verifySignature(e,t,s=this._client.webhookSecret,n=300){if("u"n)throw new eK("Webhook timestamp is too old");if(l>c+n)throw new eK("Webhook timestamp is too new");let h=i.split(" ").map(e=>e.startsWith("v1,")?e.substring(3):e),u=s.startsWith("whsec_")?Buffer.from(s.replace("whsec_",""),"base64"):Buffer.from(s,"utf-8"),d=o?`${o}.${a}.${e}`:`${a}.${e}`,f=await crypto.subtle.importKey("raw",u,{name:"HMAC",hash:"SHA-256"},!1,["verify"]);for(let e of h)try{let t=Buffer.from(e,"base64");if(await crypto.subtle.verify("HMAC",f,t,new TextEncoder().encode(d)))return}catch{continue}throw new eK("The given webhook signature does not match the expected signature")}}eg=new WeakSet,e_=function(e){if("string"!=typeof e||0===e.length)throw Error("The webhook secret must either be set using the env var, OPENAI_WEBHOOK_SECRET, on the client class, OpenAI({ webhookSecret: '123' }), or passed to this function")},ey=function(e,t){if(!e)throw Error("Headers are required");let s=e.get(t);if(null==s)throw Error(`Missing required header: ${t}`);return s},e.i(98546);class na{constructor({baseURL:e=s$("OPENAI_BASE_URL"),apiKey:t=s$("OPENAI_API_KEY"),organization:s=s$("OPENAI_ORG_ID")??null,project:n=s$("OPENAI_PROJECT_ID")??null,webhookSecret:r=s$("OPENAI_WEBHOOK_SECRET")??null,...i}={}){if(ew.add(this),ev.set(this,void 0),this.completions=new sR(this),this.chat=new so(this),this.embeddings=new sM(this),this.files=new sB(this),this.images=new sQ(this),this.audio=new sf(this),this.moderations=new sY(this),this.models=new sG(this),this.fineTuning=new sK(this),this.graders=new sz(this),this.vectorStores=new nn(this),this.webhooks=new ni(this),this.beta=new sI(this),this.batches=new sp(this),this.uploads=new s7(this),this.responses=new s5(this),this.realtime=new s1(this),this.conversations=new sj(this),this.evals=new sD(this),this.containers=new sC(this),this.videos=new nr(this),void 0===t)throw new eC("Missing credentials. Please pass an `apiKey`, or set the `OPENAI_API_KEY` environment variable.");const a={apiKey:t,organization:s,project:n,webhookSecret:r,...i,baseURL:e||"https://api.openai.com/v1"};a.dangerouslyAllowBrowser,this.baseURL=a.baseURL,this.timeout=a.timeout??eb.DEFAULT_TIMEOUT,this.logger=a.logger??console;const o="warn";this.logLevel=o,this.logLevel=td(a.logLevel,"ClientOptions.logLevel",this)??td(s$("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??o,this.fetchOptions=a.fetchOptions,this.maxRetries=a.maxRetries??2,this.fetch=a.fetch??function(){if("u">typeof fetch)return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}(),ek(this,ev,e5,"f"),this._options=a,this.apiKey="string"==typeof t?t:"Missing Key",this.organization=s,this.project=n,this.webhookSecret=r}withOptions(e){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t}){}async authHeaders(e){return sc([{Authorization:`Bearer ${this.apiKey}`}])}stringifyQuery(e){return function(e,t={}){let s,n=e,r=function(e=ta){let t;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw TypeError("Encoder has to be a function.");let s=e.charset||ta.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let n=e9;if(void 0!==e.format){if(!tt(te,e.format))throw TypeError("Unknown format option provided.");n=e.format}let r=te[n],i=ta.filter;if(("function"==typeof e.filter||ez(e.filter))&&(i=e.filter),t=e.arrayFormat&&e.arrayFormat in tr?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":ta.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw TypeError("`commaRoundTrip` must be a boolean, or absent");let a=void 0===e.allowDots?!0==!!e.encodeDotInKeys||ta.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:ta.addQueryPrefix,allowDots:a,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:ta.allowEmptyArrays,arrayFormat:t,charset:s,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:ta.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?ta.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:ta.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:ta.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:ta.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:ta.encodeValuesOnly,filter:i,format:n,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:ta.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:ta.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:ta.strictNullHandling}}(t);"function"==typeof r.filter?n=(0,r.filter)("",n):ez(r.filter)&&(s=r.filter);let i=[];if("object"!=typeof n||null===n)return"";let a=tr[r.arrayFormat],o="comma"===a&&r.commaRoundTrip;s||(s=Object.keys(n)),r.sort&&s.sort(r.sort);let l=new WeakMap;for(let e=0;e0?x.join(",")||null:void 0}];else if(ez(h))v=h;else{let e=Object.keys(x);v=u?e.sort(u):e}let k=l?String(s).replace(/\./g,"%2E"):String(s),I=r&&ez(x)&&1===x.length?k+"[]":k;if(i&&ez(x)&&0===x.length)return I+"[]";for(let s=0;s0?h+c:""}(e,{arrayFormat:"brackets"})}getUserAgent(){return`${this.constructor.name}/JS ${e0}`}defaultIdempotencyKey(){return`stainless-node-retry-${eR()}`}makeStatusError(e,t,s,n){return eT.generate(e,t,s,n)}async _callApiKey(){let e,t=this._options.apiKey;if("function"!=typeof t)return!1;try{e=await t()}catch(e){if(e instanceof eC)throw e;throw new eC(`Failed to get token from 'apiKey' function: ${e.message}`,{cause:e})}if("string"!=typeof e||!e)throw new eC(`Expected 'apiKey' function argument to return a string but it returned ${e}`);return this.apiKey=e,!0}buildURL(e,t,s){let n=!eI(this,ew,"m",ex).call(this)&&s||this.baseURL,r=new URL(eV.test(e)?e:n+(n.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),i=this.defaultQuery();return!function(e){if(!e)return!0;for(let t in e)return!1;return!0}(i)&&(t={...i,...t}),"object"==typeof t&&t&&!Array.isArray(t)&&(r.search=this.stringifyQuery(t)),r.toString()}async prepareOptions(e){await this._callApiKey()}async prepareRequest(e,{url:t,options:s}){}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,s){return this.request(Promise.resolve(s).then(s=>({method:e,path:t,...s})))}request(e,t=null){return new tA(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,s){let n=await e,r=n.maxRetries??this.maxRetries;null==t&&(t=r),await this.prepareOptions(n);let{req:i,url:a,timeout:o}=await this.buildRequest(n,{retryCount:r-t});await this.prepareRequest(i,{url:a,options:n});let l="log_"+(0x1000000*Math.random()|0).toString(16).padStart(6,"0"),c=void 0===s?"":`, retryOf: ${s}`,h=Date.now();if(t_(this).debug(`[${l}] sending request`,ty({retryOfRequestLogID:s,method:n.method,url:a,options:n,headers:i.headers})),n.signal?.aborted)throw new ej;let u=new AbortController,d=await this.fetchWithTimeout(a,i,o,u).catch(eP),f=Date.now();if(d instanceof globalThis.Error){let e=`retrying, ${t} attempts remaining`;if(n.signal?.aborted)throw new ej;let r=eE(d)||/timed? ?out/i.test(String(d)+("cause"in d?String(d.cause):""));if(t)return t_(this).info(`[${l}] connection ${r?"timed out":"failed"} - ${e}`),t_(this).debug(`[${l}] connection ${r?"timed out":"failed"} (${e})`,ty({retryOfRequestLogID:s,url:a,durationMs:f-h,message:d.message})),this.retryRequest(n,t,s??l);if(t_(this).info(`[${l}] connection ${r?"timed out":"failed"} - error; no more retries left`),t_(this).debug(`[${l}] connection ${r?"timed out":"failed"} (error; no more retries left)`,ty({retryOfRequestLogID:s,url:a,durationMs:f-h,message:d.message})),r)throw new eN;throw new eM({cause:d})}let p=[...d.headers.entries()].filter(([e])=>"x-request-id"===e).map(([e,t])=>", "+e+": "+JSON.stringify(t)).join(""),m=`[${l}${c}${p}] ${i.method} ${a} ${d.ok?"succeeded":"failed"} with status ${d.status} in ${f-h}ms`;if(!d.ok){let e=await this.shouldRetry(d);if(t&&e){let e=`retrying, ${t} attempts remaining`;return await e6(d.body),t_(this).info(`${m} - ${e}`),t_(this).debug(`[${l}] response error (${e})`,ty({retryOfRequestLogID:s,url:d.url,status:d.status,headers:d.headers,durationMs:f-h})),this.retryRequest(n,t,s??l,d.headers)}let r=e?"error; no more retries left":"error; not retryable";t_(this).info(`${m} - ${r}`);let i=await d.text().catch(e=>eP(e).message),a=(e=>{try{return JSON.parse(e)}catch(e){return}})(i),o=a?void 0:i;throw t_(this).debug(`[${l}] response error (${r})`,ty({retryOfRequestLogID:s,url:d.url,status:d.status,headers:d.headers,message:o,durationMs:Date.now()-h})),this.makeStatusError(d.status,a,o,d.headers)}return t_(this).info(m),t_(this).debug(`[${l}] response start`,ty({retryOfRequestLogID:s,url:d.url,status:d.status,headers:d.headers,durationMs:f-h})),{response:d,options:n,controller:u,requestLogID:l,retryOfRequestLogID:s,startTime:h}}getAPIList(e,t,s){return this.requestAPIList(t,s&&"then"in s?s.then(t=>({method:"get",path:e,...t})):{method:"get",path:e,...s})}requestAPIList(e,t){return new tk(this,this.makeRequest(t,null,void 0),e)}async fetchWithTimeout(e,t,s,n){let{signal:r,method:i,...a}=t||{},o=this._makeAbort(n);r&&r.addEventListener("abort",o,{once:!0});let l=setTimeout(o,s),c=globalThis.ReadableStream&&a.body instanceof globalThis.ReadableStream||"object"==typeof a.body&&null!==a.body&&Symbol.asyncIterator in a.body,h={signal:n.signal,...c?{duplex:"half"}:{},method:"GET",...a};i&&(h.method=i.toUpperCase());try{return await this.fetch.call(void 0,e,h)}finally{clearTimeout(l)}}async shouldRetry(e){let t=e.headers.get("x-should-retry");return"true"===t||"false"!==t&&(408===e.status||409===e.status||429===e.status||!!(e.status>=500))}async retryRequest(e,t,s,n){let r,i=n?.get("retry-after-ms");if(i){let e=parseFloat(i);Number.isNaN(e)||(r=e)}let a=n?.get("retry-after");if(a&&!r){let e=parseFloat(a);r=Number.isNaN(e)?Date.parse(a)-Date.now():1e3*e}if(!(r&&0<=r&&r<6e4)){let s=e.maxRetries??this.maxRetries;r=this.calculateDefaultRetryTimeoutMillis(t,s)}return await eZ(r),this.makeRequest(e,t-1,s)}calculateDefaultRetryTimeoutMillis(e,t){return Math.min(.5*Math.pow(2,t-e),8)*(1-.25*Math.random())*1e3}async buildRequest(e,{retryCount:t=0}={}){let s={...e},{method:n,path:r,query:i,defaultBaseURL:a}=s,o=this.buildURL(r,i,a);"timeout"in s&&((e,t)=>{if("number"!=typeof t||!Number.isInteger(t))throw new eC(`${e} must be an integer`);if(t<0)throw new eC(`${e} must be a positive integer`)})("timeout",s.timeout),s.timeout=s.timeout??this.timeout;let{bodyHeaders:l,body:c}=this.buildBody({options:s}),h=await this.buildHeaders({options:e,method:n,bodyHeaders:l,retryCount:t});return{req:{method:n,headers:h,...s.signal&&{signal:s.signal},...globalThis.ReadableStream&&c instanceof globalThis.ReadableStream&&{duplex:"half"},...c&&{body:c},...this.fetchOptions??{},...s.fetchOptions??{}},url:o,timeout:s.timeout}}async buildHeaders({options:e,method:t,bodyHeaders:s,retryCount:n}){let r={};this.idempotencyHeader&&"get"!==t&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),r[this.idempotencyHeader]=e.idempotencyKey);let i=sc([r,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(n),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...eS??(eS=(()=>{let e="u">typeof Deno&&null!=Deno.build?"deno":"u">typeof EdgeRuntime?"edge":"[object process]"===Object.prototype.toString.call(void 0!==globalThis.process?globalThis.process:0)?"node":"unknown";if("deno"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":e0,"X-Stainless-OS":e2(Deno.build.os),"X-Stainless-Arch":e1(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":"string"==typeof Deno.version?Deno.version:Deno.version?.deno??"unknown"};if("u">typeof EdgeRuntime)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":e0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if("node"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":e0,"X-Stainless-OS":e2(globalThis.process.platform??"unknown"),"X-Stainless-Arch":e1(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=function(){if("u"e.abort()}buildBody({options:{body:e,headers:t}}){if(!e)return{bodyHeaders:void 0,body:void 0};let s=sc([t]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||"string"==typeof e&&s.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:"object"==typeof e&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&"function"==typeof e.next)?{bodyHeaders:void 0,body:e3(e)}:eI(this,ev,"f").call(this,{body:e,headers:s})}}eb=na,ev=new WeakMap,ew=new WeakSet,ex=function(){return"https://api.openai.com/v1"!==this.baseURL},na.OpenAI=eb,na.DEFAULT_TIMEOUT=6e5,na.OpenAIError=eC,na.APIError=eT,na.APIConnectionError=eM,na.APIConnectionTimeoutError=eN,na.APIUserAbortError=ej,na.NotFoundError=eW,na.ConflictError=eq,na.RateLimitError=eF,na.BadRequestError=eL,na.AuthenticationError=eD,na.InternalServerError=eX,na.PermissionDeniedError=eB,na.UnprocessableEntityError=eU,na.InvalidWebhookSignatureError=eK,na.toFile=tF,na.Completions=sR,na.Chat=so,na.Embeddings=sM,na.Files=sB,na.Images=sQ,na.Audio=sf,na.Moderations=sY,na.Models=sG,na.FineTuning=sK,na.Graders=sz,na.VectorStores=nn,na.Webhooks=ni,na.Beta=sI,na.Batches=sp,na.Uploads=s7,na.Responses=s5,na.Realtime=s1,na.Conversations=sj,na.Evals=sD,na.Containers=sC,na.Videos=nr,e.s([],89228),e.s(["default",()=>na],91601)}]; /home/ccuser/rateright-v2/.next/server/chunks/[root-of-the-server]__8f0ff92b._.js:module.exports=[27699,(e,t,r)=>{t.exports=e.x("events",()=>require("events"))},21517,(e,t,r)=>{t.exports=e.x("http",()=>require("http"))},24836,(e,t,r)=>{t.exports=e.x("https",()=>require("https"))},33405,(e,t,r)=>{t.exports=e.x("child_process",()=>require("child_process"))},63349,e=>{"use strict";let t;var r=e.i(54799),s=e.i(27699);class o{computeHMACSignature(e,t){throw Error("computeHMACSignature not implemented.")}computeHMACSignatureAsync(e,t){throw Error("computeHMACSignatureAsync not implemented.")}computeSHA256Async(e){throw Error("computeSHA256 not implemented.")}}class n extends Error{}class a extends o{computeHMACSignature(e,t){return r.createHmac("sha256",t).update(e,"utf8").digest("hex")}async computeHMACSignatureAsync(e,t){return await this.computeHMACSignature(e,t)}async computeSHA256Async(e){return new Uint8Array(await r.createHash("sha256").update(e).digest())}}var i=e.i(21517),l=e.i(24836);class h{getClientName(){throw Error("getClientName not implemented.")}makeRequest(e,t,r,s,o,n,a,i){throw Error("makeRequest not implemented.")}static makeTimeoutError(){let e=TypeError(h.TIMEOUT_ERROR_CODE);return e.code=h.TIMEOUT_ERROR_CODE,e}}h.CONNECTION_CLOSED_ERROR_CODES=["ECONNRESET","EPIPE"],h.TIMEOUT_ERROR_CODE="ETIMEDOUT";class u{constructor(e,t){this._statusCode=e,this._headers=t}getStatusCode(){return this._statusCode}getHeaders(){return this._headers}getRawResponse(){throw Error("getRawResponse not implemented.")}toStream(e){throw Error("toStream not implemented.")}toJSON(){throw Error("toJSON not implemented.")}}let d=i.default||i,c=l.default||l,m=new d.Agent({keepAlive:!0}),p=new c.Agent({keepAlive:!0});class f extends h{constructor(e){super(),this._agent=e}getClientName(){return"node"}makeRequest(e,t,r,s,o,n,a,i){let l="http"===a,u=this._agent;return u||(u=l?m:p),new Promise((a,m)=>{let p=(l?d:c).request({host:e,port:t,path:r,method:s,agent:u,headers:o,ciphers:"DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:!MD5"});p.setTimeout(i,()=>{p.destroy(h.makeTimeoutError())}),p.on("response",e=>{a(new P(e))}),p.on("error",e=>{m(e)}),p.once("socket",e=>{e.connecting?e.once(l?"connect":"secureConnect",()=>{p.write(n),p.end()}):(p.write(n),p.end())})})}}class P extends u{constructor(e){super(e.statusCode,e.headers||{}),this._res=e}getRawResponse(){return this._res}toStream(e){return this._res.once("end",()=>e()),this._res}toJSON(){return new Promise((e,t)=>{let r="";this._res.setEncoding("utf8"),this._res.on("data",e=>{r+=e}),this._res.once("end",()=>{try{e(JSON.parse(r))}catch(e){t(e)}})})}}let v=["apiKey","idempotencyKey","stripeAccount","apiVersion","maxNetworkRetries","timeout","host","authenticator","stripeContext","additionalHeaders","streaming"];function T(e){return e&&"object"==typeof e&&v.some(t=>Object.prototype.hasOwnProperty.call(e,t))}function _(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27").replace(/%5B/g,"[").replace(/%5D/g,"]")}function y(e){let t=[];if("object"==typeof e&&null!==e)for(let r of Object.keys(e))!function e(r,s){if(void 0!==s){if(null===s||"object"!=typeof s||s instanceof Date)return void t.push(_(r)+"="+_(s instanceof Date?Math.floor(s.getTime()/1e3).toString():null===s?"":String(s)));if(Array.isArray(s)){for(let t=0;t{let r=e.replace(/["\n\r\u2028\u2029]/g,e=>t[e]);return e=>r.replace(/\{([\s\S]+?)\}/g,(t,r)=>{let s=e[r];return["number","string","boolean"].includes(typeof s)?encodeURIComponent(s):""})});function E(e){if(!Array.isArray(e)||!e[0]||"object"!=typeof e[0])return{};if(!T(e[0]))return e.shift();let t=Object.keys(e[0]),r=t.filter(e=>v.includes(e));return r.length>0&&r.length!==t.length&&x(`Options found in arguments (${r.join(", ")}). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.`),{}}function S(e){let t={host:null,headers:{},settings:{},streaming:!1};if(e.length>0){let r=e[e.length-1];if("string"==typeof r)t.authenticator=G(e.pop());else if(T(r)){let r=Object.assign({},e.pop()),s=Object.keys(r).filter(e=>!v.includes(e));if(s.length&&x(`Invalid options found (${s.join(", ")}); ignoring.`),r.apiKey&&(t.authenticator=G(r.apiKey)),r.idempotencyKey&&(t.headers["Idempotency-Key"]=r.idempotencyKey),r.stripeAccount&&(t.headers["Stripe-Account"]=r.stripeAccount),r.stripeContext){if(t.headers["Stripe-Account"])throw Error("Can't specify both stripeAccount and stripeContext.");t.headers["Stripe-Context"]=r.stripeContext}if(r.apiVersion&&(t.headers["Stripe-Version"]=r.apiVersion),Number.isInteger(r.maxNetworkRetries)&&(t.settings.maxNetworkRetries=r.maxNetworkRetries),Number.isInteger(r.timeout)&&(t.settings.timeout=r.timeout),r.host&&(t.host=r.host),r.authenticator){if(r.apiKey)throw Error("Can't specify both apiKey and authenticator.");if("function"!=typeof r.authenticator)throw Error("The authenticator must be a function receiving a request as the first parameter.");t.authenticator=r.authenticator}r.additionalHeaders&&(t.headers=r.additionalHeaders),r.streaming&&(t.streaming=!0)}}return t}function O(e){if("object"!=typeof e)throw Error("Argument must be an object");return Object.keys(e).reduce((t,r)=>(null!=e[r]&&(t[r]=e[r]),t),{})}function b(e,t){return t?e.then(e=>{setTimeout(()=>{t(null,e)},0)},e=>{setTimeout(()=>{t(e,null)},0)}):e}function x(e){return"function"!=typeof process.emitWarning?console.warn(`Stripe: ${e}`):process.emitWarning(e,"Stripe")}function w(e,t,r){if(!Number.isInteger(t))if(void 0!==r)return r;else throw Error(`${e} must be an integer`);return t}function G(e){let t=t=>(t.headers.Authorization="Bearer "+e,Promise.resolve());return t._apiKey=e,t}function C(e,t){return this[e]instanceof Date?Math.floor(this[e].getTime()/1e3).toString():t}function A(e){return e&&e.startsWith("/v2")?"v2":"v1"}function R(e){return Array.isArray(e)?e.join(", "):String(e)}class k extends h{constructor(e){if(super(),!e){if(!globalThis.fetch)throw Error("fetch() function not provided and is not defined in the global scope. You must provide a fetch implementation.");e=globalThis.fetch}globalThis.AbortController?this._fetchFn=k.makeFetchWithAbortTimeout(e):this._fetchFn=k.makeFetchWithRaceTimeout(e)}static makeFetchWithRaceTimeout(e){return(t,r,s)=>{let o,n=new Promise((e,t)=>{o=setTimeout(()=>{o=null,t(h.makeTimeoutError())},s)});return Promise.race([e(t,r),n]).finally(()=>{o&&clearTimeout(o)})}}static makeFetchWithAbortTimeout(e){return async(t,r,s)=>{let o=new AbortController,n=setTimeout(()=>{n=null,o.abort(h.makeTimeoutError())},s);try{return await e(t,Object.assign(Object.assign({},r),{signal:o.signal}))}catch(e){if("AbortError"===e.name)throw h.makeTimeoutError();throw e}finally{n&&clearTimeout(n)}}}getClientName(){return"fetch"}async makeRequest(e,t,r,s,o,n,a,i){let l=new URL(r,`${"http"===a?"http":"https"}://${e}`);l.port=t;let h="POST"==s||"PUT"==s||"PATCH"==s;return new I(await this._fetchFn(l.toString(),{method:s,headers:Object.entries(o).map(([e,t])=>[e,R(t)]),body:n||(h?"":void 0)},i))}}class I extends u{constructor(e){super(e.status,I._transformHeadersToObject(e.headers)),this._res=e}getRawResponse(){return this._res}toStream(e){return e(),this._res.body}toJSON(){return this._res.json()}static _transformHeadersToObject(e){let t={};for(let r of e){if(!Array.isArray(r)||2!=r.length)throw Error("Response objects produced by the fetch function given to FetchHttpClient do not have an iterable headers map. Response#headers should be an iterable object.");t[r[0]]=r[1]}return t}}class q extends o{constructor(e){super(),this.subtleCrypto=e||crypto.subtle}computeHMACSignature(e,t){throw new n("SubtleCryptoProvider cannot be used in a synchronous context.")}async computeHMACSignatureAsync(e,t){let r=new TextEncoder,s=await this.subtleCrypto.importKey("raw",r.encode(t),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),o=new Uint8Array(await this.subtleCrypto.sign("hmac",s,r.encode(e))),n=Array(o.length);for(let e=0;e{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}secureCompare(e,t){if(e.length!==t.length)return!1;let r=e.length,s=0;for(let o=0;o{switch(e.type){case"card_error":return new H(e);case"invalid_request_error":return new L(e);case"api_error":return new F(e);case"authentication_error":return new z(e);case"rate_limit_error":return new B(e);case"idempotency_error":return new W(e);case"invalid_grant":return new J(e);default:return new X(e)}},M=e=>"temporary_session_expired"===e.type?new Y(e):"invalid_fields"===e.code?new L(e):j(e);class U extends Error{constructor(e={},t=null){var r;super(e.message),this.type=t||this.constructor.name,this.raw=e,this.rawType=e.type,this.code=e.code,this.doc_url=e.doc_url,this.param=e.param,this.detail=e.detail,this.headers=e.headers,this.requestId=e.requestId,this.statusCode=e.statusCode,this.message=null!=(r=e.message)?r:"",this.userMessage=e.user_message,this.charge=e.charge,this.decline_code=e.decline_code,this.payment_intent=e.payment_intent,this.payment_method=e.payment_method,this.payment_method_type=e.payment_method_type,this.setup_intent=e.setup_intent,this.source=e.source}}U.generate=j;class H extends U{constructor(e={}){super(e,"StripeCardError")}}class L extends U{constructor(e={}){super(e,"StripeInvalidRequestError")}}class F extends U{constructor(e={}){super(e,"StripeAPIError")}}class z extends U{constructor(e={}){super(e,"StripeAuthenticationError")}}class $ extends U{constructor(e={}){super(e,"StripePermissionError")}}class B extends U{constructor(e={}){super(e,"StripeRateLimitError")}}class V extends U{constructor(e={}){super(e,"StripeConnectionError")}}class K extends U{constructor(e,t,r={}){super(r,"StripeSignatureVerificationError"),this.header=e,this.payload=t}}class W extends U{constructor(e={}){super(e,"StripeIdempotencyError")}}class J extends U{constructor(e={}){super(e,"StripeInvalidGrantError")}}class X extends U{constructor(e={}){super(e,"StripeUnknownError")}}class Y extends U{constructor(e={}){super(e,"TemporarySessionExpiredError")}}e.s(["StripeAPIError",()=>F,"StripeAuthenticationError",()=>z,"StripeCardError",()=>H,"StripeConnectionError",()=>V,"StripeError",()=>U,"StripeIdempotencyError",()=>W,"StripeInvalidGrantError",()=>J,"StripeInvalidRequestError",()=>L,"StripePermissionError",()=>$,"StripeRateLimitError",()=>B,"StripeSignatureVerificationError",()=>K,"StripeUnknownError",()=>X,"TemporarySessionExpiredError",()=>Y,"generateV1Error",0,j,"generateV2Error",0,M],72894);var Q=e.i(33405);class Z extends U{}var ee=e.i(72894);class et{constructor(e,t){this._stripe=e,this._maxBufferedRequestMetric=t}_normalizeStripeContext(e,t){return e?e.toString()||null:(null==t?void 0:t.toString())||null}_addHeadersDirectlyToObject(e,t){e.requestId=t["request-id"],e.stripeAccount=e.stripeAccount||t["stripe-account"],e.apiVersion=e.apiVersion||t["stripe-version"],e.idempotencyKey=e.idempotencyKey||t["idempotency-key"]}_makeResponseEvent(e,t,r){let s=Date.now(),o=s-e.request_start_time;return O({api_version:r["stripe-version"],account:r["stripe-account"],idempotency_key:r["idempotency-key"],method:e.method,path:e.path,status:t,request_id:this._getRequestId(r),elapsed:o,request_start_time:e.request_start_time,request_end_time:s})}_getRequestId(e){return e["request-id"]}_streamingResponseHandler(e,t,r){return s=>{let o=s.getHeaders(),n=()=>{let r=this._makeResponseEvent(e,s.getStatusCode(),o);this._stripe._emitter.emit("response",r),this._recordRequestMetrics(this._getRequestId(o),r.elapsed,t)},a=s.toStream(n);return this._addHeadersDirectlyToObject(a,o),r(null,a)}}_jsonResponseHandler(e,t,r,s){return o=>{let n=o.getHeaders(),a=this._getRequestId(n),i=o.getStatusCode(),l=this._makeResponseEvent(e,i,n);this._stripe._emitter.emit("response",l),o.toJSON().then(e=>{if(e.error)throw"string"==typeof e.error&&(e.error={type:e.error,message:e.error_description}),e.error.headers=n,e.error.statusCode=i,e.error.requestId=a,401===i?new z(e.error):403===i?new $(e.error):429===i?new B(e.error):"v2"===t?M(e.error):j(e.error);return e},e=>{throw new F({message:"Invalid JSON received from the Stripe API",exception:e,requestId:n["request-id"]})}).then(e=>{this._recordRequestMetrics(a,l.elapsed,r);let t=o.getRawResponse();this._addHeadersDirectlyToObject(t,n),Object.defineProperty(e,"lastResponse",{enumerable:!1,writable:!1,value:t}),s(null,e)},e=>s(e,null))}}static _generateConnectionErrorMessage(e){return`An error occurred with our connection to Stripe.${e>0?` Request was retried ${e} times.`:""}`}static _shouldRetry(e,t,r,s){return!!(s&&0===t&&h.CONNECTION_CLOSED_ERROR_CODES.includes(s.code))||!(t>=r)&&(!e||"false"!==e.getHeaders()["stripe-should-retry"]&&!!("true"===e.getHeaders()["stripe-should-retry"]||409===e.getStatusCode()||e.getStatusCode()>=500))}_getSleepTimeInMS(e,t=null){let r=this._stripe.getInitialNetworkRetryDelay(),s=Math.min(r*Math.pow(2,e-1),this._stripe.getMaxNetworkRetryDelay());return s*=.5*(1+Math.random()),s=Math.max(r,s),Number.isInteger(t)&&t<=60&&(s=Math.max(s,t)),1e3*s}_getMaxNetworkRetries(e={}){return void 0!==e.maxNetworkRetries&&Number.isInteger(e.maxNetworkRetries)?e.maxNetworkRetries:this._stripe.getMaxNetworkRetries()}_defaultIdempotencyKey(e,t,r){let s=this._getMaxNetworkRetries(t),o=()=>`stripe-node-retry-${this._stripe._platformFunctions.uuid4()}`;if("v2"===r){if("POST"===e||"DELETE"===e)return o()}else if("v1"===r&&"POST"===e&&s>0)return o();return null}_makeHeaders({contentType:e,contentLength:t,apiVersion:r,clientUserAgent:s,method:o,userSuppliedHeaders:n,userSuppliedSettings:a,stripeAccount:i,stripeContext:l,apiMode:h}){let u={Accept:"application/json","Content-Type":e,"User-Agent":this._getUserAgentString(h),"X-Stripe-Client-User-Agent":s,"X-Stripe-Client-Telemetry":this._getTelemetryHeader(),"Stripe-Version":r,"Stripe-Account":i,"Stripe-Context":l,"Idempotency-Key":this._defaultIdempotencyKey(o,a,h)},d="POST"==o||"PUT"==o||"PATCH"==o;return(d||t)&&(d||x(`${o} method had non-zero contentLength but no payload is expected for this verb`),u["Content-Length"]=t),Object.assign(O(u),n&&"object"==typeof n?Object.keys(n).reduce((e,t)=>(e[t.split("-").map(e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()).join("-")]=n[t],e),{}):n)}_getUserAgentString(e){let t=this._stripe.getConstant("PACKAGE_VERSION"),r=this._stripe._appInfo?this._stripe.getAppInfoAsString():"";return`Stripe/${e} NodeBindings/${t} ${r}`.trim()}_getTelemetryHeader(){if(this._stripe.getTelemetryEnabled()&&this._stripe._prevRequestMetrics.length>0)return JSON.stringify({last_request_metrics:this._stripe._prevRequestMetrics.shift()})}_recordRequestMetrics(e,t,r){if(this._stripe.getTelemetryEnabled()&&e)if(this._stripe._prevRequestMetrics.length>this._maxBufferedRequestMetric)x("Request metrics buffer is full, dropping telemetry message.");else{let s={request_id:e,request_duration_ms:t};r&&r.length>0&&(s.usage=r),this._stripe._prevRequestMetrics.push(s)}}_rawRequest(e,t,r,s,o){return new Promise((n,a)=>{let i;try{let n=e.toUpperCase();if("POST"!==n&&r&&0!==Object.keys(r).length)throw Error("rawRequest only supports params on POST requests. Please pass null and add your parameters to path.");let a=[].slice.call([r,s]),l=E(a),h="POST"===n?Object.assign({},l):null,u=S(a),d=u.headers,c=u.authenticator;i={requestMethod:n,requestPath:t,bodyData:h,queryData:{},authenticator:c,headers:d,host:u.host,streaming:!!u.streaming,settings:{},usage:o||["raw_request"]}}catch(e){a(e);return}let{headers:l,settings:h}=i,u=i.authenticator;this._request(i.requestMethod,i.host,t,i.bodyData,u,{headers:l,settings:h,streaming:i.streaming},i.usage,function(e,t){e?a(e):n(t)})})}_getContentLength(e){return"string"==typeof e?new TextEncoder().encode(e).length:e.length}_request(e,t,r,s,o,n,a=[],i,l=null){var u;let d;o=null!=(u=null!=o?o:this._stripe._authenticator)?u:null;let c=A(r),m=(e,t,r,s,o)=>setTimeout(e,this._getSleepTimeInMS(s,o),t,r,s+1),p=(s,l,u)=>{let f=n.settings&&n.settings.timeout&&Number.isInteger(n.settings.timeout)&&n.settings.timeout>=0?n.settings.timeout:this._stripe.getApiField("timeout"),P={host:t||this._stripe.getApiField("host"),port:this._stripe.getApiField("port"),path:r,method:e,headers:Object.assign({},l),body:d,protocol:this._stripe.getApiField("protocol")};o(P).then(()=>{let t=this._stripe.getApiField("httpClient").makeRequest(P.host,P.port,P.path,P.method,P.headers,P.body,P.protocol,f),o=Date.now(),d=O({api_version:s,account:R(l["Stripe-Account"]),idempotency_key:R(l["Idempotency-Key"]),method:e,path:r,request_start_time:o}),v=u||0,T=this._getMaxNetworkRetries(n.settings||{});this._stripe._emitter.emit("request",d),t.then(e=>{if(et._shouldRetry(e,v,T)){var t;return m(p,s,l,v,Number(Array.isArray(t=e.getHeaders()["retry-after"])?t[0]:t))}return n.streaming&&400>e.getStatusCode()?this._streamingResponseHandler(d,a,i)(e):this._jsonResponseHandler(d,c,a,i)(e)}).catch(e=>et._shouldRetry(null,v,T,e)?m(p,s,l,v,null):i(new V({message:e.code&&e.code===h.TIMEOUT_ERROR_CODE?`Request aborted due to timeout being reached (${f}ms)`:et._generateConnectionErrorMessage(v),detail:e})))}).catch(e=>{throw new U({message:"Unable to authenticate the request",exception:e})})},f=(t,r)=>{if(t)return i(t);d=r,this._stripe.getClientUserAgent(t=>{var s,o,a;let i=this._stripe.getApiField("version"),l=this._makeHeaders({contentType:"v2"==c?"application/json":"application/x-www-form-urlencoded",contentLength:this._getContentLength(r),apiVersion:i,clientUserAgent:t,method:e,userSuppliedHeaders:null!=(s=n.headers)?s:null,userSuppliedSettings:null!=(o=n.settings)?o:{},stripeAccount:null!=(a=n.stripeAccount)?a:this._stripe.getApiField("stripeAccount"),stripeContext:this._normalizeStripeContext(n.stripeContext,this._stripe.getApiField("stripeContext")),apiMode:c});p(i,l,0)})};if(l)l(e,s,n.headers,f);else{let e;f(null,e="v2"==c?s?JSON.stringify(s,C):"":y(s||{}))}}}class er{constructor(e,t,r,s){this.index=0,this.pagePromise=e,this.promiseCache={currentPromise:null},this.requestArgs=t,this.spec=r,this.stripeResource=s}async iterate(e){if(!(e&&e.data&&"number"==typeof e.data.length))throw Error("Unexpected: Stripe API response does not have a well-formed `data` array.");let t=ei(this.requestArgs);if(this.index{let e=await this._next();return this.promiseCache.currentPromise=null,e})();return this.promiseCache.currentPromise=e,e}}class es extends er{getNextPage(e){let t=ei(this.requestArgs),r=function(e,t){let r=t?0:e.data.length-1,s=e.data[r],o=s&&s.id;if(!o)throw Error("Unexpected: No `id` found on the last item while auto-paging a list.");return o}(e,t);return this.stripeResource._makeRequest(this.requestArgs,this.spec,{[t?"ending_before":"starting_after"]:r})}}class eo extends er{getNextPage(e){if(!e.next_page)throw Error("Unexpected: Stripe API response does not have a well-formed `next_page` field, but `has_more` was true.");return this.stripeResource._makeRequest(this.requestArgs,this.spec,{page:e.next_page})}}class en{constructor(e,t,r,s){this.firstPagePromise=e,this.currentPageIterator=null,this.nextPageUrl=null,this.requestArgs=t,this.spec=r,this.stripeResource=s}async initFirstPage(){if(this.firstPagePromise){let e=await this.firstPagePromise;this.firstPagePromise=null,this.currentPageIterator=e.data[Symbol.iterator](),this.nextPageUrl=e.next_page_url||null}}async turnPage(){if(!this.nextPageUrl)return null;this.spec.fullPath=this.nextPageUrl;let e=await this.stripeResource._makeRequest([],this.spec,{});return this.nextPageUrl=e.next_page_url||null,this.currentPageIterator=e.data[Symbol.iterator](),this.currentPageIterator}async next(){if(await this.initFirstPage(),this.currentPageIterator){let e=this.currentPageIterator.next();if(!e.done)return{done:!1,value:e.value}}let e=await this.turnPage();if(!e)return{done:!0,value:void 0};let t=e.next();return t.done?{done:!0,value:void 0}:{done:!1,value:t.value}}}let ea=e=>{var t,r;let s=(t=(...t)=>e.next(...t),function(){var e,r;let s=[].slice.call(arguments),o=function(e){if(0===e.length)return;let t=e[0];if("function"!=typeof t)throw Error(`The first argument to autoPagingEach, if present, must be a callback function; received ${typeof t}`);if(2===t.length)return t;if(t.length>2)throw Error(`The \`onItem\` callback function passed to autoPagingEach must accept at most two arguments; got ${t}`);return function(e,r){r(t(e))}}(s),n=function(e){if(e.length<2)return null;let t=e[1];if("function"!=typeof t)throw Error(`The second argument to autoPagingEach, if present, must be a callback function; received ${typeof t}`);return t}(s);if(s.length>2)throw Error(`autoPagingEach takes up to two arguments; received ${s}`);return b((e=t,r=o,new Promise((t,s)=>{e().then(function s(o){if(o.done)return void t();let n=o.value;return new Promise(e=>{r(n,e)}).then(t=>!1===t?s({done:!0,value:void 0}):e().then(s))}).catch(s)})),n)}),o=(r=s,function(e,t){let s=e&&e.limit;if(!s)throw Error("You must pass a `limit` option to autoPagingToArray, e.g., `autoPagingToArray({limit: 1000});`.");if(s>1e4)throw Error("You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.");return b(new Promise((e,t)=>{let o=[];r(e=>{if(o.push(e),o.length>=s)return!1}).then(()=>{e(o)}).catch(t)}),t)}),n={autoPagingEach:s,autoPagingToArray:o,next:()=>e.next(),return:()=>({}),["u">typeof Symbol&&Symbol.asyncIterator?Symbol.asyncIterator:"@@asyncIterator"]:()=>n};return n};function ei(e){return!!E([].slice.call(e)).ending_before}function el(e,t){if(this._stripe=e,t)throw Error("Support for curried url params was dropped in stripe-node v7.0.0. Instead, pass two ids.");this.basePath=g(this.basePath||e.getApiField("basePath")),this.resourcePath=this.path,this.path=g(this.path),this.initialize(...arguments)}el.extend=function(e){let t=this,r=Object.prototype.hasOwnProperty.call(e,"constructor")?e.constructor:function(...e){t.apply(this,e)};return Object.assign(r,t),r.prototype=Object.create(t.prototype),Object.assign(r.prototype,e),r},el.method=function(e){if(void 0!==e.path&&void 0!==e.fullPath)throw Error(`Method spec specified both a 'path' (${e.path}) and a 'fullPath' (${e.fullPath}).`);return function(...t){let r,s,o="function"==typeof t[t.length-1]&&t.pop();r=(e.fullPath||this.createResourcePathWithSymbols(e.path||"")).match(/\{\w+\}/g),e.urlParams=r?r.map(e=>e.replace(/[{}]/g,"")):[];let n=b(this._makeRequest(t,e,{}),o);return Object.assign(n,"v2"!==(s=A(e.fullPath||e.path))&&"search"===e.methodType?ea(new eo(n,t,e,this)):"v2"!==s&&"list"===e.methodType?ea(new es(n,t,e,this)):"v2"===s&&"list"===e.methodType?ea(new en(n,t,e,this)):null),n}},el.MAX_BUFFERED_REQUEST_METRICS=100,el.prototype={_stripe:null,path:"",resourcePath:"",basePath:null,initialize(){},requestDataProcessor:null,validateRequest:null,createFullPath(e,t){let r=[this.basePath(t),this.path(t)];if("function"==typeof e){let s=e(t);s&&r.push(s)}else r.push(e);return this._joinUrlParts(r)},createResourcePathWithSymbols(e){return e?`/${this._joinUrlParts([this.resourcePath,e])}`:`/${this.resourcePath}`},_joinUrlParts:e=>e.join("/").replace(/\/{2,}/g,"/"),_getRequestOpts(e,t,r){var s;let o=(t.method||"GET").toUpperCase(),n=t.usage||[],a=t.urlParams||[],i=t.encode||(e=>e),l=!!t.fullPath,h=g(l?t.fullPath:t.path||""),u=l?t.fullPath:this.createResourcePathWithSymbols(t.path),d=[].slice.call(e),c=a.reduce((e,t)=>{let r=d.shift();if("string"!=typeof r)throw Error(`Stripe: Argument "${t}" must be a string, but got: ${r} (on API request to \`${o} ${u}\`)`);return e[t]=r,e},{}),m=i(Object.assign({},E(d),r)),p=S(d),f=p.host||t.host,P=!!t.streaming||!!p.streaming;if(d.filter(e=>null!=e).length)throw Error(`Stripe: Unknown arguments (${d}). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options. (on API request to ${o} \`${u}\`)`);let v=l?h(c):this.createFullPath(h,c),T=Object.assign(p.headers,t.headers);t.validator&&t.validator(m,{headers:T});let _="GET"===t.method||"DELETE"===t.method;return{requestMethod:o,requestPath:v,bodyData:_?null:m,queryData:_?m:{},authenticator:null!=(s=p.authenticator)?s:null,headers:T,host:null!=f?f:null,streaming:P,settings:p.settings,usage:n}},_makeRequest(e,t,r){return new Promise((s,o)=>{var n;let a;try{a=this._getRequestOpts(e,t,r)}catch(e){o(e);return}let i=0===Object.keys(a.queryData).length,l=[a.requestPath,i?"":"?",y(a.queryData)].join(""),{headers:h,settings:u}=a;this._stripe._requestSender._request(a.requestMethod,a.host,l,a.bodyData,a.authenticator,{headers:h,settings:u,streaming:a.streaming},a.usage,function(e,r){e?o(e):s(t.transformResponseData?t.transformResponseData(r):r)},null==(n=this.requestDataProcessor)?void 0:n.bind(this))})}};class eh{constructor(e=[]){this._segments=[...e]}get segments(){return[...this._segments]}push(e){if(!e)throw Error("Segment cannot be null or undefined");return new eh([...this._segments,e])}pop(){if(0===this._segments.length)throw Error("Cannot pop from an empty context");return new eh(this._segments.slice(0,-1))}toString(){return this._segments.join("/")}static parse(e){return new eh(e?e.split("/"):[])}}let eu="2026-01-28.clover";function ed(e,t){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let s=r[0].toLowerCase()+r.substring(1),o=new t[r](e);this[s]=o}}function ec(e,t){return function(e){return new ed(e,t)}}let em=el.method,ep=el.extend({create:em({method:"POST",fullPath:"/v2/core/account_links"})}),ef=el.method,eP=el.extend({create:ef({method:"POST",fullPath:"/v2/core/account_tokens"}),retrieve:ef({method:"GET",fullPath:"/v2/core/account_tokens/{id}"})}),ev=el.method,eT=el.extend({retrieve:ev({method:"GET",fullPath:"/v1/financial_connections/accounts/{account}"}),list:ev({method:"GET",fullPath:"/v1/financial_connections/accounts",methodType:"list"}),disconnect:ev({method:"POST",fullPath:"/v1/financial_connections/accounts/{account}/disconnect"}),listOwners:ev({method:"GET",fullPath:"/v1/financial_connections/accounts/{account}/owners",methodType:"list"}),refresh:ev({method:"POST",fullPath:"/v1/financial_connections/accounts/{account}/refresh"}),subscribe:ev({method:"POST",fullPath:"/v1/financial_connections/accounts/{account}/subscribe"}),unsubscribe:ev({method:"POST",fullPath:"/v1/financial_connections/accounts/{account}/unsubscribe"})}),e_=el.method,ey=el.extend({create:e_({method:"POST",fullPath:"/v2/core/accounts/{account_id}/persons"}),retrieve:e_({method:"GET",fullPath:"/v2/core/accounts/{account_id}/persons/{id}"}),update:e_({method:"POST",fullPath:"/v2/core/accounts/{account_id}/persons/{id}"}),list:e_({method:"GET",fullPath:"/v2/core/accounts/{account_id}/persons",methodType:"list"}),del:e_({method:"DELETE",fullPath:"/v2/core/accounts/{account_id}/persons/{id}"})}),eg=el.method,eE=el.extend({create:eg({method:"POST",fullPath:"/v2/core/accounts/{account_id}/person_tokens"}),retrieve:eg({method:"GET",fullPath:"/v2/core/accounts/{account_id}/person_tokens/{id}"})}),eS=el.method,eO=el.extend({constructor:function(...e){el.apply(this,e),this.persons=new ey(...e),this.personTokens=new eE(...e)},create:eS({method:"POST",fullPath:"/v2/core/accounts"}),retrieve:eS({method:"GET",fullPath:"/v2/core/accounts/{id}"}),update:eS({method:"POST",fullPath:"/v2/core/accounts/{id}"}),list:eS({method:"GET",fullPath:"/v2/core/accounts",methodType:"list"}),close:eS({method:"POST",fullPath:"/v2/core/accounts/{id}/close"})}),eb=el.method,ex=el.extend({retrieve:eb({method:"GET",fullPath:"/v1/entitlements/active_entitlements/{id}"}),list:eb({method:"GET",fullPath:"/v1/entitlements/active_entitlements",methodType:"list"})}),ew=el.method,eG=el.extend({create:ew({method:"POST",fullPath:"/v1/billing/alerts"}),retrieve:ew({method:"GET",fullPath:"/v1/billing/alerts/{id}"}),list:ew({method:"GET",fullPath:"/v1/billing/alerts",methodType:"list"}),activate:ew({method:"POST",fullPath:"/v1/billing/alerts/{id}/activate"}),archive:ew({method:"POST",fullPath:"/v1/billing/alerts/{id}/archive"}),deactivate:ew({method:"POST",fullPath:"/v1/billing/alerts/{id}/deactivate"})}),eC=el.method,eA=el.extend({find:eC({method:"GET",fullPath:"/v1/tax/associations/find"})}),eR=el.method,ek=el.extend({retrieve:eR({method:"GET",fullPath:"/v1/issuing/authorizations/{authorization}"}),update:eR({method:"POST",fullPath:"/v1/issuing/authorizations/{authorization}"}),list:eR({method:"GET",fullPath:"/v1/issuing/authorizations",methodType:"list"}),approve:eR({method:"POST",fullPath:"/v1/issuing/authorizations/{authorization}/approve"}),decline:eR({method:"POST",fullPath:"/v1/issuing/authorizations/{authorization}/decline"})}),eI=el.method,eq=el.extend({create:eI({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations"}),capture:eI({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/capture"}),expire:eI({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/expire"}),finalizeAmount:eI({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount"}),increment:eI({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/increment"}),respond:eI({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/fraud_challenges/respond"}),reverse:eI({method:"POST",fullPath:"/v1/test_helpers/issuing/authorizations/{authorization}/reverse"})}),eD=el.method,eN=el.extend({create:eD({method:"POST",fullPath:"/v1/tax/calculations"}),retrieve:eD({method:"GET",fullPath:"/v1/tax/calculations/{calculation}"}),listLineItems:eD({method:"GET",fullPath:"/v1/tax/calculations/{calculation}/line_items",methodType:"list"})}),ej=el.method,eM=el.extend({create:ej({method:"POST",fullPath:"/v1/issuing/cardholders"}),retrieve:ej({method:"GET",fullPath:"/v1/issuing/cardholders/{cardholder}"}),update:ej({method:"POST",fullPath:"/v1/issuing/cardholders/{cardholder}"}),list:ej({method:"GET",fullPath:"/v1/issuing/cardholders",methodType:"list"})}),eU=el.method,eH=el.extend({create:eU({method:"POST",fullPath:"/v1/issuing/cards"}),retrieve:eU({method:"GET",fullPath:"/v1/issuing/cards/{card}"}),update:eU({method:"POST",fullPath:"/v1/issuing/cards/{card}"}),list:eU({method:"GET",fullPath:"/v1/issuing/cards",methodType:"list"})}),eL=el.method,eF=el.extend({deliverCard:eL({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/deliver"}),failCard:eL({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/fail"}),returnCard:eL({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/return"}),shipCard:eL({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/ship"}),submitCard:eL({method:"POST",fullPath:"/v1/test_helpers/issuing/cards/{card}/shipping/submit"})}),ez=el.method,e$=el.extend({create:ez({method:"POST",fullPath:"/v1/billing_portal/configurations"}),retrieve:ez({method:"GET",fullPath:"/v1/billing_portal/configurations/{configuration}"}),update:ez({method:"POST",fullPath:"/v1/billing_portal/configurations/{configuration}"}),list:ez({method:"GET",fullPath:"/v1/billing_portal/configurations",methodType:"list"})}),eB=el.method,eV=el.extend({create:eB({method:"POST",fullPath:"/v1/terminal/configurations"}),retrieve:eB({method:"GET",fullPath:"/v1/terminal/configurations/{configuration}"}),update:eB({method:"POST",fullPath:"/v1/terminal/configurations/{configuration}"}),list:eB({method:"GET",fullPath:"/v1/terminal/configurations",methodType:"list"}),del:eB({method:"DELETE",fullPath:"/v1/terminal/configurations/{configuration}"})}),eK=el.method,eW=el.extend({create:eK({method:"POST",fullPath:"/v1/test_helpers/confirmation_tokens"})}),eJ=el.method,eX=el.extend({create:eJ({method:"POST",fullPath:"/v1/terminal/connection_tokens"})}),eY=el.method,eQ=el.extend({retrieve:eY({method:"GET",fullPath:"/v1/billing/credit_balance_summary"})}),eZ=el.method,e1=el.extend({retrieve:eZ({method:"GET",fullPath:"/v1/billing/credit_balance_transactions/{id}"}),list:eZ({method:"GET",fullPath:"/v1/billing/credit_balance_transactions",methodType:"list"})}),e0=el.method,e2=el.extend({create:e0({method:"POST",fullPath:"/v1/billing/credit_grants"}),retrieve:e0({method:"GET",fullPath:"/v1/billing/credit_grants/{id}"}),update:e0({method:"POST",fullPath:"/v1/billing/credit_grants/{id}"}),list:e0({method:"GET",fullPath:"/v1/billing/credit_grants",methodType:"list"}),expire:e0({method:"POST",fullPath:"/v1/billing/credit_grants/{id}/expire"}),voidGrant:e0({method:"POST",fullPath:"/v1/billing/credit_grants/{id}/void"})}),e8=el.method,e4=el.extend({create:e8({method:"POST",fullPath:"/v1/treasury/credit_reversals"}),retrieve:e8({method:"GET",fullPath:"/v1/treasury/credit_reversals/{credit_reversal}"}),list:e8({method:"GET",fullPath:"/v1/treasury/credit_reversals",methodType:"list"})}),e5=el.method,e3=el.extend({fundCashBalance:e5({method:"POST",fullPath:"/v1/test_helpers/customers/{customer}/fund_cash_balance"})}),e6=el.method,e9=el.extend({create:e6({method:"POST",fullPath:"/v1/treasury/debit_reversals"}),retrieve:e6({method:"GET",fullPath:"/v1/treasury/debit_reversals/{debit_reversal}"}),list:e6({method:"GET",fullPath:"/v1/treasury/debit_reversals",methodType:"list"})}),e7=el.method,te=el.extend({create:e7({method:"POST",fullPath:"/v1/issuing/disputes"}),retrieve:e7({method:"GET",fullPath:"/v1/issuing/disputes/{dispute}"}),update:e7({method:"POST",fullPath:"/v1/issuing/disputes/{dispute}"}),list:e7({method:"GET",fullPath:"/v1/issuing/disputes",methodType:"list"}),submit:e7({method:"POST",fullPath:"/v1/issuing/disputes/{dispute}/submit"})}),tt=el.method,tr=el.extend({retrieve:tt({method:"GET",fullPath:"/v1/radar/early_fraud_warnings/{early_fraud_warning}"}),list:tt({method:"GET",fullPath:"/v1/radar/early_fraud_warnings",methodType:"list"})}),ts=el.method,to=el.extend({create:ts({method:"POST",fullPath:"/v2/core/event_destinations"}),retrieve:ts({method:"GET",fullPath:"/v2/core/event_destinations/{id}"}),update:ts({method:"POST",fullPath:"/v2/core/event_destinations/{id}"}),list:ts({method:"GET",fullPath:"/v2/core/event_destinations",methodType:"list"}),del:ts({method:"DELETE",fullPath:"/v2/core/event_destinations/{id}"}),disable:ts({method:"POST",fullPath:"/v2/core/event_destinations/{id}/disable"}),enable:ts({method:"POST",fullPath:"/v2/core/event_destinations/{id}/enable"}),ping:ts({method:"POST",fullPath:"/v2/core/event_destinations/{id}/ping"})}),tn=el.method,ta=el.extend({retrieve(...e){return tn({method:"GET",fullPath:"/v2/core/events/{id}",transformResponseData:e=>this.addFetchRelatedObjectIfNeeded(e)}).apply(this,e)},list(...e){return tn({method:"GET",fullPath:"/v2/core/events",methodType:"list",transformResponseData:e=>Object.assign(Object.assign({},e),{data:e.data.map(this.addFetchRelatedObjectIfNeeded.bind(this))})}).apply(this,e)},addFetchRelatedObjectIfNeeded(e){return e.related_object&&e.related_object.url?Object.assign(Object.assign({},e),{fetchRelatedObject:()=>tn({method:"GET",fullPath:e.related_object.url}).apply(this,[{stripeContext:e.context}])}):e}}),ti=el.method,tl=el.extend({create:ti({method:"POST",fullPath:"/v1/entitlements/features"}),retrieve:ti({method:"GET",fullPath:"/v1/entitlements/features/{id}"}),update:ti({method:"POST",fullPath:"/v1/entitlements/features/{id}"}),list:ti({method:"GET",fullPath:"/v1/entitlements/features",methodType:"list"})}),th=el.method,tu=el.extend({create:th({method:"POST",fullPath:"/v1/treasury/financial_accounts"}),retrieve:th({method:"GET",fullPath:"/v1/treasury/financial_accounts/{financial_account}"}),update:th({method:"POST",fullPath:"/v1/treasury/financial_accounts/{financial_account}"}),list:th({method:"GET",fullPath:"/v1/treasury/financial_accounts",methodType:"list"}),close:th({method:"POST",fullPath:"/v1/treasury/financial_accounts/{financial_account}/close"}),retrieveFeatures:th({method:"GET",fullPath:"/v1/treasury/financial_accounts/{financial_account}/features"}),updateFeatures:th({method:"POST",fullPath:"/v1/treasury/financial_accounts/{financial_account}/features"})}),td=el.method,tc=el.extend({fail:td({method:"POST",fullPath:"/v1/test_helpers/treasury/inbound_transfers/{id}/fail"}),returnInboundTransfer:td({method:"POST",fullPath:"/v1/test_helpers/treasury/inbound_transfers/{id}/return"}),succeed:td({method:"POST",fullPath:"/v1/test_helpers/treasury/inbound_transfers/{id}/succeed"})}),tm=el.method,tp=el.extend({create:tm({method:"POST",fullPath:"/v1/treasury/inbound_transfers"}),retrieve:tm({method:"GET",fullPath:"/v1/treasury/inbound_transfers/{id}"}),list:tm({method:"GET",fullPath:"/v1/treasury/inbound_transfers",methodType:"list"}),cancel:tm({method:"POST",fullPath:"/v1/treasury/inbound_transfers/{inbound_transfer}/cancel"})}),tf=el.method,tP=el.extend({create:tf({method:"POST",fullPath:"/v1/terminal/locations"}),retrieve:tf({method:"GET",fullPath:"/v1/terminal/locations/{location}"}),update:tf({method:"POST",fullPath:"/v1/terminal/locations/{location}"}),list:tf({method:"GET",fullPath:"/v1/terminal/locations",methodType:"list"}),del:tf({method:"DELETE",fullPath:"/v1/terminal/locations/{location}"})}),tv=el.method,tT=el.extend({create:tv({method:"POST",fullPath:"/v1/billing/meter_event_adjustments"})}),t_=el.method,ty=el.extend({create:t_({method:"POST",fullPath:"/v2/billing/meter_event_adjustments"})}),tg=el.method,tE=el.extend({create:tg({method:"POST",fullPath:"/v2/billing/meter_event_session"})}),tS=el.method,tO=el.extend({create:tS({method:"POST",fullPath:"/v2/billing/meter_event_stream",host:"meter-events.stripe.com"})}),tb=el.method,tx=el.extend({create:tb({method:"POST",fullPath:"/v1/billing/meter_events"})}),tw=el.method,tG=el.extend({create:tw({method:"POST",fullPath:"/v2/billing/meter_events"})}),tC=el.method,tA=el.extend({create:tC({method:"POST",fullPath:"/v1/billing/meters"}),retrieve:tC({method:"GET",fullPath:"/v1/billing/meters/{id}"}),update:tC({method:"POST",fullPath:"/v1/billing/meters/{id}"}),list:tC({method:"GET",fullPath:"/v1/billing/meters",methodType:"list"}),deactivate:tC({method:"POST",fullPath:"/v1/billing/meters/{id}/deactivate"}),listEventSummaries:tC({method:"GET",fullPath:"/v1/billing/meters/{id}/event_summaries",methodType:"list"}),reactivate:tC({method:"POST",fullPath:"/v1/billing/meters/{id}/reactivate"})}),tR=el.method,tk=el.extend({create:tR({method:"POST",fullPath:"/v1/terminal/onboarding_links"})}),tI=el.method,tq=el.extend({create:tI({method:"POST",fullPath:"/v1/climate/orders"}),retrieve:tI({method:"GET",fullPath:"/v1/climate/orders/{order}"}),update:tI({method:"POST",fullPath:"/v1/climate/orders/{order}"}),list:tI({method:"GET",fullPath:"/v1/climate/orders",methodType:"list"}),cancel:tI({method:"POST",fullPath:"/v1/climate/orders/{order}/cancel"})}),tD=el.method,tN=el.extend({update:tD({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_payments/{id}"}),fail:tD({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_payments/{id}/fail"}),post:tD({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_payments/{id}/post"}),returnOutboundPayment:tD({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_payments/{id}/return"})}),tj=el.method,tM=el.extend({create:tj({method:"POST",fullPath:"/v1/treasury/outbound_payments"}),retrieve:tj({method:"GET",fullPath:"/v1/treasury/outbound_payments/{id}"}),list:tj({method:"GET",fullPath:"/v1/treasury/outbound_payments",methodType:"list"}),cancel:tj({method:"POST",fullPath:"/v1/treasury/outbound_payments/{id}/cancel"})}),tU=el.method,tH=el.extend({update:tU({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}"}),fail:tU({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail"}),post:tU({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post"}),returnOutboundTransfer:tU({method:"POST",fullPath:"/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return"})}),tL=el.method,tF=el.extend({create:tL({method:"POST",fullPath:"/v1/treasury/outbound_transfers"}),retrieve:tL({method:"GET",fullPath:"/v1/treasury/outbound_transfers/{outbound_transfer}"}),list:tL({method:"GET",fullPath:"/v1/treasury/outbound_transfers",methodType:"list"}),cancel:tL({method:"POST",fullPath:"/v1/treasury/outbound_transfers/{outbound_transfer}/cancel"})}),tz=el.method,t$=el.extend({create:tz({method:"POST",fullPath:"/v1/radar/payment_evaluations"})}),tB=el.method,tV=el.extend({create:tB({method:"POST",fullPath:"/v1/issuing/personalization_designs"}),retrieve:tB({method:"GET",fullPath:"/v1/issuing/personalization_designs/{personalization_design}"}),update:tB({method:"POST",fullPath:"/v1/issuing/personalization_designs/{personalization_design}"}),list:tB({method:"GET",fullPath:"/v1/issuing/personalization_designs",methodType:"list"})}),tK=el.method,tW=el.extend({activate:tK({method:"POST",fullPath:"/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate"}),deactivate:tK({method:"POST",fullPath:"/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate"}),reject:tK({method:"POST",fullPath:"/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject"})}),tJ=el.method,tX=el.extend({retrieve:tJ({method:"GET",fullPath:"/v1/issuing/physical_bundles/{physical_bundle}"}),list:tJ({method:"GET",fullPath:"/v1/issuing/physical_bundles",methodType:"list"})}),tY=el.method,tQ=el.extend({retrieve:tY({method:"GET",fullPath:"/v1/climate/products/{product}"}),list:tY({method:"GET",fullPath:"/v1/climate/products",methodType:"list"})}),tZ=el.method,t1=el.extend({create:tZ({method:"POST",fullPath:"/v1/terminal/readers"}),retrieve:tZ({method:"GET",fullPath:"/v1/terminal/readers/{reader}"}),update:tZ({method:"POST",fullPath:"/v1/terminal/readers/{reader}"}),list:tZ({method:"GET",fullPath:"/v1/terminal/readers",methodType:"list"}),del:tZ({method:"DELETE",fullPath:"/v1/terminal/readers/{reader}"}),cancelAction:tZ({method:"POST",fullPath:"/v1/terminal/readers/{reader}/cancel_action"}),collectInputs:tZ({method:"POST",fullPath:"/v1/terminal/readers/{reader}/collect_inputs"}),collectPaymentMethod:tZ({method:"POST",fullPath:"/v1/terminal/readers/{reader}/collect_payment_method"}),confirmPaymentIntent:tZ({method:"POST",fullPath:"/v1/terminal/readers/{reader}/confirm_payment_intent"}),processPaymentIntent:tZ({method:"POST",fullPath:"/v1/terminal/readers/{reader}/process_payment_intent"}),processSetupIntent:tZ({method:"POST",fullPath:"/v1/terminal/readers/{reader}/process_setup_intent"}),refundPayment:tZ({method:"POST",fullPath:"/v1/terminal/readers/{reader}/refund_payment"}),setReaderDisplay:tZ({method:"POST",fullPath:"/v1/terminal/readers/{reader}/set_reader_display"})}),t0=el.method,t2=el.extend({presentPaymentMethod:t0({method:"POST",fullPath:"/v1/test_helpers/terminal/readers/{reader}/present_payment_method"}),succeedInputCollection:t0({method:"POST",fullPath:"/v1/test_helpers/terminal/readers/{reader}/succeed_input_collection"}),timeoutInputCollection:t0({method:"POST",fullPath:"/v1/test_helpers/terminal/readers/{reader}/timeout_input_collection"})}),t8=el.method,t4=el.extend({create:t8({method:"POST",fullPath:"/v1/test_helpers/treasury/received_credits"})}),t5=el.method,t3=el.extend({retrieve:t5({method:"GET",fullPath:"/v1/treasury/received_credits/{id}"}),list:t5({method:"GET",fullPath:"/v1/treasury/received_credits",methodType:"list"})}),t6=el.method,t9=el.extend({create:t6({method:"POST",fullPath:"/v1/test_helpers/treasury/received_debits"})}),t7=el.method,re=el.extend({retrieve:t7({method:"GET",fullPath:"/v1/treasury/received_debits/{id}"}),list:t7({method:"GET",fullPath:"/v1/treasury/received_debits",methodType:"list"})}),rt=el.method,rr=el.extend({expire:rt({method:"POST",fullPath:"/v1/test_helpers/refunds/{refund}/expire"})}),rs=el.method,ro=el.extend({create:rs({method:"POST",fullPath:"/v1/tax/registrations"}),retrieve:rs({method:"GET",fullPath:"/v1/tax/registrations/{id}"}),update:rs({method:"POST",fullPath:"/v1/tax/registrations/{id}"}),list:rs({method:"GET",fullPath:"/v1/tax/registrations",methodType:"list"})}),rn=el.method,ra=el.extend({create:rn({method:"POST",fullPath:"/v1/reporting/report_runs"}),retrieve:rn({method:"GET",fullPath:"/v1/reporting/report_runs/{report_run}"}),list:rn({method:"GET",fullPath:"/v1/reporting/report_runs",methodType:"list"})}),ri=el.method,rl=el.extend({retrieve:ri({method:"GET",fullPath:"/v1/reporting/report_types/{report_type}"}),list:ri({method:"GET",fullPath:"/v1/reporting/report_types",methodType:"list"})}),rh=el.method,ru=el.extend({create:rh({method:"POST",fullPath:"/v1/forwarding/requests"}),retrieve:rh({method:"GET",fullPath:"/v1/forwarding/requests/{id}"}),list:rh({method:"GET",fullPath:"/v1/forwarding/requests",methodType:"list"})}),rd=el.method,rc=el.extend({retrieve:rd({method:"GET",fullPath:"/v1/sigma/scheduled_query_runs/{scheduled_query_run}"}),list:rd({method:"GET",fullPath:"/v1/sigma/scheduled_query_runs",methodType:"list"})}),rm=el.method,rp=el.extend({create:rm({method:"POST",fullPath:"/v1/apps/secrets"}),list:rm({method:"GET",fullPath:"/v1/apps/secrets",methodType:"list"}),deleteWhere:rm({method:"POST",fullPath:"/v1/apps/secrets/delete"}),find:rm({method:"GET",fullPath:"/v1/apps/secrets/find"})}),rf=el.method,rP=el.extend({create:rf({method:"POST",fullPath:"/v1/billing_portal/sessions"})}),rv=el.method,rT=el.extend({create:rv({method:"POST",fullPath:"/v1/checkout/sessions"}),retrieve:rv({method:"GET",fullPath:"/v1/checkout/sessions/{session}"}),update:rv({method:"POST",fullPath:"/v1/checkout/sessions/{session}"}),list:rv({method:"GET",fullPath:"/v1/checkout/sessions",methodType:"list"}),expire:rv({method:"POST",fullPath:"/v1/checkout/sessions/{session}/expire"}),listLineItems:rv({method:"GET",fullPath:"/v1/checkout/sessions/{session}/line_items",methodType:"list"})}),r_=el.method,ry=el.extend({create:r_({method:"POST",fullPath:"/v1/financial_connections/sessions"}),retrieve:r_({method:"GET",fullPath:"/v1/financial_connections/sessions/{session}"})}),rg=el.method,rE=el.extend({retrieve:rg({method:"GET",fullPath:"/v1/tax/settings"}),update:rg({method:"POST",fullPath:"/v1/tax/settings"})}),rS=el.method,rO=el.extend({retrieve:rS({method:"GET",fullPath:"/v1/climate/suppliers/{supplier}"}),list:rS({method:"GET",fullPath:"/v1/climate/suppliers",methodType:"list"})}),rb=el.method,rx=el.extend({create:rb({method:"POST",fullPath:"/v1/test_helpers/test_clocks"}),retrieve:rb({method:"GET",fullPath:"/v1/test_helpers/test_clocks/{test_clock}"}),list:rb({method:"GET",fullPath:"/v1/test_helpers/test_clocks",methodType:"list"}),del:rb({method:"DELETE",fullPath:"/v1/test_helpers/test_clocks/{test_clock}"}),advance:rb({method:"POST",fullPath:"/v1/test_helpers/test_clocks/{test_clock}/advance"})}),rw=el.method,rG=el.extend({retrieve:rw({method:"GET",fullPath:"/v1/issuing/tokens/{token}"}),update:rw({method:"POST",fullPath:"/v1/issuing/tokens/{token}"}),list:rw({method:"GET",fullPath:"/v1/issuing/tokens",methodType:"list"})}),rC=el.method,rA=el.extend({retrieve:rC({method:"GET",fullPath:"/v1/treasury/transaction_entries/{id}"}),list:rC({method:"GET",fullPath:"/v1/treasury/transaction_entries",methodType:"list"})}),rR=el.method,rk=el.extend({retrieve:rR({method:"GET",fullPath:"/v1/financial_connections/transactions/{transaction}"}),list:rR({method:"GET",fullPath:"/v1/financial_connections/transactions",methodType:"list"})}),rI=el.method,rq=el.extend({retrieve:rI({method:"GET",fullPath:"/v1/issuing/transactions/{transaction}"}),update:rI({method:"POST",fullPath:"/v1/issuing/transactions/{transaction}"}),list:rI({method:"GET",fullPath:"/v1/issuing/transactions",methodType:"list"})}),rD=el.method,rN=el.extend({retrieve:rD({method:"GET",fullPath:"/v1/tax/transactions/{transaction}"}),createFromCalculation:rD({method:"POST",fullPath:"/v1/tax/transactions/create_from_calculation"}),createReversal:rD({method:"POST",fullPath:"/v1/tax/transactions/create_reversal"}),listLineItems:rD({method:"GET",fullPath:"/v1/tax/transactions/{transaction}/line_items",methodType:"list"})}),rj=el.method,rM=el.extend({createForceCapture:rj({method:"POST",fullPath:"/v1/test_helpers/issuing/transactions/create_force_capture"}),createUnlinkedRefund:rj({method:"POST",fullPath:"/v1/test_helpers/issuing/transactions/create_unlinked_refund"}),refund:rj({method:"POST",fullPath:"/v1/test_helpers/issuing/transactions/{transaction}/refund"})}),rU=el.method,rH=el.extend({retrieve:rU({method:"GET",fullPath:"/v1/treasury/transactions/{id}"}),list:rU({method:"GET",fullPath:"/v1/treasury/transactions",methodType:"list"})}),rL=el.method,rF=el.extend({create:rL({method:"POST",fullPath:"/v1/radar/value_list_items"}),retrieve:rL({method:"GET",fullPath:"/v1/radar/value_list_items/{item}"}),list:rL({method:"GET",fullPath:"/v1/radar/value_list_items",methodType:"list"}),del:rL({method:"DELETE",fullPath:"/v1/radar/value_list_items/{item}"})}),rz=el.method,r$=el.extend({create:rz({method:"POST",fullPath:"/v1/radar/value_lists"}),retrieve:rz({method:"GET",fullPath:"/v1/radar/value_lists/{value_list}"}),update:rz({method:"POST",fullPath:"/v1/radar/value_lists/{value_list}"}),list:rz({method:"GET",fullPath:"/v1/radar/value_lists",methodType:"list"}),del:rz({method:"DELETE",fullPath:"/v1/radar/value_lists/{value_list}"})}),rB=el.method,rV=el.extend({retrieve:rB({method:"GET",fullPath:"/v1/identity/verification_reports/{report}"}),list:rB({method:"GET",fullPath:"/v1/identity/verification_reports",methodType:"list"})}),rK=el.method,rW=el.extend({create:rK({method:"POST",fullPath:"/v1/identity/verification_sessions"}),retrieve:rK({method:"GET",fullPath:"/v1/identity/verification_sessions/{session}"}),update:rK({method:"POST",fullPath:"/v1/identity/verification_sessions/{session}"}),list:rK({method:"GET",fullPath:"/v1/identity/verification_sessions",methodType:"list"}),cancel:rK({method:"POST",fullPath:"/v1/identity/verification_sessions/{session}/cancel"}),redact:rK({method:"POST",fullPath:"/v1/identity/verification_sessions/{session}/redact"})}),rJ=el.method,rX=el.extend({create:rJ({method:"POST",fullPath:"/v1/accounts"}),retrieve(e,...t){return"string"==typeof e?rJ({method:"GET",fullPath:"/v1/accounts/{id}"}).apply(this,[e,...t]):(null==e&&[].shift.apply([e,...t]),rJ({method:"GET",fullPath:"/v1/account"}).apply(this,[e,...t]))},update:rJ({method:"POST",fullPath:"/v1/accounts/{account}"}),list:rJ({method:"GET",fullPath:"/v1/accounts",methodType:"list"}),del:rJ({method:"DELETE",fullPath:"/v1/accounts/{account}"}),createExternalAccount:rJ({method:"POST",fullPath:"/v1/accounts/{account}/external_accounts"}),createLoginLink:rJ({method:"POST",fullPath:"/v1/accounts/{account}/login_links"}),createPerson:rJ({method:"POST",fullPath:"/v1/accounts/{account}/persons"}),deleteExternalAccount:rJ({method:"DELETE",fullPath:"/v1/accounts/{account}/external_accounts/{id}"}),deletePerson:rJ({method:"DELETE",fullPath:"/v1/accounts/{account}/persons/{person}"}),listCapabilities:rJ({method:"GET",fullPath:"/v1/accounts/{account}/capabilities",methodType:"list"}),listExternalAccounts:rJ({method:"GET",fullPath:"/v1/accounts/{account}/external_accounts",methodType:"list"}),listPersons:rJ({method:"GET",fullPath:"/v1/accounts/{account}/persons",methodType:"list"}),reject:rJ({method:"POST",fullPath:"/v1/accounts/{account}/reject"}),retrieveCurrent:rJ({method:"GET",fullPath:"/v1/account"}),retrieveCapability:rJ({method:"GET",fullPath:"/v1/accounts/{account}/capabilities/{capability}"}),retrieveExternalAccount:rJ({method:"GET",fullPath:"/v1/accounts/{account}/external_accounts/{id}"}),retrievePerson:rJ({method:"GET",fullPath:"/v1/accounts/{account}/persons/{person}"}),updateCapability:rJ({method:"POST",fullPath:"/v1/accounts/{account}/capabilities/{capability}"}),updateExternalAccount:rJ({method:"POST",fullPath:"/v1/accounts/{account}/external_accounts/{id}"}),updatePerson:rJ({method:"POST",fullPath:"/v1/accounts/{account}/persons/{person}"})}),rY=el.method,rQ=el.extend({create:rY({method:"POST",fullPath:"/v1/account_links"})}),rZ=el.method,r1=el.extend({create:rZ({method:"POST",fullPath:"/v1/account_sessions"})}),r0=el.method,r2=el.extend({create:r0({method:"POST",fullPath:"/v1/apple_pay/domains"}),retrieve:r0({method:"GET",fullPath:"/v1/apple_pay/domains/{domain}"}),list:r0({method:"GET",fullPath:"/v1/apple_pay/domains",methodType:"list"}),del:r0({method:"DELETE",fullPath:"/v1/apple_pay/domains/{domain}"})}),r8=el.method,r4=el.extend({retrieve:r8({method:"GET",fullPath:"/v1/application_fees/{id}"}),list:r8({method:"GET",fullPath:"/v1/application_fees",methodType:"list"}),createRefund:r8({method:"POST",fullPath:"/v1/application_fees/{id}/refunds"}),listRefunds:r8({method:"GET",fullPath:"/v1/application_fees/{id}/refunds",methodType:"list"}),retrieveRefund:r8({method:"GET",fullPath:"/v1/application_fees/{fee}/refunds/{id}"}),updateRefund:r8({method:"POST",fullPath:"/v1/application_fees/{fee}/refunds/{id}"})}),r5=el.method,r3=el.extend({retrieve:r5({method:"GET",fullPath:"/v1/balance"})}),r6=el.method,r9=el.extend({retrieve:r6({method:"GET",fullPath:"/v1/balance_settings"}),update:r6({method:"POST",fullPath:"/v1/balance_settings"})}),r7=el.method,se=el.extend({retrieve:r7({method:"GET",fullPath:"/v1/balance_transactions/{id}"}),list:r7({method:"GET",fullPath:"/v1/balance_transactions",methodType:"list"})}),st=el.method,sr=el.extend({create:st({method:"POST",fullPath:"/v1/charges"}),retrieve:st({method:"GET",fullPath:"/v1/charges/{charge}"}),update:st({method:"POST",fullPath:"/v1/charges/{charge}"}),list:st({method:"GET",fullPath:"/v1/charges",methodType:"list"}),capture:st({method:"POST",fullPath:"/v1/charges/{charge}/capture"}),search:st({method:"GET",fullPath:"/v1/charges/search",methodType:"search"})}),ss=el.method,so=el.extend({retrieve:ss({method:"GET",fullPath:"/v1/confirmation_tokens/{confirmation_token}"})}),sn=el.method,sa=el.extend({retrieve:sn({method:"GET",fullPath:"/v1/country_specs/{country}"}),list:sn({method:"GET",fullPath:"/v1/country_specs",methodType:"list"})}),si=el.method,sl=el.extend({create:si({method:"POST",fullPath:"/v1/coupons"}),retrieve:si({method:"GET",fullPath:"/v1/coupons/{coupon}"}),update:si({method:"POST",fullPath:"/v1/coupons/{coupon}"}),list:si({method:"GET",fullPath:"/v1/coupons",methodType:"list"}),del:si({method:"DELETE",fullPath:"/v1/coupons/{coupon}"})}),sh=el.method,su=el.extend({create:sh({method:"POST",fullPath:"/v1/credit_notes"}),retrieve:sh({method:"GET",fullPath:"/v1/credit_notes/{id}"}),update:sh({method:"POST",fullPath:"/v1/credit_notes/{id}"}),list:sh({method:"GET",fullPath:"/v1/credit_notes",methodType:"list"}),listLineItems:sh({method:"GET",fullPath:"/v1/credit_notes/{credit_note}/lines",methodType:"list"}),listPreviewLineItems:sh({method:"GET",fullPath:"/v1/credit_notes/preview/lines",methodType:"list"}),preview:sh({method:"GET",fullPath:"/v1/credit_notes/preview"}),voidCreditNote:sh({method:"POST",fullPath:"/v1/credit_notes/{id}/void"})}),sd=el.method,sc=el.extend({create:sd({method:"POST",fullPath:"/v1/customer_sessions"})}),sm=el.method,sp=el.extend({create:sm({method:"POST",fullPath:"/v1/customers"}),retrieve:sm({method:"GET",fullPath:"/v1/customers/{customer}"}),update:sm({method:"POST",fullPath:"/v1/customers/{customer}"}),list:sm({method:"GET",fullPath:"/v1/customers",methodType:"list"}),del:sm({method:"DELETE",fullPath:"/v1/customers/{customer}"}),createBalanceTransaction:sm({method:"POST",fullPath:"/v1/customers/{customer}/balance_transactions"}),createFundingInstructions:sm({method:"POST",fullPath:"/v1/customers/{customer}/funding_instructions"}),createSource:sm({method:"POST",fullPath:"/v1/customers/{customer}/sources"}),createTaxId:sm({method:"POST",fullPath:"/v1/customers/{customer}/tax_ids"}),deleteDiscount:sm({method:"DELETE",fullPath:"/v1/customers/{customer}/discount"}),deleteSource:sm({method:"DELETE",fullPath:"/v1/customers/{customer}/sources/{id}"}),deleteTaxId:sm({method:"DELETE",fullPath:"/v1/customers/{customer}/tax_ids/{id}"}),listBalanceTransactions:sm({method:"GET",fullPath:"/v1/customers/{customer}/balance_transactions",methodType:"list"}),listCashBalanceTransactions:sm({method:"GET",fullPath:"/v1/customers/{customer}/cash_balance_transactions",methodType:"list"}),listPaymentMethods:sm({method:"GET",fullPath:"/v1/customers/{customer}/payment_methods",methodType:"list"}),listSources:sm({method:"GET",fullPath:"/v1/customers/{customer}/sources",methodType:"list"}),listTaxIds:sm({method:"GET",fullPath:"/v1/customers/{customer}/tax_ids",methodType:"list"}),retrieveBalanceTransaction:sm({method:"GET",fullPath:"/v1/customers/{customer}/balance_transactions/{transaction}"}),retrieveCashBalance:sm({method:"GET",fullPath:"/v1/customers/{customer}/cash_balance"}),retrieveCashBalanceTransaction:sm({method:"GET",fullPath:"/v1/customers/{customer}/cash_balance_transactions/{transaction}"}),retrievePaymentMethod:sm({method:"GET",fullPath:"/v1/customers/{customer}/payment_methods/{payment_method}"}),retrieveSource:sm({method:"GET",fullPath:"/v1/customers/{customer}/sources/{id}"}),retrieveTaxId:sm({method:"GET",fullPath:"/v1/customers/{customer}/tax_ids/{id}"}),search:sm({method:"GET",fullPath:"/v1/customers/search",methodType:"search"}),updateBalanceTransaction:sm({method:"POST",fullPath:"/v1/customers/{customer}/balance_transactions/{transaction}"}),updateCashBalance:sm({method:"POST",fullPath:"/v1/customers/{customer}/cash_balance"}),updateSource:sm({method:"POST",fullPath:"/v1/customers/{customer}/sources/{id}"}),verifySource:sm({method:"POST",fullPath:"/v1/customers/{customer}/sources/{id}/verify"})}),sf=el.method,sP=el.extend({retrieve:sf({method:"GET",fullPath:"/v1/disputes/{dispute}"}),update:sf({method:"POST",fullPath:"/v1/disputes/{dispute}"}),list:sf({method:"GET",fullPath:"/v1/disputes",methodType:"list"}),close:sf({method:"POST",fullPath:"/v1/disputes/{dispute}/close"})}),sv=el.method,sT=el.extend({create:sv({method:"POST",fullPath:"/v1/ephemeral_keys",validator:(e,t)=>{if(!t.headers||!t.headers["Stripe-Version"])throw Error("Passing apiVersion in a separate options hash is required to create an ephemeral key. See https://stripe.com/docs/api/versioning?lang=node")}}),del:sv({method:"DELETE",fullPath:"/v1/ephemeral_keys/{key}"})}),s_=el.method,sy=el.extend({retrieve:s_({method:"GET",fullPath:"/v1/events/{id}"}),list:s_({method:"GET",fullPath:"/v1/events",methodType:"list"})}),sg=el.method,sE=el.extend({retrieve:sg({method:"GET",fullPath:"/v1/exchange_rates/{rate_id}"}),list:sg({method:"GET",fullPath:"/v1/exchange_rates",methodType:"list"})}),sS=el.method,sO=el.extend({create:sS({method:"POST",fullPath:"/v1/file_links"}),retrieve:sS({method:"GET",fullPath:"/v1/file_links/{link}"}),update:sS({method:"POST",fullPath:"/v1/file_links/{link}"}),list:sS({method:"GET",fullPath:"/v1/file_links",methodType:"list"})}),sb=el.method,sx=el.extend({create:sb({method:"POST",fullPath:"/v1/files",headers:{"Content-Type":"multipart/form-data"},host:"files.stripe.com"}),retrieve:sb({method:"GET",fullPath:"/v1/files/{file}"}),list:sb({method:"GET",fullPath:"/v1/files",methodType:"list"}),requestDataProcessor:function(e,t,r,s){if(t=t||{},"POST"!==e)return s(null,y(t));this._stripe._platformFunctions.tryBufferData(t).then(e=>s(null,((e,t,r)=>{let s,o,n=(Math.round(1e16*Math.random())+Math.round(1e16*Math.random())).toString();r["Content-Type"]=`multipart/form-data; boundary=${n}`;let a=new TextEncoder,i=new Uint8Array(0),l=a.encode("\r\n");function h(e){let t=i,r=e instanceof Uint8Array?e:new Uint8Array(a.encode(e));(i=new Uint8Array(t.length+r.length+2)).set(t),i.set(r,t.length),i.set(l,i.length-2)}function u(e){return`"${e.replace(/"|"/g,"%22").replace(/\r\n|\r|\n/g," ")}"`}let d=(s={},(o=(e,t)=>{Object.entries(e).forEach(([e,r])=>{let n,a=t?`${t}[${e}]`:e;if(("function"==(n=typeof r)||"object"===n)&&r){if(!(r instanceof Uint8Array)&&!Object.prototype.hasOwnProperty.call(r,"data"))return o(r,a);s[a]=r}else s[a]=String(r)})})(t,null),s);for(let e in d){if(!Object.prototype.hasOwnProperty.call(d,e))continue;let t=d[e];h(`--${n}`),Object.prototype.hasOwnProperty.call(t,"data")?(h(`Content-Disposition: form-data; name=${u(e)}; filename=${u(t.name||"blob")}`),h(`Content-Type: ${t.type||"application/octet-stream"}`),h(""),h(t.data)):(h(`Content-Disposition: form-data; name=${u(e)}`),h(""),h(t))}return h(`--${n}--`),i})(0,e,r))).catch(e=>s(e,null))}}),sw=el.method,sG=el.extend({create:sw({method:"POST",fullPath:"/v1/invoiceitems"}),retrieve:sw({method:"GET",fullPath:"/v1/invoiceitems/{invoiceitem}"}),update:sw({method:"POST",fullPath:"/v1/invoiceitems/{invoiceitem}"}),list:sw({method:"GET",fullPath:"/v1/invoiceitems",methodType:"list"}),del:sw({method:"DELETE",fullPath:"/v1/invoiceitems/{invoiceitem}"})}),sC=el.method,sA=el.extend({retrieve:sC({method:"GET",fullPath:"/v1/invoice_payments/{invoice_payment}"}),list:sC({method:"GET",fullPath:"/v1/invoice_payments",methodType:"list"})}),sR=el.method,sk=el.extend({retrieve:sR({method:"GET",fullPath:"/v1/invoice_rendering_templates/{template}"}),list:sR({method:"GET",fullPath:"/v1/invoice_rendering_templates",methodType:"list"}),archive:sR({method:"POST",fullPath:"/v1/invoice_rendering_templates/{template}/archive"}),unarchive:sR({method:"POST",fullPath:"/v1/invoice_rendering_templates/{template}/unarchive"})}),sI=el.method,sq=el.extend({create:sI({method:"POST",fullPath:"/v1/invoices"}),retrieve:sI({method:"GET",fullPath:"/v1/invoices/{invoice}"}),update:sI({method:"POST",fullPath:"/v1/invoices/{invoice}"}),list:sI({method:"GET",fullPath:"/v1/invoices",methodType:"list"}),del:sI({method:"DELETE",fullPath:"/v1/invoices/{invoice}"}),addLines:sI({method:"POST",fullPath:"/v1/invoices/{invoice}/add_lines"}),attachPayment:sI({method:"POST",fullPath:"/v1/invoices/{invoice}/attach_payment"}),createPreview:sI({method:"POST",fullPath:"/v1/invoices/create_preview"}),finalizeInvoice:sI({method:"POST",fullPath:"/v1/invoices/{invoice}/finalize"}),listLineItems:sI({method:"GET",fullPath:"/v1/invoices/{invoice}/lines",methodType:"list"}),markUncollectible:sI({method:"POST",fullPath:"/v1/invoices/{invoice}/mark_uncollectible"}),pay:sI({method:"POST",fullPath:"/v1/invoices/{invoice}/pay"}),removeLines:sI({method:"POST",fullPath:"/v1/invoices/{invoice}/remove_lines"}),search:sI({method:"GET",fullPath:"/v1/invoices/search",methodType:"search"}),sendInvoice:sI({method:"POST",fullPath:"/v1/invoices/{invoice}/send"}),updateLines:sI({method:"POST",fullPath:"/v1/invoices/{invoice}/update_lines"}),updateLineItem:sI({method:"POST",fullPath:"/v1/invoices/{invoice}/lines/{line_item_id}"}),voidInvoice:sI({method:"POST",fullPath:"/v1/invoices/{invoice}/void"})}),sD=el.method,sN=el.extend({retrieve:sD({method:"GET",fullPath:"/v1/mandates/{mandate}"})}),sj=el.method,sM="connect.stripe.com",sU=el.extend({basePath:"/",authorizeUrl(e,t){e=e||{};let r="oauth/authorize";return(t=t||{}).express&&(r=`express/${r}`),e.response_type||(e.response_type="code"),e.client_id||(e.client_id=this._stripe.getClientId()),e.scope||(e.scope="read_write"),`https://${sM}/${r}?${y(e)}`},token:sj({method:"POST",path:"oauth/token",host:sM}),deauthorize(e,...t){return e.client_id||(e.client_id=this._stripe.getClientId()),sj({method:"POST",path:"oauth/deauthorize",host:sM}).apply(this,[e,...t])}}),sH=el.method,sL=el.extend({retrieve:sH({method:"GET",fullPath:"/v1/payment_attempt_records/{id}"}),list:sH({method:"GET",fullPath:"/v1/payment_attempt_records",methodType:"list"})}),sF=el.method,sz=el.extend({create:sF({method:"POST",fullPath:"/v1/payment_intents"}),retrieve:sF({method:"GET",fullPath:"/v1/payment_intents/{intent}"}),update:sF({method:"POST",fullPath:"/v1/payment_intents/{intent}"}),list:sF({method:"GET",fullPath:"/v1/payment_intents",methodType:"list"}),applyCustomerBalance:sF({method:"POST",fullPath:"/v1/payment_intents/{intent}/apply_customer_balance"}),cancel:sF({method:"POST",fullPath:"/v1/payment_intents/{intent}/cancel"}),capture:sF({method:"POST",fullPath:"/v1/payment_intents/{intent}/capture"}),confirm:sF({method:"POST",fullPath:"/v1/payment_intents/{intent}/confirm"}),incrementAuthorization:sF({method:"POST",fullPath:"/v1/payment_intents/{intent}/increment_authorization"}),listAmountDetailsLineItems:sF({method:"GET",fullPath:"/v1/payment_intents/{intent}/amount_details_line_items",methodType:"list"}),search:sF({method:"GET",fullPath:"/v1/payment_intents/search",methodType:"search"}),verifyMicrodeposits:sF({method:"POST",fullPath:"/v1/payment_intents/{intent}/verify_microdeposits"})}),s$=el.method,sB=el.extend({create:s$({method:"POST",fullPath:"/v1/payment_links"}),retrieve:s$({method:"GET",fullPath:"/v1/payment_links/{payment_link}"}),update:s$({method:"POST",fullPath:"/v1/payment_links/{payment_link}"}),list:s$({method:"GET",fullPath:"/v1/payment_links",methodType:"list"}),listLineItems:s$({method:"GET",fullPath:"/v1/payment_links/{payment_link}/line_items",methodType:"list"})}),sV=el.method,sK=el.extend({create:sV({method:"POST",fullPath:"/v1/payment_method_configurations"}),retrieve:sV({method:"GET",fullPath:"/v1/payment_method_configurations/{configuration}"}),update:sV({method:"POST",fullPath:"/v1/payment_method_configurations/{configuration}"}),list:sV({method:"GET",fullPath:"/v1/payment_method_configurations",methodType:"list"})}),sW=el.method,sJ=el.extend({create:sW({method:"POST",fullPath:"/v1/payment_method_domains"}),retrieve:sW({method:"GET",fullPath:"/v1/payment_method_domains/{payment_method_domain}"}),update:sW({method:"POST",fullPath:"/v1/payment_method_domains/{payment_method_domain}"}),list:sW({method:"GET",fullPath:"/v1/payment_method_domains",methodType:"list"}),validate:sW({method:"POST",fullPath:"/v1/payment_method_domains/{payment_method_domain}/validate"})}),sX=el.method,sY=el.extend({create:sX({method:"POST",fullPath:"/v1/payment_methods"}),retrieve:sX({method:"GET",fullPath:"/v1/payment_methods/{payment_method}"}),update:sX({method:"POST",fullPath:"/v1/payment_methods/{payment_method}"}),list:sX({method:"GET",fullPath:"/v1/payment_methods",methodType:"list"}),attach:sX({method:"POST",fullPath:"/v1/payment_methods/{payment_method}/attach"}),detach:sX({method:"POST",fullPath:"/v1/payment_methods/{payment_method}/detach"})}),sQ=el.method,sZ=el.extend({retrieve:sQ({method:"GET",fullPath:"/v1/payment_records/{id}"}),reportPayment:sQ({method:"POST",fullPath:"/v1/payment_records/report_payment"}),reportPaymentAttempt:sQ({method:"POST",fullPath:"/v1/payment_records/{id}/report_payment_attempt"}),reportPaymentAttemptCanceled:sQ({method:"POST",fullPath:"/v1/payment_records/{id}/report_payment_attempt_canceled"}),reportPaymentAttemptFailed:sQ({method:"POST",fullPath:"/v1/payment_records/{id}/report_payment_attempt_failed"}),reportPaymentAttemptGuaranteed:sQ({method:"POST",fullPath:"/v1/payment_records/{id}/report_payment_attempt_guaranteed"}),reportPaymentAttemptInformational:sQ({method:"POST",fullPath:"/v1/payment_records/{id}/report_payment_attempt_informational"}),reportRefund:sQ({method:"POST",fullPath:"/v1/payment_records/{id}/report_refund"})}),s1=el.method,s0=el.extend({create:s1({method:"POST",fullPath:"/v1/payouts"}),retrieve:s1({method:"GET",fullPath:"/v1/payouts/{payout}"}),update:s1({method:"POST",fullPath:"/v1/payouts/{payout}"}),list:s1({method:"GET",fullPath:"/v1/payouts",methodType:"list"}),cancel:s1({method:"POST",fullPath:"/v1/payouts/{payout}/cancel"}),reverse:s1({method:"POST",fullPath:"/v1/payouts/{payout}/reverse"})}),s2=el.method,s8=el.extend({create:s2({method:"POST",fullPath:"/v1/plans"}),retrieve:s2({method:"GET",fullPath:"/v1/plans/{plan}"}),update:s2({method:"POST",fullPath:"/v1/plans/{plan}"}),list:s2({method:"GET",fullPath:"/v1/plans",methodType:"list"}),del:s2({method:"DELETE",fullPath:"/v1/plans/{plan}"})}),s4=el.method,s5=el.extend({create:s4({method:"POST",fullPath:"/v1/prices"}),retrieve:s4({method:"GET",fullPath:"/v1/prices/{price}"}),update:s4({method:"POST",fullPath:"/v1/prices/{price}"}),list:s4({method:"GET",fullPath:"/v1/prices",methodType:"list"}),search:s4({method:"GET",fullPath:"/v1/prices/search",methodType:"search"})}),s3=el.method,s6=el.extend({create:s3({method:"POST",fullPath:"/v1/products"}),retrieve:s3({method:"GET",fullPath:"/v1/products/{id}"}),update:s3({method:"POST",fullPath:"/v1/products/{id}"}),list:s3({method:"GET",fullPath:"/v1/products",methodType:"list"}),del:s3({method:"DELETE",fullPath:"/v1/products/{id}"}),createFeature:s3({method:"POST",fullPath:"/v1/products/{product}/features"}),deleteFeature:s3({method:"DELETE",fullPath:"/v1/products/{product}/features/{id}"}),listFeatures:s3({method:"GET",fullPath:"/v1/products/{product}/features",methodType:"list"}),retrieveFeature:s3({method:"GET",fullPath:"/v1/products/{product}/features/{id}"}),search:s3({method:"GET",fullPath:"/v1/products/search",methodType:"search"})}),s9=el.method,s7=el.extend({create:s9({method:"POST",fullPath:"/v1/promotion_codes"}),retrieve:s9({method:"GET",fullPath:"/v1/promotion_codes/{promotion_code}"}),update:s9({method:"POST",fullPath:"/v1/promotion_codes/{promotion_code}"}),list:s9({method:"GET",fullPath:"/v1/promotion_codes",methodType:"list"})}),oe=el.method,ot=el.extend({create:oe({method:"POST",fullPath:"/v1/quotes"}),retrieve:oe({method:"GET",fullPath:"/v1/quotes/{quote}"}),update:oe({method:"POST",fullPath:"/v1/quotes/{quote}"}),list:oe({method:"GET",fullPath:"/v1/quotes",methodType:"list"}),accept:oe({method:"POST",fullPath:"/v1/quotes/{quote}/accept"}),cancel:oe({method:"POST",fullPath:"/v1/quotes/{quote}/cancel"}),finalizeQuote:oe({method:"POST",fullPath:"/v1/quotes/{quote}/finalize"}),listComputedUpfrontLineItems:oe({method:"GET",fullPath:"/v1/quotes/{quote}/computed_upfront_line_items",methodType:"list"}),listLineItems:oe({method:"GET",fullPath:"/v1/quotes/{quote}/line_items",methodType:"list"}),pdf:oe({method:"GET",fullPath:"/v1/quotes/{quote}/pdf",host:"files.stripe.com",streaming:!0})}),or=el.method,os=el.extend({create:or({method:"POST",fullPath:"/v1/refunds"}),retrieve:or({method:"GET",fullPath:"/v1/refunds/{refund}"}),update:or({method:"POST",fullPath:"/v1/refunds/{refund}"}),list:or({method:"GET",fullPath:"/v1/refunds",methodType:"list"}),cancel:or({method:"POST",fullPath:"/v1/refunds/{refund}/cancel"})}),oo=el.method,on=el.extend({retrieve:oo({method:"GET",fullPath:"/v1/reviews/{review}"}),list:oo({method:"GET",fullPath:"/v1/reviews",methodType:"list"}),approve:oo({method:"POST",fullPath:"/v1/reviews/{review}/approve"})}),oa=el.method,oi=el.extend({list:oa({method:"GET",fullPath:"/v1/setup_attempts",methodType:"list"})}),ol=el.method,oh=el.extend({create:ol({method:"POST",fullPath:"/v1/setup_intents"}),retrieve:ol({method:"GET",fullPath:"/v1/setup_intents/{intent}"}),update:ol({method:"POST",fullPath:"/v1/setup_intents/{intent}"}),list:ol({method:"GET",fullPath:"/v1/setup_intents",methodType:"list"}),cancel:ol({method:"POST",fullPath:"/v1/setup_intents/{intent}/cancel"}),confirm:ol({method:"POST",fullPath:"/v1/setup_intents/{intent}/confirm"}),verifyMicrodeposits:ol({method:"POST",fullPath:"/v1/setup_intents/{intent}/verify_microdeposits"})}),ou=el.method,od=el.extend({create:ou({method:"POST",fullPath:"/v1/shipping_rates"}),retrieve:ou({method:"GET",fullPath:"/v1/shipping_rates/{shipping_rate_token}"}),update:ou({method:"POST",fullPath:"/v1/shipping_rates/{shipping_rate_token}"}),list:ou({method:"GET",fullPath:"/v1/shipping_rates",methodType:"list"})}),oc=el.method,om=el.extend({create:oc({method:"POST",fullPath:"/v1/sources"}),retrieve:oc({method:"GET",fullPath:"/v1/sources/{source}"}),update:oc({method:"POST",fullPath:"/v1/sources/{source}"}),listSourceTransactions:oc({method:"GET",fullPath:"/v1/sources/{source}/source_transactions",methodType:"list"}),verify:oc({method:"POST",fullPath:"/v1/sources/{source}/verify"})}),op=el.method,of=el.extend({create:op({method:"POST",fullPath:"/v1/subscription_items"}),retrieve:op({method:"GET",fullPath:"/v1/subscription_items/{item}"}),update:op({method:"POST",fullPath:"/v1/subscription_items/{item}"}),list:op({method:"GET",fullPath:"/v1/subscription_items",methodType:"list"}),del:op({method:"DELETE",fullPath:"/v1/subscription_items/{item}"})}),oP=el.method,ov=el.extend({create:oP({method:"POST",fullPath:"/v1/subscription_schedules"}),retrieve:oP({method:"GET",fullPath:"/v1/subscription_schedules/{schedule}"}),update:oP({method:"POST",fullPath:"/v1/subscription_schedules/{schedule}"}),list:oP({method:"GET",fullPath:"/v1/subscription_schedules",methodType:"list"}),cancel:oP({method:"POST",fullPath:"/v1/subscription_schedules/{schedule}/cancel"}),release:oP({method:"POST",fullPath:"/v1/subscription_schedules/{schedule}/release"})}),oT=el.method,o_=el.extend({create:oT({method:"POST",fullPath:"/v1/subscriptions"}),retrieve:oT({method:"GET",fullPath:"/v1/subscriptions/{subscription_exposed_id}"}),update:oT({method:"POST",fullPath:"/v1/subscriptions/{subscription_exposed_id}"}),list:oT({method:"GET",fullPath:"/v1/subscriptions",methodType:"list"}),cancel:oT({method:"DELETE",fullPath:"/v1/subscriptions/{subscription_exposed_id}"}),deleteDiscount:oT({method:"DELETE",fullPath:"/v1/subscriptions/{subscription_exposed_id}/discount"}),migrate:oT({method:"POST",fullPath:"/v1/subscriptions/{subscription}/migrate"}),resume:oT({method:"POST",fullPath:"/v1/subscriptions/{subscription}/resume"}),search:oT({method:"GET",fullPath:"/v1/subscriptions/search",methodType:"search"})}),oy=el.method,og=el.extend({retrieve:oy({method:"GET",fullPath:"/v1/tax_codes/{id}"}),list:oy({method:"GET",fullPath:"/v1/tax_codes",methodType:"list"})}),oE=el.method,oS=el.extend({create:oE({method:"POST",fullPath:"/v1/tax_ids"}),retrieve:oE({method:"GET",fullPath:"/v1/tax_ids/{id}"}),list:oE({method:"GET",fullPath:"/v1/tax_ids",methodType:"list"}),del:oE({method:"DELETE",fullPath:"/v1/tax_ids/{id}"})}),oO=el.method,ob=el.extend({create:oO({method:"POST",fullPath:"/v1/tax_rates"}),retrieve:oO({method:"GET",fullPath:"/v1/tax_rates/{tax_rate}"}),update:oO({method:"POST",fullPath:"/v1/tax_rates/{tax_rate}"}),list:oO({method:"GET",fullPath:"/v1/tax_rates",methodType:"list"})}),ox=el.method,ow=el.extend({create:ox({method:"POST",fullPath:"/v1/tokens"}),retrieve:ox({method:"GET",fullPath:"/v1/tokens/{token}"})}),oG=el.method,oC=el.extend({create:oG({method:"POST",fullPath:"/v1/topups"}),retrieve:oG({method:"GET",fullPath:"/v1/topups/{topup}"}),update:oG({method:"POST",fullPath:"/v1/topups/{topup}"}),list:oG({method:"GET",fullPath:"/v1/topups",methodType:"list"}),cancel:oG({method:"POST",fullPath:"/v1/topups/{topup}/cancel"})}),oA=el.method,oR=el.extend({create:oA({method:"POST",fullPath:"/v1/transfers"}),retrieve:oA({method:"GET",fullPath:"/v1/transfers/{transfer}"}),update:oA({method:"POST",fullPath:"/v1/transfers/{transfer}"}),list:oA({method:"GET",fullPath:"/v1/transfers",methodType:"list"}),createReversal:oA({method:"POST",fullPath:"/v1/transfers/{id}/reversals"}),listReversals:oA({method:"GET",fullPath:"/v1/transfers/{id}/reversals",methodType:"list"}),retrieveReversal:oA({method:"GET",fullPath:"/v1/transfers/{transfer}/reversals/{id}"}),updateReversal:oA({method:"POST",fullPath:"/v1/transfers/{transfer}/reversals/{id}"})}),ok=el.method,oI=el.extend({create:ok({method:"POST",fullPath:"/v1/webhook_endpoints"}),retrieve:ok({method:"GET",fullPath:"/v1/webhook_endpoints/{webhook_endpoint}"}),update:ok({method:"POST",fullPath:"/v1/webhook_endpoints/{webhook_endpoint}"}),list:ok({method:"GET",fullPath:"/v1/webhook_endpoints",methodType:"list"}),del:ok({method:"DELETE",fullPath:"/v1/webhook_endpoints/{webhook_endpoint}"})}),oq=ec("apps",{Secrets:rp}),oD=ec("billing",{Alerts:eG,CreditBalanceSummary:eQ,CreditBalanceTransactions:e1,CreditGrants:e2,MeterEventAdjustments:tT,MeterEvents:tx,Meters:tA}),oN=ec("billingPortal",{Configurations:e$,Sessions:rP}),oj=ec("checkout",{Sessions:rT}),oM=ec("climate",{Orders:tq,Products:tQ,Suppliers:rO}),oU=ec("entitlements",{ActiveEntitlements:ex,Features:tl}),oH=ec("financialConnections",{Accounts:eT,Sessions:ry,Transactions:rk}),oL=ec("forwarding",{Requests:ru}),oF=ec("identity",{VerificationReports:rV,VerificationSessions:rW}),oz=ec("issuing",{Authorizations:ek,Cardholders:eM,Cards:eH,Disputes:te,PersonalizationDesigns:tV,PhysicalBundles:tX,Tokens:rG,Transactions:rq}),o$=ec("radar",{EarlyFraudWarnings:tr,PaymentEvaluations:t$,ValueListItems:rF,ValueLists:r$}),oB=ec("reporting",{ReportRuns:ra,ReportTypes:rl}),oV=ec("sigma",{ScheduledQueryRuns:rc}),oK=ec("tax",{Associations:eA,Calculations:eN,Registrations:ro,Settings:rE,Transactions:rN}),oW=ec("terminal",{Configurations:eV,ConnectionTokens:eX,Locations:tP,OnboardingLinks:tk,Readers:t1}),oJ=ec("testHelpers",{ConfirmationTokens:eW,Customers:e3,Refunds:rr,TestClocks:rx,Issuing:ec("issuing",{Authorizations:eq,Cards:eF,PersonalizationDesigns:tW,Transactions:rM}),Terminal:ec("terminal",{Readers:t2}),Treasury:ec("treasury",{InboundTransfers:tc,OutboundPayments:tN,OutboundTransfers:tH,ReceivedCredits:t4,ReceivedDebits:t9})}),oX=ec("treasury",{CreditReversals:e4,DebitReversals:e9,FinancialAccounts:tu,InboundTransfers:tp,OutboundPayments:tM,OutboundTransfers:tF,ReceivedCredits:t3,ReceivedDebits:re,TransactionEntries:rA,Transactions:rH}),oY=ec("v2",{Billing:ec("billing",{MeterEventAdjustments:ty,MeterEventSession:tE,MeterEventStream:tO,MeterEvents:tG}),Core:ec("core",{AccountLinks:ep,AccountTokens:eP,Accounts:eO,EventDestinations:to,Events:ta})});e.s(["Apps",0,oq,"Billing",0,oD,"BillingPortal",0,oN,"Checkout",0,oj,"Climate",0,oM,"Entitlements",0,oU,"FinancialConnections",0,oH,"Forwarding",0,oL,"Identity",0,oF,"Issuing",0,oz,"Radar",0,o$,"Reporting",0,oB,"Sigma",0,oV,"Tax",0,oK,"Terminal",0,oW,"TestHelpers",0,oJ,"Treasury",0,oX,"V2",0,oY],99155),e.i(99155),e.s(["Account",0,rX,"AccountLinks",0,rQ,"AccountSessions",0,r1,"Accounts",0,rX,"ApplePayDomains",0,r2,"ApplicationFees",0,r4,"Apps",0,oq,"Balance",0,r3,"BalanceSettings",0,r9,"BalanceTransactions",0,se,"Billing",0,oD,"BillingPortal",0,oN,"Charges",0,sr,"Checkout",0,oj,"Climate",0,oM,"ConfirmationTokens",0,so,"CountrySpecs",0,sa,"Coupons",0,sl,"CreditNotes",0,su,"CustomerSessions",0,sc,"Customers",0,sp,"Disputes",0,sP,"Entitlements",0,oU,"EphemeralKeys",0,sT,"Events",0,sy,"ExchangeRates",0,sE,"FileLinks",0,sO,"Files",0,sx,"FinancialConnections",0,oH,"Forwarding",0,oL,"Identity",0,oF,"InvoiceItems",0,sG,"InvoicePayments",0,sA,"InvoiceRenderingTemplates",0,sk,"Invoices",0,sq,"Issuing",0,oz,"Mandates",0,sN,"OAuth",0,sU,"PaymentAttemptRecords",0,sL,"PaymentIntents",0,sz,"PaymentLinks",0,sB,"PaymentMethodConfigurations",0,sK,"PaymentMethodDomains",0,sJ,"PaymentMethods",0,sY,"PaymentRecords",0,sZ,"Payouts",0,s0,"Plans",0,s8,"Prices",0,s5,"Products",0,s6,"PromotionCodes",0,s7,"Quotes",0,ot,"Radar",0,o$,"Refunds",0,os,"Reporting",0,oB,"Reviews",0,on,"SetupAttempts",0,oi,"SetupIntents",0,oh,"ShippingRates",0,od,"Sigma",0,oV,"Sources",0,om,"SubscriptionItems",0,of,"SubscriptionSchedules",0,ov,"Subscriptions",0,o_,"Tax",0,oK,"TaxCodes",0,og,"TaxIds",0,oS,"TaxRates",0,ob,"Terminal",0,oW,"TestHelpers",0,oJ,"Tokens",0,ow,"Topups",0,oC,"Transfers",0,oR,"Treasury",0,oX,"V2",0,oY,"WebhookEndpoints",0,oI],34549);var oQ=e.i(34549);let oZ="api.stripe.com",o1="/v1/",o0=["name","version","url","partner_id"],o2=["authenticator","apiVersion","typescript","maxNetworkRetries","httpAgent","httpClient","timeout","host","port","protocol","telemetry","appInfo","stripeAccount","stripeContext"],o8=new(function(e,t=e=>new et(e,el.MAX_BUFFERED_REQUEST_METRICS)){function r(s,o={}){if(!(this instanceof r))return new r(s,o);let n=this._getPropsFromConfig(o);this._platformFunctions=e,Object.defineProperty(this,"_emitter",{value:this._platformFunctions.createEmitter(),enumerable:!1,configurable:!1,writable:!1}),this.VERSION=r.PACKAGE_VERSION,this.on=this._emitter.on.bind(this._emitter),this.once=this._emitter.once.bind(this._emitter),this.off=this._emitter.removeListener.bind(this._emitter);let a=n.httpAgent||null;this._api={host:n.host||oZ,port:n.port||"443",protocol:n.protocol||"https",basePath:o1,version:n.apiVersion||eu,timeout:w("timeout",n.timeout,8e4),maxNetworkRetries:w("maxNetworkRetries",n.maxNetworkRetries,2),agent:a,httpClient:n.httpClient||(a?this._platformFunctions.createNodeHttpClient(a):this._platformFunctions.createDefaultHttpClient()),dev:!1,stripeAccount:n.stripeAccount||null,stripeContext:n.stripeContext||null};let i=n.typescript||!1;i!==r.USER_AGENT.typescript&&(r.USER_AGENT.typescript=i),n.appInfo&&this._setAppInfo(n.appInfo),this._prepResources(),this._setAuthenticator(s,n.authenticator),this.errors=ee,this.webhooks=r.webhooks,this._prevRequestMetrics=[],this._enableTelemetry=!1!==n.telemetry,this._requestSender=t(this),this.StripeResource=r.StripeResource}return r.PACKAGE_VERSION="20.3.1",r.API_VERSION=eu,r.USER_AGENT=Object.assign({bindings_version:r.PACKAGE_VERSION,lang:"node",publisher:"stripe",uname:null,typescript:!1},"u"{let r=t.split("=");return"t"===r[0]&&(e.timestamp=parseInt(r[1],10)),r[0]===o&&e.signatures.push(r[1]),e},{timestamp:-1,signatures:[]}));if(!h||-1===h.timestamp)throw new K(l,i,{message:"Unable to extract timestamp and signatures from header"});if(!h.signatures.length)throw new K(l,i,{message:"No signatures found with expected scheme"});return{decodedPayload:i,decodedHeader:l,details:h,suspectPayloadType:n}}function a(t,r,s,o,n,a,i,l){let h=!!s.signatures.filter(e.secureCompare.bind(e,o)).length,u="\nLearn more about webhook signing and explore webhook integration examples for various frameworks at https://docs.stripe.com/webhooks/signature",d=i?"\n\nNote: The provided signing secret contains whitespace. This often indicates an extra newline or space is in the value":"";if(!h){if(a)throw new K(r,t,{message:"Webhook payload must be provided as a string or a Buffer (https://nodejs.org/api/buffer.html) instance representing the _raw_ request body.Payload was provided as a parsed JavaScript object instead. \nSignature verification is impossible without access to the original signed material. \n"+u+"\n"+d});throw new K(r,t,{message:"No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe? \n If a webhook request is being forwarded by a third-party tool, ensure that the exact request body, including JSON formatting and new line style, is preserved.\n"+u+"\n"+d})}let c=Math.floor(("number"==typeof l?l:Date.now())/1e3)-s.timestamp;if(n>0&&c>n)throw new K(r,t,{message:"Timestamp outside the tolerance zone"});return!0}let i=null;function l(){return i||(i=e.createDefaultCryptoProvider()),i}function h(e){if(!e)throw new U({message:"Options are required"});let t=Math.floor(e.timestamp)||Math.floor(Date.now()/1e3),s=e.scheme||r.EXPECTED_SCHEME,o=e.cryptoProvider||l(),n=`${t}.${e.payload}`;return Object.assign(Object.assign({},e),{timestamp:t,scheme:s,cryptoProvider:o,payloadString:n,generateHeaderString:e=>`t=${t},${s}=${e}`})}return t.signature=r,t}(e),r.errors=ee,r.createNodeHttpClient=e.createNodeHttpClient,r.createFetchHttpClient=e.createFetchHttpClient,r.createNodeCryptoProvider=e.createNodeCryptoProvider,r.createSubtleCryptoProvider=e.createSubtleCryptoProvider,r.prototype={_appInfo:void 0,on:null,off:null,once:null,VERSION:null,StripeResource:null,webhooks:null,errors:null,_api:null,_prevRequestMetrics:null,_emitter:null,_enableTelemetry:null,_requestSender:null,_platformFunctions:null,rawRequest(e,t,r,s){return this._requestSender._rawRequest(e,t,r,s)},_setAuthenticator(e,t){if(e&&t)throw Error("Can't specify both apiKey and authenticator");if(!e&&!t)throw Error("Neither apiKey nor config.authenticator provided");this._authenticator=e?G(e):t},_setAppInfo(e){if(e&&"object"!=typeof e)throw Error("AppInfo must be an object.");if(e&&!e.name)throw Error("AppInfo.name is required");e=e||{},this._appInfo=o0.reduce((t,r)=>("string"==typeof e[r]&&((t=t||{})[r]=e[r]),t),{})},_setApiField(e,t){this._api[e]=t},getApiField(e){return this._api[e]},setClientId(e){this._clientId=e},getClientId(){return this._clientId},getConstant:e=>{switch(e){case"DEFAULT_HOST":return oZ;case"DEFAULT_PORT":return"443";case"DEFAULT_BASE_PATH":return o1;case"DEFAULT_API_VERSION":return eu;case"DEFAULT_TIMEOUT":return 8e4;case"MAX_NETWORK_RETRY_DELAY_SEC":return 5;case"INITIAL_NETWORK_RETRY_DELAY_SEC":return .5}return r[e]},getMaxNetworkRetries(){return this.getApiField("maxNetworkRetries")},_setApiNumberField(e,t,r){let s=w(e,t,r);this._setApiField(e,s)},getMaxNetworkRetryDelay:()=>5,getInitialNetworkRetryDelay:()=>.5,getClientUserAgent(e){return this.getClientUserAgentSeeded(r.USER_AGENT,e)},getClientUserAgentSeeded(e,t){this._platformFunctions.getUname().then(r=>{var s;let o={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(o[t]=encodeURIComponent(null!=(s=e[t])?s:"null"));o.uname=encodeURIComponent(r||"UNKNOWN");let n=this.getApiField("httpClient");n&&(o.httplib=encodeURIComponent(n.getClientName())),this._appInfo&&(o.application=this._appInfo),t(JSON.stringify(o))})},getAppInfoAsString(){if(!this._appInfo)return"";let e=this._appInfo.name;return this._appInfo.version&&(e+=`/${this._appInfo.version}`),this._appInfo.url&&(e+=` (${this._appInfo.url})`),e},getTelemetryEnabled(){return this._enableTelemetry},_prepResources(){for(let e in oQ)Object.prototype.hasOwnProperty.call(oQ,e)&&(this["OAuth"===e?"oauth":e[0].toLowerCase()+e.substring(1)]=new oQ[e](this))},_getPropsFromConfig(e){if(!e)return{};let t="string"==typeof e;if(!(e===Object(e)&&!Array.isArray(e))&&!t)throw Error("Config must either be an object or a string");if(t)return{apiVersion:e};if(Object.keys(e).filter(e=>!o2.includes(e)).length>0)throw Error(`Config object may only contain the following: ${o2.join(", ")}`);return e},parseEventNotification(e,t,r,s,o,n){let a=this.webhooks.constructEvent(e,t,r,s,o,n);return a.context&&(a.context=eh.parse(a.context)),a.fetchEvent=()=>this._requestSender._rawRequest("GET",`/v2/core/events/${a.id}`,void 0,{stripeContext:a.context},["fetch_event"]),a.fetchRelatedObject=()=>a.related_object?this._requestSender._rawRequest("GET",a.related_object.url,void 0,{stripeContext:a.context},["fetch_related_object"]):Promise.resolve(null),a}},r}(new class extends N{constructor(){super(),this._exec=Q.exec,this._UNAME_CACHE=null}uuid4(){return r.randomUUID?r.randomUUID():super.uuid4()}getUname(){return this._UNAME_CACHE||(this._UNAME_CACHE=new Promise((e,t)=>{try{this._exec("uname -a",(t,r)=>{if(t)return e(null);e(r)})}catch(t){e(null)}})),this._UNAME_CACHE}secureCompare(e,t){if(!e||!t)throw Error("secureCompare must receive two arguments");if(e.length!==t.length)return!1;if(r.timingSafeEqual){let s=new TextEncoder,o=s.encode(e),n=s.encode(t);return r.timingSafeEqual(o,n)}return super.secureCompare(e,t)}createEmitter(){return new s.EventEmitter}tryBufferData(e){if(!(e.file.data instanceof s.EventEmitter))return Promise.resolve(e);let t=[];return new Promise((r,s)=>{e.file.data.on("data",e=>{t.push(e)}).once("end",()=>{let s,o,n=Object.assign({},e);n.file.data=(s=new Uint8Array(t.reduce((e,t)=>e+t.length,0)),o=0,t.forEach(e=>{s.set(e,o),o+=e.length}),s),r(n)}).on("error",e=>{s(new Z({message:"An error occurred while attempting to process the file for upload.",detail:e}))})})}createNodeHttpClient(e){return new f(e)}createDefaultHttpClient(){return new f}createNodeCryptoProvider(){return new a}createDefaultCryptoProvider(){return this.createNodeCryptoProvider()}}))(process.env.STRIPE_SECRET_KEY||"",{apiVersion:"2026-01-28.clover",typescript:!0});async function o4({amount:e,matchId:t,companyId:r,companyName:s,description:o}){try{let n=await o8.paymentIntents.create({amount:Math.round(100*e),currency:"aud",automatic_payment_methods:{enabled:!0},metadata:{match_id:t,company_id:r,company_name:s,description:o},description:`RateRight Hire Fee - ${o}`});return{clientSecret:n.client_secret,paymentIntentId:n.id}}catch(e){throw console.error("Error creating PaymentIntent:",e),Error("Failed to create payment intent")}}function o5(e,t){let r=process.env.STRIPE_WEBHOOK_SECRET;if(!r)throw Error("STRIPE_WEBHOOK_SECRET is not configured");try{return o8.webhooks.constructEvent(e,t,r)}catch(e){throw console.error("Webhook signature verification failed:",e),Error("Invalid webhook signature")}}e.s(["constructWebhookEvent",()=>o5,"createPaymentIntent",()=>o4],63349)}]; /home/ccuser/rateright-v2/.next/server/app-paths-manifest.json: "/api/webhooks/stripe/route": "app/api/webhooks/stripe/route.js", /home/ccuser/rateright-v2/.next/server/functions-config-manifest.json: "/api/webhooks/stripe": {} /home/ccuser/rateright-v2/node_modules/caniuse-lite/data/regions/US.js:module.exports={C:{"5":0.01068,"11":0.31494,"44":0.01068,"45":0.00534,"52":0.01068,"59":0.00534,"72":0.01068,"78":0.01601,"89":0.00534,"94":0.00534,"114":0.00534,"115":0.1548,"117":0.00534,"118":0.71529,"125":0.01068,"128":0.01601,"132":0.00534,"133":0.01068,"134":0.00534,"135":0.01068,"136":0.01068,"137":0.01601,"138":0.01068,"139":0.01068,"140":0.27224,"141":0.01068,"142":0.01068,"143":0.02669,"144":0.0427,"145":0.79002,"146":1.09429,"147":0.00534,_:"2 3 4 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 46 47 48 49 50 51 53 54 55 56 57 58 60 61 62 63 64 65 66 67 68 69 70 71 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 90 91 92 93 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 116 119 120 121 122 123 124 126 127 129 130 131 148 149 3.5 3.6"},D:{"39":0.01068,"40":0.01068,"41":0.01068,"42":0.01068,"43":0.01068,"44":0.01068,"45":0.01068,"46":0.01068,"47":0.01601,"48":0.03737,"49":0.02135,"50":0.01601,"51":0.01068,"52":0.01601,"53":0.01068,"54":0.01068,"55":0.01068,"56":0.02135,"57":0.01068,"58":0.01601,"59":0.01068,"60":0.01068,"62":0.00534,"66":0.02669,"67":0.00534,"69":0.01068,"74":0.00534,"75":0.00534,"76":0.00534,"77":0.00534,"78":0.00534,"79":0.27224,"80":0.01068,"81":0.02669,"83":0.22953,"84":0.00534,"85":0.01068,"86":0.00534,"87":0.02669,"88":0.00534,"90":0.00534,"91":0.02669,"92":0.00534,"93":0.02135,"96":0.00534,"98":0.00534,"99":0.02135,"100":0.00534,"101":0.01601,"102":0.01068,"103":0.12277,"104":0.02669,"105":0.01601,"106":0.01601,"107":0.02135,"108":0.02135,"109":0.31494,"110":0.01601,"111":0.02669,"112":0.02135,"113":0.01068,"114":0.05338,"115":0.03737,"116":0.14413,"117":0.51245,"118":0.01068,"119":0.01601,"120":0.10142,"121":0.09608,"122":0.08541,"123":0.02669,"124":0.08007,"125":0.4911,"126":0.1121,"127":0.03737,"128":0.09075,"129":0.03203,"130":0.35765,"131":0.64056,"132":0.14413,"133":0.06939,"134":0.05338,"135":0.11744,"136":0.14413,"137":0.10676,"138":0.75266,"139":1.85229,"140":0.82739,"141":2.16189,"142":9.4536,"143":10.17957,"144":0.01601,"145":0.01068,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 61 63 64 65 68 70 71 72 73 89 94 95 97 146"},F:{"92":0.00534,"93":0.05338,"95":0.03203,"102":0.00534,"113":0.00534,"114":0.00534,"117":0.00534,"122":0.00534,"123":0.02135,"124":0.51779,"125":0.18683,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 94 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 115 116 118 119 120 121 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"17":0.00534,"18":0.00534,"91":0.00534,"109":0.04804,"120":0.00534,"122":0.00534,"124":0.00534,"126":0.00534,"128":0.00534,"129":0.00534,"130":0.00534,"131":0.02135,"132":0.01068,"133":0.00534,"134":0.01068,"135":0.01601,"136":0.01068,"137":0.01068,"138":0.02669,"139":0.01601,"140":0.03203,"141":0.12277,"142":1.7562,"143":4.66007,_:"12 13 14 15 16 79 80 81 83 84 85 86 87 88 89 90 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 119 121 123 125 127"},E:{"9":0.00534,"14":0.02135,"15":0.00534,_:"0 4 5 6 7 8 10 11 12 13 3.1 3.2 5.1 6.1 7.1","9.1":0.00534,"10.1":0.00534,"11.1":0.01068,"12.1":0.00534,"13.1":0.04804,"14.1":0.0427,"15.1":0.00534,"15.2-15.3":0.00534,"15.4":0.00534,"15.5":0.02135,"15.6":0.14946,"16.0":0.01068,"16.1":0.01601,"16.2":0.01601,"16.3":0.03203,"16.4":0.01601,"16.5":0.03203,"16.6":0.36832,"17.0":0.01068,"17.1":0.19751,"17.2":0.02135,"17.3":0.03737,"17.4":0.06939,"17.5":0.1121,"17.6":0.46974,"18.0":0.01601,"18.1":0.04804,"18.2":0.02669,"18.3":0.1121,"18.4":0.05872,"18.5-18.6":0.21352,"26.0":0.12277,"26.1":0.77935,"26.2":0.19217,"26.3":0.00534},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00476,"5.0-5.1":0,"6.0-6.1":0.00953,"7.0-7.1":0.00715,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.01905,"10.0-10.2":0.00238,"10.3":0.03334,"11.0-11.2":0.40966,"11.3-11.4":0.01191,"12.0-12.1":0.00953,"12.2-12.5":0.10718,"13.0-13.1":0.00238,"13.2":0.01667,"13.3":0.00476,"13.4-13.7":0.01667,"14.0-14.4":0.03334,"14.5-14.8":0.03573,"15.0-15.1":0.03811,"15.2-15.3":0.02858,"15.4":0.03096,"15.5":0.03334,"15.6-15.8":0.51684,"16.0":0.05954,"16.1":0.11433,"16.2":0.05954,"16.3":0.10718,"16.4":0.0262,"16.5":0.04525,"16.6-16.7":0.67166,"17.0":0.03811,"17.1":0.06193,"17.2":0.04525,"17.3":0.06907,"17.4":0.11671,"17.5":0.22865,"17.6-17.7":0.52875,"18.0":0.11909,"18.1":0.2477,"18.2":0.131,"18.3":0.42634,"18.4":0.21912,"18.5-18.7":15.73398,"26.0":0.30725,"26.1":2.55564,"26.2":0.48588,"26.3":0.02144},P:{"4":0.02145,"21":0.01073,"22":0.01073,"23":0.01073,"24":0.01073,"25":0.01073,"26":0.02145,"27":0.02145,"28":0.08582,"29":1.24435,_:"20 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.01073},I:{"0":0.07446,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00006},A:{"8":0.0172,"9":0.0516,"11":0.086,_:"6 7 10 5.5"},K:{"0":0.27966,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{"2.5":0.00466,_:"3.0-3.1"},J:{_:"7 10"},Q:{"14.9":0.00932},O:{"0":0.01864},H:{"0":0},L:{"0":23.01749},R:{_:"0"},M:{"0":0.51737}}; /home/ccuser/rateright-v2/node_modules/caniuse-lite/data/regions/CU.js:module.exports={C:{"4":0.41828,"5":0.00606,"36":0.00303,"40":0.00303,"48":0.00303,"50":0.00909,"52":0.01212,"54":0.09093,"56":0.00606,"57":0.06971,"60":0.00606,"63":0.00909,"64":0.00606,"65":0.00303,"66":0.02425,"67":0.00303,"68":0.01516,"69":0.00303,"72":0.02122,"79":0.00303,"80":0.00303,"83":0.00303,"84":0.00303,"87":0.00303,"89":0.00303,"90":0.00303,"93":0.00606,"94":0.01212,"95":0.00909,"97":0.00606,"98":0.00303,"99":0.00303,"100":0.00606,"101":0.00303,"102":0.01212,"103":0.00303,"104":0.00606,"106":0.00303,"107":0.00303,"108":0.00606,"109":0.00909,"110":0.01516,"111":0.01819,"112":0.00606,"113":0.02425,"115":0.71229,"116":0.00606,"119":0.00303,"120":0.00606,"122":0.00909,"123":0.00606,"124":0.02122,"126":0.04547,"127":0.10002,"128":0.03637,"129":0.00303,"130":0.00606,"131":0.02122,"132":0.00909,"133":0.01516,"134":0.02728,"135":0.01212,"136":0.02425,"137":0.0394,"138":0.01212,"139":0.01819,"140":0.18489,"141":0.05759,"142":0.0485,"143":0.12427,"144":0.10002,"145":1.88225,"146":2.39752,"147":0.0485,_:"2 3 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 37 38 39 41 42 43 44 45 46 47 49 51 53 55 58 59 61 62 70 71 73 74 75 76 77 78 81 82 85 86 88 91 92 96 105 114 117 118 121 125 148 149 3.5 3.6"},D:{"38":0.00303,"46":0.00303,"47":0.02425,"49":0.00303,"50":0.00303,"51":0.00303,"54":0.00303,"55":0.00303,"62":0.00303,"64":0.00303,"65":0.00303,"69":0.00606,"70":0.00606,"71":0.01516,"72":0.00303,"74":0.00606,"75":0.00909,"77":0.00303,"79":0.00606,"80":0.00606,"81":0.00606,"83":0.00303,"85":0.00606,"86":0.04243,"87":0.00909,"88":0.07274,"89":0.00303,"90":0.03637,"91":0.00303,"93":0.00303,"94":0.00606,"95":0.00303,"96":0.00909,"97":0.00909,"99":0.00606,"101":0.00303,"102":0.01212,"103":0.02122,"104":0.00606,"105":0.01516,"106":0.01212,"107":0.01212,"108":0.00909,"109":0.38191,"110":0.00606,"111":0.02728,"112":0.01516,"113":0.00303,"114":0.01819,"115":0.00303,"116":0.03334,"117":0.01516,"118":0.02425,"119":0.02122,"120":0.03031,"121":0.01212,"122":0.02425,"123":0.01516,"124":0.00909,"125":0.00909,"126":0.09093,"127":0.02122,"128":0.01212,"129":0.01516,"130":0.01819,"131":0.05759,"132":0.03334,"133":0.03031,"134":0.05153,"135":0.03334,"136":0.02122,"137":0.05153,"138":0.0879,"139":0.13943,"140":0.1364,"141":0.19095,"142":2.15201,"143":3.13709,"144":0.00303,"145":0.00303,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 39 40 41 42 43 44 45 48 52 53 56 57 58 59 60 61 63 66 67 68 73 76 78 84 92 98 100 146"},F:{"34":0.00303,"42":0.00303,"45":0.00606,"46":0.00303,"47":0.00303,"50":0.00303,"62":0.09699,"64":0.01212,"71":0.00303,"79":0.01819,"86":0.00303,"87":0.03031,"89":0.00303,"90":0.00303,"92":0.02122,"93":0.06668,"95":0.05759,"98":0.00303,"105":0.00303,"107":0.00303,"108":0.00909,"109":0.00303,"112":0.00606,"114":0.00303,"117":0.00303,"118":0.00909,"119":0.01212,"120":0.04547,"121":0.00606,"122":0.0485,"123":0.02728,"124":0.67894,"125":0.40615,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 35 36 37 38 39 40 41 43 44 48 49 51 52 53 54 55 56 57 58 60 63 65 66 67 68 69 70 72 73 74 75 76 77 78 80 81 82 83 84 85 88 91 94 96 97 99 100 101 102 103 104 106 110 111 113 115 116 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"12":0.01212,"13":0.00303,"14":0.00909,"15":0.00606,"16":0.01212,"17":0.00606,"18":0.02728,"84":0.01819,"89":0.01212,"90":0.00909,"92":0.15458,"96":0.00303,"100":0.06062,"109":0.01212,"113":0.00303,"114":0.00303,"117":0.00303,"119":0.00303,"120":0.00303,"122":0.05153,"123":0.00303,"124":0.00606,"126":0.00909,"128":0.00303,"129":0.00303,"130":0.01212,"131":0.05456,"132":0.00606,"133":0.00909,"134":0.03334,"135":0.01819,"136":0.00909,"137":0.05759,"138":0.04243,"139":0.06062,"140":0.05759,"141":0.10305,"142":0.77897,"143":1.37001,_:"79 80 81 83 85 86 87 88 91 93 94 95 97 98 99 101 102 103 104 105 106 107 108 110 111 112 115 116 118 121 125 127"},E:{"11":0.00606,_:"0 4 5 6 7 8 9 10 12 13 14 15 3.1 3.2 6.1 7.1 9.1 10.1 12.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.3 16.5 17.0 17.2 17.4 17.5 18.0 18.4 26.3","5.1":0.01516,"11.1":0.01212,"13.1":0.00303,"14.1":0.00606,"15.6":0.01819,"16.4":0.00303,"16.6":0.02425,"17.1":0.00303,"17.3":0.00303,"17.6":0.03334,"18.1":0.00303,"18.2":0.00303,"18.3":0.01516,"18.5-18.6":0.00303,"26.0":0.00606,"26.1":0.01212,"26.2":0.01819},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00063,"5.0-5.1":0,"6.0-6.1":0.00127,"7.0-7.1":0.00095,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00253,"10.0-10.2":0.00032,"10.3":0.00443,"11.0-11.2":0.05442,"11.3-11.4":0.00158,"12.0-12.1":0.00127,"12.2-12.5":0.01424,"13.0-13.1":0.00032,"13.2":0.00221,"13.3":0.00063,"13.4-13.7":0.00221,"14.0-14.4":0.00443,"14.5-14.8":0.00475,"15.0-15.1":0.00506,"15.2-15.3":0.0038,"15.4":0.00411,"15.5":0.00443,"15.6-15.8":0.06866,"16.0":0.00791,"16.1":0.01519,"16.2":0.00791,"16.3":0.01424,"16.4":0.00348,"16.5":0.00601,"16.6-16.7":0.08922,"17.0":0.00506,"17.1":0.00823,"17.2":0.00601,"17.3":0.00918,"17.4":0.0155,"17.5":0.03037,"17.6-17.7":0.07024,"18.0":0.01582,"18.1":0.0329,"18.2":0.0174,"18.3":0.05663,"18.4":0.02911,"18.5-18.7":2.09009,"26.0":0.04081,"26.1":0.33949,"26.2":0.06454,"26.3":0.00285},P:{"4":0.03075,"20":0.01025,"21":0.041,"22":0.03075,"23":0.0615,"24":0.27675,"25":0.13325,"26":0.13325,"27":0.205,"28":0.48175,"29":0.94299,_:"5.0-5.4 6.2-6.4 8.2 10.1 12.0 18.0","7.2-7.4":0.11275,"9.2":0.09225,"11.1-11.2":0.01025,"13.0":0.01025,"14.0":0.0205,"15.0":0.01025,"16.0":0.05125,"17.0":0.3075,"19.0":0.0205},I:{"0":0.08349,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00002,"4.4":0,"4.4.3-4.4.4":0.00007},A:{"11":0.02122,_:"6 7 8 9 10 5.5"},K:{"0":0.75659,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{_:"14.9"},O:{"0":0.03485},H:{"0":0.01},L:{"0":72.49627},R:{_:"0"},M:{"0":0.36936}}; /home/ccuser/rateright-v2/node_modules/caniuse-lite/data/regions/HT.js:module.exports={C:{"5":0.0073,"46":0.00487,"52":0.01704,"112":0.00974,"115":0.01217,"127":0.00243,"128":0.0073,"140":0.01704,"142":0.0073,"143":0.00487,"144":0.00974,"145":0.09736,"146":0.16064,_:"2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 113 114 116 117 118 119 120 121 122 123 124 125 126 129 130 131 132 133 134 135 136 137 138 139 141 147 148 149 3.5 3.6"},D:{"11":0.00243,"43":0.00974,"49":0.00243,"54":0.00243,"55":0.00243,"60":0.00243,"64":0.00243,"69":0.02677,"70":0.0073,"73":0.04381,"74":0.00487,"75":0.00243,"76":0.00487,"77":0.00487,"79":0.00974,"80":0.00487,"81":0.00487,"83":0.00243,"86":0.00487,"87":0.03651,"88":0.01947,"89":0.00243,"90":0.00487,"91":0.00487,"92":0.0073,"93":0.06815,"94":0.00487,"98":0.0073,"99":0.00487,"101":0.00243,"102":0.0073,"103":0.10223,"104":0.00243,"105":0.03164,"106":0.00243,"107":0.00243,"108":0.05111,"109":0.22393,"110":0.01217,"111":0.11927,"113":0.00487,"114":0.06815,"115":0.00243,"116":0.03164,"117":0.02677,"118":0.00243,"119":0.08519,"120":0.1071,"121":0.00487,"122":0.0073,"123":0.00243,"124":0.00243,"125":0.24583,"126":0.07789,"127":0.05598,"128":0.05111,"129":0.00487,"130":0.08032,"131":0.03894,"132":0.02434,"133":0.01947,"134":0.02434,"135":0.02191,"136":0.03894,"137":0.06328,"138":0.17768,"139":0.15578,"140":0.16308,"141":0.21663,"142":2.73338,"143":4.45909,"144":0.01704,"145":0.01217,_:"4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 45 46 47 48 50 51 52 53 56 57 58 59 61 62 63 65 66 67 68 71 72 78 84 85 95 96 97 100 112 146"},F:{"79":0.00243,"84":0.00243,"90":0.00243,"93":0.01704,"95":0.0146,"113":0.00243,"119":0.00243,"120":0.00243,"122":0.00487,"123":0.01217,"124":0.33346,"125":0.3505,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 85 86 87 88 89 91 92 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 114 115 116 117 118 121 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"12":0.0073,"13":0.00487,"14":0.0073,"15":0.00487,"16":0.00487,"17":0.01217,"18":0.03651,"84":0.00487,"85":0.00243,"88":0.00243,"90":0.00487,"92":0.04625,"93":0.00243,"98":0.00243,"100":0.0146,"103":0.00243,"106":0.00243,"109":0.05598,"114":0.00487,"116":0.00243,"117":0.00243,"119":0.00243,"122":0.01947,"124":0.00243,"128":0.00243,"129":0.00243,"130":0.00487,"131":0.00487,"132":0.00243,"133":0.00243,"134":0.00243,"135":0.00243,"136":0.01704,"137":0.00974,"138":0.0073,"139":0.01947,"140":0.01217,"141":0.03894,"142":0.80565,"143":2.76989,_:"79 80 81 83 86 87 89 91 94 95 96 97 99 101 102 104 105 107 108 110 111 112 113 115 118 120 121 123 125 126 127"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 6.1 7.1 10.1 15.2-15.3 15.4 15.5 16.0 16.1 16.4 17.2","5.1":0.00974,"9.1":0.00243,"11.1":0.0073,"12.1":0.00243,"13.1":0.04868,"14.1":0.02191,"15.1":0.00243,"15.6":0.04868,"16.2":0.00974,"16.3":0.00487,"16.5":0.00487,"16.6":0.06085,"17.0":0.0073,"17.1":0.01217,"17.3":0.00243,"17.4":0.00243,"17.5":0.0073,"17.6":0.07789,"18.0":0.00243,"18.1":0.00487,"18.2":0.00243,"18.3":0.00974,"18.4":0.0073,"18.5-18.6":0.04381,"26.0":0.06328,"26.1":0.22149,"26.2":0.1363,"26.3":0.02677},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00164,"5.0-5.1":0,"6.0-6.1":0.00328,"7.0-7.1":0.00246,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00657,"10.0-10.2":0.00082,"10.3":0.01149,"11.0-11.2":0.1412,"11.3-11.4":0.0041,"12.0-12.1":0.00328,"12.2-12.5":0.03694,"13.0-13.1":0.00082,"13.2":0.00575,"13.3":0.00164,"13.4-13.7":0.00575,"14.0-14.4":0.01149,"14.5-14.8":0.01231,"15.0-15.1":0.01313,"15.2-15.3":0.00985,"15.4":0.01067,"15.5":0.01149,"15.6-15.8":0.17814,"16.0":0.02052,"16.1":0.0394,"16.2":0.02052,"16.3":0.03694,"16.4":0.00903,"16.5":0.0156,"16.6-16.7":0.2315,"17.0":0.01313,"17.1":0.02134,"17.2":0.0156,"17.3":0.02381,"17.4":0.04022,"17.5":0.07881,"17.6-17.7":0.18224,"18.0":0.04105,"18.1":0.08537,"18.2":0.04515,"18.3":0.14694,"18.4":0.07552,"18.5-18.7":5.42294,"26.0":0.1059,"26.1":0.88084,"26.2":0.16747,"26.3":0.00739},P:{"4":0.03099,"21":0.05164,"22":0.03099,"23":0.02066,"24":0.11362,"25":0.08263,"26":0.03099,"27":0.20658,"28":0.22724,"29":0.70236,_:"20 10.1 12.0 15.0 17.0","5.0-5.4":0.04132,"6.2-6.4":0.01033,"7.2-7.4":0.04132,"8.2":0.01033,"9.2":0.02066,"11.1-11.2":0.04132,"13.0":0.04132,"14.0":0.01033,"16.0":0.09296,"18.0":0.02066,"19.0":0.01033},I:{"0":0.18885,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00004,"4.4":0,"4.4.3-4.4.4":0.00015},A:{_:"6 7 8 9 10 11 5.5"},K:{"0":0.44639,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{_:"14.9"},O:{"0":0.03026},H:{"0":0},L:{"0":72.27352},R:{_:"0"},M:{"0":0.18158}}; /home/ccuser/rateright-v2/node_modules/caniuse-lite/data/regions/MQ.js:module.exports={C:{"5":0.0043,"52":0.0043,"115":0.07736,"122":0.0043,"127":0.0043,"128":0.0086,"136":0.0086,"137":0.01289,"140":0.03009,"142":0.0086,"143":0.01719,"144":0.01289,"145":2.01146,"146":1.74499,_:"2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 123 124 125 126 129 130 131 132 133 134 135 138 139 141 147 148 149 3.5 3.6"},D:{"56":0.0043,"58":0.0043,"65":0.0043,"69":0.0043,"79":0.03009,"87":0.01289,"88":0.01289,"91":0.0043,"92":0.0043,"93":0.0043,"100":0.0043,"102":0.0043,"103":0.01289,"104":0.0086,"105":0.0043,"106":0.0043,"108":0.02579,"109":0.27937,"110":0.0086,"111":0.01289,"114":0.0086,"116":0.02149,"119":0.01719,"120":0.06447,"121":0.01289,"122":0.0086,"123":0.0043,"125":0.25788,"126":0.07307,"127":0.0086,"128":0.05158,"129":0.0086,"130":0.0043,"131":0.30946,"132":0.03868,"133":0.01719,"134":0.02149,"135":0.0086,"136":0.01719,"137":0.0086,"138":0.06447,"139":0.12034,"140":0.48138,"141":0.2106,"142":5.88396,"143":10.92981,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 57 59 60 61 62 63 64 66 67 68 70 71 72 73 74 75 76 77 78 80 81 83 84 85 86 89 90 94 95 96 97 98 99 101 107 112 113 115 117 118 124 144 145 146"},F:{"36":0.01719,"40":0.0043,"46":0.01289,"90":0.0043,"93":0.06017,"112":0.0043,"114":0.0043,"122":0.0043,"123":0.07736,"124":0.80373,"125":1.19484,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 37 38 39 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 91 92 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 113 115 116 117 118 119 120 121 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"17":0.0043,"18":0.0043,"92":0.0043,"109":0.0043,"122":0.0043,"123":0.0043,"125":0.0043,"129":0.0043,"131":0.0043,"132":0.0043,"133":0.0086,"135":0.0043,"136":0.01289,"137":0.01289,"138":0.0086,"139":0.04728,"140":0.18911,"141":0.2063,"142":1.63324,"143":3.67049,_:"12 13 14 15 16 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 119 120 121 124 126 127 128 130 134"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 16.4","13.1":0.04298,"14.1":0.0086,"15.5":0.11175,"15.6":0.07736,"16.0":0.0043,"16.1":0.05587,"16.2":0.01289,"16.3":0.02149,"16.5":0.03438,"16.6":0.12034,"17.0":0.0043,"17.1":0.04298,"17.2":0.02149,"17.3":0.0043,"17.4":0.0086,"17.5":0.06447,"17.6":0.28367,"18.0":0.01289,"18.1":0.0086,"18.2":0.03438,"18.3":0.14183,"18.4":0.02579,"18.5-18.6":0.32665,"26.0":0.19771,"26.1":0.54585,"26.2":0.18052,"26.3":0.0043},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00278,"5.0-5.1":0,"6.0-6.1":0.00556,"7.0-7.1":0.00417,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.01111,"10.0-10.2":0.00139,"10.3":0.01945,"11.0-11.2":0.23891,"11.3-11.4":0.00695,"12.0-12.1":0.00556,"12.2-12.5":0.06251,"13.0-13.1":0.00139,"13.2":0.00972,"13.3":0.00278,"13.4-13.7":0.00972,"14.0-14.4":0.01945,"14.5-14.8":0.02084,"15.0-15.1":0.02222,"15.2-15.3":0.01667,"15.4":0.01806,"15.5":0.01945,"15.6-15.8":0.30141,"16.0":0.03473,"16.1":0.06667,"16.2":0.03473,"16.3":0.06251,"16.4":0.01528,"16.5":0.02639,"16.6-16.7":0.3917,"17.0":0.02222,"17.1":0.03611,"17.2":0.02639,"17.3":0.04028,"17.4":0.06806,"17.5":0.13334,"17.6-17.7":0.30836,"18.0":0.06945,"18.1":0.14446,"18.2":0.0764,"18.3":0.24863,"18.4":0.12779,"18.5-18.7":9.17578,"26.0":0.17918,"26.1":1.4904,"26.2":0.28336,"26.3":0.0125},P:{"21":0.04188,"22":0.01047,"23":0.01047,"24":0.08375,"25":0.13609,"26":0.31406,"27":0.08375,"28":0.29313,"29":3.51752,_:"4 20 5.0-5.4 6.2-6.4 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.09422,"8.2":0.01047},I:{"0":0.02277,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00002},A:{_:"6 7 8 9 10 11 5.5"},K:{"0":0.25659,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{_:"14.9"},O:{"0":0.0057},H:{"0":0},L:{"0":42.58728},R:{_:"0"},M:{"0":0.47897}};