211 lines
608 KiB
JavaScript
211 lines
608 KiB
JavaScript
|
|
"use strict";var FD=Object.create;var Hi=Object.defineProperty;var ND=Object.getOwnPropertyDescriptor;var xD=Object.getOwnPropertyNames;var LD=Object.getPrototypeOf,UD=Object.prototype.hasOwnProperty;var wd=e=>{throw TypeError(e)};var TD=(e,A,t)=>A in e?Hi(e,A,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[A]=t;var Q=(e,A)=>()=>(A||e((A={exports:{}}).exports,A),A.exports),Wi=(e,A)=>{for(var t in A)Hi(e,t,{get:A[t],enumerable:!0})},Rd=(e,A,t,r)=>{if(A&&typeof A=="object"||typeof A=="function")for(let n of xD(A))!UD.call(e,n)&&n!==t&&Hi(e,n,{get:()=>A[n],enumerable:!(r=ND(A,n))||r.enumerable});return e};var Z=(e,A,t)=>(t=e!=null?FD(LD(e)):{},Rd(A||!e||!e.__esModule?Hi(t,"default",{value:e,enumerable:!0}):t,e)),MD=e=>Rd(Hi({},"__esModule",{value:!0}),e);var Dd=(e,A,t)=>TD(e,typeof A!="symbol"?A+"":A,t),Hg=(e,A,t)=>A.has(e)||wd("Cannot "+t);var f=(e,A,t)=>(Hg(e,A,"read from private field"),t?t.call(e):A.get(e)),Ne=(e,A,t)=>A.has(e)?wd("Cannot add the same private member more than once"):A instanceof WeakSet?A.add(e):A.set(e,t),Ae=(e,A,t,r)=>(Hg(e,A,"write to private field"),r?r.call(e,t):A.set(e,t),t),MA=(e,A,t)=>(Hg(e,A,"access private method"),t);var Xd=Q((LV,Zd)=>{"use strict";Zd.exports=Kd;Kd.sync=yb;var _d=require("fs");function mb(e,A){var t=A.pathExt!==void 0?A.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var r=0;r<t.length;r++){var n=t[r].toLowerCase();if(n&&e.substr(-n.length).toLowerCase()===n)return!0}return!1}function jd(e,A,t){return!e.isSymbolicLink()&&!e.isFile()?!1:mb(A,t)}function Kd(e,A,t){_d.stat(e,function(r,n){t(r,r?!1:jd(n,e,A))})}function yb(e,A){return jd(_d.statSync(e),e,A)}});var tQ=Q((UV,AQ)=>{"use strict";AQ.exports=$d;$d.sync=wb;var zd=require("fs");function $d(e,A,t){zd.stat(e,function(r,n){t(r,r?!1:eQ(n,A))})}function wb(e,A){return eQ(zd.statSync(e),A)}function eQ(e,A){return e.isFile()&&Rb(e,A)}function Rb(e,A){var t=e.mode,r=e.uid,n=e.gid,i=A.uid!==void 0?A.uid:process.getuid&&process.getuid(),s=A.gid!==void 0?A.gid:process.getgid&&process.getgid(),o=parseInt("100",8),a=parseInt("010",8),c=parseInt("001",8),g=o|a,l=t&c||t&a&&n===s||t&o&&r===i||t&g&&i===0;return l}});var nQ=Q((MV,rQ)=>{"use strict";var TV=require("fs"),_o;process.platform==="win32"||global.TESTING_WINDOWS?_o=Xd():_o=tQ();rQ.exports=tl;tl.sync=Db;function tl(e,A,t){if(typeof A=="function"&&(t=A,A={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,n){tl(e,A||{},function(i,s){i?n(i):r(s)})})}_o(e,A||{},function(r,n){r&&(r.code==="EACCES"||A&&A.ignoreErrors)&&(r=null,n=!1),t(r,n)})}function Db(e,A){try{return _o.sync(e,A||{})}catch(t){if(A&&A.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var lQ=Q((vV,gQ)=>{"use strict";var Cn=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",iQ=require("path"),bb=Cn?";":":",sQ=nQ(),oQ=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),aQ=(e,A)=>{let t=A.colon||bb,r=e.match(/\//)||Cn&&e.match(/\\/)?[""]:[...Cn?[process.cwd()]:[],...(A.path||process.env.PATH||"").split(t)],n=Cn?A.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=Cn?n.split(t):[""];return Cn&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:r,pathExt:i,pathExtExe:n}},cQ=(e,A,t)=>{typeof A=="function"&&(t=A,A={}),A||(A={});let{pathEnv:r,pathExt:n,pathExtExe:i}=aQ(e,A),s=[],o=c=>new Promise((g,l)=>{if(c===r.length)return A.all&&s.length?g(s):l(oQ(e));let u=r[c],E=/^".*"$/.test(u)?u.slice(1,-1):u,h=iQ.join(E,e),d=!E&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;g(a(d,c,0))}),a=(c,g,l)=>new Promise((u,E)=>{if(l===n.length)return u(o(g+1));let h=n[l];sQ(c+h,{pathExt:i},(d,C)=>{if(!d&&C)if(A.all)s.push(c+h);else return u(c+h);return u(a(c,g,l+1))})});return t?o(0).then(c=>t(null,c),t):o(0)},kb=(e,A)=>{A=A||{};let{pathEnv:t,pathExt:r,pathExtExe:n}=aQ(e,A),i=[];for(let s=0;s<t.length;s++){let o=t[s],a=/^".*"$/.test(o)?o.slice(1,-1):o,c=iQ.join(a,e),g=!a&&/^\.[\\\/]/.test(e)?e.slice(0,2)+c:c;for(let l=0;l<r.length;l++){let u=g+r[l];try{if(sQ.sync(u,{pathExt:n}))if(A.all)i.p
|
||
|
|
`:10,t=typeof e=="string"?"\r":13;return e[e.length-1]===A&&(e=e.slice(0,e.length-1)),e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e}});var PQ=Q((jV,zi)=>{"use strict";var Xi=require("path"),MQ=nl(),vQ=e=>{e={cwd:process.cwd(),path:process.env[MQ()],execPath:process.execPath,...e};let A,t=Xi.resolve(e.cwd),r=[];for(;A!==t;)r.push(Xi.join(t,"node_modules/.bin")),A=t,t=Xi.resolve(t,"..");let n=Xi.resolve(e.cwd,e.execPath,"..");return r.push(n),r.concat(e.path).join(Xi.delimiter)};zi.exports=vQ;zi.exports.default=vQ;zi.exports.env=e=>{e={env:process.env,...e};let A={...e.env},t=MQ({env:A});return e.path=A[t],A[t]=zi.exports(e),A}});var JQ=Q((KV,ul)=>{"use strict";var GQ=(e,A)=>{for(let t of Reflect.ownKeys(A))Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t));return e};ul.exports=GQ;ul.exports.default=GQ});var VQ=Q((ZV,Ko)=>{"use strict";var jb=JQ(),jo=new WeakMap,YQ=(e,A={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let t,r=0,n=e.displayName||e.name||"<anonymous>",i=function(...s){if(jo.set(i,++r),r===1)t=e.apply(this,s),e=null;else if(A.throw===!0)throw new Error(`Function \`${n}\` can only be called once`);return t};return jb(i,e),jo.set(i,r),i};Ko.exports=YQ;Ko.exports.default=YQ;Ko.exports.callCount=e=>{if(!jo.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return jo.get(e)}});var qQ=Q(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.SIGNALS=void 0;var Kb=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",descrip
|
||
|
|
${r.message}`:d,p=[I,A,e].filter(Boolean).join(`
|
||
|
|
`);return C?(r.originalMessage=r.message,r.message=p):r=new Error(p),r.shortMessage=I,r.command=s,r.escapedCommand=o,r.exitCode=i,r.signal=n,r.signalDescription=u,r.stdout=e,r.stderr=A,t!==void 0&&(r.all=t),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!a,r.isCanceled=c,r.killed=g&&!a,r};KQ.exports=hk});var zQ=Q((tq,hl)=>{"use strict";var zo=["stdin","stdout","stderr"],dk=e=>zo.some(A=>e[A]!==void 0),XQ=e=>{if(!e)return;let{stdio:A}=e;if(A===void 0)return zo.map(r=>e[r]);if(dk(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${zo.map(r=>`\`${r}\``).join(", ")}`);if(typeof A=="string")return A;if(!Array.isArray(A))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof A}\``);let t=Math.max(A.length,zo.length);return Array.from({length:t},(r,n)=>A[n])};hl.exports=XQ;hl.exports.node=e=>{let A=XQ(e);return A==="ipc"?"ipc":A===void 0||typeof A=="string"?[A,A,A,"ipc"]:A.includes("ipc")?A:[...A,"ipc"]}});var $Q=Q((rq,$o)=>{"use strict";$o.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&$o.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&$o.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var nC=Q((nq,yn)=>{"use strict";var we=global.process,Mr=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};Mr(we)?(eC=require("assert"),pn=$Q(),AC=/^win/i.test(we.platform),$i=require("events"),typeof $i!="function"&&($i=$i.EventEmitter),we.__signal_exit_emitter__?qe=we.__signal_exit_emitter__:(qe=we.__signal_exit_emitter__=new $i,qe.count=0,qe.emitted={}),qe.infinite||(qe.setMaxListeners(1/0),qe.infinite=!0),yn.exports=function(e,A){if(!Mr(global.process))return function(){};eC.equal(typeof e,"function","a callback must be provided for exit handler"),mn===!1&&dl();var t="exit";A&&A.alwaysLast&&(t="afterexit");var r=function(){qe.removeListener(t,e),qe.listeners("exit").length===0&&qe.listeners("afterexit").length===0&&ea()};return qe.on(t,e),r},ea=function(){!mn||!Mr(global.process)||(mn=!1,pn.forEach(function(A){try{we.removeListener(A,Aa[A])}catch{}}),we.emit=ta,we.reallyExit=Ql,qe.count-=1)},yn.exports.unload=ea,vr=function(A,t,r){qe.emitted[A]||(qe.emitted[A]=!0,qe.emit(A,t,r))},Aa={},pn.forEach(function(e){Aa[e]=function(){if(Mr(global.process)){var t=we.listeners(e);t.length===qe.count&&(ea(),vr("exit",null,e),vr("afterexit",null,e),AC&&e==="SIGHUP"&&(e="SIGINT"),we.kill(we.pid,e))}}}),yn.exports.signals=function(){return pn},mn=!1,dl=function(){mn||!Mr(global.process)||(mn=!0,qe.count+=1,pn=pn.filter(function(A){try{return we.on(A,Aa[A]),!0}catch{return!1}}),we.emit=rC,we.reallyExit=tC)},yn.exports.load=dl,Ql=we.reallyExit,tC=function(A){Mr(global.process)&&(we.exitCode=A||0,vr("exit",we.exitCode,null),vr("afterexit",we.exitCode,null),Ql.call(we,we.exitCode))},ta=we.emit,rC=function(A,t){if(A==="exit"&&Mr(global.process)){t!==void 0&&(we.exitCode=t);var r=ta.apply(this,arguments);return vr("exit",we.exitCode,null),vr("afterexit",we.exitCode,null),r}else return ta.apply(this,arguments)}):yn.exports=function(){return function(){}};var eC,pn,AC,$i,qe,ea,vr,Aa,mn,dl,Ql,tC,ta,rC});var sC=Q((iq,iC)=>{"use strict";var Qk=require("os"),Ck=nC(),fk=1e3*5,Ik=(e,A="SIGTERM",t={})=>{let r=e(A);return Bk(e,A,t,r),r},Bk=(e,A,t,r)=>{if(!pk(A,t,r))return;let n=yk(t),i=setTimeout(()=>{e("SIGKILL")},n);i.unref&&i.unref()},pk=(e,{forceKillAfterTimeout:A},t)=>mk(e)&&A!==!1&&t,mk=e=>e===Qk.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",yk=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return fk;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},wk=(e,A)=>{e.kill()&&(A.isCanceled=!0)},Rk=(e,A,t)=>{e.kill(A),t(
|
||
|
|
`);let r;for(;(r=kS.exec(t))!=null;){let n=r[1],i=r[2]||"";i=i.trim();let s=i[0];i=i.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(i=i.replace(/\\n/g,`
|
||
|
|
`),i=i.replace(/\\r/g,"\r")),A[n]=i}return A}function Dl(e){console.log(`[dotenv@${bS}][DEBUG] ${e}`)}function FS(e){return e[0]==="~"?GC.join(RS.homedir(),e.slice(1)):e}function NS(e){let A=GC.resolve(process.cwd(),".env"),t="utf8",r=!!(e&&e.debug),n=!!(e&&e.override);e&&(e.path!=null&&(A=FS(e.path)),e.encoding!=null&&(t=e.encoding));try{let i=ca.parse(wS.readFileSync(A,{encoding:t}));return Object.keys(i).forEach(function(s){Object.prototype.hasOwnProperty.call(process.env,s)?(n===!0&&(process.env[s]=i[s]),r&&Dl(n===!0?`"${s}" is already defined in \`process.env\` and WAS overwritten`:`"${s}" is already defined in \`process.env\` and was NOT overwritten`)):process.env[s]=i[s]}),{parsed:i}}catch(i){return r&&Dl(`Failed to load ${A} ${i.message}`),{error:i}}}var ca={config:NS,parse:SS};ga.exports.config=ca.config;ga.exports.parse=ca.parse;ga.exports=ca});var WC=Q((_q,HC)=>{"use strict";HC.exports=e=>{let A=e.match(/^[ \t]*(?=\S)/gm);return A?A.reduce((t,r)=>Math.min(t,r.length),1/0):0}});var jC=Q((jq,_C)=>{"use strict";var TS=WC();_C.exports=e=>{let A=TS(e);if(A===0)return e;let t=new RegExp(`^[ \\t]{${A}}`,"gm");return e.replace(t,"")}});var Fl=Q((eO,KC)=>{"use strict";KC.exports=(e,A=1,t)=>{if(t={indent:" ",includeEmptyLines:!1,...t},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof A!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof A}\``);if(typeof t.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof t.indent}\``);if(A===0)return e;let r=t.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(r,t.indent.repeat(A))}});var $C=Q((rO,zC)=>{"use strict";zC.exports=({onlyFirst:e=!1}={})=>{let A=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(A,e?void 0:"g")}});var Ul=Q((nO,ef)=>{"use strict";var qS=$C();ef.exports=e=>typeof e=="string"?e.replace(qS(),""):e});var tf=Q((oO,Ea)=>{"use strict";Ea.exports=(e={})=>{let A;if(e.repoUrl)A=e.repoUrl;else if(e.user&&e.repo)A=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");let t=new URL(`${A}/issues/new`),r=["body","title","labels","template","milestone","assignee","projects"];for(let n of r){let i=e[n];if(i!==void 0){if(n==="labels"||n==="projects"){if(!Array.isArray(i))throw new TypeError(`The \`${n}\` option should be an array`);i=i.join(",")}t.searchParams.set(n,i)}}return t.toString()};Ea.exports.default=Ea.exports});var Ol=Q((fH,Rf)=>{"use strict";Rf.exports=function(){function e(A,t,r,n,i){return A<t||r<t?A>r?r+1:A+1:n===i?t:t+1}return function(A,t){if(A===t)return 0;if(A.length>t.length){var r=A;A=t,t=r}for(var n=A.length,i=t.length;n>0&&A.charCodeAt(n-1)===t.charCodeAt(i-1);)n--,i--;for(var s=0;s<n&&A.charCodeAt(s)===t.charCodeAt(s);)s++;if(n-=s,i-=s,n===0||i<3)return i;var o=0,a,c,g,l,u,E,h,d,C,I,p,w,m=[];for(a=0;a<n;a++)m.push(a+1),m.push(A.charCodeAt(s+a));for(var K=m.length-1;o<i-3;)for(C=t.charCodeAt(s+(c=o)),I=t.charCodeAt(s+(g=o+1)),p=t.charCodeAt(s+(l=o+2)),w=t.charCodeAt(s+(u=o+3)),E=o+=4,a=0;a<K;a+=2)h=m[a],d=m[a+1],c=e(h,c,g,C,d),g=e(c,g,l,I,d),l=e(g,l,u,p,d),E=e(l,u,E,w,d),m[a]=E,u=l,l=g,g=c,c=h;for(;o<i;)for(C=t.charCodeAt(s+(c=o)),E=++o,a=0;a<K;a+=2)h=m[a],m[a]=E=e(h,c,E,C,m[a+1]),c=h;return E}}()});var de=Q((j4,_I)=>{"use strict";_I.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kHeadersList:Symbol("headers list"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:
|
||
|
|
\r
|
||
|
|
`),hL=/\r\n/g,dL=/^([^:]+):[ \t]?([\x00-\xFF]+)?$/;function _n(e){CB.call(this),e=e||{};let A=this;this.nread=0,this.maxed=!1,this.npairs=0,this.maxHeaderPairs=QB(e,"maxHeaderPairs",2e3),this.maxHeaderSize=QB(e,"maxHeaderSize",80*1024),this.buffer="",this.header={},this.finished=!1,this.ss=new uL(EL),this.ss.on("info",function(t,r,n,i){r&&!A.maxed&&(A.nread+i-n>=A.maxHeaderSize?(i=A.maxHeaderSize-A.nread+n,A.nread=A.maxHeaderSize,A.maxed=!0):A.nread+=i-n,A.buffer+=r.toString("binary",n,i)),t&&A._finish()})}lL(_n,CB);_n.prototype.push=function(e){let A=this.ss.push(e);if(this.finished)return A};_n.prototype.reset=function(){this.finished=!1,this.buffer="",this.header={},this.ss.reset()};_n.prototype._finish=function(){this.buffer&&this._parseHeader(),this.ss.matches=this.ss.maxMatches;let e=this.header;this.header={},this.buffer="",this.finished=!0,this.nread=this.npairs=0,this.maxed=!1,this.emit("header",e)};_n.prototype._parseHeader=function(){if(this.npairs===this.maxHeaderPairs)return;let e=this.buffer.split(hL),A=e.length,t,r;for(var n=0;n<A;++n){if(e[n].length===0)continue;if((e[n][0]===" "||e[n][0]===" ")&&r){this.header[r][this.header[r].length-1]+=e[n];continue}let i=e[n].indexOf(":");if(i===-1||i===0)return;if(t=dL.exec(e[n]),r=t[1].toLowerCase(),this.header[r]=this.header[r]||[],this.header[r].push(t[2]||""),++this.npairs===this.maxHeaderPairs)break}};fB.exports=_n});var Gu=Q((rj,pB)=>{"use strict";var Pu=require("stream").Writable,QL=require("util").inherits,CL=Mu(),BB=hB(),fL=IB(),IL=45,BL=Buffer.from("-"),pL=Buffer.from(`\r
|
||
|
|
`),mL=function(){};function zA(e){if(!(this instanceof zA))return new zA(e);if(Pu.call(this,e),!e||!e.headerFirst&&typeof e.boundary!="string")throw new TypeError("Boundary required");typeof e.boundary=="string"?this.setBoundary(e.boundary):this._bparser=void 0,this._headerFirst=e.headerFirst,this._dashes=0,this._parts=0,this._finished=!1,this._realFinish=!1,this._isPreamble=!0,this._justMatched=!1,this._firstWrite=!0,this._inHeader=!0,this._part=void 0,this._cb=void 0,this._ignoreData=!1,this._partOpts={highWaterMark:e.partHwm},this._pause=!1;let A=this;this._hparser=new fL(e),this._hparser.on("header",function(t){A._inHeader=!1,A._part.emit("header",t)})}QL(zA,Pu);zA.prototype.emit=function(e){if(e==="finish"&&!this._realFinish){if(!this._finished){let A=this;process.nextTick(function(){if(A.emit("error",new Error("Unexpected end of multipart data")),A._part&&!A._ignoreData){let t=A._isPreamble?"Preamble":"Part";A._part.emit("error",new Error(t+" terminated early due to unexpected end of multipart data")),A._part.push(null),process.nextTick(function(){A._realFinish=!0,A.emit("finish"),A._realFinish=!1});return}A._realFinish=!0,A.emit("finish"),A._realFinish=!1})}}else Pu.prototype.emit.apply(this,arguments)};zA.prototype._write=function(e,A,t){if(!this._hparser&&!this._bparser)return t();if(this._headerFirst&&this._isPreamble){this._part||(this._part=new BB(this._partOpts),this._events.preamble?this.emit("preamble",this._part):this._ignore());let r=this._hparser.push(e);if(!this._inHeader&&r!==void 0&&r<e.length)e=e.slice(r);else return t()}this._firstWrite&&(this._bparser.push(pL),this._firstWrite=!1),this._bparser.push(e),this._pause?this._cb=t:t()};zA.prototype.reset=function(){this._part=void 0,this._bparser=void 0,this._hparser=void 0};zA.prototype.setBoundary=function(e){let A=this;this._bparser=new CL(`\r
|
||
|
|
--`+e),this._bparser.on("info",function(t,r,n,i){A._oninfo(t,r,n,i)})};zA.prototype._ignore=function(){this._part&&!this._ignoreData&&(this._ignoreData=!0,this._part.on("error",mL),this._part.resume())};zA.prototype._oninfo=function(e,A,t,r){let n,i=this,s=0,o,a=!0;if(!this._part&&this._justMatched&&A){for(;this._dashes<2&&t+s<r;)if(A[t+s]===IL)++s,++this._dashes;else{this._dashes&&(n=BL),this._dashes=0;break}if(this._dashes===2&&(t+s<r&&this._events.trailer&&this.emit("trailer",A.slice(t+s,r)),this.reset(),this._finished=!0,i._parts===0&&(i._realFinish=!0,i.emit("finish"),i._realFinish=!1)),this._dashes)return}this._justMatched&&(this._justMatched=!1),this._part||(this._part=new BB(this._partOpts),this._part._read=function(c){i._unpause()},this._isPreamble&&this._events.preamble?this.emit("preamble",this._part):this._isPreamble!==!0&&this._events.part?this.emit("part",this._part):this._ignore(),this._isPreamble||(this._inHeader=!0)),A&&t<r&&!this._ignoreData&&(this._isPreamble||!this._inHeader?(n&&(a=this._part.push(n)),a=this._part.push(A.slice(t,r)),a||(this._pause=!0)):!this._isPreamble&&this._inHeader&&(n&&this._hparser.push(n),o=this._hparser.push(A.slice(t,r)),!this._inHeader&&o!==void 0&&o<r&&this._oninfo(!1,A,t+o,r))),e&&(this._hparser.reset(),this._isPreamble?this._isPreamble=!1:t!==r&&(++this._parts,this._part.on("end",function(){--i._parts===0&&(i._finished?(i._realFinish=!0,i.emit("finish"),i._realFinish=!1):i._unpause())})),this._part.push(null),this._part=void 0,this._ignoreData=!1,this._justMatched=!0,this._dashes=0)};zA.prototype._unpause=function(){if(this._pause&&(this._pause=!1,this._cb)){let e=this._cb;this._cb=void 0,e()}};pB.exports=zA});var za=Q((nj,yB)=>{"use strict";var mB=new TextDecoder("utf-8"),Xa=new Map([["utf-8",mB],["utf8",mB]]);function yL(e,A,t){if(e)if(Xa.has(t))try{return Xa.get(t).decode(Buffer.from(e,A))}catch{}else try{return Xa.set(t,new TextDecoder(t)),Xa.get(t).decode(Buffer.from(e,A))}catch{}return e}yB.exports=yL});var Ju=Q((ij,DB)=>{"use strict";var $a=za(),wB=/%([a-fA-F0-9]{2})/g;function RB(e,A){return String.fromCharCode(parseInt(A,16))}function wL(e){let A=[],t="key",r="",n=!1,i=!1,s=0,o="";for(var a=0,c=e.length;a<c;++a){let g=e[a];if(g==="\\"&&n)if(i)i=!1;else{i=!0;continue}else if(g==='"')if(i)i=!1;else{n?(n=!1,t="key"):n=!0;continue}else if(i&&n&&(o+="\\"),i=!1,(t==="charset"||t==="lang")&&g==="'"){t==="charset"?(t="lang",r=o.substring(1)):t="value",o="";continue}else if(t==="key"&&(g==="*"||g==="=")&&A.length){g==="*"?t="charset":t="value",A[s]=[o,void 0],o="";continue}else if(!n&&g===";"){t="key",r?(o.length&&(o=$a(o.replace(wB,RB),"binary",r)),r=""):o.length&&(o=$a(o,"binary","utf8")),A[s]===void 0?A[s]=o:A[s][1]=o,o="",++s;continue}else if(!n&&(g===" "||g===" "))continue;o+=g}return r&&o.length?o=$a(o.replace(wB,RB),"binary",r):o&&(o=$a(o,"binary","utf8")),A[s]===void 0?o&&(A[s]=o):A[s][1]=o,A}DB.exports=wL});var kB=Q((sj,bB)=>{"use strict";bB.exports=function(A){if(typeof A!="string")return"";for(var t=A.length-1;t>=0;--t)switch(A.charCodeAt(t)){case 47:case 92:return A=A.slice(t+1),A===".."||A==="."?"":A}return A===".."||A==="."?"":A}});var xB=Q((oj,NB)=>{"use strict";var{Readable:FB}=require("stream"),{inherits:RL}=require("util"),DL=Gu(),SB=Ju(),bL=za(),kL=kB(),qr=Za(),SL=/^boundary$/i,FL=/^form-data$/i,NL=/^charset$/i,xL=/^filename$/i,LL=/^name$/i;ec.detect=/^multipart\/form-data/i;function ec(e,A){let t,r,n=this,i,s=A.limits,o=A.isPartAFile||((ee,Y,ce)=>Y==="application/octet-stream"||ce!==void 0),a=A.parsedConType||[],c=A.defCharset||"utf8",g=A.preservePath,l={highWaterMark:A.fileHwm};for(t=0,r=a.length;t<r;++t)if(Array.isArray(a[t])&&SL.test(a[t][0])){i=a[t][1];break}function u(){H===0&&ae&&!e._done&&(ae=!1,n.end())}if(typeof i!="string")throw new Error("Multipart: Boundary not found");let E=qr(s,"fieldSize",1*1024*1024),h=qr(s,"fileSize",1/0),d=qr(s,"files",1/0),C=qr(s,"fields",1/0),I=qr(s,"parts",1/0),p=qr(s,"headerPairs",2e3),w=qr(s,"headerSize",80*1024),m=0,K=0,H=0,ne,q,ae=!1;this._needDrain=!1,this._pause=!1,this._cb=void 0,this._nparts=0,this._boy=e
|
||
|
|
`))}function mU(e,A){let{headersList:t}=A,r=(t.get("referrer-policy")??"").split(","),n="";if(r.length>0)for(let i=r.length;i!==0;i--){let s=r[i-1].trim();if(aU.has(s)){n=s;break}}n!==""&&(e.referrerPolicy=n)}function yU(){return"allowed"}function wU(){return"success"}function RU(){return"success"}function DU(e){let A=null;A=e.mode,e.headersList.set("sec-fetch-mode",A)}function bU(e){let A=e.origin;if(e.responseTainting==="cors"||e.mode==="websocket")A&&e.headersList.append("origin",A);else if(e.method!=="GET"&&e.method!=="HEAD"){switch(e.referrerPolicy){case"no-referrer":A=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":e.origin&&ju(e.origin)&&!ju(Ns(e))&&(A=null);break;case"same-origin":rc(e,Ns(e))||(A=null);break;default:}A&&e.headersList.append("origin",A)}}function kU(e){return lU.now()}function SU(e){return{startTime:e.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:e.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}}function FU(){return{referrerPolicy:"strict-origin-when-cross-origin"}}function NU(e){return{referrerPolicy:e.referrerPolicy}}function xU(e){let A=e.referrerPolicy;zn(A);let t=null;if(e.referrer==="client"){let o=gU();if(!o||o.origin==="null")return"no-referrer";t=new URL(o)}else e.referrer instanceof URL&&(t=e.referrer);let r=Wu(t),n=Wu(t,!0);r.toString().length>4096&&(r=n);let i=rc(e,r),s=Fs(r)&&!Fs(e.url);switch(A){case"origin":return n??Wu(t,!0);case"unsafe-url":return r;case"same-origin":return i?n:"no-referrer";case"origin-when-cross-origin":return i?r:n;case"strict-origin-when-cross-origin":{let o=Ns(e);return rc(r,o)?r:Fs(r)&&!Fs(o)?"no-referrer":n}case"strict-origin":case"no-referrer-when-downgrade":default:return s?"no-referrer":n}}function Wu(e,A){return zn(e instanceof URL),e.protocol==="file:"||e.protocol==="about:"||e.protocol==="blank:"?"no-referrer":(e.username="",e.password="",e.hash="",A&&(e.pathname="",e.search=""),e)}function Fs(e){if(!(e instanceof URL))return!1;if(e.href==="about:blank"||e.href==="about:srcdoc"||e.protocol==="data:"||e.protocol==="file:")return!0;return A(e.origin);function A(t){if(t==null||t==="null")return!1;let r=new URL(t);return!!(r.protocol==="https:"||r.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(r.hostname)||r.hostname==="localhost"||r.hostname.includes("localhost.")||r.hostname.endsWith(".localhost"))}}function LU(e,A){if(tc===void 0)return!0;let t=$B(A);if(t==="no metadata"||t.length===0)return!0;let r=TU(t),n=MU(t,r);for(let i of n){let s=i.algo,o=i.hash,a=tc.createHash(s).update(e).digest("base64");if(a[a.length-1]==="="&&(a[a.length-2]==="="?a=a.slice(0,-2):a=a.slice(0,-1)),vU(a,o))return!0}return!1}var UU=/(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function $B(e){let A=[],t=!0;for(let r of e.split(" ")){t=!1;let n=UU.exec(r);if(n===null||n.groups===void 0||n.groups.algo===void 0)continue;let i=n.groups.algo.toLowerCase();KB.includes(i)&&A.push(n.groups)}return t===!0?"no metadata":A}function TU(e){let A=e[0].algo;if(A[3]==="5")return A;for(let t=1;t<e.length;++t){let r=e[t];if(r.algo[3]==="5"){A="sha512";break}else{if(A[3]==="3")continue;r.algo[3]==="3"&&(A="sha384")}}return A}function MU(e,A){if(e.length===1)return e;let t=0;for(let r=0;r<e.length;++r)e[r].algo===A&&(e[t++]=e[r]);return e.length=t,e}function vU(e,A){if(e.length!==A.length)return!1;for(let t=0;t<e.length;++t)if(e[t]!==A[t]){if(e[t]==="+"&&A[t]==="-"||e[t]==="/"&&A[t]==="_")continue;return!1}return!0}function PU(e){}function rc(e,A){return e.origin===A.origin&&e.origin==="null"||e.protocol===A.protocol&&e.hostname===A.hostname&&e.port===A.port}function GU(){let e,A;return{promise:new Promise((r,n)=>{e=r,A=n}),resolve:e,reject:A}}function JU(e){return e.controller.state==="aborted"}function YU(e){return e.controller.state==="aborted"||e.controller.state==="terminated"}var Ku={delete:"DEL
|
||
|
|
`||e===" "||e===" "}function Zu(e,A=!0,t=!0){let r=0,n=e.length-1;if(A)for(;r<e.length&&sp(e[r]);r++);if(t)for(;n>0&&sp(e[n]);n--);return e.slice(r,n+1)}function op(e){return e==="\r"||e===`
|
||
|
|
`||e===" "||e==="\f"||e===" "}function lT(e,A=!0,t=!0){let r=0,n=e.length-1;if(A)for(;r<e.length&&op(e[r]);r++);if(t)for(;n>0&&op(e[n]);n--);return e.slice(r,n+1)}lp.exports={dataURLProcessor:oT,URLSerializer:ap,collectASequenceOfCodePoints:sc,collectASequenceOfCodePointsFast:$n,stringPercentDecode:cp,parseMIMEType:Xu,collectAnHTTPQuotedString:gp,serializeAMimeType:gT}});var oc=Q((Cj,Qp)=>{"use strict";var{Blob:hp,File:up}=require("buffer"),{types:zu}=require("util"),{kState:DA}=qt(),{isBlobLike:dp}=YA(),{webidl:te}=iA(),{parseMIMEType:uT,serializeAMimeType:ET}=$A(),{kEnumerableProperty:Ep}=W(),hT=new TextEncoder,xs=class e extends hp{constructor(A,t,r={}){te.argumentLengthCheck(arguments,2,{header:"File constructor"}),A=te.converters["sequence<BlobPart>"](A),t=te.converters.USVString(t),r=te.converters.FilePropertyBag(r);let n=t,i=r.type,s;e:{if(i){if(i=uT(i),i==="failure"){i="";break e}i=ET(i).toLowerCase()}s=r.lastModified}super(dT(A,r),{type:i}),this[DA]={name:n,lastModified:s,type:i}}get name(){return te.brandCheck(this,e),this[DA].name}get lastModified(){return te.brandCheck(this,e),this[DA].lastModified}get type(){return te.brandCheck(this,e),this[DA].type}},$u=class e{constructor(A,t,r={}){let n=t,i=r.type,s=r.lastModified??Date.now();this[DA]={blobLike:A,name:n,type:i,lastModified:s}}stream(...A){return te.brandCheck(this,e),this[DA].blobLike.stream(...A)}arrayBuffer(...A){return te.brandCheck(this,e),this[DA].blobLike.arrayBuffer(...A)}slice(...A){return te.brandCheck(this,e),this[DA].blobLike.slice(...A)}text(...A){return te.brandCheck(this,e),this[DA].blobLike.text(...A)}get size(){return te.brandCheck(this,e),this[DA].blobLike.size}get type(){return te.brandCheck(this,e),this[DA].blobLike.type}get name(){return te.brandCheck(this,e),this[DA].name}get lastModified(){return te.brandCheck(this,e),this[DA].lastModified}get[Symbol.toStringTag](){return"File"}};Object.defineProperties(xs.prototype,{[Symbol.toStringTag]:{value:"File",configurable:!0},name:Ep,lastModified:Ep});te.converters.Blob=te.interfaceConverter(hp);te.converters.BlobPart=function(e,A){if(te.util.Type(e)==="Object"){if(dp(e))return te.converters.Blob(e,{strict:!1});if(ArrayBuffer.isView(e)||zu.isAnyArrayBuffer(e))return te.converters.BufferSource(e,A)}return te.converters.USVString(e,A)};te.converters["sequence<BlobPart>"]=te.sequenceConverter(te.converters.BlobPart);te.converters.FilePropertyBag=te.dictionaryConverter([{key:"lastModified",converter:te.converters["long long"],get defaultValue(){return Date.now()}},{key:"type",converter:te.converters.DOMString,defaultValue:""},{key:"endings",converter:e=>(e=te.converters.DOMString(e),e=e.toLowerCase(),e!=="native"&&(e="transparent"),e),defaultValue:"transparent"}]);function dT(e,A){let t=[];for(let r of e)if(typeof r=="string"){let n=r;A.endings==="native"&&(n=QT(n)),t.push(hT.encode(n))}else zu.isAnyArrayBuffer(r)||zu.isTypedArray(r)?r.buffer?t.push(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)):t.push(new Uint8Array(r)):dp(r)&&t.push(r);return t}function QT(e){let A=`
|
||
|
|
`;return process.platform==="win32"&&(A=`\r
|
||
|
|
`),e.replace(/\r?\n/g,A)}function CT(e){return up&&e instanceof up||e instanceof xs||e&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&e[Symbol.toStringTag]==="File"}Qp.exports={File:xs,FileLike:$u,isFileLike:CT}});var cc=Q((fj,pp)=>{"use strict";var{isBlobLike:ac,toUSVString:fT,makeIterator:eE}=YA(),{kState:$e}=qt(),{File:Bp,FileLike:Cp,isFileLike:IT}=oc(),{webidl:re}=iA(),{Blob:BT,File:AE}=require("buffer"),fp=AE??Bp,ei=class e{constructor(A){if(A!==void 0)throw re.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[$e]=[]}append(A,t,r=void 0){if(re.brandCheck(this,e),re.argumentLengthCheck(arguments,2,{header:"FormData.append"}),arguments.length===3&&!ac(t))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");A=re.converters.USVString(A),t=ac(t)?re.converters.Blob(t,{strict:!1}):re.converters.USVString(t),r=arguments.length===3?re.converters.USVString(r):void 0;let n=Ip(A,t,r);this[$e].push(n)}delete(A){re.brandCheck(this,e),re.argumentLengthCheck(arguments,1,{header:"FormData.delete"}),A=re.converters.USVString(A),this[$e]=this[$e].filter(t=>t.name!==A)}get(A){re.brandCheck(this,e),re.argumentLengthCheck(arguments,1,{header:"FormData.get"}),A=re.converters.USVString(A);let t=this[$e].findIndex(r=>r.name===A);return t===-1?null:this[$e][t].value}getAll(A){return re.brandCheck(this,e),re.argumentLengthCheck(arguments,1,{header:"FormData.getAll"}),A=re.converters.USVString(A),this[$e].filter(t=>t.name===A).map(t=>t.value)}has(A){return re.brandCheck(this,e),re.argumentLengthCheck(arguments,1,{header:"FormData.has"}),A=re.converters.USVString(A),this[$e].findIndex(t=>t.name===A)!==-1}set(A,t,r=void 0){if(re.brandCheck(this,e),re.argumentLengthCheck(arguments,2,{header:"FormData.set"}),arguments.length===3&&!ac(t))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");A=re.converters.USVString(A),t=ac(t)?re.converters.Blob(t,{strict:!1}):re.converters.USVString(t),r=arguments.length===3?fT(r):void 0;let n=Ip(A,t,r),i=this[$e].findIndex(s=>s.name===A);i!==-1?this[$e]=[...this[$e].slice(0,i),n,...this[$e].slice(i+1).filter(s=>s.name!==A)]:this[$e].push(n)}entries(){return re.brandCheck(this,e),eE(()=>this[$e].map(A=>[A.name,A.value]),"FormData","key+value")}keys(){return re.brandCheck(this,e),eE(()=>this[$e].map(A=>[A.name,A.value]),"FormData","key")}values(){return re.brandCheck(this,e),eE(()=>this[$e].map(A=>[A.name,A.value]),"FormData","value")}forEach(A,t=globalThis){if(re.brandCheck(this,e),re.argumentLengthCheck(arguments,1,{header:"FormData.forEach"}),typeof A!="function")throw new TypeError("Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'.");for(let[r,n]of this)A.apply(t,[n,r,this])}};ei.prototype[Symbol.iterator]=ei.prototype.entries;Object.defineProperties(ei.prototype,{[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function Ip(e,A,t){if(e=Buffer.from(e).toString("utf8"),typeof A=="string")A=Buffer.from(A).toString("utf8");else if(IT(A)||(A=A instanceof BT?new fp([A],"blob",{type:A.type}):new Cp(A,"blob",{type:A.type})),t!==void 0){let r={type:A.type,lastModified:A.lastModified};A=AE&&A instanceof AE||A instanceof Bp?new fp([A],t,r):new Cp(A,t,r)}return{name:e,value:A}}pp.exports={FormData:ei}});var Ls=Q((Ij,Fp)=>{"use strict";var pT=GB(),Ai=W(),{ReadableStreamFrom:mT,isBlobLike:mp,isReadableStreamLike:yT,readableStreamClose:wT,createDeferredPromise:RT,fullyReadBody:DT}=YA(),{FormData:yp}=cc(),{kState:Ht}=qt(),{webidl:tE}=iA(),{DOMException:Dp,structuredClone:bT}=mr(),{Blob:kT,File:ST}=require("buffer"),{kBodyUsed:FT}=de(),rE=require("assert"),{isErrored:NT}=W(),{isUint8Array:bp,isArrayBuffer:xT}=require("util/types"),{File:LT}=oc(),{parseMIMEType:UT,serializeAMimeType:TT}=$A(),Ot=globalThis.ReadableStream,wp=ST??LT,gc=new TextEncoder,MT=new TextDecoder;function kp(e,A=!1){Ot||(Ot=require("stream/web").ReadableStream);let t=null;e instanceof Ot?t=e:mp(e)?t=e.stream():t=new Ot({async pull(a){a.enqueue(typeof n=="stri
|
||
|
|
Content-Disposition: form-data`;let g=C=>C.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),l=C=>C.replace(/\r?\n|\r/g,`\r
|
||
|
|
`),u=[],E=new Uint8Array([13,10]);i=0;let h=!1;for(let[C,I]of e)if(typeof I=="string"){let p=gc.encode(c+`; name="${g(l(C))}"\r
|
||
|
|
\r
|
||
|
|
${l(I)}\r
|
||
|
|
`);u.push(p),i+=p.byteLength}else{let p=gc.encode(`${c}; name="${g(l(C))}"`+(I.name?`; filename="${g(I.name)}"`:"")+`\r
|
||
|
|
Content-Type: ${I.type||"application/octet-stream"}\r
|
||
|
|
\r
|
||
|
|
`);u.push(p,I,E),typeof I.size=="number"?i+=p.byteLength+I.size+E.byteLength:h=!0}let d=gc.encode(`--${a}--`);u.push(d),i+=d.byteLength,h&&(i=null),n=e,r=async function*(){for(let C of u)C.stream?yield*C.stream():yield C},s="multipart/form-data; boundary="+a}else if(mp(e))n=e,i=e.size,e.type&&(s=e.type);else if(typeof e[Symbol.asyncIterator]=="function"){if(A)throw new TypeError("keepalive");if(Ai.isDisturbed(e)||e.locked)throw new TypeError("Response body object should not be disturbed or locked");t=e instanceof Ot?e:mT(e)}if((typeof n=="string"||Ai.isBuffer(n))&&(i=Buffer.byteLength(n)),r!=null){let a;t=new Ot({async start(){a=r(e)[Symbol.asyncIterator]()},async pull(c){let{value:g,done:l}=await a.next();return l?queueMicrotask(()=>{c.close()}):NT(t)||c.enqueue(new Uint8Array(g)),c.desiredSize>0},async cancel(c){await a.return()},type:void 0})}return[{stream:t,source:n,length:i},s]}function vT(e,A=!1){return Ot||(Ot=require("stream/web").ReadableStream),e instanceof Ot&&(rE(!Ai.isDisturbed(e),"The body has already been consumed."),rE(!e.locked,"The stream is locked.")),kp(e,A)}function PT(e){let[A,t]=e.stream.tee(),r=bT(t,{transfer:[t]}),[,n]=r.tee();return e.stream=A,{stream:n,length:e.length,source:e.source}}async function*Rp(e){if(e)if(bp(e))yield e;else{let A=e.stream;if(Ai.isDisturbed(A))throw new TypeError("The body has already been consumed.");if(A.locked)throw new TypeError("The stream is locked.");A[FT]=!0,yield*A}}function nE(e){if(e.aborted)throw new Dp("The operation was aborted.","AbortError")}function GT(e){return{blob(){return lc(this,t=>{let r=qT(this);return r==="failure"?r="":r&&(r=TT(r)),new kT([t],{type:r})},e)},arrayBuffer(){return lc(this,t=>new Uint8Array(t).buffer,e)},text(){return lc(this,Sp,e)},json(){return lc(this,VT,e)},async formData(){tE.brandCheck(this,e),nE(this[Ht]);let t=this.headers.get("Content-Type");if(/multipart\/form-data/.test(t)){let r={};for(let[o,a]of this.headers)r[o.toLowerCase()]=a;let n=new yp,i;try{i=new pT({headers:r,preservePath:!0})}catch(o){throw new Dp(`${o}`,"AbortError")}i.on("field",(o,a)=>{n.append(o,a)}),i.on("file",(o,a,c,g,l)=>{let u=[];if(g==="base64"||g.toLowerCase()==="base64"){let E="";a.on("data",h=>{E+=h.toString().replace(/[\r\n]/gm,"");let d=E.length-E.length%4;u.push(Buffer.from(E.slice(0,d),"base64")),E=E.slice(d)}),a.on("end",()=>{u.push(Buffer.from(E,"base64")),n.append(o,new wp(u,c,{type:l}))})}else a.on("data",E=>{u.push(E)}),a.on("end",()=>{n.append(o,new wp(u,c,{type:l}))})});let s=new Promise((o,a)=>{i.on("finish",o),i.on("error",c=>a(new TypeError(c)))});if(this.body!==null)for await(let o of Rp(this[Ht].body))i.write(o);return i.end(),await s,n}else if(/application\/x-www-form-urlencoded/.test(t)){let r;try{let i="",s=new TextDecoder("utf-8",{ignoreBOM:!0});for await(let o of Rp(this[Ht].body)){if(!bp(o))throw new TypeError("Expected Uint8Array chunk");i+=s.decode(o,{stream:!0})}i+=s.decode(),r=new URLSearchParams(i)}catch(i){throw Object.assign(new TypeError,{cause:i})}let n=new yp;for(let[i,s]of r)n.append(i,s);return n}else throw await Promise.resolve(),nE(this[Ht]),tE.errors.exception({header:`${e.name}.formData`,message:"Could not parse content as FormData."})}}}function JT(e){Object.assign(e.prototype,GT(e))}async function lc(e,A,t){if(tE.brandCheck(e,t),nE(e[Ht]),YT(e[Ht].body))throw new TypeError("Body is unusable");let r=RT(),n=s=>r.reject(s),i=s=>{try{r.resolve(A(s))}catch(o){n(o)}};return e[Ht].body==null?(i(new Uint8Array),r.promise):(await DT(e[Ht].body,i,n),r.promise)}function YT(e){return e!=null&&(e.stream.locked||Ai.isDisturbed(e.stream))}function Sp(e){return e.length===0?"":(e[0]===239&&e[1]===187&&e[2]===191&&(e=e.subarray(3)),MT.decode(e))}function VT(e){return JSON.parse(Sp(e))}function qT(e){let{headersList:A}=e[Ht],t=A.get("content-type");return t===null?"failure":UT(t)}Fp.exports={extractBody:kp,safelyExtractBody:vT,cloneBody:PT,mixinBody:JT}});var Up=Q((Bj,Lp)=>{"use strict";var{InvalidArgumentError:Qe,NotSupportedError:OT}=le(),Wt=require("assert"),{kHTTP2BuildRequest:HT,kHTTP2CopyHeaders:WT,kHTTP1BuildRequest:_
|
||
|
|
`),this.body=C.stream,this.contentLength=C.length}else QA.isBlobLike(n)&&this.contentType==null&&n.type&&(this.contentType=n.type,this.headers+=`content-type: ${n.type}\r
|
||
|
|
`);QA.validateHandler(d,r,c),this.servername=QA.getServerName(this.host),this[et]=d,Te.create.hasSubscribers&&Te.create.publish({request:this})}onBodySent(A){if(this[et].onBodySent)try{return this[et].onBodySent(A)}catch(t){this.abort(t)}}onRequestSent(){if(Te.bodySent.hasSubscribers&&Te.bodySent.publish({request:this}),this[et].onRequestSent)try{return this[et].onRequestSent()}catch(A){this.abort(A)}}onConnect(A){if(Wt(!this.aborted),Wt(!this.completed),this.error)A(this.error);else return this.abort=A,this[et].onConnect(A)}onHeaders(A,t,r,n){Wt(!this.aborted),Wt(!this.completed),Te.headers.hasSubscribers&&Te.headers.publish({request:this,response:{statusCode:A,headers:t,statusText:n}});try{return this[et].onHeaders(A,t,r,n)}catch(i){this.abort(i)}}onData(A){Wt(!this.aborted),Wt(!this.completed);try{return this[et].onData(A)}catch(t){return this.abort(t),!1}}onUpgrade(A,t,r){return Wt(!this.aborted),Wt(!this.completed),this[et].onUpgrade(A,t,r)}onComplete(A){this.onFinally(),Wt(!this.aborted),this.completed=!0,Te.trailers.hasSubscribers&&Te.trailers.publish({request:this,trailers:A});try{return this[et].onComplete(A)}catch(t){this.onError(t)}}onError(A){if(this.onFinally(),Te.error.hasSubscribers&&Te.error.publish({request:this,error:A}),!this.aborted)return this.aborted=!0,this[et].onError(A)}onFinally(){this.errorHandler&&(this.body.off("error",this.errorHandler),this.errorHandler=null),this.endHandler&&(this.body.off("end",this.endHandler),this.endHandler=null)}addHeader(A,t){return Us(this,A,t),this}static[_T](A,t,r){return new e(A,t,r)}static[HT](A,t,r){let n=t.headers;t={...t,headers:null};let i=new e(A,t,r);if(i.headers={},Array.isArray(n)){if(n.length%2!==0)throw new Qe("headers array must be even");for(let s=0;s<n.length;s+=2)Us(i,n[s],n[s+1],!0)}else if(n&&typeof n=="object"){let s=Object.keys(n);for(let o=0;o<s.length;o++){let a=s[o];Us(i,a,n[a],!0)}}else if(n!=null)throw new Qe("headers must be an object or an array");return i}static[WT](A){let t=A.split(`\r
|
||
|
|
`),r={};for(let n of t){let[i,s]=n.split(": ");s==null||s.length===0||(r[i]?r[i]+=`,${s}`:r[i]=s)}return r}};function Or(e,A,t){if(A&&typeof A=="object")throw new Qe(`invalid ${e} header`);if(A=A!=null?`${A}`:"",xp.exec(A)!==null)throw new Qe(`invalid ${e} header`);return t?A:`${e}: ${A}\r
|
||
|
|
`}function Us(e,A,t,r=!1){if(t&&typeof t=="object"&&!Array.isArray(t))throw new Qe(`invalid ${A} header`);if(t===void 0)return;if(e.host===null&&A.length===4&&A.toLowerCase()==="host"){if(xp.exec(t)!==null)throw new Qe(`invalid ${A} header`);e.host=t}else if(e.contentLength===null&&A.length===14&&A.toLowerCase()==="content-length"){if(e.contentLength=parseInt(t,10),!Number.isFinite(e.contentLength))throw new Qe("invalid content-length header")}else if(e.contentType===null&&A.length===12&&A.toLowerCase()==="content-type")e.contentType=t,r?e.headers[A]=Or(A,t,r):e.headers+=Or(A,t);else{if(A.length===17&&A.toLowerCase()==="transfer-encoding")throw new Qe("invalid transfer-encoding header");if(A.length===10&&A.toLowerCase()==="connection"){let n=typeof t=="string"?t.toLowerCase():null;if(n!=="close"&&n!=="keep-alive")throw new Qe("invalid connection header");n==="close"&&(e.reset=!0)}else{if(A.length===10&&A.toLowerCase()==="keep-alive")throw new Qe("invalid keep-alive header");if(A.length===7&&A.toLowerCase()==="upgrade")throw new Qe("invalid upgrade header");if(A.length===6&&A.toLowerCase()==="expect")throw new OT("expect header not supported");if(Np.exec(A)===null)throw new Qe("invalid header key");if(Array.isArray(t))for(let n=0;n<t.length;n++)r?e.headers[A]?e.headers[A]+=`,${Or(A,t[n],r)}`:e.headers[A]=Or(A,t[n],r):e.headers+=Or(A,t[n]);else r?e.headers[A]=Or(A,t,r):e.headers+=Or(A,t)}}}Lp.exports=sE});var uc=Q((pj,Tp)=>{"use strict";var KT=require("events"),oE=class extends KT{dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}};Tp.exports=oE});var Ms=Q((mj,Mp)=>{"use strict";var ZT=uc(),{ClientDestroyedError:aE,ClientClosedError:XT,InvalidArgumentError:ti}=le(),{kDestroy:zT,kClose:$T,kDispatch:cE,kInterceptors:Hr}=de(),ri=Symbol("destroyed"),Ts=Symbol("closed"),_t=Symbol("onDestroyed"),ni=Symbol("onClosed"),Ec=Symbol("Intercepted Dispatch"),gE=class extends ZT{constructor(){super(),this[ri]=!1,this[_t]=null,this[Ts]=!1,this[ni]=[]}get destroyed(){return this[ri]}get closed(){return this[Ts]}get interceptors(){return this[Hr]}set interceptors(A){if(A){for(let t=A.length-1;t>=0;t--)if(typeof this[Hr][t]!="function")throw new ti("interceptor must be an function")}this[Hr]=A}close(A){if(A===void 0)return new Promise((r,n)=>{this.close((i,s)=>i?n(i):r(s))});if(typeof A!="function")throw new ti("invalid callback");if(this[ri]){queueMicrotask(()=>A(new aE,null));return}if(this[Ts]){this[ni]?this[ni].push(A):queueMicrotask(()=>A(null,null));return}this[Ts]=!0,this[ni].push(A);let t=()=>{let r=this[ni];this[ni]=null;for(let n=0;n<r.length;n++)r[n](null,null)};this[$T]().then(()=>this.destroy()).then(()=>{queueMicrotask(t)})}destroy(A,t){if(typeof A=="function"&&(t=A,A=null),t===void 0)return new Promise((n,i)=>{this.destroy(A,(s,o)=>s?i(s):n(o))});if(typeof t!="function")throw new ti("invalid callback");if(this[ri]){this[_t]?this[_t].push(t):queueMicrotask(()=>t(null,null));return}A||(A=new aE),this[ri]=!0,this[_t]=this[_t]||[],this[_t].push(t);let r=()=>{let n=this[_t];this[_t]=null;for(let i=0;i<n.length;i++)n[i](null,null)};this[zT](A).then(()=>{queueMicrotask(r)})}[Ec](A,t){if(!this[Hr]||this[Hr].length===0)return this[Ec]=this[cE],this[cE](A,t);let r=this[cE].bind(this);for(let n=this[Hr].length-1;n>=0;n--)r=this[Hr][n](r);return this[Ec]=r,r(A,t)}dispatch(A,t){if(!t||typeof t!="object")throw new ti("handler must be an object");try{if(!A||typeof A!="object")throw new ti("opts must be an object.");if(this[ri]||this[_t])throw new aE;if(this[Ts])throw new XT;return this[Ec](A,t)}catch(r){if(typeof t.onError!="function")throw new ti("invalid onError method");return t.onError(r),!1}}};Mp.exports=gE});var vs=Q((Rj,Gp)=>{"use strict";var eM=require("net"),vp=require("assert"),Pp=W(),{InvalidArgumentError:AM,ConnectTimeoutError:tM}=le(),lE,uE;global.FinalizationRegistry&&!process.env.NODE_V8_COVERAGE?uE=class{constructor(A){this._maxCachedSessions=A,this._sessionCache=new Map,this._sessionRegistry=new global.FinalizationRegistry(t=>{if(this._sessi
|
||
|
|
`,this[tm]=a??3e5,this[Am]=n??3e5,this[qs]=p??!0,this[LM]=m,this[Os]=H,this[wr]=null,this[nm]=q>-1?q:-1,this[Rt]="h1",this[kA]=null,this[pc]=ee?{openStreams:0,maxConcurrentStreams:Y??100}:null,this[im]=`${this[Ke].hostname}${this[Ke].port?`:${this[Ke].port}`:""}`,this[Ie]=[],this[Be]=0,this[bA]=0}get pipelining(){return this[Dr]}set pipelining(A){this[Dr]=A,SA(this,!0)}get[jr](){return this[Ie].length-this[bA]}get[be](){return this[bA]-this[Be]}get[_r](){return this[Ie].length-this[Be]}get[xM](){return!!this[Fe]&&!this[si]&&!this[Fe].destroyed}get[BE](){let A=this[Fe];return A&&(A[sA]||A[Zt]||A[ai])||this[_r]>=(this[Dr]||1)||this[jr]>0}[NM](A){cm(this),this.once("connect",A)}[MM](A,t){let r=A.origin||this[Ke].origin,n=this[Rt]==="h2"?IE[PM](r,A,t):IE[JM](r,A,t);return this[Ie].push(n),this[Wr]||(k.bodyLength(n.body)==null&&k.isIterable(n.body)?(this[Wr]=1,process.nextTick(SA,this)):SA(this,!0)),this[Wr]&&this[Rr]!==2&&this[BE]&&(this[Rr]=2),this[Rr]<2}async[UM](){return new Promise(A=>{this[_r]?this[wr]=A:A(null)})}async[TM](A){return new Promise(t=>{let r=this[Ie].splice(this[bA]);for(let i=0;i<r.length;i++){let s=r[i];oA(this,s,A)}let n=()=>{this[wr]&&(this[wr](),this[wr]=null),t()};this[kA]!=null&&(k.destroy(this[kA],A),this[kA]=null,this[pc]=null),this[Fe]?k.destroy(this[Fe].on("close",n),A):queueMicrotask(n),SA(this)})}};function jM(e){D(e.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[Fe][Ze]=e,Rc(this[wt],e)}function KM(e,A,t){let r=new yt(`HTTP/2: "frameError" received - type ${e}, code ${A}`);t===0&&(this[Fe][Ze]=r,Rc(this[wt],r))}function ZM(){k.destroy(this,new oi("other side closed")),k.destroy(this[Fe],new oi("other side closed"))}function XM(e){let A=this[wt],t=new yt(`HTTP/2: "GOAWAY" frame received with code ${e}`);if(A[Fe]=null,A[kA]=null,A.destroyed){D(this[jr]===0);let r=A[Ie].splice(A[Be]);for(let n=0;n<r.length;n++){let i=r[n];oA(this,i,t)}}else if(A[be]>0){let r=A[Ie][A[Be]];A[Ie][A[Be]++]=null,oA(A,r,t)}A[bA]=A[Be],D(A[be]===0),A.emit("disconnect",A[Ke],[A],t),SA(A)}var Bt=Yp(),zM=Qc(),$M=Buffer.alloc(0);async function ev(){let e=process.env.JEST_WORKER_ID?QE():void 0,A;try{A=await WebAssembly.compile(Buffer.from(jp(),"base64"))}catch{A=await WebAssembly.compile(Buffer.from(e||QE(),"base64"))}return await WebAssembly.instantiate(A,{env:{wasm_on_url:(t,r,n)=>0,wasm_on_status:(t,r,n)=>{D.strictEqual(Ge.ptr,t);let i=r-mt+pt.byteOffset;return Ge.onStatus(new Cc(pt.buffer,i,n))||0},wasm_on_message_begin:t=>(D.strictEqual(Ge.ptr,t),Ge.onMessageBegin()||0),wasm_on_header_field:(t,r,n)=>{D.strictEqual(Ge.ptr,t);let i=r-mt+pt.byteOffset;return Ge.onHeaderField(new Cc(pt.buffer,i,n))||0},wasm_on_header_value:(t,r,n)=>{D.strictEqual(Ge.ptr,t);let i=r-mt+pt.byteOffset;return Ge.onHeaderValue(new Cc(pt.buffer,i,n))||0},wasm_on_headers_complete:(t,r,n,i)=>(D.strictEqual(Ge.ptr,t),Ge.onHeadersComplete(r,!!n,!!i)||0),wasm_on_body:(t,r,n)=>{D.strictEqual(Ge.ptr,t);let i=r-mt+pt.byteOffset;return Ge.onBody(new Cc(pt.buffer,i,n))||0},wasm_on_message_complete:t=>(D.strictEqual(Ge.ptr,t),Ge.onMessageComplete()||0)}})}var fE=null,yE=ev();yE.catch();var Ge=null,pt=null,fc=0,mt=null,ci=1,Bc=2,wE=3,RE=class{constructor(A,t,{exports:r}){D(Number.isFinite(A[Ic])&&A[Ic]>0),this.llhttp=r,this.ptr=this.llhttp.llhttp_alloc(Bt.TYPE.RESPONSE),this.client=A,this.socket=t,this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.statusCode=null,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=A[Ic],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=A[nm]}setTimeout(A,t){this.timeoutType=t,A!==this.timeoutValue?(CE.clearTimeout(this.timeout),A?(this.timeout=CE.setTimeout(Av,A,this),this.timeout.unref&&this.timeout.unref()):this.timeout=null,this.timeoutValue=A):this.timeout&&this.timeout.refresh&&this.timeout.refresh()}resume(){this.socket.destroyed||!this.paused||(D(this.ptr!=null),D(Ge==null),this.llhttp.llhttp_resume(this.ptr),D(this.timeoutType===Bc),this.timeout&
|
||
|
|
`;return typeof i=="string"?h+=`host: ${i}\r
|
||
|
|
`:h+=e[zp],s?h+=`connection: upgrade\r
|
||
|
|
upgrade: ${s}\r
|
||
|
|
`:e[Dr]&&!E[sA]?h+=`connection: keep-alive\r
|
||
|
|
`:h+=`connection: close\r
|
||
|
|
`,o&&(h+=o),eA.sendHeaders.hasSubscribers&&eA.sendHeaders.publish({request:A,headers:h,socket:E}),!t||l===0?(u===0?E.write(`${h}content-length: 0\r
|
||
|
|
\r
|
||
|
|
`,"latin1"):(D(u===null,"no body must not have content length"),E.write(`${h}\r
|
||
|
|
`,"latin1")),A.onRequestSent()):k.isBuffer(t)?(D(u===t.byteLength,"buffer body must have content length"),E.cork(),E.write(`${h}content-length: ${u}\r
|
||
|
|
\r
|
||
|
|
`,"latin1"),E.write(t),E.uncork(),A.onBodySent(t),A.onRequestSent(),g||(E[sA]=!0)):k.isBlobLike(t)?typeof t.stream=="function"?yc({body:t.stream(),client:e,request:A,socket:E,contentLength:u,header:h,expectsPayload:g}):um({body:t,client:e,request:A,socket:E,contentLength:u,header:h,expectsPayload:g}):k.isStream(t)?lm({body:t,client:e,request:A,socket:E,contentLength:u,header:h,expectsPayload:g}):k.isIterable(t)?yc({body:t,client:e,request:A,socket:E,contentLength:u,header:h,expectsPayload:g}):D(!1),!0}function nv(e,A,t){let{body:r,method:n,path:i,host:s,upgrade:o,expectContinue:a,signal:c,headers:g}=t,l;if(typeof g=="string"?l=IE[GM](g.trim()):l=g,o)return oA(e,t,new Error("Upgrade not supported for H2")),!1;try{t.onConnect(p=>{t.aborted||t.completed||oA(e,t,p||new bE)})}catch(p){oA(e,t,p)}if(t.aborted)return!1;let u,E=e[pc];if(l[YM]=s||e[im],l[VM]=n,n==="CONNECT")return A.ref(),u=A.request(l,{endStream:!1,signal:c}),u.id&&!u.pending?(t.onUpgrade(null,null,u),++E.openStreams):u.once("ready",()=>{t.onUpgrade(null,null,u),++E.openStreams}),u.once("close",()=>{E.openStreams-=1,E.openStreams===0&&A.unref()}),!0;l[qM]=i,l[OM]="https";let h=n==="PUT"||n==="POST"||n==="PATCH";r&&typeof r.read=="function"&&r.read(0);let d=k.bodyLength(r);if(d==null&&(d=t.contentLength),(d===0||!h)&&(d=null),gm(n)&&d>0&&t.contentLength!=null&&t.contentLength!==d){if(e[qs])return oA(e,t,new Kt),!1;process.emitWarning(new Kt)}d!=null&&(D(r,"no body must not have content length"),l[HM]=`${d}`),A.ref();let C=n==="GET"||n==="HEAD";return a?(l[WM]="100-continue",u=A.request(l,{endStream:C,signal:c}),u.once("continue",I)):(u=A.request(l,{endStream:C,signal:c}),I()),++E.openStreams,u.once("response",p=>{let{[_M]:w,...m}=p;t.onHeaders(Number(w),m,u.resume.bind(u),"")===!1&&u.pause()}),u.once("end",()=>{t.onComplete([])}),u.on("data",p=>{t.onData(p)===!1&&u.pause()}),u.once("close",()=>{E.openStreams-=1,E.openStreams===0&&A.unref()}),u.once("error",function(p){e[kA]&&!e[kA].destroyed&&!this.closed&&!this.destroyed&&(E.streams-=1,k.destroy(u,p))}),u.once("frameError",(p,w)=>{let m=new yt(`HTTP/2: "frameError" received - type ${p}, code ${w}`);oA(e,t,m),e[kA]&&!e[kA].destroyed&&!this.closed&&!this.destroyed&&(E.streams-=1,k.destroy(u,m))}),!0;function I(){r?k.isBuffer(r)?(D(d===r.byteLength,"buffer body must have content length"),u.cork(),u.write(r),u.uncork(),u.end(),t.onBodySent(r),t.onRequestSent()):k.isBlobLike(r)?typeof r.stream=="function"?yc({client:e,request:t,contentLength:d,h2stream:u,expectsPayload:h,body:r.stream(),socket:e[Fe],header:""}):um({body:r,client:e,request:t,contentLength:d,expectsPayload:h,h2stream:u,header:"",socket:e[Fe]}):k.isStream(r)?lm({body:r,client:e,request:t,contentLength:d,expectsPayload:h,socket:e[Fe],h2stream:u,header:""}):k.isIterable(r)?yc({body:r,client:e,request:t,contentLength:d,expectsPayload:h,header:"",h2stream:u,socket:e[Fe]}):D(!1):t.onRequestSent()}}function lm({h2stream:e,body:A,client:t,request:r,socket:n,contentLength:i,header:s,expectsPayload:o}){if(D(i!==0||t[be]===0,"stream body cannot be pipelined"),t[Rt]==="h2"){let d=function(C){r.onBodySent(C)},h=pM(A,e,C=>{C?(k.destroy(A,C),k.destroy(e,C)):r.onRequestSent()});h.on("data",d),h.once("end",()=>{h.removeListener("data",d),k.destroy(h)});return}let a=!1,c=new wc({socket:n,request:r,contentLength:i,client:t,expectsPayload:o,header:s}),g=function(h){if(!a)try{!c.write(h)&&this.pause&&this.pause()}catch(d){k.destroy(this,d)}},l=function(){a||A.resume&&A.resume()},u=function(){if(a)return;let h=new bE;queueMicrotask(()=>E(h))},E=function(h){if(!a){if(a=!0,D(n.destroyed||n[Zt]&&t[be]<=1),n.off("drain",l).off("error",E),A.removeListener("data",g).removeListener("end",E).removeListener("error",E).removeListener("close",u),!h)try{c.end()}catch(d){h=d}c.destroy(h),h&&(h.code!=="UND_ERR_INFO"||h.message!=="reset")?k.destroy(A,h):k.destroy(A)}};A.on("data",g).on("end",E).on("error",E).on("close",u),A.resume&&A.resume(),n.on("drain",l).on("error",E)}async function um({h2stream:e,body:A,client:t,request:r,socket:n,contentLength:i,header:s,expectsPayload:o}){D(i===A.s
|
||
|
|
\r
|
||
|
|
`,"latin1"),n.write(c),n.uncork()),r.onBodySent(c),r.onRequestSent(),o||(n[sA]=!0),SA(t)}catch(c){k.destroy(a?e:n,c)}}async function yc({h2stream:e,body:A,client:t,request:r,socket:n,contentLength:i,header:s,expectsPayload:o}){D(i!==0||t[be]===0,"iterator body cannot be pipelined");let a=null;function c(){if(a){let u=a;a=null,u()}}let g=()=>new Promise((u,E)=>{D(a===null),n[Ze]?E(n[Ze]):a=u});if(t[Rt]==="h2"){e.on("close",c).on("drain",c);try{for await(let u of A){if(n[Ze])throw n[Ze];let E=e.write(u);r.onBodySent(u),E||await g()}}catch(u){e.destroy(u)}finally{r.onRequestSent(),e.end(),e.off("close",c).off("drain",c)}return}n.on("close",c).on("drain",c);let l=new wc({socket:n,request:r,contentLength:i,client:t,expectsPayload:o,header:s});try{for await(let u of A){if(n[Ze])throw n[Ze];l.write(u)||await g()}l.end()}catch(u){l.destroy(u)}finally{n.off("close",c).off("drain",c)}}var wc=class{constructor({socket:A,request:t,contentLength:r,client:n,expectsPayload:i,header:s}){this.socket=A,this.request=t,this.contentLength=r,this.client=n,this.bytesWritten=0,this.expectsPayload=i,this.header=s,A[Zt]=!0}write(A){let{socket:t,request:r,contentLength:n,client:i,bytesWritten:s,expectsPayload:o,header:a}=this;if(t[Ze])throw t[Ze];if(t.destroyed)return!1;let c=Buffer.byteLength(A);if(!c)return!0;if(n!==null&&s+c>n){if(i[qs])throw new Kt;process.emitWarning(new Kt)}t.cork(),s===0&&(o||(t[sA]=!0),n===null?t.write(`${a}transfer-encoding: chunked\r
|
||
|
|
`,"latin1"):t.write(`${a}content-length: ${n}\r
|
||
|
|
\r
|
||
|
|
`,"latin1")),n===null&&t.write(`\r
|
||
|
|
${c.toString(16)}\r
|
||
|
|
`,"latin1"),this.bytesWritten+=c;let g=t.write(A);return t.uncork(),r.onBodySent(A),g||t[Se].timeout&&t[Se].timeoutType===ci&&t[Se].timeout.refresh&&t[Se].timeout.refresh(),g}end(){let{socket:A,contentLength:t,client:r,bytesWritten:n,expectsPayload:i,header:s,request:o}=this;if(o.onRequestSent(),A[Zt]=!1,A[Ze])throw A[Ze];if(!A.destroyed){if(n===0?i?A.write(`${s}content-length: 0\r
|
||
|
|
\r
|
||
|
|
`,"latin1"):A.write(`${s}\r
|
||
|
|
`,"latin1"):t===null&&A.write(`\r
|
||
|
|
0\r
|
||
|
|
\r
|
||
|
|
`,"latin1"),t!==null&&n!==t){if(r[qs])throw new Kt;process.emitWarning(new Kt)}A[Se].timeout&&A[Se].timeoutType===ci&&A[Se].timeout.refresh&&A[Se].timeout.refresh(),SA(r)}}destroy(A){let{socket:t,client:r}=this;t[Zt]=!1,A&&(D(r[be]<=1,"pipeline should only contain this request"),k.destroy(t,A))}};function oA(e,A,t){try{A.onError(t),D(A.aborted)}catch(r){e.emit("error",r)}}Em.exports=mE});var dm=Q((Uj,hm)=>{"use strict";var Dc=class{constructor(){this.bottom=0,this.top=0,this.list=new Array(2048),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(A){this.list[this.top]=A,this.top=this.top+1&2047}shift(){let A=this.list[this.bottom];return A===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,A)}};hm.exports=class{constructor(){this.head=this.tail=new Dc}isEmpty(){return this.head.isEmpty()}push(A){this.head.isFull()&&(this.head=this.head.next=new Dc),this.head.push(A)}shift(){let A=this.tail,t=A.shift();return A.isEmpty()&&A.next!==null&&(this.tail=A.next),t}}});var Cm=Q((Tj,Qm)=>{"use strict";var{kFree:iv,kConnected:sv,kPending:ov,kQueued:av,kRunning:cv,kSize:gv}=de(),Kr=Symbol("pool"),kE=class{constructor(A){this[Kr]=A}get connected(){return this[Kr][sv]}get free(){return this[Kr][iv]}get pending(){return this[Kr][ov]}get queued(){return this[Kr][av]}get running(){return this[Kr][cv]}get size(){return this[Kr][gv]}};Qm.exports=kE});var UE=Q((Mj,bm)=>{"use strict";var lv=Ms(),uv=dm(),{kConnected:SE,kSize:fm,kRunning:Im,kPending:Bm,kQueued:Ws,kBusy:Ev,kFree:hv,kUrl:dv,kClose:Qv,kDestroy:Cv,kDispatch:fv}=de(),Iv=Cm(),CA=Symbol("clients"),aA=Symbol("needDrain"),_s=Symbol("queue"),FE=Symbol("closed resolve"),NE=Symbol("onDrain"),pm=Symbol("onConnect"),mm=Symbol("onDisconnect"),ym=Symbol("onConnectionError"),xE=Symbol("get dispatcher"),Rm=Symbol("add client"),Dm=Symbol("remove client"),wm=Symbol("stats"),LE=class extends lv{constructor(){super(),this[_s]=new uv,this[CA]=[],this[Ws]=0;let A=this;this[NE]=function(r,n){let i=A[_s],s=!1;for(;!s;){let o=i.shift();if(!o)break;A[Ws]--,s=!this.dispatch(o.opts,o.handler)}this[aA]=s,!this[aA]&&A[aA]&&(A[aA]=!1,A.emit("drain",r,[A,...n])),A[FE]&&i.isEmpty()&&Promise.all(A[CA].map(o=>o.close())).then(A[FE])},this[pm]=(t,r)=>{A.emit("connect",t,[A,...r])},this[mm]=(t,r,n)=>{A.emit("disconnect",t,[A,...r],n)},this[ym]=(t,r,n)=>{A.emit("connectionError",t,[A,...r],n)},this[wm]=new Iv(this)}get[Ev](){return this[aA]}get[SE](){return this[CA].filter(A=>A[SE]).length}get[hv](){return this[CA].filter(A=>A[SE]&&!A[aA]).length}get[Bm](){let A=this[Ws];for(let{[Bm]:t}of this[CA])A+=t;return A}get[Im](){let A=0;for(let{[Im]:t}of this[CA])A+=t;return A}get[fm](){let A=this[Ws];for(let{[fm]:t}of this[CA])A+=t;return A}get stats(){return this[wm]}async[Qv](){return this[_s].isEmpty()?Promise.all(this[CA].map(A=>A.close())):new Promise(A=>{this[FE]=A})}async[Cv](A){for(;;){let t=this[_s].shift();if(!t)break;t.handler.onError(A)}return Promise.all(this[CA].map(t=>t.destroy(A)))}[fv](A,t){let r=this[xE]();return r?r.dispatch(A,t)||(r[aA]=!0,this[aA]=!this[xE]()):(this[aA]=!0,this[_s].push({opts:A,handler:t}),this[Ws]++),!this[aA]}[Rm](A){return A.on("drain",this[NE]).on("connect",this[pm]).on("disconnect",this[mm]).on("connectionError",this[ym]),this[CA].push(A),this[aA]&&process.nextTick(()=>{this[aA]&&this[NE](A[dv],[this,A])}),this}[Dm](A){A.close(()=>{let t=this[CA].indexOf(A);t!==-1&&this[CA].splice(t,1)}),this[aA]=this[CA].some(t=>!t[aA]&&t.closed!==!0&&t.destroyed!==!0)}};bm.exports={PoolBase:LE,kClients:CA,kNeedDrain:aA,kAddClient:Rm,kRemoveClient:Dm,kGetDispatcher:xE}});var gi=Q((vj,Nm)=>{"use strict";var{PoolBase:Bv,kClients:km,kNeedDrain:pv,kAddClient:mv,kGetDispatcher:yv}=UE(),wv=Hs(),{InvalidArgumentError:TE}=le(),ME=W(),{kUrl:Sm,kInterceptors:Rv}=de(),Dv=vs(),vE=Symbol("options"),PE=Symbol("connections"),Fm=Symbol("factory");function bv(e,A){return new wv(e,A)}var GE=class extends Bv{constructor(A,{connections:t,factory:r=bv,connect:n,connectTimeout:i,tls:s,maxCachedSessions:o,socketPath:a,autoSelectFamily:c,a
|
||
|
|
${r.count} ${r.noun} ${r.is} pending:
|
||
|
|
|
||
|
|
${A.format(t)}
|
||
|
|
`.trim())}};cw.exports=yh});var Qw=Q((a8,dw)=>{"use strict";var{kProxy:k2,kClose:S2,kDestroy:F2,kInterceptors:N2}=de(),{URL:lw}=require("url"),uw=Ks(),x2=gi(),L2=Ms(),{InvalidArgumentError:eo,RequestAbortedError:U2}=le(),Ew=vs(),zs=Symbol("proxy agent"),_c=Symbol("proxy client"),$s=Symbol("proxy headers"),wh=Symbol("request tls settings"),T2=Symbol("proxy tls settings"),hw=Symbol("connect endpoint function");function M2(e){return e==="https:"?443:80}function v2(e){if(typeof e=="string"&&(e={uri:e}),!e||!e.uri)throw new eo("Proxy opts.uri is mandatory");return{uri:e.uri,protocol:e.protocol||"https"}}function P2(e,A){return new x2(e,A)}var Rh=class extends L2{constructor(A){if(super(A),this[k2]=v2(A),this[zs]=new uw(A),this[N2]=A.interceptors&&A.interceptors.ProxyAgent&&Array.isArray(A.interceptors.ProxyAgent)?A.interceptors.ProxyAgent:[],typeof A=="string"&&(A={uri:A}),!A||!A.uri)throw new eo("Proxy opts.uri is mandatory");let{clientFactory:t=P2}=A;if(typeof t!="function")throw new eo("Proxy opts.clientFactory must be a function.");this[wh]=A.requestTls,this[T2]=A.proxyTls,this[$s]=A.headers||{};let r=new lw(A.uri),{origin:n,port:i,host:s,username:o,password:a}=r;if(A.auth&&A.token)throw new eo("opts.auth cannot be used in combination with opts.token");A.auth?this[$s]["proxy-authorization"]=`Basic ${A.auth}`:A.token?this[$s]["proxy-authorization"]=A.token:o&&a&&(this[$s]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(o)}:${decodeURIComponent(a)}`).toString("base64")}`);let c=Ew({...A.proxyTls});this[hw]=Ew({...A.requestTls}),this[_c]=t(r,{connect:c}),this[zs]=new uw({...A,connect:async(g,l)=>{let u=g.host;g.port||(u+=`:${M2(g.protocol)}`);try{let{socket:E,statusCode:h}=await this[_c].connect({origin:n,port:i,path:u,signal:g.signal,headers:{...this[$s],host:s}});if(h!==200&&(E.on("error",()=>{}).destroy(),l(new U2(`Proxy response (${h}) !== 200 when HTTP Tunneling`))),g.protocol!=="https:"){l(null,E);return}let d;this[wh]?d=this[wh].servername:d=g.servername,this[hw]({...g,servername:d,httpSocket:E},l)}catch(E){l(E)}}})}dispatch(A,t){let{host:r}=new lw(A.origin),n=G2(A.headers);return J2(n),this[zs].dispatch({...A,headers:{...n,host:r}},t)}async[S2](){await this[zs].close(),await this[_c].close()}async[F2](){await this[zs].destroy(),await this[_c].destroy()}};function G2(e){if(Array.isArray(e)){let A={};for(let t=0;t<e.length;t+=2)A[e[t]]=e[t+1];return A}return e}function J2(e){if(e&&Object.keys(e).find(t=>t.toLowerCase()==="proxy-authorization"))throw new eo("Proxy-Authorization should be sent in ProxyAgent constructor")}dw.exports=Rh});var pw=Q((c8,Bw)=>{"use strict";var An=require("assert"),{kRetryHandlerDefaultRetry:Cw}=de(),{RequestRetryError:jc}=le(),{isDisturbed:fw,parseHeaders:Y2,parseRangeHeader:Iw}=W();function V2(e){let A=Date.now();return new Date(e).getTime()-A}var Dh=class e{constructor(A,t){let{retryOptions:r,...n}=A,{retry:i,maxRetries:s,maxTimeout:o,minTimeout:a,timeoutFactor:c,methods:g,errorCodes:l,retryAfter:u,statusCodes:E}=r??{};this.dispatch=t.dispatch,this.handler=t.handler,this.opts=n,this.abort=null,this.aborted=!1,this.retryOpts={retry:i??e[Cw],retryAfter:u??!0,maxTimeout:o??30*1e3,timeout:a??500,timeoutFactor:c??2,maxRetries:s??5,methods:g??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:E??[500,502,503,504,429],errorCodes:l??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE"]},this.retryCount=0,this.start=0,this.end=null,this.etag=null,this.resume=null,this.handler.onConnect(h=>{this.aborted=!0,this.abort?this.abort(h):this.reason=h})}onRequestSent(){this.handler.onRequestSent&&this.handler.onRequestSent()}onUpgrade(A,t,r){this.handler.onUpgrade&&this.handler.onUpgrade(A,t,r)}onConnect(A){this.aborted?A(this.reason):this.abort=A}onBodySent(A){if(this.handler.onBodySent)return this.handler.onBodySent(A)}static[Cw](A,{state:t,opts:r},n){let{statusCode:i,code:s,headers:o}=A,{method:a,retryOptions:c}=r,{maxRetries:g,timeout:l,maxTimeout:u,timeoutFactor:E,statusCodes:h,errorCodes:d,methods:C}=c,{counter:I,currentTimeou
|
||
|
|
`);return A.length<e?A:A.slice(-e)}function Pd(){ji.length=0}var ie=Zg;var Xg=["darwin","darwin-arm64","debian-openssl-1.0.x","debian-openssl-1.1.x","debian-openssl-3.0.x","rhel-openssl-1.0.x","rhel-openssl-1.1.x","rhel-openssl-3.0.x","linux-arm64-openssl-1.1.x","linux-arm64-openssl-1.0.x","linux-arm64-openssl-3.0.x","linux-arm-openssl-1.1.x","linux-arm-openssl-1.0.x","linux-arm-openssl-3.0.x","linux-musl","linux-musl-openssl-3.0.x","linux-musl-arm64-openssl-1.1.x","linux-musl-arm64-openssl-3.0.x","linux-nixos","linux-static-x64","linux-static-arm64","windows","freebsd11","freebsd12","freebsd13","freebsd14","freebsd15","openbsd","netbsd","arm"];var Po="libquery_engine";function Go(e,A){let t=A==="url";return e.includes("windows")?t?"query_engine.dll.node":`query_engine-${e}.dll.node`:e.includes("darwin")?t?`${Po}.dylib.node`:`${Po}-${e}.dylib.node`:t?`${Po}.so.node`:`${Po}-${e}.so.node`}var Vd=Z(require("child_process")),Al=Z(require("fs/promises")),Ho=Z(require("os"));var Mt=Symbol.for("@ts-pattern/matcher"),nb=Symbol.for("@ts-pattern/isVariadic"),Yo="@ts-pattern/anonymous-select-key",zg=e=>!!(e&&typeof e=="object"),Jo=e=>e&&!!e[Mt],ct=(e,A,t)=>{if(Jo(e)){let r=e[Mt](),{matched:n,selections:i}=r.match(A);return n&&i&&Object.keys(i).forEach(s=>t(s,i[s])),n}if(zg(e)){if(!zg(A))return!1;if(Array.isArray(e)){if(!Array.isArray(A))return!1;let r=[],n=[],i=[];for(let s of e.keys()){let o=e[s];Jo(o)&&o[nb]?i.push(o):i.length?n.push(o):r.push(o)}if(i.length){if(i.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(A.length<r.length+n.length)return!1;let s=A.slice(0,r.length),o=n.length===0?[]:A.slice(-n.length),a=A.slice(r.length,n.length===0?1/0:-n.length);return r.every((c,g)=>ct(c,s[g],t))&&n.every((c,g)=>ct(c,o[g],t))&&(i.length===0||ct(i[0],a,t))}return e.length===A.length&&e.every((s,o)=>ct(s,A[o],t))}return Object.keys(e).every(r=>{let n=e[r];return(r in A||Jo(i=n)&&i[Mt]().matcherType==="optional")&&ct(n,A[r],t);var i})}return Object.is(A,e)},gr=e=>{var A,t,r;return zg(e)?Jo(e)?(A=(t=(r=e[Mt]()).getSelectionKeys)==null?void 0:t.call(r))!=null?A:[]:Array.isArray(e)?Zi(e,gr):Zi(Object.values(e),gr):[]},Zi=(e,A)=>e.reduce((t,r)=>t.concat(A(r)),[]);function PA(e){return Object.assign(e,{optional:()=>ib(e),and:A=>ye(e,A),or:A=>sb(e,A),select:A=>A===void 0?Gd(e):Gd(A,e)})}function ib(e){return PA({[Mt]:()=>({match:A=>{let t={},r=(n,i)=>{t[n]=i};return A===void 0?(gr(e).forEach(n=>r(n,void 0)),{matched:!0,selections:t}):{matched:ct(e,A,r),selections:t}},getSelectionKeys:()=>gr(e),matcherType:"optional"})})}function ye(...e){return PA({[Mt]:()=>({match:A=>{let t={},r=(n,i)=>{t[n]=i};return{matched:e.every(n=>ct(n,A,r)),selections:t}},getSelectionKeys:()=>Zi(e,gr),matcherType:"and"})})}function sb(...e){return PA({[Mt]:()=>({match:A=>{let t={},r=(n,i)=>{t[n]=i};return Zi(e,gr).forEach(n=>r(n,void 0)),{matched:e.some(n=>ct(n,A,r)),selections:t}},getSelectionKeys:()=>Zi(e,gr),matcherType:"or"})})}function X(e){return{[Mt]:()=>({match:A=>({matched:!!e(A)})})}}function Gd(...e){let A=typeof e[0]=="string"?e[0]:void 0,t=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return PA({[Mt]:()=>({match:r=>{let n={[A??Yo]:r};return{matched:t===void 0||ct(t,r,(i,s)=>{n[i]=s}),selections:n}},getSelectionKeys:()=>[A??Yo].concat(t===void 0?[]:gr(t))})})}function ot(e){return typeof e=="number"}function sr(e){return typeof e=="string"}function or(e){return typeof e=="bigint"}var fV=PA(X(function(e){return!0}));var ar=e=>Object.assign(PA(e),{startsWith:A=>{return ar(ye(e,(t=A,X(r=>sr(r)&&r.startsWith(t)))));var t},endsWith:A=>{return ar(ye(e,(t=A,X(r=>sr(r)&&r.endsWith(t)))));var t},minLength:A=>ar(ye(e,(t=>X(r=>sr(r)&&r.length>=t))(A))),length:A=>ar(ye(e,(t=>X(r=>sr(r)&&r.length===t))(A))),maxLength:A=>ar(ye(e,(t=>X(r=>sr(r)&&r.length<=t))(A))),includes:A=>{return ar(ye(e,(t=A,X(r=>sr(r)&&r.includes(t)))));var t},regex:A=>{return ar(ye(e,(t=A,X(r=>sr(r)&&!!r.match(t)))));var t}}),IV=ar(X(sr)),at=e=>Object.assign(PA(e),{between:(A,t)=>at(ye(e,((r,n)=>X(i=>ot(i)&&r<=i&&n>=i))(A,
|
||
|
|
${JSON.stringify(o,null,2)}`),o}async function ub(){let e="/etc/os-release";try{let A=await Al.default.readFile(e,{encoding:"utf-8"});return lb(A)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}function Eb(e){let A=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(e);if(A){let t=`${A[1]}.x`;return Hd(t)}}function Jd(e){let A=/libssl\.so\.(\d)(\.\d)?/.exec(e);if(A){let t=`${A[1]}${A[2]??".0"}.x`;return Hd(t)}}function Hd(e){let A=(()=>{if(Wd(e))return e;let t=e.split(".");return t[1]="0",t.join(".")})();if(gb.includes(A))return A}function hb(e){return Vo(e).with({familyDistro:"musl"},()=>(rA('Trying platform-specific paths for "alpine"'),["/lib"])).with({familyDistro:"debian"},({archFromUname:A})=>(rA('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${A}-linux-gnu`,`/lib/${A}-linux-gnu`])).with({familyDistro:"rhel"},()=>(rA('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:A,arch:t,archFromUname:r})=>(rA(`Don't know any platform-specific paths for "${A}" on ${t} (${r})`),[]))}async function db(e){let A='grep -v "libssl.so.0"',t=await Yd(e);if(t){rA(`Found libssl.so file using platform-specific paths: ${t}`);let i=Jd(t);if(rA(`The parsed libssl version is: ${i}`),i)return{libssl:i,strategy:"libssl-specific-path"}}rA('Falling back to "ldconfig" and other generic paths');let r=await Wo(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${A}`);if(r||(r=await Yd(["/lib64","/usr/lib64","/lib"])),r){rA(`Found libssl.so file using "ldconfig" or other generic paths: ${r}`);let i=Jd(r);if(rA(`The parsed libssl version is: ${i}`),i)return{libssl:i,strategy:"ldconfig"}}let n=await Wo("openssl version -v");if(n){rA(`Found openssl binary with version: ${n}`);let i=Eb(n);if(rA(`The parsed openssl version is: ${i}`),i)return{libssl:i,strategy:"openssl-binary"}}return rA("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function Yd(e){for(let A of e){let t=await Qb(A);if(t)return t}}async function Qb(e){try{return(await Al.default.readdir(e)).find(t=>t.startsWith("libssl.so.")&&!t.startsWith("libssl.so.0"))}catch(A){if(A.code==="ENOENT")return;throw A}}async function Tr(){let{binaryTarget:e}=await fb();return e}function Cb(e){return e.binaryTarget!==void 0}var Oo={};async function fb(){if(Cb(Oo))return Promise.resolve({...Oo,memoized:!0});let e=await Od(),A=Ib(e);return Oo={...e,binaryTarget:A},{...Oo,memoized:!1}}function Ib(e){let{platform:A,arch:t,archFromUname:r,libssl:n,targetDistro:i,familyDistro:s,originalDistro:o}=e;A==="linux"&&!["x64","arm64"].includes(t)&&qo(`Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures (detected "${t}" instead). If you are using your own custom Prisma engines, you can ignore this warning, as long as you've compiled the engines for your system architecture "${r}".`);let a="1.1.x";if(A==="linux"&&n===void 0){let g=Vo({familyDistro:s}).with({familyDistro:"debian"},()=>"Please manually install OpenSSL via `apt-get update -y && apt-get install -y openssl` and try installing Prisma again. If you're running Prisma on Docker, add this command to your Dockerfile, or switch to an image that already has OpenSSL installed.").otherwise(()=>"Please manually install OpenSSL and try installing Prisma again.");qo(`Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-${a}".
|
||
|
|
${g}`)}let c="debian";if(A==="linux"&&i===void 0&&rA(`Distro is "${o}". Falling back to Prisma engines built for "${c}".`),A==="darwin"&&t==="arm64")return"darwin-arm64";if(A==="darwin")return"darwin";if(A==="win32")return"windows";if(A==="freebsd")return i;if(A==="openbsd")return"openbsd";if(A==="netbsd")return"netbsd";if(A==="linux"&&i==="nixos")return"linux-nixos";if(A==="linux"&&t==="arm64")return`${i==="musl"?"linux-musl-arm64":"linux-arm64"}-openssl-${n||a}`;if(A==="linux"&&t==="arm")return`linux-arm-openssl-${n||a}`;if(A==="linux"&&i==="musl"){let g="linux-musl";return!n||Wd(n)?g:`${g}-openssl-${n}`}return A==="linux"&&i&&n?`${i}-openssl-${n}`:(A!=="linux"&&qo(`Prisma detected unknown OS "${A}" and may not work as expected. Defaulting to "linux".`),n?`${c}-openssl-${n}`:i?`${i}-openssl-${a}`:`${c}-openssl-${a}`)}async function Bb(e){try{return await e()}catch{return}}function Wo(e){return Bb(async()=>{let A=await cb(e);return rA(`Command "${e}" successfully returned "${A.stdout}"`),A.stdout})}async function pb(){return typeof Ho.default.machine=="function"?Ho.default.machine():(await Wo("uname -m"))?.trim()}function Wd(e){return e.startsWith("1.")}var pS=Z(yl());var he=Z(require("path")),mS=Z(yl()),Uq=ie("prisma:engines");function MC(){return he.default.join(__dirname,"../")}var Tq="libquery-engine";he.default.join(__dirname,"../query-engine-darwin");he.default.join(__dirname,"../query-engine-darwin-arm64");he.default.join(__dirname,"../query-engine-debian-openssl-1.0.x");he.default.join(__dirname,"../query-engine-debian-openssl-1.1.x");he.default.join(__dirname,"../query-engine-debian-openssl-3.0.x");he.default.join(__dirname,"../query-engine-linux-static-x64");he.default.join(__dirname,"../query-engine-linux-static-arm64");he.default.join(__dirname,"../query-engine-rhel-openssl-1.0.x");he.default.join(__dirname,"../query-engine-rhel-openssl-1.1.x");he.default.join(__dirname,"../query-engine-rhel-openssl-3.0.x");he.default.join(__dirname,"../libquery_engine-darwin.dylib.node");he.default.join(__dirname,"../libquery_engine-darwin-arm64.dylib.node");he.default.join(__dirname,"../libquery_engine-debian-openssl-1.0.x.so.node");he.default.join(__dirname,"../libquery_engine-debian-openssl-1.1.x.so.node");he.default.join(__dirname,"../libquery_engine-debian-openssl-3.0.x.so.node");he.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.0.x.so.node");he.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.1.x.so.node");he.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-3.0.x.so.node");he.default.join(__dirname,"../libquery_engine-linux-musl.so.node");he.default.join(__dirname,"../libquery_engine-linux-musl-openssl-3.0.x.so.node");he.default.join(__dirname,"../libquery_engine-rhel-openssl-1.0.x.so.node");he.default.join(__dirname,"../libquery_engine-rhel-openssl-1.1.x.so.node");he.default.join(__dirname,"../libquery_engine-rhel-openssl-3.0.x.so.node");he.default.join(__dirname,"../query_engine-windows.dll.node");var wl=Z(require("fs")),vC=ie("chmodPlusX");function Rl(e){if(process.platform==="win32")return;let A=wl.default.statSync(e),t=A.mode|64|8|1;if(A.mode===t){vC(`Execution permissions of ${e} are fine`);return}let r=t.toString(8).slice(-3);vC(`Have to call chmodPlusX on ${e}`),wl.default.chmodSync(e,r)}var kl=Z(JC()),la=Z(require("fs"));var Rn=Z(require("path"));function YC(e){let A=e.ignoreProcessEnv?{}:process.env,t=r=>r.match(/(.?\${(?:[a-zA-Z0-9_]+)?})/g)?.reduce(function(i,s){let o=/(.?)\${([a-zA-Z0-9_]+)?}/g.exec(s);if(!o)return i;let a=o[1],c,g;if(a==="\\")g=o[0],c=g.replace("\\$","$");else{let l=o[2];g=o[0].substring(a.length),c=Object.hasOwnProperty.call(A,l)?A[l]:e.parsed[l]||"",c=t(c)}return i.replace(g,c)},r)??r;for(let r in e.parsed){let n=Object.hasOwnProperty.call(A,r)?A[r]:e.parsed[r];e.parsed[r]=t(n)}for(let r in e.parsed)A[r]=e.parsed[r];return e}var bl=ie("prisma:tryLoadEnv");function ts({rootEnvPath:e,schemaEnvPath:A},t={conflictCheck:"none"}){let r=VC(e);t.conflictCheck!=="none"&&xS(r,A,t.conflictCheck);let n=null;return qC(r?.path,A)||(n=VC(A)),!r&&!n&&bl
|
||
|
|
`),parsed:{...r?.dotenvResult?.parsed,...n?.dotenvResult?.parsed}}}function xS(e,A,t){let r=e?.dotenvResult.parsed,n=!qC(e?.path,A);if(r&&A&&n&&la.default.existsSync(A)){let i=kl.default.parse(la.default.readFileSync(A)),s=[];for(let o in i)r[o]===i[o]&&s.push(o);if(s.length>0){let o=Rn.default.relative(process.cwd(),e.path),a=Rn.default.relative(process.cwd(),A);if(t==="error"){let c=`There is a conflict between env var${s.length>1?"s":""} in ${EA(o)} and ${EA(a)}
|
||
|
|
Conflicting env vars:
|
||
|
|
${s.map(g=>` ${Ve(g)}`).join(`
|
||
|
|
`)}
|
||
|
|
|
||
|
|
We suggest to move the contents of ${EA(a)} to ${EA(o)} to consolidate your env vars.
|
||
|
|
`;throw new Error(c)}else if(t==="warn"){let c=`Conflict for env var${s.length>1?"s":""} ${s.map(g=>Ve(g)).join(", ")} in ${EA(o)} and ${EA(a)}
|
||
|
|
Env vars from ${EA(a)} overwrite the ones from ${EA(o)}
|
||
|
|
`;console.warn(`${Lt("warn(prisma)")} ${c}`)}}}}function VC(e){if(LS(e)){bl(`Environment variables loaded from ${e}`);let A=kl.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:YC(A),message:Ur(`Environment variables loaded from ${Rn.default.relative(process.cwd(),e)}`),path:e}}else bl(`Environment variables not found at ${e}`);return null}function qC(e,A){return e&&A&&Rn.default.resolve(e)===Rn.default.resolve(A)}function LS(e){return!!(e&&la.default.existsSync(e))}var OC="library";function rs(e){let A=US();return A||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":OC)}function US(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}var lr;(A=>{let e;(m=>(m.findUnique="findUnique",m.findUniqueOrThrow="findUniqueOrThrow",m.findFirst="findFirst",m.findFirstOrThrow="findFirstOrThrow",m.findMany="findMany",m.create="create",m.createMany="createMany",m.createManyAndReturn="createManyAndReturn",m.update="update",m.updateMany="updateMany",m.upsert="upsert",m.delete="delete",m.deleteMany="deleteMany",m.groupBy="groupBy",m.count="count",m.aggregate="aggregate",m.findRaw="findRaw",m.aggregateRaw="aggregateRaw"))(e=A.ModelAction||={})})(lr||={});var ns=Z(require("path"));function Sl(e){return ns.default.sep===ns.default.posix.sep?e:e.split(ns.default.sep).join(ns.default.posix.sep)}var ZC=Z(Fl());function xl(e){return String(new Nl(e))}var Nl=class{constructor(A){this.config=A}toString(){let{config:A}=this,t=A.provider.fromEnvVar?`env("${A.provider.fromEnvVar}")`:A.provider.value,r=JSON.parse(JSON.stringify({provider:t,binaryTargets:MS(A.binaryTargets)}));return`generator ${A.name} {
|
||
|
|
${(0,ZC.default)(vS(r),2)}
|
||
|
|
}`}};function MS(e){let A;if(e.length>0){let t=e.find(r=>r.fromEnvVar!==null);t?A=`env("${t.fromEnvVar}")`:A=e.map(r=>r.native?"native":r.value)}else A=void 0;return A}function vS(e){let A=Object.keys(e).reduce((t,r)=>Math.max(t,r.length),0);return Object.entries(e).map(([t,r])=>`${t.padEnd(A)} = ${PS(r)}`).join(`
|
||
|
|
`)}function PS(e){return JSON.parse(JSON.stringify(e,(A,t)=>Array.isArray(t)?`[${t.map(r=>JSON.stringify(r)).join(", ")}]`:JSON.stringify(t)))}var ss={};Wi(ss,{error:()=>YS,info:()=>JS,log:()=>GS,query:()=>VS,should:()=>XC,tags:()=>is,warn:()=>Ll});var is={error:vA("prisma:error"),warn:Lt("prisma:warn"),info:Tt("prisma:info"),query:Ut("prisma:query")},XC={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function GS(...e){console.log(...e)}function Ll(e,...A){XC.warn()&&console.warn(`${is.warn} ${e}`,...A)}function JS(e,...A){console.info(`${is.info} ${e}`,...A)}function YS(e,...A){console.error(`${is.error} ${e}`,...A)}function VS(e,...A){console.log(`${is.query} ${e}`,...A)}function vt(e,A){throw new Error(A)}var ua=Z(require("stream")),Af=Z(require("util"));function os(e,A){return OS(e,A)}function OS(e,A){return e?HS(e,A):new Gr(A)}function HS(e,A){if(!e)throw new Error("expected readStream");if(!e.readable)throw new Error("readStream must be readable");let t=new Gr(A);return e.pipe(t),t}function Gr(e){ua.default.Transform.call(this,e),e=e||{},this._readableState.objectMode=!0,this._lineBuffer=[],this._keepEmptyLines=e.keepEmptyLines||!1,this._lastChunkEndedWithCR=!1,this.on("pipe",function(A){this.encoding||A instanceof ua.default.Readable&&(this.encoding=A._readableState.encoding)})}Af.default.inherits(Gr,ua.default.Transform);Gr.prototype._transform=function(e,A,t){A=A||"utf8",Buffer.isBuffer(e)&&(A=="buffer"?(e=e.toString(),A="utf8"):e=e.toString(A)),this._chunkEncoding=A;let r=e.split(/\r\n|\r|\n/g);this._lastChunkEndedWithCR&&e[0]==`
|
||
|
|
`&&r.shift(),this._lineBuffer.length>0&&(this._lineBuffer[this._lineBuffer.length-1]+=r[0],r.shift()),this._lastChunkEndedWithCR=e[e.length-1]=="\r",this._lineBuffer=this._lineBuffer.concat(r),this._pushBuffer(A,1,t)};Gr.prototype._pushBuffer=function(e,A,t){for(;this._lineBuffer.length>A;){let r=this._lineBuffer.shift();if((this._keepEmptyLines||r.length>0)&&!this.push(this._reencode(r,e))){let n=this;setImmediate(function(){n._pushBuffer(e,A,t)});return}}t()};Gr.prototype._flush=function(e){this._pushBuffer(this._chunkEncoding,0,e)};Gr.prototype._reencode=function(e,A){return this.encoding&&this.encoding!=A?Buffer.from(e,A).toString(this.encoding):this.encoding?e:Buffer.from(e,A)};function Tl(e,A){return Object.prototype.hasOwnProperty.call(e,A)}var Ml=(e,A)=>e.reduce((t,r)=>(t[A(r)]=r,t),{});function Dn(e,A){let t={};for(let r of Object.keys(e))t[r]=A(e[r],r);return t}function vl(e,A){if(e.length===0)return;let t=e[0];for(let r=1;r<e.length;r++)A(t,e[r])<0&&(t=e[r]);return t}function L(e,A){Object.defineProperty(e,"name",{value:A,configurable:!0})}var rf=new Set,as=(e,A,...t)=>{rf.has(e)||(rf.add(e),Ll(A,...t))};var xe=class extends Error{constructor(A,{code:t,clientVersion:r,meta:n,batchRequestIdx:i}){super(A),this.name="PrismaClientKnownRequestError",this.code=t,this.clientVersion=r,this.meta=n,Object.defineProperty(this,"batchRequestIdx",{value:i,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};L(xe,"PrismaClientKnownRequestError");var Pt=class extends xe{constructor(A,t){super(A,{code:"P2025",clientVersion:t}),this.name="NotFoundError"}};L(Pt,"NotFoundError");var z=class e extends Error{constructor(A,t,r){super(A),this.name="PrismaClientInitializationError",this.clientVersion=t,this.errorCode=r,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};L(z,"PrismaClientInitializationError");var JA=class extends Error{constructor(A,t){super(A),this.name="PrismaClientRustPanicError",this.clientVersion=t}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};L(JA,"PrismaClientRustPanicError");var ve=class extends Error{constructor(A,{clientVersion:t,batchRequestIdx:r}){super(A),this.name="PrismaClientUnknownRequestError",this.clientVersion=t,Object.defineProperty(this,"batchRequestIdx",{value:r,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};L(ve,"PrismaClientUnknownRequestError");var Oe=class extends Error{constructor(t,{clientVersion:r}){super(t);this.name="PrismaClientValidationError";this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};L(Oe,"PrismaClientValidationError");var bn=9e15,dr=1e9,Pl="0123456789abcdef",Qa="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Ca="3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660631558817488
|
||
|
|
`);return new e(A,mf(r).split(`
|
||
|
|
`))}highlight(){let A=Bf(this.toString());return new e(this.firstLineNumber,A.split(`
|
||
|
|
`))}toString(){return this.lines.join(`
|
||
|
|
`)}};var HF={red:vA,gray:_i,dim:Ur,bold:Ve,underline:EA,highlightSource:e=>e.highlight()},WF={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function _F({message:e,originalMethod:A,isPanic:t,callArguments:r}){return{functionName:`prisma.${A}()`,message:e,isPanic:t??!1,callArguments:r}}function jF({callsite:e,message:A,originalMethod:t,isPanic:r,callArguments:n},i){let s=_F({message:A,originalMethod:t,isPanic:r,callArguments:n});if(!e||typeof window<"u"||process.env.NODE_ENV==="production")return s;let o=e.getLocation();if(!o||!o.lineNumber||!o.columnNumber)return s;let a=Math.max(1,o.lineNumber-3),c=wa.read(o.fileName)?.slice(a,o.lineNumber),g=c?.lineAt(o.lineNumber);if(c&&g){let l=ZF(g),u=KF(g);if(!u)return s;s.functionName=`${u.code})`,s.location=o,r||(c=c.mapLineAt(o.lineNumber,h=>h.slice(0,u.openingBraceIndex))),c=i.highlightSource(c);let E=String(c.lastLineNumber).length;if(s.contextLines=c.mapLines((h,d)=>i.gray(String(d).padStart(E))+" "+h).mapLines(h=>i.dim(h)).prependSymbolAt(o.lineNumber,i.bold(i.red("\u2192"))),n){let h=l+E+1;h+=2,s.callArguments=(0,wf.default)(n,h).slice(h)}}return s}function KF(e){let A=Object.keys(lr.ModelAction).join("|"),r=new RegExp(String.raw`\.(${A})\(`).exec(e);if(r){let n=r.index+r[0].length,i=e.lastIndexOf(" ",r.index)+1;return{code:e.slice(i,n),openingBraceIndex:n}}return null}function ZF(e){let A=0;for(let t=0;t<e.length;t++){if(e.charAt(t)!==" ")return A;A++}return A}function XF({functionName:e,location:A,message:t,isPanic:r,contextLines:n,callArguments:i},s){let o=[""],a=A?" in":":";if(r?(o.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),o.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${a}`))):o.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${a}`)),A&&o.push(s.underline(zF(A))),n){o.push("");let c=[n.toString()];i&&(c.push(i),c.push(s.dim(")"))),o.push(c.join("")),i&&o.push("")}else o.push(""),i&&o.push(i),o.push("");return o.push(t),o.join(`
|
||
|
|
`)}function zF(e){let A=[e.fileName];return e.lineNumber&&A.push(String(e.lineNumber)),e.columnNumber&&A.push(String(e.columnNumber)),A.join(":")}function Ln(e){let A=e.showColors?HF:WF,t;return t=jF(e,A),XF(t,A)}var Nf=Z(Ol());function kf(e,A,t){let r=Sf(e),n=$F(r),i=AN(n);i?Ra(i,A,t):A.addErrorMessage(()=>"Unknown error")}function Sf(e){return e.errors.flatMap(A=>A.kind==="Union"?Sf(A):[A])}function $F(e){let A=new Map,t=[];for(let r of e){if(r.kind!=="InvalidArgumentType"){t.push(r);continue}let n=`${r.selectionPath.join(".")}:${r.argumentPath.join(".")}`,i=A.get(n);i?A.set(n,{...r,argument:{...r.argument,typeNames:eN(i.argument.typeNames,r.argument.typeNames)}}):A.set(n,r)}return t.push(...A.values()),t}function eN(e,A){return[...new Set(e.concat(A))]}function AN(e){return vl(e,(A,t)=>{let r=Df(A),n=Df(t);return r!==n?r-n:bf(A)-bf(t)})}function Df(e){let A=0;return Array.isArray(e.selectionPath)&&(A+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(A+=e.argumentPath.length),A}function bf(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}var RA=class{constructor(A,t){this.name=A;this.value=t;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(A){let{colors:{green:t}}=A.context;A.addMarginSymbol(t(this.isRequired?"+":"?")),A.write(t(this.name)),this.isRequired||A.write(t("?")),A.write(t(": ")),typeof this.value=="string"?A.write(t(this.value)):A.write(this.value)}};var Un=class{constructor(A=0,t){this.context=t;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=A}write(A){return typeof A=="string"?this.currentLine+=A:A.write(this),this}writeJoined(A,t,r=(n,i)=>i.write(n)){let n=t.length-1;for(let i=0;i<t.length;i++)r(t[i],this),i!==n&&this.write(A);return this}writeLine(A){return this.write(A).newLine()}newLine(){this.lines.push(this.indentedCurrentLine()),this.currentLine="",this.marginSymbol=void 0;let A=this.afterNextNewLineCallback;return this.afterNextNewLineCallback=void 0,A?.(),this}withIndent(A){return this.indent(),A(this),this.unindent(),this}afterNextNewline(A){return this.afterNextNewLineCallback=A,this}indent(){return this.currentIndent++,this}unindent(){return this.currentIndent>0&&this.currentIndent--,this}addMarginSymbol(A){return this.marginSymbol=A,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(`
|
||
|
|
`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let A=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+A.slice(1):A}};var Da=class{constructor(A){this.value=A}write(A){A.write(this.value)}markAsError(){this.value.markAsError()}};var ba=e=>e,ka={bold:ba,red:ba,green:ba,dim:ba,enabled:!1},Ff={bold:Ve,red:vA,green:ir,dim:Ur,enabled:!0},Tn={write(e){e.writeLine(",")}};var Et=class{constructor(A){this.contents=A;this.isUnderlined=!1;this.color=A=>A}underline(){return this.isUnderlined=!0,this}setColor(A){return this.color=A,this}write(A){let t=A.getCurrentLineLength();A.write(this.color(this.contents)),this.isUnderlined&&A.afterNextNewline(()=>{A.write(" ".repeat(t)).writeLine(this.color("~".repeat(this.contents.length)))})}};var Qr=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var Mn=class extends Qr{constructor(){super(...arguments);this.items=[]}addItem(t){return this.items.push(new Da(t)),this}getField(t){return this.items[t]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(r=>r.value.getPrintWidth()))+2}write(t){if(this.items.length===0){this.writeEmpty(t);return}this.writeWithItems(t)}writeEmpty(t){let r=new Et("[]");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithItems(t){let{colors:r}=t.context;t.writeLine("[").withIndent(()=>t.writeJoined(Tn,this.items).newLine()).write("]"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(r.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var vn=class e extends Qr{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(t){this.fields[t.name]=t}addSuggestion(t){this.suggestions.push(t)}getField(t){return this.fields[t]}getDeepField(t){let[r,...n]=t,i=this.getField(r);if(!i)return;let s=i;for(let o of n){let a;if(s.value instanceof e?a=s.value.getField(o):s.value instanceof Mn&&(a=s.value.getField(Number(o))),!a)return;s=a}return s}getDeepFieldValue(t){return t.length===0?this:this.getDeepField(t)?.value}hasField(t){return!!this.getField(t)}removeAllFields(){this.fields={}}removeField(t){delete this.fields[t]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(t){return this.getField(t)?.value}getDeepSubSelectionValue(t){let r=this;for(let n of t){if(!(r instanceof e))return;let i=r.getSubSelectionValue(n);if(!i)return;r=i}return r}getDeepSelectionParent(t){let r=this.getSelectionParent();if(!r)return;let n=r;for(let i of t){let s=n.value.getFieldValue(i);if(!s||!(s instanceof e))return;let o=s.getSelectionParent();if(!o)return;n=o}return n}getSelectionParent(){let t=this.getField("select")?.value.asObject();if(t)return{kind:"select",value:t};let r=this.getField("include")?.value.asObject();if(r)return{kind:"include",value:r}}getSubSelectionValue(t){return this.getSelectionParent()?.value.fields[t].value}getPrintWidth(){let t=Object.values(this.fields);return t.length==0?2:Math.max(...t.map(n=>n.getPrintWidth()))+2}write(t){let r=Object.values(this.fields);if(r.length===0&&this.suggestions.length===0){this.writeEmpty(t);return}this.writeWithContents(t,r)}asObject(){return this}writeEmpty(t){let r=new Et("{}");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithContents(t,r){t.writeLine("{").withIndent(()=>{t.writeJoined(Tn,[...r,...this.suggestions]).newLine()}),t.write("}"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(t.context.colors.red("~".repeat(this.getPrintWidth())))})}};var He=class extends Qr{constructor(t){super();this.text=t}getPrintWidth(){return this.text.length}write(t){let r=new Et(this.text);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r)}asObject(){}};var gs=class{constructor(){this.fields=[]}addField(A,t){return this.fields.push({write(r){let{green:n,dim:i}=r.context.colors;r.write(n(i(`${A}: ${t}`))).addMarginSymbol(n(i("+")))}}),this}write(A){let{colors:{green:t}}=A.context;A.writeLine(t("{")).withIndent(()=>{A.writeJoined(Tn,this.fields).newLine(
|
||
|
|
Note that ${s.bold("include")} statements only accept relation fields.`,o})}function iN(e,A,t){let r=A.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(r){let n=r.getField("omit")?.value.asObject();if(n){sN(e,A,n);return}if(r.hasField("select")){oN(e,A);return}}if(t?.[Fn(e.outputType.name)]){aN(e,A);return}A.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function sN(e,A,t){t.removeAllFields();for(let r of e.outputType.fields)t.addSuggestion(new RA(r.name,"false"));A.addErrorMessage(r=>`The ${r.red("omit")} statement includes every field of the model ${r.bold(e.outputType.name)}. At least one field must be included in the result`)}function oN(e,A){let t=e.outputType,r=A.arguments.getDeepSelectionParent(e.selectionPath)?.value,n=r?.isEmpty()??!1;r&&(r.removeAllFields(),Uf(r,t)),A.addErrorMessage(i=>n?`The ${i.red("`select`")} statement for type ${i.bold(t.name)} must not be empty. ${us(i)}`:`The ${i.red("`select`")} statement for type ${i.bold(t.name)} needs ${i.bold("at least one truthy value")}.`)}function aN(e,A){let t=new gs;for(let n of e.outputType.fields)n.isRelation||t.addField(n.name,"false");let r=new RA("omit",t).makeRequired();if(e.selectionPath.length===0)A.arguments.addSuggestion(r);else{let[n,i]=ls(e.selectionPath),o=A.arguments.getDeepSelectionParent(n)?.value.asObject()?.getField(i);if(o){let a=o?.value.asObject()??new vn;a.addSuggestion(r),o.value=a}}A.addErrorMessage(n=>`The global ${n.red("omit")} configuration excludes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function cN(e,A){let t=Tf(e.selectionPath,A);if(t.parentKind!=="unknown"){t.field.markAsError();let r=t.parent;switch(t.parentKind){case"select":Uf(r,e.outputType);break;case"include":IN(r,e.outputType);break;case"omit":BN(r,e.outputType);break}}A.addErrorMessage(r=>{let n=[`Unknown field ${r.red(`\`${t.fieldName}\``)}`];return t.parentKind!=="unknown"&&n.push(`for ${r.bold(t.parentKind)} statement`),n.push(`on model ${r.bold(`\`${e.outputType.name}\``)}.`),n.push(us(r)),n.join(" ")})}function gN(e,A){let t=Tf(e.selectionPath,A);t.parentKind!=="unknown"&&t.field.value.markAsError(),A.addErrorMessage(r=>`Invalid value for selection field \`${r.red(t.fieldName)}\`: ${e.underlyingError}`)}function lN(e,A){let t=e.argumentPath[0],r=A.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(t)?.markAsError(),pN(r,e.arguments)),A.addErrorMessage(n=>xf(n,t,e.arguments.map(i=>i.name)))}function uN(e,A){let[t,r]=ls(e.argumentPath),n=A.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){n.getDeepField(e.argumentPath)?.markAsError();let i=n.getDeepFieldValue(t)?.asObject();i&&Mf(i,e.inputType)}A.addErrorMessage(i=>xf(i,r,e.inputType.fields.map(s=>s.name)))}function xf(e,A,t){let r=[`Unknown argument \`${e.red(A)}\`.`],n=yN(A,t);return n&&r.push(`Did you mean \`${e.green(n)}\`?`),t.length>0&&r.push(us(e)),r.join(" ")}function EN(e,A){let t;A.addErrorMessage(a=>t?.value instanceof He&&t.value.text==="null"?`Argument \`${a.green(i)}\` must not be ${a.red("null")}.`:`Argument \`${a.green(i)}\` is missing.`);let r=A.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!r)return;let[n,i]=ls(e.argumentPath),s=new gs,o=r.getDeepFieldValue(n)?.asObject();if(o)if(t=o.getField(i),t&&o.removeField(i),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let a of e.inputTypes[0].fields)s.addField(a.name,a.typeNames.join(" | "));o.addSuggestion(new RA(i,s).makeRequired())}else{let a=e.inputTypes.map(Lf).join(" | ");o.addSuggestion(new RA(i,a).makeRequired())}}function Lf(e){return e.kind==="list"?`${Lf(e.elementType)}[]`:e.name}function hN(e,A){let t=e.argument.name,r=A.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&r.getDeepFieldValue(e.argumentPath)?.markAsError(),A.addErrorMessage(n=>{let i=Sa("or",e.argument.typeNames.map(s=>n.green(s)));return`Argument \`${n.bold(t)}\`: Invalid value provided. Expected ${i}, provided ${n.red(e.inferredType)}.`})}function dN(e,A){let t=e
|
||
|
|
`)}};function Gn(e){return new _l(Gf(e))}function Gf(e){let A=new vn;for(let[t,r]of Object.entries(e)){let n=new xa(t,Jf(r));A.addField(n)}return A}function Jf(e){if(typeof e=="string")return new He(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new He(String(e));if(typeof e=="bigint")return new He(`${e}n`);if(e===null)return new He("null");if(e===void 0)return new He("undefined");if(xn(e))return new He(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new He(`Buffer.alloc(${e.byteLength})`):new He(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let A=ma(e)?e.toISOString():"Invalid Date";return new He(`new Date("${A}")`)}return e instanceof Jt?new He(`Prisma.${e._getName()}`):Pn(e)?new He(`prisma.${vf(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?wN(e):typeof e=="object"?Gf(e):new He(Object.prototype.toString.call(e))}function wN(e){let A=new Mn;for(let t of e)A.addItem(Jf(t));return A}function La(e,A){let t=A==="pretty"?Ff:ka,r=e.renderAllMessages(t),n=new Un(0,{colors:t}).write(e).toString();return{message:r,args:n}}function Ua({args:e,errors:A,errorFormat:t,callsite:r,originalMethod:n,clientVersion:i,globalOmit:s}){let o=Gn(e);for(let l of A)Ra(l,o,s);let{message:a,args:c}=La(o,t),g=Ln({message:a,callsite:r,originalMethod:n,showColors:t==="pretty",callArguments:c});throw new Oe(g,{clientVersion:i})}var ht=class{constructor(){this._map=new Map}get(A){return this._map.get(A)?.value}set(A,t){this._map.set(A,{value:t})}getOrCreate(A,t){let r=this._map.get(A);if(r)return r.value;let n=t();return this.set(A,n),n}};function fs(e){let A;return{get(){return A||(A={value:e()}),A.value}}}function dt(e){return e.replace(/^./,A=>A.toLowerCase())}function Vf(e,A,t){let r=dt(t);return!A.result||!(A.result.$allModels||A.result[r])?e:RN({...e,...Yf(A.name,e,A.result.$allModels),...Yf(A.name,e,A.result[r])})}function RN(e){let A=new ht,t=(r,n)=>A.getOrCreate(r,()=>n.has(r)?[r]:(n.add(r),e[r]?e[r].needs.flatMap(i=>t(i,n)):[r]));return Dn(e,r=>({...r,needs:t(r.name,new Set)}))}function Yf(e,A,t){return t?Dn(t,({needs:r,compute:n},i)=>({name:i,needs:r?Object.keys(r).filter(s=>r[s]):[],compute:DN(A,i,n)})):{}}function DN(e,A,t){let r=e?.[A]?.compute;return r?n=>t({...n,[A]:r(n)}):t}function qf(e,A){if(!A)return e;let t={...e};for(let r of Object.values(A))if(e[r.name])for(let n of r.needs)t[n]=!0;return t}function Of(e,A){if(!A)return e;let t={...e};for(let r of Object.values(A))if(!e[r.name])for(let n of r.needs)delete t[n];return t}var Ta=class{constructor(A,t){this.extension=A;this.previous=t;this.computedFieldsCache=new ht;this.modelExtensionsCache=new ht;this.queryCallbacksCache=new ht;this.clientExtensions=fs(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=fs(()=>{let A=this.previous?.getAllBatchQueryCallbacks()??[],t=this.extension.query?.$__internalBatch;return t?A.concat(t):A})}getAllComputedFields(A){return this.computedFieldsCache.getOrCreate(A,()=>Vf(this.previous?.getAllComputedFields(A),this.extension,A))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(A){return this.modelExtensionsCache.getOrCreate(A,()=>{let t=dt(A);return!this.extension.model||!(this.extension.model[t]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(A):{...this.previous?.getAllModelExtensions(A),...this.extension.model.$allModels,...this.extension.model[t]}})}getAllQueryCallbacks(A,t){return this.queryCallbacksCache.getOrCreate(`${A}:${t}`,()=>{let r=this.previous?.getAllQueryCallbacks(A,t)??[],n=[],i=this.extension.query;return!i||!(i[A]||i.$allModels||i[t]||i.$allOperations)?r:(i[A]!==void 0&&(i[A][t]!==void 0&&n.push(i[A][t]),i[A].$allOperations!==void 0&&n.push(i[A].$allOperations)),A!=="$none"&&i.$allModels!==void 0&&(i.$allModels[t]!==void 0&&n.push(i.$allModels[t]),i.$allModels.$allOperations!==void 0&&n.push(i.$allModels.$allOperations)),i[t]!==void 0&&n.push(i[t]),i.$allOperations!==void 0&&n.push(i.$allOp
|
||
|
|
Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),t}var ys="<unknown>";function nI(e){var A=e.split(`
|
||
|
|
`);return A.reduce(function(t,r){var n=HN(r)||_N(r)||ZN(r)||ex(r)||zN(r);return n&&t.push(n),t},[])}var qN=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ON=/\((\S*)(?::(\d+))(?::(\d+))\)/;function HN(e){var A=qN.exec(e);if(!A)return null;var t=A[2]&&A[2].indexOf("native")===0,r=A[2]&&A[2].indexOf("eval")===0,n=ON.exec(A[2]);return r&&n!=null&&(A[2]=n[1],A[3]=n[2],A[4]=n[3]),{file:t?null:A[2],methodName:A[1]||ys,arguments:t?[A[2]]:[],lineNumber:A[3]?+A[3]:null,column:A[4]?+A[4]:null}}var WN=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function _N(e){var A=WN.exec(e);return A?{file:A[2],methodName:A[1]||ys,arguments:[],lineNumber:+A[3],column:A[4]?+A[4]:null}:null}var jN=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,KN=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function ZN(e){var A=jN.exec(e);if(!A)return null;var t=A[3]&&A[3].indexOf(" > eval")>-1,r=KN.exec(A[3]);return t&&r!=null&&(A[3]=r[1],A[4]=r[2],A[5]=null),{file:A[3],methodName:A[1]||ys,arguments:A[2]?A[2].split(","):[],lineNumber:A[4]?+A[4]:null,column:A[5]?+A[5]:null}}var XN=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function zN(e){var A=XN.exec(e);return A?{file:A[3],methodName:A[1]||ys,arguments:[],lineNumber:+A[4],column:A[5]?+A[5]:null}:null}var $N=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function ex(e){var A=$N.exec(e);return A?{file:A[2],methodName:A[1]||ys,arguments:[],lineNumber:+A[3],column:A[4]?+A[4]:null}:null}var nu=class{getLocation(){return null}},iu=class{constructor(){this._error=new Error}getLocation(){let A=this._error.stack;if(!A)return null;let r=nI(A).find(n=>{if(!n.file)return!1;let i=Sl(n.file);return i!=="<anonymous>"&&!i.includes("@prisma")&&!i.includes("/packages/client/src/runtime/")&&!i.endsWith("/runtime/binary.js")&&!i.endsWith("/runtime/library.js")&&!i.endsWith("/runtime/edge.js")&&!i.endsWith("/runtime/edge-esm.js")&&!i.startsWith("internal/")&&!n.methodName.includes("new ")&&!n.methodName.includes("getCallSite")&&!n.methodName.includes("Proxy.")&&n.methodName.split(".").length<4});return!r||!r.file?null:{fileName:r.file,lineNumber:r.lineNumber,columnNumber:r.column}}};function Cr(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new nu:new iu}var iI={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function On(e={}){let A=tx(e);return Object.entries(A).reduce((r,[n,i])=>(iI[n]!==void 0?r.select[n]={select:i}:r[n]=i,r),{select:{}})}function tx(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Ya(e={}){return A=>(typeof e._count=="boolean"&&(A._count=A._count._all),A)}function sI(e,A){let t=Ya(e);return A({action:"aggregate",unpacker:t,argsMapper:On})(e)}function rx(e={}){let{select:A,...t}=e;return typeof A=="object"?On({...t,_count:A}):On({...t,_count:{_all:!0}})}function nx(e={}){return typeof e.select=="object"?A=>Ya(e)(A)._count:A=>Ya(e)(A)._count._all}function oI(e,A){return A({action:"count",unpacker:nx(e),argsMapper:rx})(e)}function ix(e={}){let A=On(e);if(Array.isArray(A.by))for(let t of A.by)typeof t=="string"&&(A.select[t]=!0);else typeof A.by=="string"&&(A.select[A.by]=!0);return A}function sx(e={}){return A=>(typeof e?._count=="boolean"&&A.forEach(t=>{t._count=t._count._all}),A)}function aI(e,A){return A({action:"groupBy",unpacker:sx(e),argsMapper:ix})(e)}function cI(e,A,t){if(A==="aggregate")return r=>sI(r,t);if(A==="count")return r=>oI(r,t);if(A==="groupBy")return r=>aI(r,t)}function gI(e,A){let t=A.fields.filter(n=>!n.relationName),r=Ml(t,n=>n.name);return new Proxy({},{get(n,i){if(i in n||typeof i=="symbol")return n[i];let s=r[i];if(s)return new Es(e,i,s.type,s.isList,s.kind==="enum")},...Ja(Object.keys(r))})}var lI=e=>Array.isArray(e)?e:e.split("."),su=(e,A)=>lI(A).reduce((t,r)=>t&&t[r],e),uI=(e,A,t)=>lI(A).reduceRight((r,n,
|
||
|
|
|
||
|
|
Learn how: https://pris.ly/d/${kI[A]}-build`;throw console.error(r),new z(r,t)}}function FI(e,A){return e?e.datasources?e.datasources:e.datasourceUrl?{[A[0]]:{url:e.datasourceUrl}}:{}:{}}var Bx="Cloudflare-Workers",px="node";function NI(){return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":globalThis.navigator?.userAgent===Bx?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":globalThis.process?.release?.name===px?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var mx={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function xI(){let e=NI();return{id:e,prettyName:mx[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var UR=require("child_process"),TR=Z(kC()),Tg=Z(require("fs"));var MR=Z(TC());function Hn(e){return typeof e=="string"?e:e.message}function LI(e){if(e.fields?.message){let A=e.fields?.message;return e.fields?.file&&(A+=` in ${e.fields.file}`,e.fields?.line&&(A+=`:${e.fields.line}`),e.fields?.column&&(A+=`:${e.fields.column}`)),e.fields?.reason&&(A+=`
|
||
|
|
${e.fields?.reason}`),A}return"Unknown error"}function UI(e){return e.fields?.message==="PANIC"}function yx(e){return e.timestamp&&typeof e.level=="string"&&typeof e.target=="string"}function gu(e){return yx(e)&&(e.level==="error"||e.fields?.message?.includes("fatal error"))}function TI(e){let t=wx(e.fields)?"query":e.level.toLowerCase();return{...e,level:t,timestamp:new Date(e.timestamp)}}function wx(e){return!!e.query}var Ds=class extends Error{constructor({clientVersion:A,error:t}){let r=LI(t);super(r??"Unknown error"),this._isPanic=UI(t),this.clientVersion=A}get[Symbol.toStringTag](){return"PrismaClientRustError"}isPanic(){return this._isPanic}};L(Ds,"PrismaClientRustError");var JI=Z(require("fs")),bs=Z(require("path"));function qa(e){let{runtimeBinaryTarget:A}=e;return`Add "${A}" to \`binaryTargets\` in the "schema.prisma" file and run \`prisma generate\` after saving it:
|
||
|
|
|
||
|
|
${Rx(e)}`}function Rx(e){let{generator:A,generatorBinaryTargets:t,runtimeBinaryTarget:r}=e,n={fromEnvVar:null,value:r},i=[...t,n];return xl({...A,binaryTargets:i})}function fr(e){let{runtimeBinaryTarget:A}=e;return`Prisma Client could not locate the Query Engine for runtime "${A}".`}function Ir(e){let{searchedLocations:A}=e;return`The following locations have been searched:
|
||
|
|
${[...new Set(A)].map(n=>` ${n}`).join(`
|
||
|
|
`)}`}function MI(e){let{runtimeBinaryTarget:A}=e;return`${fr(e)}
|
||
|
|
|
||
|
|
This happened because \`binaryTargets\` have been pinned, but the actual deployment also required "${A}".
|
||
|
|
${qa(e)}
|
||
|
|
|
||
|
|
${Ir(e)}`}function Oa(e){return`We would appreciate if you could take the time to share some information with us.
|
||
|
|
Please help us by answering a few questions: https://pris.ly/${e}`}function Ha(e){let{errorStack:A}=e;return A?.match(/\/\.next|\/next@|\/next\//)?`
|
||
|
|
|
||
|
|
We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs.`:""}function vI(e){let{queryEngineName:A}=e;return`${fr(e)}${Ha(e)}
|
||
|
|
|
||
|
|
This is likely caused by a bundler that has not copied "${A}" next to the resulting bundle.
|
||
|
|
Ensure that "${A}" has been copied next to the bundle or in "${e.expectedLocation}".
|
||
|
|
|
||
|
|
${Oa("engine-not-found-bundler-investigation")}
|
||
|
|
|
||
|
|
${Ir(e)}`}function PI(e){let{runtimeBinaryTarget:A,generatorBinaryTargets:t}=e,r=t.find(n=>n.native);return`${fr(e)}
|
||
|
|
|
||
|
|
This happened because Prisma Client was generated for "${r?.value??"unknown"}", but the actual deployment required "${A}".
|
||
|
|
${qa(e)}
|
||
|
|
|
||
|
|
${Ir(e)}`}function GI(e){let{queryEngineName:A}=e;return`${fr(e)}${Ha(e)}
|
||
|
|
|
||
|
|
This is likely caused by tooling that has not copied "${A}" to the deployment folder.
|
||
|
|
Ensure that you ran \`prisma generate\` and that "${A}" has been copied to "${e.expectedLocation}".
|
||
|
|
|
||
|
|
${Oa("engine-not-found-tooling-investigation")}
|
||
|
|
|
||
|
|
${Ir(e)}`}var Dx=ie("prisma:client:engines:resolveEnginePath"),bx=()=>new RegExp("runtime[\\\\/]binary\\.m?js$");async function lu(e,A){let t={binary:process.env.PRISMA_QUERY_ENGINE_BINARY,library:process.env.PRISMA_QUERY_ENGINE_LIBRARY}[e]??A.prismaPath;if(t!==void 0)return t;let{enginePath:r,searchedLocations:n}=await kx(e,A);if(Dx("enginePath",r),r!==void 0&&e==="binary"&&Rl(r),r!==void 0)return A.prismaPath=r;let i=await Tr(),s=A.generator?.binaryTargets??[],o=s.some(u=>u.native),a=!s.some(u=>u.value===i),c=__filename.match(bx())===null,g={searchedLocations:n,generatorBinaryTargets:s,generator:A.generator,runtimeBinaryTarget:i,queryEngineName:YI(e,i),expectedLocation:bs.default.relative(process.cwd(),A.dirname),errorStack:new Error().stack},l;throw o&&a?l=PI(g):a?l=MI(g):c?l=vI(g):l=GI(g),new z(l,A.clientVersion)}async function kx(engineType,config){let binaryTarget=await Tr(),searchedLocations=[],dirname=eval("__dirname"),searchLocations=[config.dirname,bs.default.resolve(dirname,".."),config.generator?.output?.value??dirname,bs.default.resolve(dirname,"../../../.prisma/client"),"/tmp/prisma-engines",config.cwd];__filename.includes("resolveEnginePath")&&searchLocations.push(MC());for(let e of searchLocations){let A=YI(engineType,binaryTarget),t=bs.default.join(e,A);if(searchedLocations.push(e),JI.default.existsSync(t))return{enginePath:t,searchedLocations}}return{enginePath:void 0,searchedLocations}}function YI(e,A){return e==="library"?Go(A,"fs"):`query-engine-${A}${A==="windows"?".exe":""}`}var uu=Z(Ul());function VI(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,A=>`${A[0]}5`):""}function qI(e){return e.split(`
|
||
|
|
`).map(A=>A.replace(/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)\s*/,"").replace(/\+\d+\s*ms$/,"")).join(`
|
||
|
|
`)}var OI=Z(tf());function HI({title:e,user:A="prisma",repo:t="prisma",template:r="bug_report.yml",body:n}){return(0,OI.default)({user:A,repo:t,template:r,title:e,body:n})}function WI({version:e,binaryTarget:A,title:t,description:r,engineVersion:n,database:i,query:s}){let o=vd(6e3-(s?.length??0)),a=qI((0,uu.default)(o)),c=r?`# Description
|
||
|
|
\`\`\`
|
||
|
|
${r}
|
||
|
|
\`\`\``:"",g=(0,uu.default)(`Hi Prisma Team! My Prisma Client just crashed. This is the report:
|
||
|
|
## Versions
|
||
|
|
|
||
|
|
| Name | Version |
|
||
|
|
|-----------------|--------------------|
|
||
|
|
| Node | ${process.version?.padEnd(19)}|
|
||
|
|
| OS | ${A?.padEnd(19)}|
|
||
|
|
| Prisma Client | ${e?.padEnd(19)}|
|
||
|
|
| Query Engine | ${n?.padEnd(19)}|
|
||
|
|
| Database | ${i?.padEnd(19)}|
|
||
|
|
|
||
|
|
${c}
|
||
|
|
|
||
|
|
## Logs
|
||
|
|
\`\`\`
|
||
|
|
${a}
|
||
|
|
\`\`\`
|
||
|
|
|
||
|
|
## Client Snippet
|
||
|
|
\`\`\`ts
|
||
|
|
// PLEASE FILL YOUR CODE SNIPPET HERE
|
||
|
|
\`\`\`
|
||
|
|
|
||
|
|
## Schema
|
||
|
|
\`\`\`prisma
|
||
|
|
// PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE
|
||
|
|
\`\`\`
|
||
|
|
|
||
|
|
## Prisma Engine Query
|
||
|
|
\`\`\`
|
||
|
|
${s?VI(s):""}
|
||
|
|
\`\`\`
|
||
|
|
`),l=HI({title:t,body:g});return`${t}
|
||
|
|
|
||
|
|
This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic.
|
||
|
|
|
||
|
|
${EA(l)}
|
||
|
|
|
||
|
|
If you want the Prisma team to look into it, please open the link above \u{1F64F}
|
||
|
|
To increase the chance of success, please post your schema and a snippet of
|
||
|
|
how you used Prisma Client in the issue.
|
||
|
|
`}var SR=Z(fl()),RY=()=>kR();function DY(e){if(e===void 0)throw new Error("Connection has not been opened")}var rr=class{constructor(){}static async onHttpError(A,t){let r=await A;return r.statusCode>=400?t(r):r}open(A,t){this._pool||(this._pool=new(RY()).Pool(A,{connections:1e3,keepAliveMaxTimeout:6e5,headersTimeout:0,bodyTimeout:0,...t}))}async raw(A,t,r,n,i=!0){DY(this._pool);let s=await this._pool.request({path:t,method:A,headers:{"Content-Type":"application/json",...r},body:n}),o=await(0,SR.default)(s.body);return{statusCode:s.statusCode,headers:s.headers,data:i?JSON.parse(o):o}}post(A,t,r,n){return this.raw("POST",A,r,t,n)}get(A,t){return this.raw("GET",A,t)}close(){this._pool&&this._pool.close(()=>{}),this._pool=void 0}};var tA=ie("prisma:engine"),fo=(...e)=>{},FR=[...Xg,"native"],Mg=[],NR=process.env.PRISMA_CLIENT_NO_RETRY?1:2,xR=process.env.PRISMA_CLIENT_NO_RETRY?1:2,Bo=class{constructor(A){this.name="BinaryEngine";this.startCount=0;this.previewFeatures=[];this.stderrLogs="";this.handleRequestError=async A=>{tA({error:A}),this.startPromise&&await this.startPromise;let t=["ECONNRESET","ECONNREFUSED","UND_ERR_CLOSED","UND_ERR_SOCKET","UND_ERR_DESTROYED","UND_ERR_ABORTED"].includes(A.code);if(A instanceof xe)return{error:A,shouldRetry:!1};try{if(this.throwAsyncErrorIfExists(),this.currentRequestPromise?.isCanceled)this.throwAsyncErrorIfExists();else if(t){if(this.globalKillSignalReceived&&!this.child?.connected)throw new ve(`The Node.js process already received a ${this.globalKillSignalReceived} signal, therefore the Prisma query engine exited
|
||
|
|
and your request can't be processed.
|
||
|
|
You probably have some open handle that prevents your process from exiting.
|
||
|
|
It could be an open http server or stream that didn't close yet.
|
||
|
|
We recommend using the \`wtfnode\` package to debug open handles.`,{clientVersion:this.clientVersion});if(this.throwAsyncErrorIfExists(),this.startCount>NR){for(let r=0;r<5;r++)await new Promise(n=>setTimeout(n,50)),this.throwAsyncErrorIfExists(!0);throw new Error(`Query engine is trying to restart, but can't.
|
||
|
|
Please look into the logs or turn on the env var DEBUG=* to debug the constantly restarting query engine.`)}}throw this.throwAsyncErrorIfExists(!0),A}catch(r){return{error:r,shouldRetry:t}}};this.config=A,this.env=A.env,this.cwd=this.resolveCwd(A.cwd),this.enableDebugLogs=A.enableDebugLogs??!1,this.allowTriggerPanic=A.allowTriggerPanic??!1,this.datamodelPath=A.datamodelPath,this.tracingHelper=A.tracingHelper,this.logEmitter=A.logEmitter,this.showColors=A.showColors??!1,this.logQueries=A.logQueries??!1,this.clientVersion=A.clientVersion,this.flags=A.flags??[],this.previewFeatures=A.previewFeatures??[],this.activeProvider=A.activeProvider,this.connection=new rr;let t=Object.keys(A.overrideDatasources)[0],r=A.overrideDatasources[t]?.url;t!==void 0&&r!==void 0&&(this.datasourceOverrides=[{name:t,url:r}]),bY();let n=["middlewares","aggregateApi","distinct","aggregations","insensitiveFilters","atomicNumberOperations","transactionApi","transaction","connectOrCreate","uncheckedScalarInputs","nativeTypes","createMany","groupBy","referentialActions","microsoftSqlServer"],i=this.previewFeatures.filter(s=>n.includes(s));if(i.length>0&&!process.env.PRISMA_HIDE_PREVIEW_FLAG_WARNINGS&&console.log(`${Ut(Ve("info"))} The preview flags \`${i.join("`, `")}\` were removed, you can now safely remove them from your schema.prisma.`),this.previewFeatures=this.previewFeatures.filter(s=>!n.includes(s)),this.engineEndpoint=A.engineEndpoint,this.binaryTarget){if(!FR.includes(this.binaryTarget)&&!Tg.default.existsSync(this.binaryTarget))throw new z(`Unknown ${vA("PRISMA_QUERY_ENGINE_BINARY")} ${vA(Ve(this.binaryTarget))}. Possible binaryTargets: ${ir(FR.join(", "))} or a path to the query engine binary.
|
||
|
|
You may have to run ${ir("prisma generate")} for your changes to take effect.`,this.clientVersion)}else this.getCurrentBinaryTarget();this.enableDebugLogs&&ie.enable("*"),Mg.push(this)}setError(A){gu(A)&&(this.lastError=new Ds({clientVersion:this.clientVersion,error:A}),this.lastError.isPanic()&&(this.child&&(this.stopPromise=kY(this.child)),this.currentRequestPromise?.cancel&&this.currentRequestPromise.cancel()))}resolveCwd(A){return Tg.default.existsSync(A)&&Tg.default.lstatSync(A).isDirectory()?A:process.cwd()}onBeforeExit(A){this.beforeExitListener=A}async emitExit(){if(this.beforeExitListener)try{await this.beforeExitListener()}catch(A){console.error(A)}}async getCurrentBinaryTarget(){return this.binaryTargetPromise?this.binaryTargetPromise:(this.binaryTargetPromise=Tr(),this.binaryTargetPromise)}printDatasources(){return this.datasourceOverrides?JSON.stringify(this.datasourceOverrides):"[]"}async start(){this.stopPromise&&await this.stopPromise;let A={times:10},t=async()=>{try{await this.internalStart()}catch(n){throw n.retryable===!0&&A.times>0&&(A.times--,await t()),n}},r=async()=>{if(this.startPromise||(this.startCount++,this.startPromise=t()),await this.startPromise,!this.child&&!this.engineEndpoint)throw new ve("Can't perform request, as the Engine has already been stopped",{clientVersion:this.clientVersion})};return this.startPromise?r():this.tracingHelper.runInChildSpan("connect",r)}getEngineEnvVars(){let A={PRISMA_DML_PATH:this.datamodelPath};this.logQueries&&(A.LOG_QUERIES="true"),this.datasourceOverrides&&(A.OVERWRITE_DATASOURCES=this.printDatasources()),!process.env.NO_COLOR&&this.showColors&&(A.CLICOLOR_FORCE="1");let t=this.tracingHelper.getTraceParent();return t&&(A.TRACE_CONTEXT=JSON.stringify({traceparent:t})),{...this.env,...process.env,...A,RUST_BACKTRACE:process.env.RUST_BACKTRACE??"1",RUST_LOG:process.env.RUST_LOG??"info"}}internalStart(){return new Promise(async(A,t)=>{if(await new Promise(r=>process.nextTick(r)),this.stopPromise&&await this.stopPromise,this.engineEndpoint){try{this.connection.open(this.engineEndpoint),await(0,MR.default)(()=>this.connection.get("/status"),{retries:10})}catch(r){return t(r)}return A()}try{(this.child?.connected||this.child&&!this.child?.killed)&&tA("There is a child that still runs and we want to start again"),this.lastError=void 0,fo("startin & resettin"),this.globalKillSignalReceived=void 0,tA({cwd:this.cwd});let r=await lu("binary",this.config),n=this.allowTriggerPanic?["--debug"]:[],i=["--enable-raw-queries","--enable-metrics","--enable-open-telemetry",...this.flags,...n];i.push("--port","0"),i.push("--engine-protocol","json"),tA({flags:i});let s=this.getEngineEnvVars();if(this.child=(0,UR.spawn)(r,i,{env:s,cwd:this.cwd,windowsHide:!0,stdio:["ignore","pipe","pipe"]}),os(this.child.stderr).on("data",o=>{let a=String(o);tA("stderr",a);try{let c=JSON.parse(a);if(typeof c.is_panic<"u"&&(tA(c),this.setError(c),this.engineStartDeferred)){let g=new z(c.message,this.clientVersion,c.error_code);this.engineStartDeferred.reject(g)}}catch{!a.includes("Printing to stderr")&&!a.includes("Listening on ")&&(this.stderrLogs+=`
|
||
|
|
`+a)}}),os(this.child.stdout).on("data",o=>{let a=String(o);try{let c=JSON.parse(a);if(tA("stdout",Hn(c)),this.engineStartDeferred&&c.level==="INFO"&&c.target==="query_engine::server"&&c.fields?.message?.startsWith("Started query engine http server")){let g=c.fields.ip,l=c.fields.port;if(g===void 0||l===void 0){this.engineStartDeferred.reject(new z('This version of Query Engine is not compatible with Prisma Client: "ip" and "port" fields are missing in the startup log entry',this.clientVersion));return}this.connection.open(`http://${g}:${l}`),this.engineStartDeferred.resolve(),this.engineStartDeferred=void 0}if(typeof c.is_panic>"u"){if(c.span===!0){this.tracingHelper.createEngineSpan(c);return}let g=TI(c);gu(g)?this.setError(g):g.level==="query"?this.logEmitter.emit(g.level,{timestamp:g.timestamp,query:g.fields.query,params:g.fields.params,duration:g.fields.duration_ms,target:g.target}):this.logEmitter.emit(g.level,{timestamp:g.timestamp,message:g.fields.message,target:g.target})}else this.setError(c)}catch(c){tA(c,a)}}),this.child.on("exit",o=>{if(fo("removing startPromise"),this.startPromise=void 0,this.engineStopDeferred){this.engineStopDeferred.resolve(o);return}if(this.connection.close(),o!==0&&this.engineStartDeferred&&this.startCount===1){let a,c=this.stderrLogs;this.lastError&&(c=Hn(this.lastError)),o!==null?(a=new z(`Query engine exited with code ${o}
|
||
|
|
`+c,this.clientVersion),a.retryable=!0):this.child?.signalCode?(a=new z(`Query engine process killed with signal ${this.child.signalCode} for unknown reason.
|
||
|
|
Make sure that the engine binary at ${r} is not corrupt.
|
||
|
|
`+c,this.clientVersion),a.retryable=!0):a=new z(c,this.clientVersion),this.engineStartDeferred.reject(a)}this.child&&(this.lastError||o===126&&this.setError({timestamp:new Date,target:"binary engine process exit",level:"error",fields:{message:`Couldn't start query engine as it's not executable on this operating system.
|
||
|
|
You very likely have the wrong "binaryTarget" defined in the schema.prisma file.`}}))}),this.child.on("error",o=>{this.setError({timestamp:new Date,target:"binary engine process error",level:"error",fields:{message:`Couldn't start query engine: ${o}`}}),t(o)}),this.child.on("close",(o,a)=>{this.connection.close();let c;o===null&&a==="SIGABRT"&&this.child?c=new JA(this.getErrorMessageWithLink("Panic in Query Engine with SIGABRT signal"),this.clientVersion):o===255&&a===null&&this.lastError&&(c=this.lastError),c&&this.logEmitter.emit("error",{message:c.message,timestamp:new Date,target:"binary engine process close"})}),this.lastError)return t(new z(Hn(this.lastError),this.clientVersion));try{await new Promise((o,a)=>{this.engineStartDeferred={resolve:o,reject:a}})}catch(o){throw this.child?.kill(),o}(async()=>{try{let o=await this.version(!0);tA(`Client Version: ${this.clientVersion}`),tA(`Engine Version: ${o}`),tA(`Active provider: ${this.activeProvider}`)}catch(o){tA(o)}})(),this.stopPromise=void 0,A()}catch(r){t(r)}})}async stop(){let A=async()=>(this.stopPromise||(this.stopPromise=this._stop()),this.stopPromise);return this.tracingHelper.runInChildSpan("disconnect",A)}async _stop(){if(this.startPromise&&await this.startPromise,await new Promise(t=>process.nextTick(t)),this.currentRequestPromise)try{await this.currentRequestPromise}catch{}let A;this.child&&(tA("Stopping Prisma engine"),this.startPromise&&(tA("Waiting for start promise"),await this.startPromise),tA("Done waiting for start promise"),this.child.exitCode===null?A=new Promise((t,r)=>{this.engineStopDeferred={resolve:t,reject:r}}):tA("Child already exited with code",this.child.exitCode),this.connection.close(),this.child.kill(),this.child=void 0),A&&await A,await new Promise(t=>process.nextTick(t)),this.startPromise=void 0,this.engineStopDeferred=void 0}kill(A){this.globalKillSignalReceived=A,this.child?.kill(),this.connection.close()}async version(A=!1){return this.versionPromise&&!A?this.versionPromise:(this.versionPromise=this.internalVersion(),this.versionPromise)}async internalVersion(){let A=await lu("binary",this.config),t=await(0,TR.default)(A,["--version"]);return this.lastVersion=t.stdout,this.lastVersion}async request(A,{traceparent:t,numTry:r=1,isWrite:n,interactiveTransaction:i}){await this.start();let s={};t&&(s.traceparent=t),i&&(s["X-transaction-id"]=i.id);let o=JSON.stringify(A);this.currentRequestPromise=rr.onHttpError(this.connection.post("/",o,s),a=>this.httpErrorHandler(a)),this.lastQuery=o;try{let{data:a,headers:c}=await this.currentRequestPromise;if(a.errors)throw a.errors.length===1?Yt(a.errors[0],this.clientVersion,this.config.activeProvider):new ve(JSON.stringify(a.errors),{clientVersion:this.clientVersion});let g=parseInt(c["x-elapsed"])/1e3;return this.startCount>0&&(this.startCount=0),this.currentRequestPromise=void 0,{data:a,elapsed:g}}catch(a){fo("req - e",a);let{error:c,shouldRetry:g}=await this.handleRequestError(a);if(r<=xR&&g&&!n)return fo("trying a retry now"),this.request(A,{traceparent:t,numTry:r+1,isWrite:n,interactiveTransaction:i});throw c}}async requestBatch(A,{traceparent:t,transaction:r,numTry:n=1,containsWrite:i}){await this.start();let s={};t&&(s.traceparent=t);let o=r?.kind==="itx"?r.options:void 0;o&&(s["X-transaction-id"]=o.id);let a=qn(A,r);return this.lastQuery=JSON.stringify(a),this.currentRequestPromise=rr.onHttpError(this.connection.post("/",this.lastQuery,s),c=>this.httpErrorHandler(c)),this.currentRequestPromise.then(({data:c,headers:g})=>{let l=parseInt(g["x-elapsed"])/1e3,{batchResult:u}=c;if(Array.isArray(u))return u.map(E=>E.errors&&E.errors.length>0?Yt(E.errors[0],this.clientVersion,this.config.activeProvider):{data:E,elapsed:l});throw Yt(c.errors[0],this.clientVersion,this.config.activeProvider)}).catch(async c=>{let{error:g,shouldRetry:l}=await this.handleRequestError(c);if(l&&!i&&n<=xR)return this.requestBatch(A,{traceparent:t,transaction:r,numTry:n+1,containsWrite:i});throw g})}async transaction(A,t,r){if(await this.start(),A==="start"){let n=JSON.stringify({max_wait:r.maxWait,timeout:r.timeout
|
||
|
|
${t}`,j(r,!0));this.name="RequestError";this.code="P5010"}};L(xo,"RequestError");async function dn(e,A,t=r=>r){let r=A.clientVersion;try{return typeof fetch=="function"?await t(fetch)(e,A):await t(hd)(e,A)}catch(n){let i=n.message??"Unknown error";throw new xo(i,{clientVersion:r})}}function UY(e){return{...e.headers,"Content-Type":"application/json"}}function TY(e){return{method:e.method,headers:UY(e)}}function MY(e,A){return{text:()=>Promise.resolve(Buffer.concat(e).toString()),json:()=>Promise.resolve().then(()=>JSON.parse(Buffer.concat(e).toString())),ok:A.statusCode>=200&&A.statusCode<=299,status:A.statusCode,url:A.url,headers:new dd(A.headers)}}async function hd(e,A={}){let t=vY("https"),r=TY(A),n=[],{origin:i}=new URL(e);return new Promise((s,o)=>{let a=t.request(e,r,c=>{let{statusCode:g,headers:{location:l}}=c;g>=301&&g<=399&&l&&(l.startsWith("http")===!1?s(hd(`${i}${l}`,A)):s(hd(l,A))),c.on("data",u=>n.push(u)),c.on("end",()=>s(MY(n,c))),c.on("error",o)});a.on("error",o),a.end(A.body??"")})}var vY=typeof require<"u"?require:()=>{},dd=class{constructor(A={}){this.headers=new Map;for(let[t,r]of Object.entries(A))if(typeof r=="string")this.headers.set(t,r);else if(Array.isArray(r))for(let n of r)this.headers.set(t,n)}append(A,t){this.headers.set(A,t)}delete(A){this.headers.delete(A)}get(A){return this.headers.get(A)??null}has(A){return this.headers.has(A)}set(A,t){this.headers.set(A,t)}forEach(A,t){for(let[r,n]of this.headers)A.call(t,n,r,this)}};var PY=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,VR=ie("prisma:client:dataproxyEngine");async function GY(e,A){let t=YR["@prisma/engines-version"],r=A.clientVersion??"unknown";if(process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&r!=="0.0.0"&&r!=="in-memory")return r;let[n,i]=r?.split("-")??[];if(i===void 0&&PY.test(n))return n;if(i!==void 0||r==="0.0.0"||r==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[s]=t.split("-")??[],[o,a,c]=s.split("."),g=JY(`<=${o}.${a}.${c}`),l=await dn(g,{clientVersion:r});if(!l.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${l.status} ${l.statusText}, response body: ${await l.text()||"<empty body>"}`);let u=await l.text();VR("length of body fetched from unpkg.com",u.length);let E;try{E=JSON.parse(u)}catch(h){throw console.error("JSON.parse error: body fetched from unpkg.com: ",u),h}return E.version}throw new En("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:r})}async function qR(e,A){let t=await GY(e,A);return VR("version",t),t}function JY(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var OR=3,Qd=ie("prisma:client:dataproxyEngine"),Cd=class{constructor({apiKey:A,tracingHelper:t,logLevel:r,logQueries:n,engineHash:i}){this.apiKey=A,this.tracingHelper=t,this.logLevel=r,this.logQueries=n,this.engineHash=i}build({traceparent:A,interactiveTransaction:t}={}){let r={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};this.tracingHelper.isEnabled()&&(r.traceparent=A??this.tracingHelper.getTraceParent()),t&&(r["X-transaction-id"]=t.id);let n=this.buildCaptureSettings();return n.length>0&&(r["X-capture-telemetry"]=n.join(", ")),r}buildCaptureSettings(){let A=[];return this.tracingHelper.isEnabled()&&A.push("tracing"),this.logLevel&&A.push(this.logLevel),this.logQueries&&A.push("query"),A}},Lo=class{constructor(A){this.name="DataProxyEngine";GR(A),this.config=A,this.env={...A.env,...typeof process<"u"?process.env:{}},this.inlineSchema=PR(A.inlineSchema),this.inlineDatasources=A.inlineDatasources,this.inlineSchemaHash=A.inlineSchemaHash,this.clientVersion=A.clientVersion,this.engineHash=A.engineVersion,this.logEmitter=A.logEmitter,this.tracingHelper=A.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let[A,t]=this.extractHostAndApiKey();this.host=A,this.headerBuilder=new Cd({apiKey:t,tracingHelper:this.
|
||
|
|
`),{clientVersion:A.clientVersion})}if(i)return new Lo(A);if(a)return new Bo(A);throw new Oe("Invalid client engine type, please use `library` or `binary`",{clientVersion:A.clientVersion})}function Pg({generator:e}){return e?.previewFeatures??[]}var WR=e=>({command:e});var _R=e=>e.strings.reduce((A,t,r)=>`${A}@P${r}${t}`);function Yi(e){try{return jR(e,"fast")}catch{return jR(e,"slow")}}function jR(e,A){return JSON.stringify(e.map(t=>ZR(t,A)))}function ZR(e,A){return Array.isArray(e)?e.map(t=>ZR(t,A)):typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:Nn(e)?{prisma__type:"date",prisma__value:e.toJSON()}:ut.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:YY(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:Buffer.from(e).toString("base64")}:typeof e=="object"&&A==="slow"?XR(e):e}function YY(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function XR(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(KR);let A={};for(let t of Object.keys(e))A[t]=KR(e[t]);return A}function KR(e){return typeof e=="bigint"?e.toString():XR(e)}var VY=["$connect","$disconnect","$on","$transaction","$use","$extends"],zR=VY;var qY=/^(\s*alter\s)/i,$R=ie("prisma:client");function fd(e,A,t,r){if(!(e!=="postgresql"&&e!=="cockroachdb")&&t.length>0&&qY.exec(A))throw new Error(`Running ALTER using ${r} is not supported
|
||
|
|
Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization.
|
||
|
|
|
||
|
|
Example:
|
||
|
|
await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`)
|
||
|
|
|
||
|
|
More Information: https://pris.ly/d/execute-raw
|
||
|
|
`)}var Id=({clientMethod:e,activeProvider:A})=>t=>{let r="",n;if(zf(t))r=t.sql,n={values:Yi(t.values),__prismaRawParameters__:!0};else if(Array.isArray(t)){let[i,...s]=t;r=i,n={values:Yi(s||[]),__prismaRawParameters__:!0}}else switch(A){case"sqlite":case"mysql":{r=t.sql,n={values:Yi(t.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{r=t.text,n={values:Yi(t.values),__prismaRawParameters__:!0};break}case"sqlserver":{r=_R(t),n={values:Yi(t.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${A} provider does not support ${e}`)}return n?.values?$R(`prisma.${e}(${r}, ${n.values})`):$R(`prisma.${e}(${r})`),{query:r,parameters:n}},eD={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[A,...t]=e;return new dA(A,t)}},AD={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function Bd(e){return function(t){let r,n=(i=e)=>{try{return i===void 0||i?.kind==="itx"?r??=tD(t(i)):tD(t(i))}catch(s){return Promise.reject(s)}};return{then(i,s){return n().then(i,s)},catch(i){return n().catch(i)},finally(i){return n().finally(i)},requestTransaction(i){let s=n(i);return s.requestTransaction?s.requestTransaction(i):s},[Symbol.toStringTag]:"PrismaPromise"}}}function tD(e){return typeof e.then=="function"?e:Promise.resolve(e)}var rD={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,A){return A()}},pd=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(A){return this.getGlobalTracingHelper().getTraceParent(A)}createEngineSpan(A){return this.getGlobalTracingHelper().createEngineSpan(A)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(A,t){return this.getGlobalTracingHelper().runInChildSpan(A,t)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??rD}};function nD(e){return e.includes("tracing")?new pd:rD}function iD(e,A=()=>{}){let t,r=new Promise(n=>t=n);return{then(n){return--e===0&&t(A()),n?.(r)}}}function sD(e){return typeof e=="string"?e:e.reduce((A,t)=>{let r=typeof t=="string"?t:t.level;return r==="query"?A:A&&(t==="info"||A==="info")?"info":r},void 0)}var Gg=class{constructor(){this._middlewares=[]}use(A){this._middlewares.push(A)}get(A){return this._middlewares[A]}has(A){return!!this._middlewares[A]}length(){return this._middlewares.length}};var cD=Z(Ul());function Jg(e){return typeof e.batchRequestIdx=="number"}function oD(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let A=[];return e.modelName&&A.push(e.modelName),e.query.arguments&&A.push(md(e.query.arguments)),A.push(md(e.query.selection)),A.join("")}function md(e){return`(${Object.keys(e).sort().map(t=>{let r=e[t];return typeof r=="object"&&r!==null?`(${t} ${md(r)})`:t}).join(" ")})`}var OY={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function yd(e){return OY[e]}var Yg=class{constructor(A){this.options=A;this.tickActive=!1;this.batches={}}request(A){let t=this.options.batchBy(A);return t?(this.batches[t]||(this.batches[t]=[],this.tickActive||(this.tickActive=!0,process.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((r,n)=>{this.batches[t].push({request:A,resolve:r,reject:n})})):this.options.singleLoader(A)}dispatchBatches(){for(let A in this.batches){let t=this.batches[A];delete this.batches[A],t.length===1?this.options.singleLoader(t[0].request).then(r=>{r instanceof Error?t[0].reject(r):t[0].resolve(r)}).catch(r=>{t[0].reject(r)}):(t.sort((r,n)=>this.options.batchOrder(r.request,n.request)),this.options.batchLoader(t.map(r=>r.request)).then(r=>{if(r instanceof Error)for(let n=0;n<t.length;n++)t[n].reject(r);else for(let n=0;n<t.length;n++){let i=r[n];i instanceof Error?t[n].reject(i
|
||
|
|
Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};L(oe,"PrismaClientConstructorValidationError");var hD=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],dD=["pretty","colorless","minimal"],QD=["info","query","warn","error"],XY={datasources:(e,{datasourceNames:A})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new oe(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[t,r]of Object.entries(e)){if(!A.includes(t)){let n=Vi(t,A)||` Available datasources: ${A.join(", ")}`;throw new oe(`Unknown datasource ${t} provided to PrismaClient constructor.${n}`)}if(typeof r!="object"||Array.isArray(r))throw new oe(`Invalid value ${JSON.stringify(e)} for datasource "${t}" provided to PrismaClient constructor.
|
||
|
|
It should have this form: { url: "CONNECTION_STRING" }`);if(r&&typeof r=="object")for(let[n,i]of Object.entries(r)){if(n!=="url")throw new oe(`Invalid value ${JSON.stringify(e)} for datasource "${t}" provided to PrismaClient constructor.
|
||
|
|
It should have this form: { url: "CONNECTION_STRING" }`);if(typeof i!="string")throw new oe(`Invalid value ${JSON.stringify(i)} for datasource "${t}" provided to PrismaClient constructor.
|
||
|
|
It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,A)=>{if(e===null)return;if(e===void 0)throw new oe('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Pg(A).includes("driverAdapters"))throw new oe('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(rs()==="binary")throw new oe('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new oe(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor.
|
||
|
|
Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new oe(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!dD.includes(e)){let A=Vi(e,dD);throw new oe(`Invalid errorFormat ${e} provided to PrismaClient constructor.${A}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new oe(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function A(t){if(typeof t=="string"&&!QD.includes(t)){let r=Vi(t,QD);throw new oe(`Invalid log level "${t}" provided to PrismaClient constructor.${r}`)}}for(let t of e){A(t);let r={level:A,emit:n=>{let i=["stdout","event"];if(!i.includes(n)){let s=Vi(n,i);throw new oe(`Invalid value ${JSON.stringify(n)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(t&&typeof t=="object")for(let[n,i]of Object.entries(t))if(r[n])r[n](i);else throw new oe(`Invalid property ${n} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let A=e.maxWait;if(A!=null&&A<=0)throw new oe(`Invalid value ${A} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let t=e.timeout;if(t!=null&&t<=0)throw new oe(`Invalid value ${t} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(e,A)=>{if(typeof e!="object")throw new oe('"omit" option is expected to be an object.');if(e===null)throw new oe('"omit" option can not be `null`');let t=[];for(let[r,n]of Object.entries(e)){let i=$Y(r,A.runtimeDataModel);if(!i){t.push({kind:"UnknownModel",modelKey:r});continue}for(let[s,o]of Object.entries(n)){let a=i.fields.find(c=>c.name===s);if(!a){t.push({kind:"UnknownField",modelKey:r,fieldName:s});continue}if(a.relationName){t.push({kind:"RelationInOmit",modelKey:r,fieldName:s});continue}typeof o!="boolean"&&t.push({kind:"InvalidFieldValue",modelKey:r,fieldName:s})}}if(t.length>0)throw new oe(eV(e,t))},__internal:e=>{if(!e)return;let A=["debug","engine","configOverride"];if(typeof e!="object")throw new oe(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[t]of Object.entries(e))if(!A.includes(t)){let r=Vi(t,A);throw new oe(`Invalid property ${JSON.stringify(t)} for "__internal" provided to PrismaClient constructor.${r}`)}}};function ID(e,A){for(let[t,r]of Object.entries(e)){if(!hD.includes(t)){let n=Vi(t,hD);throw new oe(`Unknown property ${t} provided to PrismaClient constructor.${n}`)}XY[t](r,A)}if(e.datasourceUrl&&e.datasources)throw new oe('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function Vi(e,A){if(A.length===0||typeof e!="string")return"";let t=zY(e,A);return t?` Did you mean "${t}"?`:""}function zY(e,A){if(A.length===0)return null;let t=A.map(n=>({value:n,distance:(0,fD.default)(e,n)}));t.sort((n,i)=>n.distance<i.distance?-1:1);let r=t[0];return r.distance<3?r.value:null}function $Y(e,A){return CD(A.models,e)??CD(A.types,e)}function CD(e,A){let t=Object.keys(e).find(r=>Fn(r)===A);if(t)return e[t]}function eV(e,A){let t=Gn(e);for(let i of A)switch(i.kind){case"UnknownModel":t.arguments.getField(i.modelKey)?.markAsError(),t.addErrorMessage(()=>`Unknown model name: ${i.modelKey}.`);break;case"UnknownField":t.arguments.getDeepField([i.modelKey,i.fieldName])?.markAsError(),t.addErrorMessage(()=>`Model "${i.modelKey}" does not have a field named "${i.fieldName}".`);break;case"RelationInOmit":t.arguments.getDeepField([i.modelKey,i.fieldName])?.markAsError(),t.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":t.arguments.getDeepFieldValue([i.modelKey,i.fieldName])?.markAsError(),t.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:r,args:n}=La(t,"colorless");return`Error validating "omit" option:
|
||
|
|
|
||
|
|
${n}
|
||
|
|
|
||
|
|
${r}`}function BD(e){return e.length===0?Promise.resolve([]):new Promise((A,t)=>{let r=new Array(e.length),n=null,i=!1,s=0,o=()=>{i||(s++,s===e.length&&(i=!0,n?t(n):A(r)))},a=c=>{i||(i=!0,t(c))};for(let c=0;c<e.length;c++)e[c].then(g=>{r[c]=g,o()},g=>{if(!Jg(g)){a(g);return}g.batchRequestIdx===c?a(g):(n||(n=g),o())})})}var Lr=ie("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var AV={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},tV=Symbol.for("prisma.client.transaction.id"),rV={id:0,nextId(){return++this.id}};function DD(e){class A{constructor(r){this._originalClient=this;this._middlewares=new Gg;this._createPrismaPromise=Bd();this.$extends=QI;e=r?.__internal?.configOverride?.(e)??e,SI(e),r&&ID(r,e);let n=new wD.EventEmitter().on("error",()=>{});this._extensions=Jn.empty(),this._previewFeatures=Pg(e),this._clientVersion=e.clientVersion??ED,this._activeProvider=e.activeProvider,this._globalOmit=r?.omit,this._tracingHelper=nD(this._previewFeatures);let i={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&Uo.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&Uo.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(r?.adapter){s=Au(r.adapter);let a=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==a)throw new z(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${a}\` specified in the Prisma schema.`,this._clientVersion);if(r.datasources||r.datasourceUrl!==void 0)throw new z("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let o=!s&&ts(i,{conflictCheck:"none"})||e.injectableEdgeEnv?.();try{let a=r??{},c=a.__internal??{},g=c.debug===!0;g&&ie.enable("prisma:client");let l=Uo.default.resolve(e.dirname,e.relativePath);RD.default.existsSync(l)||(l=e.dirname),Lr("dirname",e.dirname),Lr("relativePath",e.relativePath),Lr("cwd",l);let u=c.engine||{};if(a.errorFormat?this._errorFormat=a.errorFormat:process.env.NODE_ENV==="production"?this._errorFormat="minimal":process.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:l,dirname:e.dirname,enableDebugLogs:g,allowTriggerPanic:u.allowTriggerPanic,datamodelPath:Uo.default.join(e.dirname,e.filename??"schema.prisma"),prismaPath:u.binaryPath??void 0,engineEndpoint:u.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:a.log&&sD(a.log),logQueries:a.log&&!!(typeof a.log=="string"?a.log==="query":a.log.find(E=>typeof E=="string"?E==="query":E.level==="query")),env:o?.parsed??{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:FI(a,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:a.transactionOptions?.maxWait??2e3,timeout:a.transactionOptions?.timeout??5e3,isolationLevel:a.transactionOptions?.isolationLevel},logEmitter:n,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:vi,getBatchRequestPayload:qn,prismaGraphQLToJSError:Yt,PrismaClientUnknownRequestError:ve,PrismaClientInitializationError:z,PrismaClientKnownRequestError:xe,debug:ie("prisma:client:accelerateEngine"),engineVersion:mD.version,clientVersion:e.clientVersion}},Lr("clientVersion",e.clientVersion),this._engine=HR(e,this._engineConfig),this._requestHandler=new Vg(this,n),a.log)for(let E of a.log){let h=typeof E=="string"?E:E.emit==="stdout"?E.level:null;h&&this.$on(h,d=>{ss.log(`${ss.tags[h]??""}`,d.message||d.query)})}this._metrics=new Yn(this._engine)}catch(a){throw a.clientVersion=this._clientVersion,a}return this._appliedParent=ws(this)}get[Symbol.toString
|
||
|
|
`)),g?.kind==="batch"&&await g.lock,this._requestHandler.request({protocolQuery:d,modelName:a,action:o,clientMethod:n,dataPath:i,callsite:s,args:r,extensions:this._extensions,transaction:g,unpacker:l,otelParentCtx:u,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:E})}catch(h){throw h.clientVersion=this._clientVersion,h}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new Oe("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(r){return!!this._engineConfig.previewFeatures?.includes(r)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return A}function pD(e,A){return nV(e)?[new dA(e,A),eD]:[e,AD]}function nV(e){return Array.isArray(e)&&Array.isArray(e.raw)}var iV=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function bD(e){return new Proxy(e,{get(A,t){if(t in A)return A[t];if(!iV.has(t))throw new TypeError(`Invalid enum value: ${String(t)}`)}})}function kD(e){ts(e,{conflictCheck:"warn"})}0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,defineDmmfProperty,deserializeJsonResponse,dmmfToRuntimeDataModel,empty,getPrismaClient,getRuntime,join,makeStrictEnum,makeTypedQueryFactory,objectEnumValues,raw,serializeJsonQuery,skip,sqltag,warnEnvConflicts,warnOnce});
|
||
|
|
/*! Bundled license information:
|
||
|
|
|
||
|
|
undici/lib/fetch/body.js:
|
||
|
|
(*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
|
||
|
|
|
||
|
|
undici/lib/websocket/frame.js:
|
||
|
|
(*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> *)
|
||
|
|
|
||
|
|
decimal.js/decimal.mjs:
|
||
|
|
(*!
|
||
|
|
* decimal.js v10.4.3
|
||
|
|
* An arbitrary-precision Decimal type for JavaScript.
|
||
|
|
* https://github.com/MikeMcl/decimal.js
|
||
|
|
* Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
|
||
|
|
* MIT Licence
|
||
|
|
*)
|
||
|
|
*/
|
||
|
|
//# sourceMappingURL=binary.js.map
|